A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
UI: decision options show no chevron (Fixes #1105) (#1172)
Beri53643fa28efd
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d07f1d071..d95e21292 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -86,6 +86,9 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB- The map pans left and right from the first frame (#1062, player report): the game opens at 90 km, not 120 km, underthe ~106 km where a 16:9 view is wider than the map and held centred (#174). A 21:9 window still opens centreduntil zoomed in a little.+- An event card's options no longer show a chevron (play-test of v0.1.2: it read as "expand", but the press chooses,+ #1105). The text starts at the button's edge padding in English and Hebrew; the gold rim and the hover and focus+ fills still mark each option as a button.- Content: every option that did not happen now says who proposed it, with sources, or that it is a design assumption(R-ALT-004; refs #949, #939). The 30 records are copied from the owner-checked`research_notes/Alternate timelines/roads-checked.md` with the owner's road rulings of 18 October 2026: roads 1, 22diff --git a/unity/Assets/Scripts/UI/EventCardPresenter.cs b/unity/Assets/Scripts/UI/EventCardPresenter.csindex 7ebcbfb8a..752db6175 100644--- a/unity/Assets/Scripts/UI/EventCardPresenter.cs+++ b/unity/Assets/Scripts/UI/EventCardPresenter.cs@@ -256,7 +256,6 @@ namespace Statecraft.Game.UIvar b = new Button(() => Choose(e, option)) { name = "option-" + o.Id, text = price > 0 ? text.Format("event.option_cost", label, price) : label };b.AddToClassList(OptionClass);b.SetEnabled(!unpaid);- b.generateVisualContent += PaintSign; // the promo's round sign at the option's leftoptions.Add(b);}card.Q<Label>("event-count").text = open.Count > 1 ? text.Format("event.more", open.Count - 1) : "";@@ -438,19 +437,6 @@ namespace Statecraft.Game.UI/// this event, or dropped on a short window).</summary>public string? PhotoAlt { get; private set; }- /// <summary>The round sign in an option's left padding (Statecraft.uss .event-option), painted into the button so it- /// stays a leaf whose wrapped text Yoga measures (UiIcon.Paint). In the Hebrew UI it sits in the right padding and- /// points left (#193).</summary>- const float SignRadius = 15f, SignLeft = 9f;-- static void PaintSign(MeshGenerationContext m)- {- var e = m.visualElement;- bool rtl = UiLanguage.Within(e);- var x = rtl ? e.layout.width - SignLeft - SignRadius : SignLeft + SignRadius;- UiIcon.PaintDisc(m, rtl ? "chevron-back" : "chevron", new UnityEngine.Vector2(x, e.layout.height / 2f), SignRadius);- }-void Choose(GameEvent e, EventOption o){// The bridge raises Refused (the toast shows it) or Changed (the toast clears and Render shows the next event,diff --git a/unity/Assets/Scripts/UI/UiIcon.cs b/unity/Assets/Scripts/UI/UiIcon.csindex 46b917e9e..956f230dc 100644--- a/unity/Assets/Scripts/UI/UiIcon.cs+++ b/unity/Assets/Scripts/UI/UiIcon.cs@@ -42,7 +42,7 @@ namespace Statecraft.Game.UI{["coin"] = Coin, ["people"] = People, ["crowd"] = Crowd, ["shield"] = Shield, ["globe"] = Globe, ["banknote"] = Banknote, ["rings"] = Rings,["columns"] = Columns, ["scales"] = Scales, ["helmet"] = Helmet, ["question"] = Question, ["book"] = Book, ["restart"] = Restart, ["gear"] = Gear,- ["chevron"] = Chevron, ["chevron-back"] = ChevronBack, ["hourglass"] = Hourglass,+ ["hourglass"] = Hourglass,["region"] = Region, ["house"] = House, ["village"] = Village, ["flag"] = Flag,["peaks"] = Peaks, ["skyline"] = Skyline, ["ledger"] = Ledger,["biome-sea"] = Waves, ["biome-lake"] = Waves, ["biome-coastal_plain"] = Plain, ["biome-hills"] = Hills,@@ -79,17 +79,6 @@ namespace Statecraft.Game.UIpaint(p, (x, y) => origin + new Vector2(x, y) * s, s, LineColour(lit));}- /// <summary>A round navy disc with a gold rim and <paramref name="glyph"/> inside it, centred on <paramref name="centre"/>- /// (the promo's round option and button sign).</summary>- public static void PaintDisc(MeshGenerationContext mgc, string glyph, Vector2 centre, float radius)- {- var p = mgc.painter2D;- p.fillColor = new Color32(14, 22, 38, 255); p.strokeColor = new Color32(196, 160, 92, 150); p.lineWidth = 1f;- Circle(p, centre, radius); p.Fill(); p.Stroke();- var inner = radius * 0.62f;- Paint(mgc, glyph, new Rect(centre.x - inner, centre.y - inner, 2 * inner, 2 * inner));- }-// --- helpers (design-box coordinates) ---static void Circle(Painter2D p, Vector2 c, float r) { p.BeginPath(); p.Arc(c, r, Angle.Degrees(0), Angle.Degrees(360)); p.ClosePath(); }@@ -293,19 +282,6 @@ namespace Statecraft.Game.UICircle(p, at(12, 12), 3.2f * s); p.Stroke();}- static void Chevron(Painter2D p, Func<float, float, Vector2> at, float s, Color gold)- {- p.strokeColor = gold; p.lineWidth = 2.2f * s;- p.BeginPath(); p.MoveTo(at(9.6f, 6.4f)); p.LineTo(at(15.2f, 12)); p.LineTo(at(9.6f, 17.6f)); p.Stroke();- }-- /// <summary>The chevron mirrored, pointing left: the option sign in the Hebrew UI.</summary>- static void ChevronBack(Painter2D p, Func<float, float, Vector2> at, float s, Color gold)- {- p.strokeColor = gold; p.lineWidth = 2.2f * s;- p.BeginPath(); p.MoveTo(at(14.4f, 6.4f)); p.LineTo(at(8.8f, 12)); p.LineTo(at(14.4f, 17.6f)); p.Stroke();- }-static void Hourglass(Painter2D p, Func<float, float, Vector2> at, float s, Color gold){p.strokeColor = gold; p.lineWidth = 1.5f * s;diff --git a/unity/Assets/Tests/EditMode/PromoHudTests.cs b/unity/Assets/Tests/EditMode/PromoHudTests.csindex 69afc03ac..49fe0693b 100644--- a/unity/Assets/Tests/EditMode/PromoHudTests.cs+++ b/unity/Assets/Tests/EditMode/PromoHudTests.cs@@ -13,8 +13,8 @@ using UnityEngine.TestTools;using UnityEngine.UIElements;/// <summary>The promo HUD pass (promo/final/03): the top bar's indicator icons, the round screen buttons and their lit-/// state, the event card's option signs, the info panel's terrain sign (real hex facts, no tile yields) and the panel-/// trim. Behaviour is unchanged; these check the new pieces are wired to the real elements and data.</summary>+/// state, the event card's options (no sign since #1105), the info panel's terrain sign (real hex facts, no tile yields)+/// and the panel trim. Behaviour is unchanged; these check the new pieces are wired to the real elements and data.</summary>public class PromoHudTests{static readonly Content C = ContentLoader.Load(Paths.Content);@@ -68,24 +68,40 @@ public class PromoHudTestsfinally { nav.Dispose(); }}- [Test]- public void EachEventOptionCarriesItsSignAndStaysPressable()+ /// <summary>#1105 (play-test of v0.1.2): an option shows no chevron, which read as "expand" but chose. No sign is+ /// painted and no padding is kept for one, in English and in Hebrew; the option stays a leaf button that answers.</summary>+ [UnityTest]+ public IEnumerator EventOptionsShowNoChevronAndStayPressable(){+ CollectionAssert.DoesNotContain(UiIcon.Glyphs, "chevron", "no chevron glyph is left to paint");+ CollectionAssert.DoesNotContain(UiIcon.Glyphs, "chevron-back", "nor its Hebrew mirror");using var ui = new UiTestKit();var g = GameSession.New(C, GoldenRun.Seed, Mode.Historical);while (!g.State.PendingEvents.Contains("armistice_egypt")) g.Step(new Command[0]);var bridge = new SimBridge(g, Text);var card = new EventCardPresenter(ui.Root, bridge, Text, null);- var options = ui.Q<VisualElement>("event-options").Query<Button>().ToList();- Assert.Greater(options.Count, 1);- foreach (var b in options)+ var root = ui.Q<VisualElement>("root");+ try{- Assert.IsTrue(b.ClassListContains(EventCardPresenter.OptionClass), b.name);- Assert.AreEqual(0, b.childCount, b.name + ": the sign is painted, so the button stays a leaf whose wrapped text is measured");+ var options = ui.Q<VisualElement>("event-options").Query<Button>().ToList();+ Assert.Greater(options.Count, 1);+ foreach (var hebrew in new[] { false, true })+ {+ root.EnableInClassList(UiLanguage.HebrewClass, hebrew);+ yield return null; yield return null;+ foreach (var b in options)+ {+ var what = b.name + (hebrew ? " (he)" : " (en)");+ Assert.IsTrue(b.ClassListContains(EventCardPresenter.OptionClass), what);+ Assert.AreEqual(0, b.childCount, what + ": a leaf whose wrapped text is measured");+ Assert.AreEqual(b.resolvedStyle.paddingLeft, b.resolvedStyle.paddingRight, 0.5f, what + ": no side is kept for a sign");+ Assert.That(b.resolvedStyle.paddingLeft, Is.GreaterThan(0f).And.LessThan(30f), what + ": the stylesheet's edge padding, no room for the 30 px sign");+ }+ }+ UiTestKit.Press(ui.Q<Button>("option-sign"));+ Assert.AreNotEqual("armistice_egypt", card.Shown?.Id, "the option still answers the event");}- UiTestKit.Press(ui.Q<Button>("option-sign"));- Assert.AreNotEqual("armistice_egypt", card.Shown?.Id, "the option still answers the event");- card.Dispose();+ finally { card.Dispose(); }}[Test]diff --git a/unity/Assets/UI/Statecraft.uss b/unity/Assets/UI/Statecraft.ussindex f467b0447..92f8f8f03 100644--- a/unity/Assets/UI/Statecraft.uss+++ b/unity/Assets/UI/Statecraft.uss@@ -320,9 +320,10 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);color: var(--ink); background-color: rgba(5, 9, 18, 0.92); -unity-font-style: italic; /* 0.92: blending is linear, so less reads grey */}.event-office { white-space: normal; -unity-text-align: middle-center; font-size: 18px; }-/* Options wrap inside the card (playtest 2, P2-2); each has a round gold-rimmed sign at its left, as the promo's choices. */+/* Options wrap inside the card (playtest 2, P2-2). No sign beside the text: a chevron read as "expand", but the press+ chooses (#1105); the gold rim and the hover and focus fills (Button:hover, :focus) mark it as a button. */#event-options Button { white-space: normal; -unity-text-align: middle-left; }-.event-option { min-height: 42px; padding: 5px 12px 5px 46px; margin: 3px 0; border-color: rgba(196, 160, 92, 0.6); }+.event-option { min-height: 42px; padding: 5px 12px; margin: 3px 0; border-color: rgba(196, 160, 92, 0.6); }.event-title { -unity-text-align: middle-center; margin-bottom: 4px; white-space: normal; font-size: 28px; } /* centred, as before, in the card */.event-text { white-space: normal; margin-bottom: 8px; }/* An objective card's line under its text (#380): when it was completed against history. */@@ -839,8 +840,7 @@ Button.settings-choice-selected { -unity-font-definition: url("project://databas.lang-he .rung-turn { margin-left: 0; margin-right: 8px; }.lang-he .budget-title { margin: 0 0 0 18px; }.lang-he .budget-share { margin-left: 0; margin-right: 16px; }-/* The option's round sign and End Turn's hourglass are painted on the right in Hebrew (EventCardPresenter, HudPresenter). */-.lang-he .event-option { padding: 5px 46px 5px 12px; }+/* End Turn's hourglass is painted on the right in Hebrew (HudPresenter). */.lang-he .end-turn { padding: 4px 40px 4px 14px; }/* A bar fills from the right: the whole bar is flipped, so its fill and its mark (placed from the left in code) follow. */.lang-he .ui-bar { scale: -1 1; }