From d1665891f44f6069fe0eb3cd90b810a226cd2411 Mon Sep 17 00:00:00 2001 From: Tom Boullay Date: Tue, 2 Jun 2026 21:59:54 +0200 Subject: [PATCH] feat(repair): filter debug sub-state options by current mission Pylon-only mission steps (approaching/arrived/npc-return/narrator-outro) no longer appear in the GameStateDebugPanel sub-state dropdown for the ebike or farm missions, which use the shorter locked/waiting/inspected/fragmented/scanning/repairing/reassembling/done flow. --- src/components/ui/debug/GameStateDebugPanel.tsx | 6 ++++-- src/data/gameplay/repairMissionState.ts | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/ui/debug/GameStateDebugPanel.tsx b/src/components/ui/debug/GameStateDebugPanel.tsx index 153b2fc..30bd530 100644 --- a/src/components/ui/debug/GameStateDebugPanel.tsx +++ b/src/components/ui/debug/GameStateDebugPanel.tsx @@ -5,8 +5,8 @@ import { MAIN_GAME_STATES, } from "@/data/game/gameStateConfig"; import { + getMissionStepsFor, isMissionStep, - MISSION_STEPS, } from "@/data/gameplay/repairMissionState"; import { useGameStore } from "@/managers/stores/useGameStore"; import type { MainGameState } from "@/types/game"; @@ -53,7 +53,9 @@ export function GameStateDebugPanel(): React.JSX.Element { ? GAME_STEPS : mainState === "outro" ? ["waiting", "started"] - : MISSION_STEPS; + : mainState === "ebike" || mainState === "pylon" || mainState === "farm" + ? getMissionStepsFor(mainState) + : []; function setSubState(nextSubState: string): void { if (mainState === "intro") { diff --git a/src/data/gameplay/repairMissionState.ts b/src/data/gameplay/repairMissionState.ts index fc13c60..71a93de 100644 --- a/src/data/gameplay/repairMissionState.ts +++ b/src/data/gameplay/repairMissionState.ts @@ -24,6 +24,20 @@ export const MISSION_STEPS = [ ] as const satisfies readonly MissionStep[]; const MISSION_STEP_VALUES: ReadonlySet = new Set(MISSION_STEPS); +const PYLON_ONLY_MISSION_STEPS = new Set([ + "approaching", + "arrived", + "npc-return", + "narrator-outro", +]); + +export function getMissionStepsFor( + mission: RepairMissionId, +): readonly MissionStep[] { + if (mission === "pylon") return MISSION_STEPS; + return MISSION_STEPS.filter((step) => !PYLON_ONLY_MISSION_STEPS.has(step)); +} + export function isRepairMissionId(value: string): value is RepairMissionId { return REPAIR_MISSION_ID_VALUES.has(value); }