From ac4fd29899e2fed8cb53d771325994ed481eae6b Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Mon, 21 Sep 2026 11:48:37 +0800 Subject: feat(desktop): P 键暂停帮助页 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P 键改为打开暂停帮助页(完整键位说明),打开时暂停模拟并保留原控制状态,返回游戏时精确恢复(速度/暂停原状);常驻 HUD 不放全键位清单。MenuState 新增 enterPauseHelp/exitPauseHelp 纯函数与回归测试。 --- src/LivingVillage.Desktop.Tests/PrototypeTests.fs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/LivingVillage.Desktop.Tests') diff --git a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs index f1f4aed..524573f 100644 --- a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs +++ b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs @@ -202,6 +202,22 @@ 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 _.PauseHelpOpensFromPlayingAndRestoresSimulationControl () = + let original = { Paused = false; Speed = TwoX } + let state = { MenuState.create original true with Page = Playing } + + let helpState, pausedControl = MenuState.enterPauseHelp original state + Assert.AreEqual(Controls, helpState.Page) + Assert.AreEqual(Playing, helpState.ReturnPage) + Assert.IsTrue(pausedControl.Paused) + Assert.AreEqual(TwoX, pausedControl.Speed) + + let backState, restoredControl = MenuState.exitPauseHelp original helpState + Assert.AreEqual(Playing, backState.Page) + Assert.IsFalse(restoredControl.Paused) + Assert.AreEqual(original, restoredControl) + [] member _.CornerStatusShowsDayMoneyAndEnergyFromRealData () = let world = Sim.initialWorldN 42UL 0 -- cgit v1.2.3