Complete MVP HUD frame

This commit is contained in:
2026-05-18 21:06:20 -07:00
parent e8d46c8238
commit df8bc6c7a8
4 changed files with 79 additions and 1 deletions
+1 -1
View File
@@ -798,7 +798,7 @@ Target deliverable: A small group can join a server, spawn into one biome, gathe
- [x] Let players choose a realistic young adult male or female character with average proportions for the MVP. Added a selectable MVP character archetype enum, visible selected state, keyboard selection, and `AgrarianSelectCharacter male|female` dev command while keeping both choices on the same MVP survival baseline until real character art arrives. - [x] Let players choose a realistic young adult male or female character with average proportions for the MVP. Added a selectable MVP character archetype enum, visible selected state, keyboard selection, and `AgrarianSelectCharacter male|female` dev command while keeping both choices on the same MVP survival baseline until real character art arrives.
- [x] Add join server screen. Added a native `JoinServer` frontend screen showing the selected character and `play.agrariangame.com:7777`, with keyboard flow from character selection and a dev command to display the screen directly. - [x] Add join server screen. Added a native `JoinServer` frontend screen showing the selected character and `play.agrariangame.com:7777`, with keyboard flow from character selection and a dev command to display the screen directly.
- [x] Add loading screen. Added a native `Loading` frontend screen with Ground Zero preparation copy, selected character/server context, a deterministic placeholder progress bar, and join-screen keyboard flow into loading. - [x] Add loading screen. Added a native `Loading` frontend screen with Ground Zero preparation copy, selected character/server context, a deterministic placeholder progress bar, and join-screen keyboard flow into loading.
- [~] Add HUD. - [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.
- [ ] Add inventory UI. - [ ] Add inventory UI.
- [ ] Add crafting UI. - [ ] Add crafting UI.
- [ ] Add interaction prompts. - [ ] Add interaction prompts.
+46
View File
@@ -0,0 +1,46 @@
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",
"AGRARIAN_DEVELOPMENT_ROADMAP.md": ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md",
}
EXPECTED = {
"AgrarianDebugHUD.h": [
"bShowMvpHudFrame",
"DrawMvpHudFrame",
],
"AgrarianDebugHUD.cpp": [
"DrawMvpHudFrame(AgrarianCharacter)",
"AAgrarianDebugHUD::DrawMvpHudFrame",
"AGRARIAN MVP | Ground Zero",
"Health %.0f Food %.0f Water %.0f Temp %.1fC",
"bShowDebugHUD",
],
"AGRARIAN_DEVELOPMENT_ROADMAP.md": [
"[x] Add HUD.",
"`bShowMvpHudFrame`",
"developer overlay separately toggleable",
],
}
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 HUD frame verification failed: " + "; ".join(missing))
print("Agrarian MVP HUD frame verification complete.")
if __name__ == "__main__":
main()
+28
View File
@@ -23,6 +23,7 @@ void AAgrarianDebugHUD::DrawHUD()
return; return;
} }
DrawMvpHudFrame(AgrarianCharacter);
DrawInteractionPrompt(AgrarianCharacter); DrawInteractionPrompt(AgrarianCharacter);
DrawCriticalStats(AgrarianCharacter->GetSurvivalComponent()); DrawCriticalStats(AgrarianCharacter->GetSurvivalComponent());
const float InventoryBottomY = DrawInventoryPanel(AgrarianCharacter); const float InventoryBottomY = DrawInventoryPanel(AgrarianCharacter);
@@ -40,6 +41,33 @@ void AAgrarianDebugHUD::DrawHUD()
} }
} }
void AAgrarianDebugHUD::DrawMvpHudFrame(const AAgrarianGameCharacter* AgrarianCharacter)
{
if (!bShowMvpHudFrame || !AgrarianCharacter || !Canvas)
{
return;
}
const UAgrarianSurvivalComponent* SurvivalComponent = AgrarianCharacter->GetSurvivalComponent();
const FAgrarianSurvivalSnapshot* Survival = SurvivalComponent ? &SurvivalComponent->Survival : nullptr;
const float Scale = FMath::Max(0.25f, TextScale);
const float PanelWidth = FMath::Min(Canvas->ClipX - 64.0f, 620.0f * Scale);
const float PanelHeight = 54.0f * Scale;
const float X = (Canvas->ClipX - PanelWidth) * 0.5f;
const float Y = 26.0f;
DrawRect(FLinearColor(0.02f, 0.025f, 0.02f, 0.68f), X, Y, PanelWidth, PanelHeight);
DrawRect(FLinearColor(0.45f, 0.72f, 0.40f, 0.92f), X, Y, PanelWidth, 3.0f * Scale);
const FString StateText = Survival && Survival->bIsDead ? TEXT("DEAD") : TEXT("ALIVE");
const FString CoreStats = Survival
? FString::Printf(TEXT("Health %.0f Food %.0f Water %.0f Temp %.1fC"), Survival->Health, Survival->Hunger, Survival->Thirst, Survival->BodyTemperature)
: FString(TEXT("Survival unavailable"));
const FString HudText = FString::Printf(TEXT("AGRARIAN MVP | Ground Zero | %s | %s"), *StateText, *CoreStats);
DrawText(HudText, FColor(225, 235, 220), X + (18.0f * Scale), Y + (16.0f * Scale), nullptr, 0.86f * Scale, false);
}
void AAgrarianDebugHUD::DrawInteractionPrompt(const AAgrarianGameCharacter* AgrarianCharacter) void AAgrarianDebugHUD::DrawInteractionPrompt(const AAgrarianGameCharacter* AgrarianCharacter)
{ {
if (!bShowInteractionPrompt || !AgrarianCharacter || !AgrarianCharacter->HasInteractionPrompt() || !Canvas) if (!bShowInteractionPrompt || !AgrarianCharacter || !AgrarianCharacter->HasInteractionPrompt() || !Canvas)
+4
View File
@@ -21,6 +21,9 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|HUD") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|HUD")
bool bShowDebugHUD = true; bool bShowDebugHUD = true;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|HUD")
bool bShowMvpHudFrame = true;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|HUD") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|HUD")
bool bShowCriticalStatsHUD = true; bool bShowCriticalStatsHUD = true;
@@ -52,6 +55,7 @@ public:
float PromptTextScale = 1.15f; float PromptTextScale = 1.15f;
protected: protected:
void DrawMvpHudFrame(const class AAgrarianGameCharacter* AgrarianCharacter);
void DrawInteractionPrompt(const class AAgrarianGameCharacter* AgrarianCharacter); void DrawInteractionPrompt(const class AAgrarianGameCharacter* AgrarianCharacter);
void DrawCriticalStats(const UAgrarianSurvivalComponent* SurvivalComponent); void DrawCriticalStats(const UAgrarianSurvivalComponent* SurvivalComponent);
float DrawInventoryPanel(const class AAgrarianGameCharacter* AgrarianCharacter); float DrawInventoryPanel(const class AAgrarianGameCharacter* AgrarianCharacter);