This repository has been archived on 2026-05-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
AgrarianGameArchive/Scripts/verify_mvp_segmented_startup_pause_flow.py
T

85 lines
2.8 KiB
Python

#!/usr/bin/env python3
"""Verify the MVP startup/menu flow is segmented and modal."""
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
FRONTEND_H = ROOT / "Source" / "AgrarianGame" / "AgrarianMvpFrontendWidget.h"
FRONTEND_CPP = ROOT / "Source" / "AgrarianGame" / "AgrarianMvpFrontendWidget.cpp"
CONTROLLER_CPP = ROOT / "Source" / "AgrarianGame" / "AgrarianGamePlayerController.cpp"
ROADMAP = ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md"
def require(condition: bool, message: str) -> None:
if not condition:
raise SystemExit(f"FAILED: {message}")
def main() -> None:
header = FRONTEND_H.read_text(encoding="utf-8")
frontend = FRONTEND_CPP.read_text(encoding="utf-8")
controller = CONTROLLER_CPP.read_text(encoding="utf-8")
roadmap = ROADMAP.read_text(encoding="utf-8")
for token in (
"Settings",
"GameSaved",
"SavingAndQuit",
"SaveGame",
"ExecuteSaveAndQuit",
"QuitWithoutSaving",
):
require(token in header, f"missing segmented flow declaration: {token}")
for token in (
"Character Selection",
"Server Join",
"Loading Segment",
"Pause Menu",
"Gameplay is paused while this menu is active.",
"Save Game",
"Settings",
"Quit Without Saving",
"Game Saved",
"Player Options",
"Saving World",
"Writing the current world state",
"SetActiveScreen(EAgrarianMvpFrontendScreen::GameSaved)",
"SetActiveScreen(EAgrarianMvpFrontendScreen::Settings)",
"SetActiveScreen(EAgrarianMvpFrontendScreen::SavingAndQuit)",
"GetTimerManager().SetTimer",
"ExecuteSaveGame",
"ExecuteSaveAndQuit",
"ExecuteQuitWithoutSaving",
"ConsoleCommand(TEXT(\"AgrarianSaveWorld\"))",
"ConsoleCommand(TEXT(\"quit\"))",
):
require(token in frontend, f"missing segmented frontend token: {token}")
require(
controller.count("FInputModeUIOnly") >= 3,
"startup/frontend/pause paths should use UI-only input while menus are active",
)
for token in (
"SetIgnoreMoveInput(true)",
"SetIgnoreLookInput(true)",
"SetInputMode(FInputModeGameOnly())",
"ResetIgnoreMoveInput()",
"ResetIgnoreLookInput()",
"RestoreGameplayControlState",
"saving",
):
require(token in controller + frontend, f"missing modal input or debug token: {token}")
require(
"- [x] Make startup credits, character selection, server/join, loading, pause, save, and quit feel like separate intentional segments" in roadmap,
"0.1.O segmented startup/menu roadmap item is not checked off",
)
print("OK: MVP startup, menu, loading, pause, save, and quit flow is segmented and modal.")
if __name__ == "__main__":
main()