new theme

This commit is contained in:
2026-05-25 20:49:41 +02:00
parent ec6761693c
commit 2eef22a76b
16 changed files with 540 additions and 4 deletions
+68
View File
@@ -29,6 +29,74 @@ func RegisterDefaultUI(g *Game) {
g.UIManager.Register(&Cursor{Name: "cursor"})
}
// RegisterRichUI installs a "story-rich" HUD that matches the layout of
// the screenshot used as the reference: top bar with title/score/time,
// floating character panels for the player and a single NPC, a chat-log
// strip at the bottom-left, a tiny inventory at the bottom-right and a
// permanent verb-wheel on the right edge.
//
// The HUD assumes the default 320×200 internal resolution and that
// PlayerName / NPCName correspond to registered characters. Pass "" for
// NPCName to skip the NPC panel.
func RegisterRichUI(g *Game, playerName, npcName string) {
g.UIManager.Register(&TopBar{
Name: "topbar",
Height: 12,
ScoreVar: "score", ScoreMax: 100,
TimeVar: "time",
})
g.UIManager.Register(&HotspotDebug{Name: "hotspot_debug"})
if playerName != "" {
g.UIManager.Register(&CharacterPanel{
Name: "panel_player",
Bounds: Rect(2, 14, 92, 36),
Character: playerName,
Title: "PLAYER",
Stats: []CharStat{
{Label: "State", VarKey: playerName + ".state"},
{Label: "Mood", VarKey: playerName + ".mood"},
},
})
}
if npcName != "" {
g.UIManager.Register(&CharacterPanel{
Name: "panel_npc",
Bounds: Rect(180, 14, 92, 36),
Character: npcName,
Title: "NPC",
Stats: []CharStat{
{Label: "State", VarKey: npcName + ".state"},
{Label: "Mood", VarKey: npcName + ".mood"},
},
})
}
g.UIManager.Register(&InventoryBar{
Name: "inventory",
Origin: Point{X: 4, Y: 188},
Slots: 8,
Cols: 8,
SlotSize: 10,
Gap: 1,
})
g.UIManager.Register(&ChatLog{
Name: "chat",
Bounds: Rect(2, 148, 280, 38),
LineHeight: 9,
Padding: 3,
ShowBorder: true,
})
g.UIManager.Register(&RadialVerbs{
Name: "verbs",
AlwaysVisible: true,
Center: Point{X: 290, Y: 90},
Radius: 28,
})
g.UIManager.Register(&SpeechBubble{Name: "speech", MaxWidth: 200, Padding: 3, OffsetY: 4, FallbackY: 18})
g.UIManager.Register(&DialogBox{Name: "dialog", Bounds: Rect(0, 90, float64(g.Width), 56), LineHeight: 12, Padding: 6})
g.UIManager.Register(&EndCard{Name: "endcard"})
g.UIManager.Register(&Cursor{Name: "cursor"})
}
// RegisterRadialVerbUI installs an alternative HUD that swaps the
// permanent verb-bar for a verb-coin (right-click radial menu). Inventory,
// dialog, speech and cursor stay the same.