summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop.Tests/P16UiTests.fs
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-22 10:14:31 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-22 10:14:31 +0800
commitb377e750a6a3f35c5d64a29f14ac3fbd87d4a752 (patch)
tree8baac5fca38fdcecda4a00eed7a58b1031ab9dca /src/LivingVillage.Desktop.Tests/P16UiTests.fs
parentd36e86ac637ccc477479f88bea511c49b0a6a67c (diff)
parent5f12e63f2d2203267c30666f1559e06ec637b91c (diff)
downloadliving-village-b377e750a6a3f35c5d64a29f14ac3fbd87d4a752.tar.gz
merge: P26 美术整改(民居第二变体/河岸装饰/夜月光/HUD 双景可读)— Hermes 复验通过
Diffstat (limited to 'src/LivingVillage.Desktop.Tests/P16UiTests.fs')
-rw-r--r--src/LivingVillage.Desktop.Tests/P16UiTests.fs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop.Tests/P16UiTests.fs b/src/LivingVillage.Desktop.Tests/P16UiTests.fs
index 2e474ac..b68bbd3 100644
--- a/src/LivingVillage.Desktop.Tests/P16UiTests.fs
+++ b/src/LivingVillage.Desktop.Tests/P16UiTests.fs
@@ -128,6 +128,27 @@ type P16HudTests () =
Assert.IsTrue(ChineseText.requiredUiLabels |> List.contains "体力")
Assert.IsTrue(ChineseText.requiredUiLabels |> List.contains "钱币")
+ [<TestMethod>]
+ member _.HudPersistentSegmentsGetBackdropAndOutlineInBothPeriods () =
+ // P26:白天/夜景两套调色板都要有半透明底色 + 不透明深色描边,保证常驻元素可读。
+ for mode in [ Day; Night ] do
+ let palette = HudLayout.palette mode
+ Assert.IsTrue(palette.SegmentBackdrop.A > 0uy, "segment backdrop must be translucent, not opaque")
+ Assert.IsTrue(palette.SegmentBackdrop.A < 255uy, "segment backdrop must keep the scene visible")
+ Assert.AreEqual<byte>(255uy, palette.Outline.A)
+ Assert.IsTrue(palette.Outline.R < 40uy && palette.Outline.G < 40uy && palette.Outline.B < 40uy)
+ let outlineSum = int palette.Outline.R + int palette.Outline.G + int palette.Outline.B
+ let valueSum = int palette.Value.R + int palette.Value.G + int palette.Value.B
+ Assert.IsTrue(outlineSum < valueSum, "outline must contrast with the bright value text")
+ Assert.AreEqual<int>(4, HudLayout.textOutlineOffsets.Length)
+ for (dx, dy) in HudLayout.textOutlineOffsets do
+ Assert.IsTrue(dx <> 0 || dy <> 0, "outline offset must be non-zero")
+ let placed = HudLayout.layout (HudLayout.segments world SimulationControl.initial)
+ for (x, width, _) in placed do
+ let rect = HudLayout.segmentBackdrop x width
+ Assert.IsTrue(rect.X <= x && rect.X + rect.Width >= x + width, "backdrop must cover the segment text")
+ Assert.IsTrue(rect.Y >= 0 && rect.Y + rect.Height <= HudLayout.barHeight, "backdrop must stay inside the bar")
+
// ---- P16-FIX 菜单截图帧表 ----
[<TestClass>]