Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

fix(ui): an opaque top bar, so map labels do not show through it (Task 24 review M7)

eyalgolanfb1ed875bdb2
diff --git a/unity/Assets/Tests/EditMode/UiFoundationTests.cs b/unity/Assets/Tests/EditMode/UiFoundationTests.cs
index 3ef453f86..a0d2cb2af 100644
--- a/unity/Assets/Tests/EditMode/UiFoundationTests.cs
+++ b/unity/Assets/Tests/EditMode/UiFoundationTests.cs
@@ -102,4 +102,14 @@ public class UiFoundationTests
var e = Assert.Throws<System.Collections.Generic.KeyNotFoundException>(() => { var _ = text["x"]; });
StringAssert.Contains("other.yaml", e.Message);
}
+
+ /// <summary>Task 24 review M7: world-space settlement labels must not show through the top bar.</summary>
+ [UnityTest]
+ public IEnumerator TheTopBarIsOpaque()
+ {
+ using var ui = new UiTestKit();
+ var bar = ui.Q<VisualElement>("top-bar");
+ for (int i = 0; i < 10 && bar.resolvedStyle.backgroundColor.a < 0.5f; i++) yield return null;
+ Assert.AreEqual(1f, bar.resolvedStyle.backgroundColor.a, 1e-3f);
+ }
}
diff --git a/unity/Assets/UI/Statecraft.uss b/unity/Assets/UI/Statecraft.uss
index b8f3fe61b..d222e0c78 100644
--- a/unity/Assets/UI/Statecraft.uss
+++ b/unity/Assets/UI/Statecraft.uss
@@ -2,6 +2,7 @@
:root {
--navy: rgba(14, 22, 38, 0.94);
--navy-deep: rgb(9, 14, 26);
+ --navy-solid: rgb(14, 22, 38); /* --navy without its transparency */
--gold: rgb(196, 160, 92);
--gold-dim: rgba(196, 160, 92, 0.45);
--ink: rgb(236, 228, 210);
@@ -55,6 +56,7 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);
position: absolute; left: 0; right: 0; top: 0; height: 96px;
flex-direction: row; align-items: center;
border-width: 0 0 1px 0; border-radius: 0; padding: 0 16px;
+ background-color: var(--navy-solid); /* opaque: map labels must not show through it (Task 24 review M7) */
}
/* Everything in the bar must fit its 96px (EB Garamond lines are about 1.55 x the font size): labels lose their default
vertical padding and margin, the year is 32px, and turn and date share one line. */