Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ImLukzy/ChefDash/llms.txt

Use this file to discover all available pages before exploring further.

The Settings screen is ChefDash’s preferences panel, exposing the one system-level control available to players: a toggle for tactile haptic feedback. There is no separate SettingsView.swift file — the setting is backed entirely by gameState.isHapticsEnabled, a @Published Bool on GameState. The screen becomes active when gameState.activeTab is set to "settings".

Reaching the Settings Screen

Settings is opened from HomeView by tapping the gear icon (gearshape.fill) in the top-right corner of the HUD bar:
Button(action: {
    withAnimation(.spring(response: 0.4, dampingFraction: 0.75)) {
        gameState.activeTab = "settings"
    }
}) {
    Image(systemName: "gearshape.fill")
        .font(.system(size: 16, weight: .bold))
        .foregroundColor(.white.opacity(0.8))
        .frame(width: 38, height: 38)
        .background(Color.white.opacity(0.1))
        .clipShape(Circle())
}

The Haptics Toggle

The only setting on this screen controls gameState.isHapticsEnabled:
PropertyTypeDefault
isHapticsEnabledBooltrue
isHapticsEnabled is declared as a @Published property on GameState:
@Published var isHapticsEnabled: Bool = true
Because it is @Published, toggling the setting takes effect immediately across every screen — no restart or re-navigation is required.

Where Haptics Fire

When isHapticsEnabled is true, a UIImpactFeedbackGenerator fires at the following interactions throughout the app:
ScreenInteractionHaptic Style
HomeViewTap the ¡INICIAR PARTIDA! Start Game button.heavy
MainMapViewTap an unlocked level node.medium
ShopViewTap the COMPRAR button on any item.medium
VictoryViewTap the post-round action button.medium
Each call site checks the flag before firing:
if gameState.isHapticsEnabled {
    UIImpactFeedbackGenerator(style: .heavy).impactOccurred()
}
Setting isHapticsEnabled to false silences all of the above interactions simultaneously.
isHapticsEnabled is stored in memory on the GameState instance and is not persisted to disk in the current implementation. It resets to true on every app launch.

Build docs developers (and LLMs) love