diff --git a/AGRARIAN_DEVELOPMENT_ROADMAP.md b/AGRARIAN_DEVELOPMENT_ROADMAP.md index ba67650..130057a 100644 --- a/AGRARIAN_DEVELOPMENT_ROADMAP.md +++ b/AGRARIAN_DEVELOPMENT_ROADMAP.md @@ -801,7 +801,7 @@ Target deliverable: A small group can join a server, spawn into one biome, gathe - [x] Add HUD. Completed the MVP HUD pass with a separate `bShowMvpHudFrame` top status frame showing Ground Zero context, alive/dead state, health, food, water, and body temperature, while keeping the deeper developer overlay separately toggleable. - [x] Add inventory UI. Promoted the existing compact replicated-inventory HUD panel into the 0.1.N UI pass with `AgrarianToggleInventoryUI`, keeping the MVP inventory surface lightweight while full drag/drop inventory remains later work. - [x] Add crafting UI. Promoted the existing compact crafting HUD panel into the 0.1.N UI pass with `AgrarianToggleCraftingUI`, showing known recipes and ingredient readiness while keeping full crafting menus for later UX expansion. -- [ ] Add interaction prompts. +- [x] Add interaction prompts. Promoted the existing centered interactable prompt renderer into the 0.1.N UI pass with `AgrarianToggleInteractionPrompts`, keeping prompt text driven by focused interactables. - [ ] Add death/respawn UI. - [ ] Add debug/dev menu. - [ ] Add accessibility basics. diff --git a/Scripts/verify_mvp_interaction_prompt_toggle.py b/Scripts/verify_mvp_interaction_prompt_toggle.py new file mode 100644 index 0000000..396edf9 --- /dev/null +++ b/Scripts/verify_mvp_interaction_prompt_toggle.py @@ -0,0 +1,56 @@ +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[1] +FILES = { + "AgrarianDebugHUD.h": ROOT / "Source" / "AgrarianGame" / "AgrarianDebugHUD.h", + "AgrarianDebugHUD.cpp": ROOT / "Source" / "AgrarianGame" / "AgrarianDebugHUD.cpp", + "AgrarianGamePlayerController.h": ROOT / "Source" / "AgrarianGame" / "AgrarianGamePlayerController.h", + "AgrarianGamePlayerController.cpp": ROOT / "Source" / "AgrarianGame" / "AgrarianGamePlayerController.cpp", + "AGRARIAN_DEVELOPMENT_ROADMAP.md": ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md", +} + +EXPECTED = { + "AgrarianDebugHUD.h": [ + "bShowInteractionPrompt", + "PromptTextScale", + "DrawInteractionPrompt", + ], + "AgrarianDebugHUD.cpp": [ + "DrawInteractionPrompt(AgrarianCharacter)", + "HasInteractionPrompt()", + "GetInteractionPromptText()", + "[E] %s", + ], + "AgrarianGamePlayerController.h": [ + "AgrarianToggleInteractionPrompts", + ], + "AgrarianGamePlayerController.cpp": [ + "AgrarianToggleInteractionPrompts", + "bShowInteractionPrompt = !AgrarianHUD->bShowInteractionPrompt", + "MVP interaction prompts shown.", + "MVP interaction prompts hidden.", + ], + "AGRARIAN_DEVELOPMENT_ROADMAP.md": [ + "[x] Add interaction prompts.", + "`AgrarianToggleInteractionPrompts`", + ], +} + + +def main(): + missing = [] + for label, path in FILES.items(): + text = path.read_text(encoding="utf-8") + for snippet in EXPECTED[label]: + if snippet not in text: + missing.append(f"{label}: {snippet}") + + if missing: + raise RuntimeError("MVP interaction prompt toggle verification failed: " + "; ".join(missing)) + + print("Agrarian MVP interaction prompt toggle verification complete.") + + +if __name__ == "__main__": + main() diff --git a/Source/AgrarianGame/AgrarianGamePlayerController.cpp b/Source/AgrarianGame/AgrarianGamePlayerController.cpp index b075b20..220848a 100644 --- a/Source/AgrarianGame/AgrarianGamePlayerController.cpp +++ b/Source/AgrarianGame/AgrarianGamePlayerController.cpp @@ -307,6 +307,19 @@ void AAgrarianGamePlayerController::AgrarianToggleCraftingUI() ClientMessage(AgrarianHUD->bShowCraftingHUD ? TEXT("MVP crafting UI shown.") : TEXT("MVP crafting UI hidden.")); } +void AAgrarianGamePlayerController::AgrarianToggleInteractionPrompts() +{ + AAgrarianDebugHUD* AgrarianHUD = GetHUD(); + if (!AgrarianHUD) + { + ClientMessage(TEXT("No Agrarian HUD is active.")); + return; + } + + AgrarianHUD->bShowInteractionPrompt = !AgrarianHUD->bShowInteractionPrompt; + ClientMessage(AgrarianHUD->bShowInteractionPrompt ? TEXT("MVP interaction prompts shown.") : TEXT("MVP interaction prompts hidden.")); +} + void AAgrarianGamePlayerController::AgrarianSelectCharacter(FName Archetype) { if (!MvpFrontendWidget) diff --git a/Source/AgrarianGame/AgrarianGamePlayerController.h b/Source/AgrarianGame/AgrarianGamePlayerController.h index 06f4bad..f694c34 100644 --- a/Source/AgrarianGame/AgrarianGamePlayerController.h +++ b/Source/AgrarianGame/AgrarianGamePlayerController.h @@ -97,6 +97,9 @@ public: UFUNCTION(Exec) void AgrarianToggleCraftingUI(); + UFUNCTION(Exec) + void AgrarianToggleInteractionPrompts(); + UFUNCTION(Exec) void AgrarianSelectCharacter(FName Archetype);