Fix Task 9: Climb/Descend Controls
1. Fixed exitSpireMode in store.ts to allow exit at any floor for re-entry resume 2. Removed floor restriction on Exit Spire button in page.tsx 3. Updated descend button label to use currentAction for 'Climbing' status
This commit is contained in:
+8
-14
@@ -273,22 +273,16 @@ export default function ManaLoopGame() {
|
||||
>
|
||||
<ChevronDown className="w-4 h-4 mr-2" />
|
||||
{store.isDescending ? 'Descending…' :
|
||||
store.climbDirection === 'up' ? 'Climbing' :
|
||||
store.currentAction === 'climb' ? 'Climbing' :
|
||||
'Begin Descent'}
|
||||
</Button>
|
||||
{store.currentFloor === 1 ? (
|
||||
<Button
|
||||
variant="default"
|
||||
className="bg-green-600 hover:bg-green-700"
|
||||
onClick={() => store.exitSpireMode()}
|
||||
>
|
||||
Exit Spire
|
||||
</Button>
|
||||
) : (
|
||||
<span className="text-xs text-gray-400 flex items-center">
|
||||
Reach floor 1 to exit
|
||||
</span>
|
||||
)}
|
||||
<Button
|
||||
variant="default"
|
||||
className="bg-green-600 hover:bg-green-700"
|
||||
onClick={() => store.exitSpireMode()}
|
||||
>
|
||||
Exit Spire
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2306,13 +2306,10 @@ export const useGameStore = create<GameStore>()(
|
||||
}, 500);
|
||||
},
|
||||
|
||||
// Exit Spire Mode - only works when at floor 1
|
||||
// Exit Spire Mode - can exit at any floor (re-entry will resume at same floor)
|
||||
exitSpireMode: () => {
|
||||
set((state) => {
|
||||
// Only allow exit if at floor 1 (bottom)
|
||||
if (state.currentFloor > 1) {
|
||||
return state; // Can't exit, need to climb down to floor 1 first
|
||||
}
|
||||
// Allow exit at any floor for re-entry resume
|
||||
return {
|
||||
spireMode: false,
|
||||
currentAction: 'meditate',
|
||||
|
||||
Reference in New Issue
Block a user