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.

HUD round 2: promo 03's left icon column, the four screens' buttons (refs #398) (#602)

Eyal Golan0fbd44750954
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 53f51bd8b..a6740ec9d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,11 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB
- GDD v0.1 Phase 1, a dev flag and the score (refs #380): `?mvp=1` in the WebGL page's URL loads the content through
`MvpSlice.Overlay` (the GDD slice) for playtests. The golden check and the smoke run ignore it, and a slice game never
reads, sets aside or writes the player's autosave (and has no New Game). In the GDD loop the top bar shows the score.
+- The left icon column (HUD round 2, part 2, refs #398): the four screens' buttons (Cabinet, Budget, Defence, Why?) move
+ from the top bar to promo 03's column of round icons at the left edge, icon-only, each named in a tip beside it on hover
+ and on keyboard focus. No new action. Tab still runs Cabinet, Budget, Defence, Why?, New Game, End Turn; the column stays
+ usable under the decision card, as the top bar does, and the card's backdrop, the screens and the toast start right of it.
+ Budget's button draws promo 03's ledger (owner, 2026-10-15), a new `UiIcon` glyph drawn in code.
- The minimap as promo 03's (HUD round 2, part 1, refs #398): a painted relief of the country, baked once from the map's
own heightmap, ground colours, land use and coast (`tools/minimap_bake.py`, `Resources/Map/MinimapRelief.png`, checked
fresh in CI) in place of the 128-pixel hex strip painted at boot, and beside it promo 03's three round buttons: zoom all
diff --git a/docs/visual-v1.md b/docs/visual-v1.md
index 898dbdc83..fbfb5d3fa 100644
--- a/docs/visual-v1.md
+++ b/docs/visual-v1.md
@@ -2758,6 +2758,48 @@ Runs in the same position agree within 0.1 ms (1 and 2; 3 and 4), and the 0.6 ms
not the build: the machine was slower early in the slot (run 2's gameplay03 is the same drift). The variants that remove
the mipmaps or the larger panel and its buttons cost the same as the branch. The first pair's +0.56 ms was this drift.
+## HUD round 2, part 2: the left icon column (#398)
+
+Promo 03 and T29 have a column of round icons at the left edge under the bar. This step moves the four screens' buttons
+(Cabinet, Budget, Defence, Why?) there from the top bar. It adds no action and no second copy of a button.
+- Icon-only, as in the promo. Each button keeps its name as its text, because the event log and the strings read it, but
+ draws it clear; the name is also its tooltip, and `HoverTip` (from #584) shows it beside the disc on hover and on focus.
+- The column comes before the top bar in Game.uxml, so Tab still runs Cabinet, Budget, Defence, Why?, New Game, End
+ Turn. It is covered where the top bar is (the start screen, an outcome clip) and stays usable under the decision card,
+ as the top bar does: the card's backdrop starts at its right edge. The card stays centred in the window.
+- The screens, the wide screens, the narrow HUD's full-width screens and the toast start right of the column (84 px), so
+ a screen never hides the button that closes it. The toast is 460 px wide (was 520), to stay clear of the screens.
+- The Hebrew UI mirrors rows, not the screen's corners (#550): the column stays at the left, as the minimap stays at the
+ right and the info panel at the left.
+- The top bar now holds New Game and End Turn. Its height and its tiers are part 3.
+
+Measured on the WebGL `?shot` frames at 1920x1080. The discs are found as the navy fill in the left 5% of the frame,
+between 7% and 47% of its height:
+
+| frame | discs | disc width, share of height | pitch | left edge, share of width | first disc's top |
+|---|---|---|---|---|---|
+| promo 03 | 5 | 5.21% | 6.32% | 0.87% | 12.1% |
+| demo2 T29 | 5 | 5.56% | 6.30% | 0.31% | 12.1% |
+| branch gameplay03 (EN, HE, diorama02 the same) | 4 | 4.72% | 6.30% | 0.94% | 10.8% |
+
+Frame time (`?vprofile` with the same temporary all/none-only FrameProfile patch on both builds, headless 1920x1080, then a
+headed DPR 2 pair) and boot (`headed.py boot --runs 3`), one `--exclusive` slot of 8 minutes, interleaved base, branch,
+branch, base. Base is #584's head 916cbad. Median avg ms (spread):
+
+| | base | branch | branch | base |
+|---|---|---|---|---|
+| gameplay03 all | 8.16 (0.05) | 8.21 (0.08) | 8.18 (0.01) | 8.21 (0.04) |
+| gameplay03 none | 7.02 (0.04) | 6.97 (0.04) | 7.02 (0.03) | 6.98 (0.03) |
+| diorama02 all | 15.49 (0.40) | 15.55 (0.43) | 15.61 (0.36) | 15.46 (0.43) |
+| diorama02 none | 11.08 (0.08) | 10.73 (0.09) | 10.74 (0.17) | 11.16 (0.05) |
+| boot map_build / first_frame, cpu 1 | 533 / 3877 ms | 530 / 3866 ms | 532 / 3862 ms | 528 / 3852 ms |
+
+DPR 2 headed, base then branch (spread): gameplay03 all 19.14 (0.29) / 19.09 (0.19), none 17.81 (0.03) / 17.84 (0.05);
+diorama02 all 33.79 (0.21) / 33.81 (0.25), none 27.91 (0.04) / 27.87 (0.01). The column costs nothing measurable.
+Diorama02 `none` is 0.35-0.4 ms lower on the branch in both positions, outside the spreads; at DPR 2 the same cell is
+equal (27.91 / 27.87). It is not explained (the branch draws four fewer captioned buttons in the bar, but that is not
+measured on its own), so it is not claimed as a gain.
+
## Issue #391: the terrain shader's frame-time cliff (warm land shade, not shipped)
#391 asked for the shaded hill ground to read warm brown, as promo 03's does (about (67, 53, 46)), rather than olive-grey.
The look was solved; the cost was not, so nothing shipped. What was measured is a constraint on any future addition to
diff --git a/tools/headed.py b/tools/headed.py
index 7481f2d78..2408999d1 100644
--- a/tools/headed.py
+++ b/tools/headed.py
@@ -42,8 +42,21 @@ import web_check # noqa: E402 (stdlib only)
WINDOW = (1568, 752)
# OPTION: the first option of the centred decision card after the first End Turn (One Army); MAP_UNDER_WHY: a map point under
# the open Why screen, clear of the card (the card hides under a screen and its backdrop blocks the map; #434). All four
-# measured on a WebGL capture of the playtest window, this branch at 1a0c3a7 (WHY had moved with the HUD round 1 bar).
-END_TURN, WHY, OPTION, MAP_UNDER_WHY = (1516, 42), (1389, 32), (608, 520), (1180, 300)
+# measured on a WebGL capture of the playtest window, this branch at 1a0c3a7; WHY is now derived (left_column_button).
+END_TURN, OPTION, MAP_UNDER_WHY = (1516, 42), (608, 520), (1180, 300)
+
+
+def left_column_button(index: int, window: tuple[int, int] = WINDOW) -> tuple[int, int]:
+ """The centre of the left icon column's button `index` (0 Cabinet, 1 Budget, 2 Defence, 3 Why?) in CSS pixels, from
+ Statecraft.uss (HUD round 2, #398): the column at left 16 px and top 112 px (the one-row bar), 56 px discs 68 px apart,
+ in panel units the PanelSettings scale to the window (1920x1080 reference, match 0.5: the geometric mean of the two
+ ratios). Derived, so a moved column is one change in the USS and here, not a re-measured capture."""
+ w, h = window
+ scale = ((w / 1920) * (h / 1080)) ** 0.5
+ return round((16 + 28) * scale), round((112 + 68 * index + 28) * scale)
+
+
+WHY = left_column_button(3) # Why? moved from the top bar to the left icon column (#602)
# For `wheel`, in a fixed 1568x752 CSS viewport (Playwright's, from the #43 browser runs): START_NEW, the start screen's
diff --git a/tools/tests/test_headed_column.py b/tools/tests/test_headed_column.py
new file mode 100644
index 000000000..767a261f7
--- /dev/null
+++ b/tools/tests/test_headed_column.py
@@ -0,0 +1,39 @@
+"""tools/headed.py derives the left icon column's click points (HUD round 2, #602) from Statecraft.uss's numbers; this
+fails when the USS moves the column and headed.py does not follow (review of #602: Why? was still clicked at the top bar)."""
+import importlib.util
+import re
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[2]
+USS = (ROOT / "unity/Assets/UI/Statecraft.uss").read_text()
+
+
+def headed():
+ spec = importlib.util.spec_from_file_location("headed", ROOT / "tools/headed.py")
+ mod = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(mod)
+ return mod
+
+
+def rule(selector: str) -> str:
+ m = re.search(re.escape(selector) + r"\s*\{([^}]*)\}", USS)
+ assert m, selector
+ return m.group(1)
+
+
+def px(body: str, prop: str) -> float:
+ m = re.search(rf"(?<![-\w]){prop}:\s*([0-9.]+)px", body)
+ assert m, prop
+ return float(m.group(1))
+
+
+def test_the_column_click_points_follow_the_uss():
+ col, button = rule(".left-column"), rule(".left-column .rail-button")
+ left, top, size = px(col, "left"), px(col, "top"), px(button, "height")
+ gap = float(re.search(r"margin:\s*0 0 ([0-9.]+)px 0", button).group(1))
+ h = headed()
+ w, hh = h.WINDOW
+ scale = ((w / 1920) * (hh / 1080)) ** 0.5
+ for i in range(4):
+ assert h.left_column_button(i) == (round((left + size / 2) * scale), round((top + (size + gap) * i + size / 2) * scale))
+ assert h.WHY == h.left_column_button(3)
diff --git a/unity/Assets/Scripts/UI/HudPresenter.cs b/unity/Assets/Scripts/UI/HudPresenter.cs
index c24cafb8c..b9dec9921 100644
--- a/unity/Assets/Scripts/UI/HudPresenter.cs
+++ b/unity/Assets/Scripts/UI/HudPresenter.cs
@@ -1,4 +1,5 @@
#nullable enable
+using System.Collections.Generic;
using System.Linq;
using UnityEngine.UIElements;
@@ -62,6 +63,10 @@ namespace Statecraft.Game.UI
("nav-why", "hud.nav.why"), ("new-game", "hud.new_game"), ("end-turn", "hud.end_turn"),
};
+ /// <summary>The left icon column (promo 03): the four screens' buttons.</summary>
+ public const string RailName = "left-column";
+ readonly HoverTip? railTips;
+
public HudPresenter(VisualElement root, SimBridge bridge, UiText text)
{
this.root = root; this.bridge = bridge; this.text = text;
@@ -76,6 +81,11 @@ namespace Statecraft.Game.UI
nav = root.Q<VisualElement>("nav");
foreach (var m in meters) m.RegisterCallback<GeometryChangedEvent>(OnMeterGeometry);
foreach (var (name, key) in Texts) root.Q<TextElement>(name).text = text[key];
+ // The left column's buttons are icon-only (HUD round 2, #398): their name, kept as their (clear) text, is also
+ // their tooltip, which HoverTip shows beside the disc on hover and on focus.
+ var rail = root.Q<VisualElement>(RailName)?.Query<Button>().ToList() ?? new List<Button>();
+ foreach (var b in rail) b.tooltip = b.text;
+ if (rail.Count > 0 && root.Q<Label>(HoverTip.TipName) != null) railTips = new HoverTip(root, rail, () => HoverTip.Side.Right);
foreach (var id in new[] { "treasury", "immigration", "security", "support", "standing", "fx" })
{
var meter = root.Q<VisualElement>("meter-" + id); var caption = text["hud.caption." + id];
@@ -90,6 +100,7 @@ namespace Statecraft.Game.UI
/// <summary>Unsubscribes from the bridge and the button (the owner calls this when it is disabled).</summary>
public void Dispose()
{
+ railTips?.Dispose();
bridge.Changed -= Render; endTurn.clicked -= onEndTurn; endTurn.generateVisualContent -= PaintHourglass;
bar.UnregisterCallback<GeometryChangedEvent>(OnBarGeometry);
foreach (var m in meters) m.UnregisterCallback<GeometryChangedEvent>(OnMeterGeometry);
diff --git a/unity/Assets/Scripts/UI/MapLabelsPresenter.cs b/unity/Assets/Scripts/UI/MapLabelsPresenter.cs
index 311f35b08..dc66fac62 100644
--- a/unity/Assets/Scripts/UI/MapLabelsPresenter.cs
+++ b/unity/Assets/Scripts/UI/MapLabelsPresenter.cs
@@ -30,7 +30,7 @@ namespace Statecraft.Game.UI
/// place (village, kibbutz, moshav) beyond DeclutterDistanceM, or when no spot fits. Its anchor class (USS) picks which
/// of the three spots above the kit is tried first; the spots are applied as a pixel shift on the slot's translate (no
/// class change, so no style pass). A spot fits when the pill lies wholly on screen and clear of every panel
- /// (OccluderNames: the top bar, the info panel, the minimap and its map-layer caption, the event card), does not
+ /// (OccluderNames: the top bar, the left icon column, the info panel, the minimap and its map-layer caption, the event card), does not
/// overlap an already placed pill (its last laid-out size plus MarginPx), covers at most MaxKitCover of its own kit's
/// rectangle and of every other visible kit's, and is more than twice as far from every other visible marker's top as
/// from its own kit (the kit alone, not the tokens on it), plus MarginPx, so no name reads as a neighbour's. A city
@@ -70,7 +70,7 @@ namespace Statecraft.Game.UI
/// visible kit's.</summary>
public const float MaxKitCover = 0.1f;
/// <summary>The panels a pill never sits under (Game.uxml names).</summary>
- public static readonly string[] OccluderNames = { "top-bar", "info-panel", "minimap", "map-layer", "event-card" };
+ public static readonly string[] OccluderNames = { "top-bar", "left-column", "info-panel", "minimap", "map-layer", "event-card" };
const string Centre = "anchor-lower-centre", Left = "anchor-lower-left", Right = "anchor-lower-right";
diff --git a/unity/Assets/Scripts/UI/ScreenNav.cs b/unity/Assets/Scripts/UI/ScreenNav.cs
index 62cb28676..ba34aa7b8 100644
--- a/unity/Assets/Scripts/UI/ScreenNav.cs
+++ b/unity/Assets/Scripts/UI/ScreenNav.cs
@@ -41,6 +41,7 @@ namespace Statecraft.Game.UI
bool modal = r.ClassListContains(EventCardPresenter.OpenClass) && !start && !screen && !outcome;
r.EnableInClassList(EventCardPresenter.ModalClass, modal);
r.Q("top-bar")?.SetEnabled(!(start || outcome));
+ r.Q("left-column")?.SetEnabled(!(start || outcome)); // the screens' buttons: usable wherever the top bar is
r.Q("right-column")?.SetEnabled(!(start || full || modal || outcome));
r.Q("info-panel")?.SetEnabled(!(start || full || modal || outcome || r.ClassListContains(WideOpenClass)));
var layer = r.Q("event-layer");
diff --git a/unity/Assets/Scripts/UI/UiIcon.cs b/unity/Assets/Scripts/UI/UiIcon.cs
index 82b8775d6..26d62622b 100644
--- a/unity/Assets/Scripts/UI/UiIcon.cs
+++ b/unity/Assets/Scripts/UI/UiIcon.cs
@@ -44,7 +44,7 @@ namespace Statecraft.Game.UI
["columns"] = Columns, ["scales"] = Scales, ["helmet"] = Helmet, ["question"] = Question, ["restart"] = Restart,
["chevron"] = Chevron, ["chevron-back"] = ChevronBack, ["hourglass"] = Hourglass,
["region"] = Region, ["house"] = House, ["village"] = Village, ["flag"] = Flag,
- ["peaks"] = Peaks, ["skyline"] = Skyline,
+ ["peaks"] = Peaks, ["skyline"] = Skyline, ["ledger"] = Ledger,
["biome-sea"] = Waves, ["biome-lake"] = Waves, ["biome-coastal_plain"] = Plain, ["biome-hills"] = Hills,
["biome-mountains"] = Mountains, ["biome-valley"] = Valley, ["biome-lowland"] = Plain, ["biome-desert"] = Dunes,
};
@@ -305,6 +305,25 @@ namespace Statecraft.Game.UI
Rect(p, at, 16.6f, 15f, 2.2f, 1.8f); p.Fill();
}
+ /// <summary>The Budget screen's button (owner, 2026-10-15, as promo 03's column): a ruled ledger with a curl at the top
+ /// and the bottom, its entries in three panels.</summary>
+ static void Ledger(Painter2D p, Func<float, float, Vector2> at, float s, Color gold)
+ {
+ p.strokeColor = gold; p.lineWidth = 1.4f * s;
+ p.BeginPath(); p.MoveTo(at(6, 4.6f)); p.LineTo(at(6, 19.4f)); p.Stroke();
+ p.BeginPath(); p.MoveTo(at(18, 4.6f)); p.LineTo(at(18, 19.4f)); p.Stroke();
+ foreach (var y in new[] { 3.4f, 20.6f })
+ {
+ p.BeginPath(); p.MoveTo(at(5, y)); p.LineTo(at(19.6f, y)); p.Stroke();
+ p.fillColor = gold; Circle(p, at(4.4f, y), 1.3f * s); p.Fill();
+ }
+ p.lineWidth = 1f * s;
+ foreach (var y in new[] { 8.2f, 16 }) { p.BeginPath(); p.MoveTo(at(6, y)); p.LineTo(at(18, y)); p.Stroke(); }
+ p.fillColor = gold;
+ foreach (var (x, y, w) in new[] { (7.6f, 5.2f, 3.6f), (12.6f, 5.2f, 3.8f), (7.6f, 9.8f, 2.6f), (11.4f, 9.8f, 5f), (7.6f, 12.4f, 4f), (12.8f, 12.4f, 3.6f), (7.6f, 17.6f, 3.4f), (12.4f, 17.6f, 4f) })
+ { Rect(p, at, x, y, w, 1.6f); p.Fill(); }
+ }
+
/// <summary>The settlements row: a house.</summary>
static void House(Painter2D p, Func<float, float, Vector2> at, float s, Color gold)
{
diff --git a/unity/Assets/Tests/EditMode/DecisionCardTests.cs b/unity/Assets/Tests/EditMode/DecisionCardTests.cs
index 57d654734..ac6f77d15 100644
--- a/unity/Assets/Tests/EditMode/DecisionCardTests.cs
+++ b/unity/Assets/Tests/EditMode/DecisionCardTests.cs
@@ -100,8 +100,12 @@ public class DecisionCardTests
Assert.IsTrue(r.Shows("event-scrim"), $"{where}: the backdrop shows");
Covered(r, true, where);
// A point of the map clear of every panel: the backdrop takes it, so a map click or drag stops there.
- // (The layer's 16 px gutter at the left, just under the bar: the backdrop reaches the window's edge.)
- var free = new Vector2(4f, r.Root.Q("top-bar").worldBound.yMax + 4f);
+ // (The window's left edge just under the bar, inside the left icon column's strip: the backdrop's gutter takes it,
+ // review of #602; and just right of the column the backdrop itself.)
+ var bar = r.Root.Q("top-bar").worldBound.yMax;
+ var edge = new Vector2(4f, bar + 4f);
+ Assert.AreSame(r.Root.Q("event-gutter"), r.Root.panel.Pick(edge), $"{where}: the backdrop's strip under the column takes the pointer at {edge}");
+ var free = new Vector2(r.Root.Q("left-column").worldBound.xMax + 4f, bar + 4f);
Assert.AreSame(r.Root.Q("event-scrim"), r.Root.panel.Pick(free), $"{where}: the backdrop takes the pointer at {free}");
Assert.AreSame(r.CardElement, r.Focused, $"{where}: the new event's card has the focus, no option lit");
Assert.IsTrue(r.FirstOption.canGrabFocus, $"{where}: its options are in reach");
@@ -112,6 +116,7 @@ public class DecisionCardTests
Assert.IsTrue(r.Card.Collapsed, where);
Assert.IsFalse(r.Shows("event-card"), $"{where}: the card is hidden");
Assert.IsFalse(r.Shows("event-scrim"), $"{where}: the backdrop is gone");
+ Assert.IsFalse(r.Shows("event-gutter"), $"{where}: and its strip under the left column");
Assert.IsTrue(r.Shows("event-reopen"), $"{where}: Decision waiting shows");
Assert.AreEqual("Decision waiting", r.Waiting.text);
Assert.IsFalse(r.Hud.ClassListContains(EventCardPresenter.ModalClass), where);
diff --git a/unity/Assets/Tests/EditMode/GameSceneTests.cs b/unity/Assets/Tests/EditMode/GameSceneTests.cs
index 4b6cf1cdc..d09c61cd9 100644
--- a/unity/Assets/Tests/EditMode/GameSceneTests.cs
+++ b/unity/Assets/Tests/EditMode/GameSceneTests.cs
@@ -121,6 +121,71 @@ public class GameSceneTests
Assert.AreEqual(size.z, Camera.main.GetComponent<CameraController>().Bounds.height, 1f);
}
+ /// <summary>Review of #602 (must-fix): with a decision card open the map is blocked everywhere but the left icon column's
+ /// own buttons. Probes in the column's gutter (left of the discs, between two discs, below the last) reach the map while
+ /// no card is open (a hex click picks a hex there), and are UI while the card is open: the map pointer refuses the hex
+ /// click and the camera refuses the drag there. Before the fix the backdrop started at the column's right edge and the
+ /// column takes no pointer, so the strip leaked through to the map.</summary>
+ [UnityTest]
+ public IEnumerator WithACardOpenTheColumnsGutterBlocksTheMap()
+ {
+ EditorSceneManager.OpenScene("Assets/Map.unity", OpenSceneMode.Single);
+ var doc = Object.FindFirstObjectByType<UIDocument>();
+ var rt = new RenderTexture(1920, 1080, 0);
+ var ps = Object.Instantiate(doc.panelSettings);
+ ps.targetTexture = rt;
+ try
+ {
+ doc.panelSettings = ps;
+ Object.FindFirstObjectByType<MapScene>().Build(Inputs.Map);
+ var root = Object.FindFirstObjectByType<GameRoot>();
+ root.Store = new SaveStore(saveDir);
+ root.Begin(Inputs, 0);
+ var ui = doc.rootVisualElement;
+ for (int i = 0; i < 30 && !(ui.Q("nav-why").worldBound.width > 0); i++) yield return null;
+ var panel = ui.panel;
+ float h = Screen.height;
+ Vector2 o = UiPointer.ToPanel(panel, Vector2.zero, h), ex = UiPointer.ToPanel(panel, Vector2.right * 100, h) - o, ey = UiPointer.ToPanel(panel, Vector2.up * 100, h) - o;
+ Vector2 ScreenFor(Vector2 p) => new Vector2((p - o).x / ex.x * 100, (p - o).y / ey.y * 100);
+ Rect a = ui.Q("nav-cabinet").worldBound, b = ui.Q("nav-budget").worldBound, last = ui.Q("nav-why").worldBound;
+ var probes = new (string where, Vector2 p)[]
+ {
+ ("left of a disc", new Vector2(a.xMin - 6f, a.center.y)),
+ ("between two discs", new Vector2(a.center.x, (a.yMax + b.yMin) / 2)),
+ ("right of a disc, inside the column's strip", new Vector2(a.xMax + 4f, a.center.y)),
+ ("below the last disc", new Vector2(last.center.x, last.yMax + 80f)),
+ };
+ var pointer = Object.FindFirstObjectByType<MapPointer>();
+ var camera = Camera.main.GetComponent<CameraController>();
+ var bridge = root.Bridge!;
+ Assert.IsFalse(ui.Q("root").ClassListContains(EventCardPresenter.ModalClass), "precondition: no card at the start");
+ foreach (var (where, p) in probes)
+ {
+ Assert.IsFalse(pointer.IsOverUi!(ScreenFor(p)), $"no card: {where} {p} is map");
+ Assert.IsTrue(pointer.HandleClick(ScreenFor(p)), $"no card: a hex click {where} {p} picks a hex (the probe is on the map)");
+ }
+ var g = GameSession.New(Inputs.Content, GoldenRun.Seed, Mode.Historical);
+ while (g.State.PendingEvents.Count == 0) g.Step(new Command[0]);
+ bridge.Replace(g);
+ for (int i = 0; i < 5; i++) yield return null;
+ Assert.IsTrue(ui.Q("root").ClassListContains(EventCardPresenter.ModalClass), "precondition: the card is open");
+ foreach (var (where, p) in probes)
+ {
+ Assert.IsTrue(pointer.IsOverUi!(ScreenFor(p)), $"card open: {where} {p} blocks map clicks");
+ Assert.IsFalse(pointer.HandleClick(ScreenFor(p)), $"card open: a hex click {where} {p} picks no hex");
+ Assert.IsTrue(camera.IsOverUi!(ScreenFor(p)), $"card open: {where} {p} blocks the drag and the wheel");
+ }
+ UiTestKit.Press(ui.Q<Button>("nav-why"));
+ Assert.AreEqual(DisplayStyle.Flex, ui.Q("screen-why").style.display.value, "card open: the column's own buttons still work");
+ }
+ finally
+ {
+ EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single);
+ if (ps != null) Object.DestroyImmediate(ps);
+ if (rt != null) { rt.Release(); Object.DestroyImmediate(rt); }
+ }
+ }
+
// Carry 2 and 8: ScreenNav hides every screen at start; the empty middle of the screen reaches the map while the
// panels do not (the camera and the map pointer ask the game panel); a minimap click moves the camera.
[UnityTest]
diff --git a/unity/Assets/Tests/EditMode/LeftColumnTests.cs b/unity/Assets/Tests/EditMode/LeftColumnTests.cs
new file mode 100644
index 000000000..b2f7976f3
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/LeftColumnTests.cs
@@ -0,0 +1,271 @@
+#nullable enable
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using NUnit.Framework;
+using Statecraft.Game;
+using Statecraft.Game.Map;
+using Statecraft.Game.UI;
+using Statecraft.Sim;
+using UnityEditor;
+using UnityEngine;
+using UnityEngine.TestTools;
+using UnityEngine.UIElements;
+
+/// <summary>HUD round 2, part 2 (#398): promo/final/03's left icon column. It holds the four screens' buttons, moved from
+/// the top bar (no new action): Cabinet, Budget, Defence, Why?. They are round icons with no caption; each one's name is its
+/// text (clear) and its tooltip, which HoverTip shows beside it. The Hebrew UI mirrors rows, not the screen's corners (#550),
+/// so the column stays at the left. Tab still runs Cabinet, Budget, Defence, Why?, New Game, End Turn.</summary>
+public class LeftColumnTests
+{
+ static readonly Content C = ContentLoader.Load(Paths.Content);
+ static readonly HexFile Hexes = MapBuilder.LoadHexes(Path.Combine(Paths.Content, "map", "hexes.json"));
+ static UiText En => UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.Strings).text);
+ static UiText He => UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.StringsHebrew).text, "strings.he.yaml");
+ static string MapFile(string name) => File.ReadAllText(Path.Combine(Paths.Content, "map", name));
+ static MapRegions Regions() => new MapRegions(Subdistricts1948.Parse(MapFile(Subdistricts1948.FileName)), Armistice1949.Parse(MapFile(Armistice1949.FileName)));
+ static Dictionary<string, string> Names() => SettlementPlacer.Parse(MapFile(SettlementPlacer.DefaultFileName)).ToDictionary(t => t.Id, t => t.Name);
+
+ const string Column = "left-column"; // HudPresenter.RailName
+
+ static readonly (string name, string key, string glyph)[] Rail =
+ {
+ ("nav-cabinet", "hud.nav.cabinet", "columns"), ("nav-budget", "hud.nav.budget", "ledger"),
+ ("nav-defence", "hud.nav.defence", "helmet"), ("nav-why", "hud.nav.why", "question"),
+ };
+
+ /// <summary>InfoPanelLayoutTests' 19 window sizes.</summary>
+ static readonly (int w, int h)[] Windows =
+ {
+ (1920, 1080), (1280, 720), (1366, 768), (1760, 1000), (1920, 1200), (1440, 900), (1680, 1050), (1024, 768), (1280, 1024),
+ (1024, 1024), (960, 1080), (800, 1000), (1531, 784), (2560, 1080), (1920, 900), (1600, 757), (1366, 657), (960, 600), (390, 844),
+ };
+
+ static GameSession WithAnEventOpen()
+ {
+ var g = GameSession.New(C, GoldenRun.Seed, Mode.Historical);
+ for (int t = 0; g.State.PendingEvents.Count == 0; t++)
+ {
+ if (t >= 50) Assert.Fail("no event within 50 turns");
+ g.Step(new Command[0]);
+ }
+ return g;
+ }
+
+ /// <summary>The real Game.uxml on the real PanelSettings at w x h, in English or Hebrew, with the top bar, the screens'
+ /// navigation, the decision card (open when the session has an event), the info panel on Lydda's hex, the minimap and the
+ /// border caption.</summary>
+ static IEnumerator Rendered(int w, int h, bool hebrew, GameSession g, System.Action<VisualElement, ScreenNav> check, System.Action<VisualElement, ScreenNav>? act = null)
+ {
+ var text = hebrew ? He : En;
+ var rt = new RenderTexture(w, h, 0);
+ var ps = Object.Instantiate(AssetDatabase.LoadAssetAtPath<PanelSettings>(UiPaths.Panel));
+ ps.targetTexture = rt;
+ var go = new GameObject("LeftColumnTest");
+ go.SetActive(false);
+ var doc = go.AddComponent<UIDocument>();
+ doc.panelSettings = ps;
+ doc.visualTreeAsset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(UiPaths.GameUxml);
+ go.SetActive(true);
+ var root = doc.rootVisualElement;
+ root.Q("root").RemoveFromClassList("loading");
+ if (hebrew) root.Q("root").AddToClassList(UiLanguage.HebrewClass);
+ var bridge = new SimBridge(g, text);
+ var hud = new HudPresenter(root, bridge, text);
+ var nav = new ScreenNav(root);
+ var card = new EventCardPresenter(root, bridge, text, null);
+ var info = new InfoPanelPresenter(root, bridge, text, Names(), regions: Regions());
+ var mini = new MinimapPresenter(root, Hexes, text);
+ var layer = root.Q<Label>("map-layer");
+ layer.text = "Mandate sub-districts, 1947";
+ layer.style.display = DisplayStyle.Flex;
+ try
+ {
+ var lod = C.SettlementHexes.Single(s => s.Id == "lod");
+ info.Show(lod.Q, lod.R);
+ act?.Invoke(root, nav);
+ for (int i = 0; i < 30 && !(root.Q("nav-cabinet").layout.width > 0); i++) yield return null;
+ for (int i = 0; i < 3; i++) yield return null;
+ check(root, nav);
+ }
+ finally
+ {
+ mini.Dispose(); info.Dispose(); card.Dispose(); hud.Dispose();
+ Object.DestroyImmediate(go); Object.DestroyImmediate(ps); rt.Release(); Object.DestroyImmediate(rt);
+ }
+ }
+
+ /// <summary>The column holds the four screens, in the top bar's old order, each a round icon whose name is its text and
+ /// its tooltip in both languages; the top bar keeps New Game and End Turn only. No new button: the screens are ScreenNav's.</summary>
+ [Test]
+ public void TheColumnHoldsTheFourScreensAsRoundIconsNamedInBothLanguages()
+ {
+ foreach (var hebrew in new[] { false, true })
+ {
+ var text = hebrew ? He : En;
+ using var ui = new UiTestKit();
+ var bridge = new SimBridge(GameSession.New(C, GoldenRun.Seed, Mode.Historical), text);
+ using var hud = new HudPresenter(ui.Root, bridge, text);
+ var column = ui.Q<VisualElement>(Column);
+ CollectionAssert.AreEqual(Rail.Select(r => r.name).ToArray(), column.Query<Button>().ToList().Select(b => b.name).ToArray(), "the column's buttons, in order");
+ CollectionAssert.AreEquivalent(ScreenNav.Screens.Select(s => "nav-" + s).ToArray(), Rail.Select(r => r.name).ToArray(), "exactly ScreenNav's screens");
+ foreach (var (name, key, glyph) in Rail)
+ {
+ var b = ui.Q<Button>(name);
+ Assert.AreEqual(text[key], b.text, $"{name}: its name is still its text (the event log records it)");
+ Assert.IsFalse(string.IsNullOrWhiteSpace(b.tooltip), $"{name}: a tooltip");
+ Assert.AreEqual(text[key], b.tooltip, $"{name}: the tooltip is its name");
+ Assert.AreEqual(glyph, b.Q<UiIcon>(className: "nav-disc").Glyph, name);
+ }
+ CollectionAssert.AreEqual(new[] { "new-game" }, ui.Q<VisualElement>("nav").Query<Button>().ToList().Select(b => b.name).ToArray(), "the top bar keeps New Game (and End Turn)");
+ }
+ }
+
+ /// <summary>At every window size, in English and Hebrew, with an event card open and Lydda's hex chosen: the column lies in
+ /// the window at its left edge (Hebrew too: #550 mirrors rows, not corners), under the bar, each disc at least 24 screen
+ /// px with no caption showing, clear of the info panel, the decision card and its backdrop, the minimap column and the
+ /// border caption, and the toast.</summary>
+ [UnityTest]
+ public IEnumerator TheColumnFitsEveryWindowInEnglishAndHebrew()
+ {
+ var problems = new List<string>();
+ var g = WithAnEventOpen();
+ foreach (var hebrew in new[] { false, true })
+ foreach (var (w, h) in Windows)
+ yield return Rendered(w, h, hebrew, g, (root, nav) =>
+ {
+ string at = $"{(hebrew ? "he" : "en")} {w}x{h}";
+ var window = root.worldBound;
+ float scale = w / window.width;
+ // Preconditions, so no overlap check below is vacuous (a hidden element has no size).
+ foreach (var shown in new[] { "event-card", "event-scrim", "event-gutter", "info-panel", "minimap", "map-layer" })
+ if (!(root.Q(shown).worldBound.width > 0)) problems.Add($"{at}: precondition: {shown} shows");
+ var col = root.Q(Column).worldBound;
+ var buttons = root.Q(Column).Query<Button>().ToList();
+ var hull = buttons.Select(b => b.worldBound).Aggregate((a, b) => Rect.MinMaxRect(Mathf.Min(a.xMin, b.xMin), Mathf.Min(a.yMin, b.yMin), Mathf.Max(a.xMax, b.xMax), Mathf.Max(a.yMax, b.yMax)));
+ if (!(hull.xMin >= window.xMin && hull.xMax <= window.xMax && hull.yMax <= window.yMax)) problems.Add($"{at}: the column {hull} leaves the window {window}");
+ if (hull.xMin - window.xMin > 0.03f * window.width) problems.Add($"{at}: the column {hull} is not at the left edge");
+ if (hull.yMin < root.Q("top-bar").worldBound.yMax) problems.Add($"{at}: the column {hull} rises into the top bar");
+ foreach (var b in buttons)
+ {
+ if (b.worldBound.width * scale < 24f || b.worldBound.height * scale < 24f) problems.Add($"{at}: {b.name} is {b.worldBound.width * scale:0} px, under 24");
+ if (b.resolvedStyle.color.a > 0.01f) problems.Add($"{at}: {b.name}'s caption shows");
+ }
+ foreach (var (name, r) in new[] { ("the info panel", root.Q("info-panel").worldBound), ("the decision card", root.Q("event-card").worldBound),
+ ("the card's backdrop", root.Q("event-scrim").worldBound), ("the backdrop's strip, over the column", ColumnOverGutter(root)), ("the minimap", root.Q("minimap").worldBound),
+ ("the border caption", root.Q("map-layer").worldBound) })
+ if (r.Overlaps(hull)) problems.Add($"{at}: the column {hull} overlaps {name} {r}");
+ if (!root.Q(Column).enabledInHierarchy) problems.Add($"{at}: the column is disabled under the open card (the top bar is not)");
+ });
+ Assert.IsEmpty(problems, string.Join("\n", problems));
+ }
+
+ /// <summary>Each screen opens clear of the column at every window size (a screen under the column would hide the button
+ /// that closes it), and the toast too, in English and Hebrew.</summary>
+ [UnityTest]
+ public IEnumerator EveryScreenAndTheToastOpenClearOfTheColumn()
+ {
+ var problems = new List<string>();
+ var g = GameSession.New(C, GoldenRun.Seed, Mode.Historical);
+ foreach (var hebrew in new[] { false, true })
+ foreach (var (w, h) in Windows)
+ {
+ string at = $"{(hebrew ? "he" : "en")} {w}x{h}";
+ yield return Rendered(w, h, hebrew, g, (root, nav) =>
+ {
+ var toast = root.Q("toast").worldBound;
+ if (!(toast.width > 0)) problems.Add($"{at}: precondition: the toast shows");
+ else if (toast.Overlaps(Hull(root))) problems.Add($"{at}: the toast {toast} covers the column {Hull(root)}");
+ }, (root, nav) => { var t = root.Q<Label>("toast"); t.text = "A note"; t.style.display = DisplayStyle.Flex; });
+ foreach (var screen in ScreenNav.Screens)
+ yield return Rendered(w, h, hebrew, g, (root, nav) =>
+ {
+ var r = root.Q("screen-" + screen).worldBound;
+ if (!(r.width > 0)) problems.Add($"{at}: precondition: the {screen} screen shows");
+ else if (r.Overlaps(Hull(root))) problems.Add($"{at}: the {screen} screen {r} covers the column {Hull(root)}");
+ }, (root, nav) => nav.Toggle(screen));
+ }
+ Assert.IsEmpty(problems, string.Join("\n", problems));
+ }
+
+ /// <summary>Empty unless the strip draws over the column: the strip comes before the column in the tree, so the column's
+ /// buttons are above it (checked by picking a disc's centre).</summary>
+ static Rect ColumnOverGutter(VisualElement root)
+ {
+ var b = root.Q<Button>("nav-cabinet");
+ var picked = root.panel.Pick(b.worldBound.center);
+ return picked == b || picked?.GetFirstAncestorOfType<Button>() == b ? Rect.zero : b.worldBound;
+ }
+
+ static Rect Hull(VisualElement root) => root.Q(Column).Query<Button>().ToList().Select(b => b.worldBound)
+ .Aggregate((a, b) => Rect.MinMaxRect(Mathf.Min(a.xMin, b.xMin), Mathf.Min(a.yMin, b.yMin), Mathf.Max(a.xMax, b.xMax), Mathf.Max(a.yMax, b.yMax)));
+
+ /// <summary>The audit's focus order is kept: Cabinet, Budget, Defence, Why?, New Game, End Turn (then the minimap's
+ /// buttons, out of reach under the open card). The column is out of Tab's reach under the start screen and an outcome clip, as the top bar is, and usable
+ /// under the decision card, as the top bar is.</summary>
+ [UnityTest]
+ public IEnumerator TheTabOrderIsKeptAndTheColumnIsCoveredWhereTheTopBarIs()
+ {
+ var g = WithAnEventOpen();
+ foreach (var hebrew in new[] { false, true })
+ yield return Rendered(1920, 1080, hebrew, g, (root, nav) =>
+ {
+ string at = hebrew ? "he" : "en";
+ var order = root.Query<VisualElement>().Where(e => e.focusable && e.canGrabFocus && e.tabIndex >= 0 && e is Button).ToList()
+ .Select(e => e.name).Where(n => n.StartsWith("nav-") || n == "new-game" || n == "end-turn" || n.StartsWith("minimap-")).ToList();
+ // Under the open card the minimap column is out of reach (the backdrop covers it); the column and the bar are not.
+ CollectionAssert.AreEqual(new[] { "nav-cabinet", "nav-budget", "nav-defence", "nav-why", "new-game", "end-turn" },
+ order, $"{at}: the Tab order under the open card");
+ var r = root.Q("root");
+ Assert.IsTrue(r.ClassListContains(EventCardPresenter.ModalClass), at + ": precondition: the card is open");
+ Assert.IsTrue(root.Q(Column).enabledSelf, at + ": usable under the card, as the top bar is");
+ r.AddToClassList(StartScreenPresenter.OpenClass); ScreenNav.DisableCovered(root);
+ Assert.IsFalse(root.Q(Column).enabledSelf, at + ": out of reach under the start screen");
+ r.RemoveFromClassList(StartScreenPresenter.OpenClass); r.AddToClassList(OutcomePresenter.OpenClass); ScreenNav.DisableCovered(root);
+ Assert.IsFalse(root.Q(Column).enabledSelf, at + ": out of reach under an outcome clip");
+ r.RemoveFromClassList(OutcomePresenter.OpenClass); ScreenNav.DisableCovered(root);
+ Assert.IsTrue(root.Q(Column).enabledSelf, at + ": back");
+ });
+ }
+
+ /// <summary>Each button's name shows beside it, to its right, on hover and on focus, inside the window, and goes on leave
+ /// and blur; pressing it still opens its screen.</summary>
+ [UnityTest]
+ public IEnumerator EachButtonShowsItsNameOnHoverAndFocusAndOpensItsScreen()
+ {
+ var problems = new List<string>();
+ var g = GameSession.New(C, GoldenRun.Seed, Mode.Historical);
+ foreach (var hebrew in new[] { false, true })
+ foreach (var (w, h) in new[] { (1920, 1080), (960, 600), (390, 844) })
+ yield return Rendered(w, h, hebrew, g, (root, nav) =>
+ {
+ string at = $"{(hebrew ? "he" : "en")} {w}x{h}";
+ var tip = root.Q<Label>(HoverTip.TipName);
+ foreach (var (name, key, _) in Rail)
+ {
+ var b = root.Q<Button>(name);
+ using (var e = PointerEnterEvent.GetPooled(new Event { type = EventType.MouseMove, mousePosition = b.worldBound.center }))
+ { e.target = b; b.SendEvent(e); }
+ if (tip.style.display.value != DisplayStyle.Flex || tip.text != b.tooltip) problems.Add($"{at}: hovering {name} shows no tip");
+ float left = tip.style.left.value.value;
+ float width = tip.MeasureTextSize(tip.text, 0, VisualElement.MeasureMode.Undefined, 0, VisualElement.MeasureMode.Undefined).x + 22;
+ if (left < b.worldBound.xMax - 0.5f) problems.Add($"{at}: the tip of {name} covers its button");
+ if (left + width > root.worldBound.xMax) problems.Add($"{at}: the tip of {name} leaves the window");
+ using (var e = PointerLeaveEvent.GetPooled(new Event { type = EventType.MouseMove, mousePosition = Vector2.zero }))
+ { e.target = b; b.SendEvent(e); }
+ if (tip.style.display.value != DisplayStyle.None) problems.Add($"{at}: the tip of {name} stays after leave");
+ b.Focus();
+ if (tip.style.display.value != DisplayStyle.Flex || tip.text != b.tooltip) problems.Add($"{at}: focusing {name} shows no tip");
+ b.Blur();
+ if (tip.style.display.value != DisplayStyle.None) problems.Add($"{at}: the tip of {name} stays after blur");
+ }
+ var budget = root.Q<Button>("nav-budget");
+ budget.Focus();
+ UiTestKit.Press(budget);
+ if (tip.style.display.value != DisplayStyle.None) problems.Add($"{at}: the tip stays over the screen Budget opened (review of #602)");
+ if (nav.Current != "budget") problems.Add($"{at}: Budget in the column opens the Budget screen (was {nav.Current ?? "none"})");
+ });
+ Assert.IsEmpty(problems, string.Join("\n", problems));
+ }
+}
diff --git a/unity/Assets/Tests/EditMode/LeftColumnTests.cs.meta b/unity/Assets/Tests/EditMode/LeftColumnTests.cs.meta
new file mode 100644
index 000000000..381490af1
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/LeftColumnTests.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 1e3e0845b202647ad9ecf132b5f53e2a
\ No newline at end of file
diff --git a/unity/Assets/Tests/EditMode/PromoHudTests.cs b/unity/Assets/Tests/EditMode/PromoHudTests.cs
index e34d7e6ce..622f714f7 100644
--- a/unity/Assets/Tests/EditMode/PromoHudTests.cs
+++ b/unity/Assets/Tests/EditMode/PromoHudTests.cs
@@ -38,7 +38,7 @@ public class PromoHudTests
public void EveryScreenButtonIsARoundIconWithItsName()
{
using var ui = new UiTestKit();
- foreach (var (button, name, glyph) in new[] { ("nav-cabinet", "Cabinet", "columns"), ("nav-budget", "Budget", "scales"),
+ foreach (var (button, name, glyph) in new[] { ("nav-cabinet", "Cabinet", "columns"), ("nav-budget", "Budget", "ledger"),
("nav-defence", "Defence", "helmet"), ("nav-why", "Why?", "question"), ("new-game", "New Game", "restart") })
{
var b = ui.Q<Button>(button);
diff --git a/unity/Assets/Tests/EditMode/PromoScreensTests.cs b/unity/Assets/Tests/EditMode/PromoScreensTests.cs
index d121b5543..fde1f4015 100644
--- a/unity/Assets/Tests/EditMode/PromoScreensTests.cs
+++ b/unity/Assets/Tests/EditMode/PromoScreensTests.cs
@@ -734,7 +734,10 @@ public class PromoScreensTests
if (twoRow)
{
var panel = root.panel.visualTree.worldBound;
- if (r.width < panel.width - 40f) problems.Add($"{where}: not full width ({r.width:0} of {panel.width:0})");
+ // Full width right of the left icon column (HUD round 2, #398), which stays in view to switch screens.
+ var column = root.Q("left-column").worldBound;
+ if (r.xMin < column.xMax - 0.5f) problems.Add($"{where}: covers the left icon column {column}");
+ if (r.width < panel.width - 40f - 68f) problems.Add($"{where}: not full width ({r.width:0} of {panel.width:0})");
foreach (var hidden in new[] { "right-column", "info-panel" })
if (root.Q(hidden).resolvedStyle.display != DisplayStyle.None) problems.Add($"{where}: {hidden} shows under the screen");
var before = info.Selected;
diff --git a/unity/Assets/UI/Game.uxml b/unity/Assets/UI/Game.uxml
index 6c1269579..8f561db28 100644
--- a/unity/Assets/UI/Game.uxml
+++ b/unity/Assets/UI/Game.uxml
@@ -5,6 +5,19 @@
<ui:Label name="loading" text="Loading the map of 1948…" class="loading-line" picking-mode="Ignore" />
<!-- Settlement names, positioned by MapLabelsPresenter under every panel; clicks pass through to the map. -->
<ui:VisualElement name="map-labels" class="map-labels" picking-mode="Ignore" />
+ <!-- HUD round 2, part 2 (#398): promo 03's left icon column, the four screens (ScreenNav), icon-only; each one's name
+ is its text (the event log records it), hidden, and its tooltip, shown beside it on hover and on focus
+ (HoverTip). Before the top bar in the tree, so Tab still runs Cabinet, Budget, Defence, Why?, New Game, End Turn. -->
+ <!-- The left column's strip of the decision card's backdrop (review of #602): dimmed and taking the pointer while the
+ card is open (event-modal), so the map is blocked between and below the discs as it is everywhere else; before
+ the column in the tree, so the column's buttons stay above it and usable. -->
+ <ui:VisualElement name="event-gutter" class="event-gutter" />
+ <ui:VisualElement name="left-column" class="left-column" picking-mode="Ignore">
+ <ui:Button name="nav-cabinet" text="Cabinet" class="nav-button rail-button"><Statecraft.Game.UI.UiIcon glyph="columns" class="nav-disc" /></ui:Button>
+ <ui:Button name="nav-budget" text="Budget" class="nav-button rail-button"><Statecraft.Game.UI.UiIcon glyph="ledger" class="nav-disc" /></ui:Button>
+ <ui:Button name="nav-defence" text="Defence" class="nav-button rail-button"><Statecraft.Game.UI.UiIcon glyph="helmet" class="nav-disc" /></ui:Button>
+ <ui:Button name="nav-why" text="Why?" class="nav-button rail-button"><Statecraft.Game.UI.UiIcon glyph="question" class="nav-disc" /></ui:Button>
+ </ui:VisualElement>
<ui:VisualElement name="top-bar" class="panel top-bar">
<Statecraft.Game.UI.UiFrame corners="false" rule="false" />
<ui:VisualElement class="date-box">
@@ -67,10 +80,6 @@
</ui:VisualElement>
</ui:VisualElement>
<ui:VisualElement name="nav" class="nav">
- <ui:Button name="nav-cabinet" text="Cabinet" class="nav-button"><Statecraft.Game.UI.UiIcon glyph="columns" class="nav-disc" /></ui:Button>
- <ui:Button name="nav-budget" text="Budget" class="nav-button"><Statecraft.Game.UI.UiIcon glyph="scales" class="nav-disc" /></ui:Button>
- <ui:Button name="nav-defence" text="Defence" class="nav-button"><Statecraft.Game.UI.UiIcon glyph="helmet" class="nav-disc" /></ui:Button>
- <ui:Button name="nav-why" text="Why?" class="nav-button"><Statecraft.Game.UI.UiIcon glyph="question" class="nav-disc" /></ui:Button>
<ui:Button name="new-game" text="New Game" class="nav-button"><Statecraft.Game.UI.UiIcon glyph="restart" class="nav-disc" /></ui:Button>
</ui:VisualElement>
<ui:VisualElement class="turn-box">
diff --git a/unity/Assets/UI/Statecraft.uss b/unity/Assets/UI/Statecraft.uss
index 33c3c2776..10f21cd78 100644
--- a/unity/Assets/UI/Statecraft.uss
+++ b/unity/Assets/UI/Statecraft.uss
@@ -141,7 +141,7 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);
/* The narrow HUD (HudPresenter sets hud-narrow on the root, with the compact bar): a taller bar whose meters put the
change under the value, so no change runs into its neighbour; the panels below the bar move down with it. */
.hud-narrow .top-bar { height: 124px; }
-.hud-narrow .right-column, .hud-narrow .event-layer, .hud-narrow .screen, .hud-narrow .toast { top: 140px; }
+.hud-narrow .right-column, .hud-narrow .left-column, .hud-narrow .event-layer, .hud-narrow .screen, .hud-narrow .toast { top: 140px; }
.hud-narrow .meter { min-width: 96px; padding: 0 6px; }
.hud-narrow .meter-row { flex-direction: column; align-items: flex-start; }
.hud-narrow .meter-value { font-size: 22px; }
@@ -150,12 +150,12 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);
(78% of the bar, so they always take the first row) above, the screen buttons and End Turn below; the panels move down. */
.hud-two-row .top-bar { height: 216px; padding-top: 6px; padding-bottom: 4px; flex-wrap: wrap; justify-content: space-between; align-content: space-around; }
.hud-two-row .meters { width: 78%; flex-grow: 1; }
-.hud-two-row .right-column, .hud-two-row .event-layer, .hud-two-row .screen, .hud-two-row .toast { top: 232px; }
+.hud-two-row .right-column, .hud-two-row .left-column, .hud-two-row .event-layer, .hud-two-row .screen, .hud-two-row .toast { top: 232px; }
/* Narrower still (a phone upright; HudPresenter adds hud-three-row with hud-two-row): the badge, the meters and the
screen buttons with End Turn take a row each, and the panels move down under the taller bar (#210). */
.hud-three-row .top-bar { height: 312px; }
.hud-three-row .meters { width: 100%; }
-.hud-three-row .right-column, .hud-three-row .event-layer, .hud-three-row .screen, .hud-three-row .toast { top: 328px; }
+.hud-three-row .right-column, .hud-three-row .left-column, .hud-three-row .event-layer, .hud-three-row .screen, .hud-three-row .toast { top: 328px; }
.turn-box { width: 150px; flex-shrink: 1; min-width: 150px; align-items: flex-end; }
#attention { font-size: 16px; }
.end-turn {
@@ -168,6 +168,19 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);
bottom-right. The right-hand column keeps its 480 px width, so the screens and the border layer's caption stay where
they were; it now holds only the minimap. */
.right-column { position: absolute; right: 16px; top: 112px; bottom: 16px; width: 480px; }
+/* HUD round 2, part 2 (#398): promo 03's left icon column, the four screens' round buttons under the bar at the left edge
+ (promo 03: discs about 5.3% of the frame's height, 6.3% apart). Icon-only: the caption is the button's text (the event
+ log and the strings read it) but drawn clear; HoverTip shows it beside the disc on hover and on focus. The decision
+ card's backdrop, the screens and the toast start right of it (68 px: its 56 px and a 12 px gap), so nothing covers it
+ and it stays usable under the decision card, as the top bar does; the card itself stays centred in the window. */
+.left-column { position: absolute; left: 16px; top: 112px; width: 56px; align-items: center; }
+/* The backdrop's strip under the column (review of #602): from the window's left edge to where the backdrop starts (72 px),
+ full height (the bar draws over its top), shown and taking the pointer only while the decision card is open. */
+.event-gutter { display: none; position: absolute; left: 0; top: 0; bottom: 0; width: 72px; background-color: rgba(5, 9, 18, 0.55); }
+.event-modal .event-gutter { display: flex; }
+.left-column .rail-button { width: 56px; height: 56px; margin: 0 0 12px 0; padding: 0; font-size: 1px; color: rgba(0, 0, 0, 0); }
+.left-column .rail-button:hover, .left-column .rail-button:focus, .left-column .nav-open { color: rgba(0, 0, 0, 0); }
+.left-column .rail-button .nav-disc { top: 0; left: 0; width: 56px; height: 56px; padding: 13px; border-radius: 28px; }
.right-gap { flex-grow: 1; flex-shrink: 0; min-height: 16px; }
/* The decision layer: the room under the bar, top per HUD tier as the column's. While an event is open (event-open on the
root) the map is blocked: the backdrop dims it and takes the pointer, so map clicks and drags stop at it, and
@@ -175,7 +188,7 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);
middle. Hide collapses the card to the "Decision
waiting" button at the layer's top right (EventCardPresenter), which takes no more room than itself. */
.event-layer { position: absolute; left: 16px; right: 16px; top: 112px; bottom: 16px; justify-content: center; align-items: center; }
-.event-scrim { display: none; position: absolute; left: -16px; right: -16px; top: -16px; bottom: -16px; background-color: rgba(5, 9, 18, 0.55); }
+.event-scrim { display: none; position: absolute; left: 56px; right: -16px; top: -16px; bottom: -16px; background-color: rgba(5, 9, 18, 0.55); }
.event-open .event-scrim { display: flex; }
.event-reopen {
display: none; position: absolute; right: 0; top: 0; margin: 0; padding: 6px 18px; font-size: 20px; -unity-text-align: middle-center;
@@ -316,7 +329,7 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);
/* The toast sits in the map's free top-left corner, above the info panel: opaque, and never over an open screen's title or
the minimap column (B7). */
.toast {
- display: none; position: absolute; left: 16px; width: 520px; top: 112px; -unity-text-align: middle-center; white-space: normal;
+ display: none; position: absolute; left: 84px; width: 460px; top: 112px; -unity-text-align: middle-center; white-space: normal;
background-color: var(--navy-solid); border-color: var(--gold); border-width: 1.5px;
}
@@ -337,11 +350,11 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);
/* Wide screens (Cabinet and Defence, laid out as promo/final/04 and 08): from the left edge to the minimap column, over the
info panel (an opaque reading screen; the info panel is about a hex, not needed while reading a screen). The event card
and the minimap stay in view (UiLayoutTests). */
-.screen-wide { left: 16px; bottom: 100px; }
+.screen-wide { left: 84px; bottom: 100px; }
/* While a wide screen is open the toast's corner (B7) is under it, so the toast moves to the strip the wide screen leaves
free at the bottom, between the window's left edge and the minimap column: opaque, clear of the screen and the column
(PromoHudTests.TheToastIsOpaqueAndClearOfTheScreens). Two lines fit. */
-.wide-screen-open .toast { top: auto; bottom: 16px; left: 16px; right: 512px; width: auto; padding: 6px 12px; }
+.wide-screen-open .toast { top: auto; bottom: 16px; left: 84px; right: 512px; width: auto; padding: 6px 12px; }
/* The info panel under an open wide screen is hidden (ScreenNav sets wide-screen-open): no focus, no clicks, no updates. */
.wide-screen-open .info-panel { display: none; }
.section-title {
@@ -477,7 +490,7 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);
.hud-two-row .pm-card .card-plate { height: 210px; }
/* #210: in the two-row (narrow) HUD every screen takes the full width under the bar. While one is open the minimap column
and the info panel under it are hidden (no focus, no clicks), and the toast takes the strip below the screen. */
-.hud-two-row .screen { left: 16px; right: 16px; bottom: 100px; }
+.hud-two-row .screen { left: 84px; right: 16px; bottom: 100px; }
.hud-two-row.screen-open .right-column, .hud-two-row.screen-open .info-panel { display: none; }
/* Any open screen sits where the decision card does: the card waits, hidden and out of reach, until the screen closes. */
.screen-open .event-layer { display: none; }
@@ -489,7 +502,7 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);
.loading-line { display: none; position: absolute; left: 0; right: 0; top: 45%; -unity-text-align: middle-center; font-size: 28px; color: var(--ink); }
.loading .loading-line { display: flex; }
.root.loading { background-color: var(--navy-solid); } /* the template's navy, not the default sky (final review M1) */
-.loading .date-box, .loading .meters, .loading .nav, .loading .turn-box, .loading .info-panel, .loading .right-column, .loading .event-layer { visibility: hidden; }
+.loading .date-box, .loading .meters, .loading .nav, .loading .left-column, .loading .turn-box, .loading .info-panel, .loading .right-column, .loading .event-layer { visibility: hidden; }
/* Map labels (visual v1 Task 9; promo HUD pass: rounder, a firmer gold edge): the promo's dark pill with a thin gold edge, in EB Garamond SemiBold. Each pill sits in a
zero-size slot that MapLabelsPresenter moves with an inline translate; the anchor class says which corner of the pill sits
@@ -541,7 +554,7 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);
whole painting, as a full-width band, over the panel (StartScreenPresenter.Fit). */
.start-screen { display: none; position: absolute; left: 0; top: 0; right: 0; bottom: 0; background-color: var(--navy-deep); }
.start-open .start-screen { display: flex; }
-.start-open .top-bar, .start-open .right-column, .start-open .event-layer, .start-open .info-panel, .start-open .screen, .start-open .map-labels { display: none; }
+.start-open .top-bar, .start-open .left-column, .start-open .right-column, .start-open .event-layer, .start-open .info-panel, .start-open .screen, .start-open .map-labels { display: none; }
.start-art {
position: absolute; left: 0; top: 0; right: 0; bottom: 0;
background-image: url("project://database/Assets/UI/StartScreen/declaration-hall.jpg");