MainMapView is the level-selection hub of ChefDash. It presents all 20 kitchen levels as a scrollable vertical path styled like a classic arcade board, with each level node connected by a painted path segment. Players tap an unlocked node to open a full-screen pre-game overlay where they can equip purchased upgrades before committing to a round. The view becomes active whenDocumentation 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.
gameState.activeTab is set to "map.fill".
Layout Overview
The screen is aZStack with two layers: the scrollable level path beneath and the pre-game overlay on top. The overlay is only rendered when showPreGameSheet == true.
Header HUD
Displays the Mapa de Cocinas title with the RUTA DE APRENDIZAJE label in
orangeAccent, and the player’s current coin balance (🪙 gameState.coins) in a neonYellow capsule on the right.Scrollable Level Path
A
ScrollView containing a VStack of alternating level nodes and path connectors. Bottom padding of 120 pt clears the floating CustomTabBar.Level Node Layout — Zigzag Pattern
Levels are rendered usingForEach(Array(gameState.levels.enumerated()), id: \.element.id). The horizontal alignment of each node alternates based on its index:
- Even index (0, 2, 4 …) → node aligns to the left side of the screen
- Odd index (1, 3, 5 …) → node aligns to the right side of the screen
Level Node States
Each circular node is 70×70 pt and visually distinguishes locked from unlocked levels:| State | Fill Colour | Icon |
|---|---|---|
| Unlocked | orangeAccent with 30% white stroke | Level number (24 pt black rounded) |
| Locked | lockedGray (0.22, 0.22, 0.26) | lock.fill icon at 18 pt, 30% opacity |
star.fill / star system images in neonYellow; locked levels show a greyed-out “Bloqueado” label instead.
Path Connectors
Between every pair of adjacent nodes, a thinRectangle acts as the connecting path segment:
lockedGray when still locked.
Tapping a Level Node
Tapping an unlocked node runs the following logic:.disabled(!level.isUnlocked) so locked nodes register no touch interaction. Haptics fire at .medium style on a valid tap.
Pre-Game Overlay Modal
WhenshowPreGameSheet is true, a full-screen dimmed overlay (Color.black.opacity(0.6)) appears over the map. Tapping the dim area closes the modal without starting the round. The modal card itself is a rounded rectangle (cornerRadius: 24) with a dark fill (0.12, 0.12, 0.15).
Modal Sections
Mission Header
Displays the MISIÓN DISPONIBLE label, the selected level’s name (uppercased), and the target order count:
"Meta: Servir X comandas." where X is level.targetOrders.Upgrade Equipment Panel
Iterates
gameState.shopInventory and renders one upgradeRow per item. Each row shows the item’s emoji, title, and current quantityOwned.Upgrade Row Buttons
The toggle state of each item is stored ingameState.selectedUpgradesForRound, which is a Set<String> of item IDs:
quantityOwned | Button Label | Behaviour |
|---|---|---|
> 0, not selected | USAR (orange capsule) | Inserts item.id into selectedUpgradesForRound |
> 0, selected | LISTO (green capsule) | Removes item.id from selectedUpgradesForRound |
== 0 | Comprar en Tienda (orange text capsule) | Closes modal, navigates to gameState.activeTab = "cart.fill" |
selectedUpgradesForRound is cleared automatically inside gameState.startNewRound() after the equipped items have their quantityOwned decremented. Items are consumed when the round starts, not when they are toggled.