summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop.Tests
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-21 11:45:11 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-21 11:45:11 +0800
commitb13b28521f4b286d9a750848c7940546cf50adf3 (patch)
tree440a8dc2943d52d17a0dd8db5523680732648802 /src/LivingVillage.Desktop.Tests
parent89be1bce62a01c6994c0de4d5c9f05338f3b4d4f (diff)
downloadliving-village-b13b28521f4b286d9a750848c7940546cf50adf3.tar.gz
feat(desktop): 顶部极简状态条
常驻 HUD 新增右上角半透明状态条:天数(world.Tick/ticksPerDay+1)与金钱/精力(直接取自 avatar.Mind.Needs 真实数据,无编造数值源);新增 cornerStatusLines 纯函数与回归测试,UI 文案目录补 天数/金钱/精力(字符表已含,无需重生成图集)。
Diffstat (limited to 'src/LivingVillage.Desktop.Tests')
-rw-r--r--src/LivingVillage.Desktop.Tests/PrototypeTests.fs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs
index ab7ae1a..f1f4aed 100644
--- a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs
+++ b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs
@@ -203,6 +203,33 @@ type PrototypeTests () =
Assert.IsTrue(first.Tiles |> List.exists (fun tile -> tile.Kind = (VillageArt.StonePaving)))
[<TestMethod>]
+ member _.CornerStatusShowsDayMoneyAndEnergyFromRealData () =
+ let world = Sim.initialWorldN 42UL 0
+ let lines = M5Interaction.cornerStatusLines world
+ Assert.AreEqual<int>(2, lines.Length)
+ Assert.IsTrue(lines.[0].StartsWith("天数 "), sprintf "day line: %s" lines.[0])
+ Assert.IsTrue(lines.[1].StartsWith("金钱 "), sprintf "money line: %s" lines.[1])
+ Assert.IsTrue(lines.[1].Contains("精力"))
+
+ let nextDay = { world with Tick = world.Tick + Sim.ticksPerDay }
+ Assert.AreNotEqual<string>(lines.[0], M5Interaction.cornerStatusLines nextDay |> List.item 0)
+
+ let richWorld =
+ { world with
+ Avatar =
+ { world.Avatar with
+ Mind =
+ { world.Avatar.Mind with
+ Needs = { world.Avatar.Mind.Needs with Money = 88.0f; Energy = 76.0f } } } }
+ let richLines = M5Interaction.cornerStatusLines richWorld
+ Assert.IsTrue(richLines.[1].Contains("88"), sprintf "money value missing: %s" richLines.[1])
+ Assert.IsTrue(richLines.[1].Contains("76"), sprintf "energy value missing: %s" richLines.[1])
+
+ Assert.IsTrue(ChineseText.requiredUiLabels |> List.contains "天数")
+ Assert.IsTrue(ChineseText.requiredUiLabels |> List.contains "金钱")
+ Assert.IsTrue(ChineseText.requiredUiLabels |> List.contains "精力")
+
+ [<TestMethod>]
member _.TitleScreenLayoutIsDeterministicAndLayered () =
let first = TitleScreen.layout 1280 720
let second = TitleScreen.layout 1280 720