From b13b28521f4b286d9a750848c7940546cf50adf3 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Mon, 21 Sep 2026 11:45:11 +0800 Subject: feat(desktop): 顶部极简状态条 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 常驻 HUD 新增右上角半透明状态条:天数(world.Tick/ticksPerDay+1)与金钱/精力(直接取自 avatar.Mind.Needs 真实数据,无编造数值源);新增 cornerStatusLines 纯函数与回归测试,UI 文案目录补 天数/金钱/精力(字符表已含,无需重生成图集)。 --- src/LivingVillage.Desktop.Tests/PrototypeTests.fs | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/LivingVillage.Desktop.Tests') 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 @@ -202,6 +202,33 @@ type PrototypeTests () = Assert.IsTrue(first.Tiles |> List.exists (fun tile -> tile.Kind = (VillageArt.RiverWater))) Assert.IsTrue(first.Tiles |> List.exists (fun tile -> tile.Kind = (VillageArt.StonePaving))) + [] + member _.CornerStatusShowsDayMoneyAndEnergyFromRealData () = + let world = Sim.initialWorldN 42UL 0 + let lines = M5Interaction.cornerStatusLines world + Assert.AreEqual(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(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 "精力") + [] member _.TitleScreenLayoutIsDeterministicAndLayered () = let first = TitleScreen.layout 1280 720 -- cgit v1.2.3