A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
UI: an Objectives screen in the side menu, status and dates, no score (Fixes #1189) (#1202)
Beri078af4acc002
diff --git a/changelog.d/1189.md b/changelog.d/1189.mdnew file mode 100644index 000000000..7adc4f704--- /dev/null+++ b/changelog.d/1189.md@@ -0,0 +1,5 @@+- **An Objectives screen in the side menu (#1189).** A seventh disc (a flag) opens a read-only list of every objective in+ `content/objectives.yaml`: its name, whether it is done, the date you completed it and the historical date, in English+ and Hebrew. No score on it (owner's ruling). The sim reads it through a new pure helper, `Objectives.Status`; the goldens+ do not move. On the one-row bar the side menu's discs are 45 px, 3 px apart (they were 50 px, 6 px apart), so seven+ fit where six did; the narrow, two-row and three-row bars keep their discs.diff --git a/sim/Statecraft.Sim.Tests/ObjectivesTests.cs b/sim/Statecraft.Sim.Tests/ObjectivesTests.csindex 642982146..0177ec762 100644--- a/sim/Statecraft.Sim.Tests/ObjectivesTests.cs+++ b/sim/Statecraft.Sim.Tests/ObjectivesTests.cs@@ -459,6 +459,31 @@ eras:Assert.Equal(field, ex.Field);Assert.Contains(message, ex.Message);}++ /// <summary>#1189: the Objectives screen's reading, one row per objective in content order, with its name, whether it is done,+ /// the player's date (none until it is done) and the historical date. Pure: the state's hash is the same afterwards.</summary>+ [Fact]+ public void StatusListsEveryObjectiveDoneOrNotWithBothDates()+ {+ var s = Simulation.NewGame(Real, GoldenRun.Seed, Mode.Historical);+ var hash = s.Hash();+ var open = Objectives.Status(Real, s);+ Assert.Equal(hash, s.Hash());+ Assert.Equal(Real.Objectives.Select(o => (o.Id, o.Name, o.ReferenceDate)), open.Select(o => (o.Id, o.Name, o.Historical)));+ Assert.All(open, o => { Assert.False(o.Done); Assert.Null(o.Completed); });++ var first = Real.Objectives[0];+ var date = first.ReferenceDate.AddMonths(-2);+ Assert.True(Objectives.Record(Real, s, Real.RulesAt(s.Date).Mvp!, first.Id, date, new List<Cause>()));+ hash = s.Hash();+ var after = Objectives.Status(Real, s);+ Assert.Equal(hash, s.Hash());+ Assert.True(after[0].Done);+ Assert.Equal(date, after[0].Completed);+ Assert.Equal(first.ReferenceDate, after[0].Historical);+ Assert.All(after.Skip(1), o => { Assert.False(o.Done); Assert.Null(o.Completed); });+ }+/// <summary>#1187: an objective's Hebrew name loads beside the English, agent-checked until a native read (#564).</summary>[Fact]public void TheHebrewNameLoadsBesideTheEnglish()diff --git a/sim/Statecraft.Sim/Objectives.cs b/sim/Statecraft.Sim/Objectives.csindex 14bb7921c..0ad7229cd 100644--- a/sim/Statecraft.Sim/Objectives.cs+++ b/sim/Statecraft.Sim/Objectives.cs@@ -30,6 +30,13 @@ namespace Statecraft.Simreturn r.ObjectivePoints!.Value + (int)bonus;}+ /// <summary>The Objectives screen's reading (#1189): one row per objective, in id order (as the loader sorts them),+ /// done or not, with the player's completion date when it is done and the historical reference date. No score: the+ /// owner's ruling for the screen (20 October 2026). A pure reading: it writes nothing, so the hash stays put.</summary>+ public static IReadOnlyList<ObjectiveStatus> Status(Content c, GameState s) =>+ c.Objectives.Select(o => new ObjectiveStatus(o.Id, o.Name, s.Objectives.TryGetValue(o.Id, out var done) ? done : (DateTime?)null,+ o.ReferenceDate)).ToList();+/// <summary>Step 11 of the GDD turn (spec 2026-10-12 §2.3, D-A6): records, in id order, every objective whose condition/// holds, completed on <paramref name="next"/>, the turn's end date (R-OBJ-001). <paramref name="r"/> is the rules of/// the date the turn starts from (docs/determinism.md, "Rules per era").</summary>@@ -80,4 +87,20 @@ namespace Statecraft.Simreturn true;}}++ /// <summary>One row of <see cref="Objectives.Status"/>: the objective's id and name, the date the player completed it (null+ /// until then) and the date of the real event.</summary>+ public sealed class ObjectiveStatus+ {+ public string Id { get; }+ public string Name { get; }+ public DateTime? Completed { get; }+ public DateTime Historical { get; }+ public bool Done => Completed != null;++ public ObjectiveStatus(string id, string name, DateTime? completed, DateTime historical)+ {+ Id = id; Name = name; Completed = completed; Historical = historical;+ }+ }}diff --git a/tools/headed.py b/tools/headed.pyindex 63c23cf34..e2b4421c3 100644--- a/tools/headed.py+++ b/tools/headed.py@@ -48,13 +48,13 @@ 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), 50 px discs 56 px apart- (six since How to play, #1041),+ Statecraft.uss (HUD round 2, #398): the column at left 16 px and top 112 px (the one-row bar), 45 px discs 48 px apart+ (seven since Objectives, #1189),in panel units the PanelSettings scale to the window (1920x1080 reference, match 0.5: the geometric mean of the tworatios). Derived, so a moved column is one change in the USS and here, not a re-measured capture."""w, h = windowscale = ((w / 1920) * (h / 1080)) ** 0.5- return round((16 + 28) * scale), round((112 + 56 * index + 25) * scale) # the discs are centred in the 56 px column+ return round((16 + 28) * scale), round((112 + 48 * index + 22.5) * scale) # the discs are centred in the 56 px columnWHY = left_column_button(3) # Why? moved from the top bar to the left icon column (#602)diff --git a/unity/Assets/Scripts/UI/GameRoot.cs b/unity/Assets/Scripts/UI/GameRoot.csindex 4a6607738..1a41adb31 100644--- a/unity/Assets/Scripts/UI/GameRoot.cs+++ b/unity/Assets/Scripts/UI/GameRoot.cs@@ -255,6 +255,7 @@ namespace Statecraft.Game.UIOwn(new BudgetPresenter(root, bridge, text));Own(new WhyPresenter(root, bridge, text));Own(new HowToPlayPresenter(root, text));+ Own(new ObjectivesPresenter(root, bridge, text));// Presentation only (#40): never the sim or the save. Outside Play mode (EditMode tests) no file: the developer's// own settings must not leak into a test. Each Begin (New Game too) reads the file again.// The language switch (#1036) builds every screen again in the new language over this game (SwitchLanguage).diff --git a/unity/Assets/Scripts/UI/HudPresenter.cs b/unity/Assets/Scripts/UI/HudPresenter.csindex 2f7bd7f99..ce213150a 100644--- a/unity/Assets/Scripts/UI/HudPresenter.cs+++ b/unity/Assets/Scripts/UI/HudPresenter.cs@@ -69,7 +69,8 @@ namespace Statecraft.Game.UIstatic readonly (string name, string key)[] Texts ={("nav-cabinet", "hud.nav.cabinet"), ("nav-budget", "hud.nav.budget"), ("nav-defence", "hud.nav.defence"),- ("nav-why", "hud.nav.why"), ("nav-how-to-play", "hud.nav.how_to_play"), ("nav-settings", "hud.nav.settings"),+ ("nav-why", "hud.nav.why"), ("nav-how-to-play", "hud.nav.how_to_play"), ("nav-objectives", "hud.nav.objectives"),+ ("nav-settings", "hud.nav.settings"),("new-game", "hud.new_game"), ("end-turn", "hud.end_turn"),};diff --git a/unity/Assets/Scripts/UI/KeyScroll.cs b/unity/Assets/Scripts/UI/KeyScroll.csindex 7e19c1d6a..badf118e5 100644--- a/unity/Assets/Scripts/UI/KeyScroll.cs+++ b/unity/Assets/Scripts/UI/KeyScroll.cs@@ -18,7 +18,7 @@ namespace Statecraft.Game.UIstatic readonly Dictionary<string, string> MainViews = new Dictionary<string, string>{["cabinet"] = "cabinet-seats", ["budget"] = "budget-rows", ["defence"] = "defence-body", ["why"] = "why-rows",- ["how-to-play"] = "how-to-play-body",+ ["how-to-play"] = "how-to-play-body", ["objectives"] = "objectives-rows",};/// <summary>A page is the view's height less about one line of text, so the line at the edge stays in sight.</summary>diff --git a/unity/Assets/Scripts/UI/ObjectivesPresenter.cs b/unity/Assets/Scripts/UI/ObjectivesPresenter.csnew file mode 100644index 000000000..36055dcfe--- /dev/null+++ b/unity/Assets/Scripts/UI/ObjectivesPresenter.cs@@ -0,0 +1,48 @@+#nullable enable+using Statecraft.Sim;+using UnityEngine.UIElements;++namespace Statecraft.Game.UI+{+ /// <summary>The Objectives screen (#1189): every objective the content has, from the sim's Objectives.Status, each with+ /// its name, whether it is done and the player's date beside the historical one. No score on it (owner, 20 October 2026).+ /// It follows the bridge, as the Why screen does, so a turn that completes an objective shows here at once.</summary>+ public sealed class ObjectivesPresenter : System.IDisposable+ {+ readonly VisualElement screen; readonly SimBridge bridge; readonly UiText text;++ public ObjectivesPresenter(VisualElement root, SimBridge bridge, UiText text)+ {+ screen = root.Q<VisualElement>("screen-objectives"); this.bridge = bridge; this.text = text;+ screen.Q<Label>("objectives-title").text = text["objectives.title"];+ bridge.Changed += Render;+ Render();+ }++ public void Dispose() { bridge.Changed -= Render; }++ string Date(System.DateTime d) => text.Format("date.day_month_year", d.Day, text["date.month_" + d.Month], d.Year);++ /// <summary>Rebuilds the rows from the state as it is now (two objectives today, a handful at most, so no diffing).</summary>+ public void Render()+ {+ var rows = screen.Q<ScrollView>("objectives-rows");+ rows.Clear();+ foreach (var o in Objectives.Status(bridge.Content, bridge.State))+ {+ var row = new VisualElement { name = "objectives-row-" + o.Id };+ row.AddToClassList("objectives-row");+ // A new objective (#791) with no strings key yet still shows, under its objectives.yaml name.+ var key = "objectives.name." + o.Id;+ var name = new Label(text.Has(key) ? text[key] : o.Name);+ name.AddToClassList("objectives-name");+ var status = new Label(o.Completed is System.DateTime done+ ? text.Format("objectives.done", Date(done), Date(o.Historical))+ : text.Format("objectives.open", Date(o.Historical)));+ status.AddToClassList("objectives-status");+ row.Add(name); row.Add(status);+ rows.Add(row);+ }+ }+ }+}diff --git a/unity/Assets/Scripts/UI/ObjectivesPresenter.cs.meta b/unity/Assets/Scripts/UI/ObjectivesPresenter.cs.metanew file mode 100644index 000000000..622d35fb0--- /dev/null+++ b/unity/Assets/Scripts/UI/ObjectivesPresenter.cs.meta@@ -0,0 +1,2 @@+fileFormatVersion: 2+guid: 7a2e4c6b8d0f4a1c9e3b5d7f9a1c3e5bdiff --git a/unity/Assets/Scripts/UI/ScreenNav.cs b/unity/Assets/Scripts/UI/ScreenNav.csindex 077da2010..6145e5ed5 100644--- a/unity/Assets/Scripts/UI/ScreenNav.cs+++ b/unity/Assets/Scripts/UI/ScreenNav.cs@@ -4,13 +4,13 @@ using UnityEngine.UIElements;namespace Statecraft.Game.UI{- /// <summary>The side-menu buttons open the Cabinet, Budget, Defence, Why, How to play and Settings screens, one at a time; pressing the open+ /// <summary>The side-menu buttons open the Cabinet, Budget, Defence, Why, How to play, Objectives and Settings screens, one at a time; pressing the open/// screen's button again closes it. Every press toggles, synchronously, with no debounce: two presses in one frame (a/// double click, or a click plus Enter) open and close again, so the result depends only on the number of presses/// (HudTests.TwoPressesInOneFrameToggleTwice; playtest 1, item 11).</summary>public sealed class ScreenNav : System.IDisposable{- public static readonly string[] Screens = { "cabinet", "budget", "defence", "why", "how-to-play", "settings" };+ public static readonly string[] Screens = { "cabinet", "budget", "defence", "why", "how-to-play", "objectives", "settings" };/// <summary>The class on the open screen's button (Statecraft.uss lights its ring).</summary>public const string OpenClass = "nav-open";/// <summary>The class on the "root" element while a wide screen (class <see cref="WideClass"/>: Cabinet, Defence) isdiff --git a/unity/Assets/Tests/EditMode/HebrewUiTests.cs b/unity/Assets/Tests/EditMode/HebrewUiTests.csindex 3def73a9f..cfc49f3a3 100644--- a/unity/Assets/Tests/EditMode/HebrewUiTests.cs+++ b/unity/Assets/Tests/EditMode/HebrewUiTests.cs@@ -280,13 +280,13 @@ public class HebrewUiTests("meter-security/meter-name", "hud.caption.security"), ("meter-support/meter-name", "hud.caption.support"),("meter-cohesion/meter-name", "hud.caption.cohesion"), ("meter-standing/meter-name", "hud.caption.standing"), ("meter-fx/meter-name", "hud.caption.fx"),("nav-cabinet", "hud.nav.cabinet"), ("nav-budget", "hud.nav.budget"), ("nav-defence", "hud.nav.defence"),- ("nav-why", "hud.nav.why"), ("nav-how-to-play", "hud.nav.how_to_play"),+ ("nav-why", "hud.nav.why"), ("nav-how-to-play", "hud.nav.how_to_play"), ("nav-objectives", "hud.nav.objectives"),("new-game", "hud.new_game"), ("end-turn", "hud.end_turn"),("event-draft", "event.draft"),("budget-screen-title", "budget.title"), ("budget-reset", "budget.reset"), ("budget-submit", "budget.submit"),("defence-screen-title", "defence.title"), ("de-escalate", "defence.lower"), ("escalate", "defence.raise"),("why-screen-title", "why.title"),- ("how-to-play-title", "how_to_play.title"),+ ("how-to-play-title", "how_to_play.title"), ("objectives-title", "objectives.title"),("nav-settings", "hud.nav.settings"), ("settings-screen-title", "settings.title"), ("settings-tiltshift-label", "settings.tiltshift"),("settings-quality-label", "settings.quality"), ("settings-quality-auto", "settings.quality.auto"),("settings-quality-high", "settings.quality.high"), ("settings-quality-low", "settings.quality.low"),diff --git a/unity/Assets/Tests/EditMode/LeftColumnTests.cs b/unity/Assets/Tests/EditMode/LeftColumnTests.csindex b99d2aca7..97aef4987 100644--- a/unity/Assets/Tests/EditMode/LeftColumnTests.cs+++ b/unity/Assets/Tests/EditMode/LeftColumnTests.cs@@ -33,7 +33,7 @@ public class LeftColumnTests{("nav-cabinet", "hud.nav.cabinet", "columns"), ("nav-budget", "hud.nav.budget", "ledger"),("nav-defence", "hud.nav.defence", "helmet"), ("nav-why", "hud.nav.why", "question"),- ("nav-how-to-play", "hud.nav.how_to_play", "book"),+ ("nav-how-to-play", "hud.nav.how_to_play", "book"), ("nav-objectives", "hud.nav.objectives", "flag"),("nav-settings", "hud.nav.settings", "gear"),};@@ -255,7 +255,7 @@ public class LeftColumnTestsvar 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", "nav-how-to-play", "nav-settings", "new-game", "end-turn" },+ CollectionAssert.AreEqual(new[] { "nav-cabinet", "nav-budget", "nav-defence", "nav-why", "nav-how-to-play", "nav-objectives", "nav-settings", "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");diff --git a/unity/Assets/Tests/EditMode/ObjectivesScreenTests.cs b/unity/Assets/Tests/EditMode/ObjectivesScreenTests.csnew file mode 100644index 000000000..3322cd7a9--- /dev/null+++ b/unity/Assets/Tests/EditMode/ObjectivesScreenTests.cs@@ -0,0 +1,144 @@+#nullable enable+using System.Collections;+using System.Collections.Generic;+using System.Linq;+using NUnit.Framework;+using Statecraft.Game;+using Statecraft.Game.UI;+using Statecraft.Sim;+using UnityEditor;+using UnityEngine;+using UnityEngine.TestTools;+using UnityEngine.UIElements;+using Object = UnityEngine.Object;++/// <summary>The Objectives screen (#1189): a side-menu screen like How to play, one row per objective from the sim's+/// Objectives.Status, each with its name, whether it is done and both dates, and no score; both languages, and the two+/// required layouts.</summary>+public class ObjectivesScreenTests+{+ static readonly Content C = ContentLoader.Load(Paths.Content);+ 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 Date(UiText t, System.DateTime d) => t.Format("date.day_month_year", d.Day, t["date.month_" + d.Month], d.Year);++ [Test]+ public void TheSideMenuOpensAndClosesTheScreenInBothLanguages([Values(false, true)] bool hebrew)+ {+ var text = hebrew ? He : En;+ using var ui = new UiTestKit();+ using var nav = new ScreenNav(ui.Root);+ var bridge = new SimBridge(GameSession.New(C, GoldenRun.Seed, Mode.Historical), text);+ using var screenPresenter = new ObjectivesPresenter(ui.Root, bridge, text);+ var screen = ui.Q<VisualElement>("screen-objectives");++ Assert.IsFalse(ScreenNav.IsOpen(screen), "hidden at start");+ ui.Press("nav-objectives");+ Assert.IsTrue(ScreenNav.IsOpen(screen), "the side-menu button opens it");+ Assert.AreEqual("objectives", nav.Current);+ Assert.AreEqual(text["objectives.title"], ui.Q<Label>("objectives-title").text);+ ui.Press("nav-objectives");+ Assert.IsFalse(ScreenNav.IsOpen(screen), "pressing the same button closes it");+ Assert.IsNull(nav.Current);+ }++ /// <summary>The rows are the helper's, in its order: not done yet, then done with the player's date once the sim records+ /// it (the screen follows the bridge). The two patterns have no score in them (the owner's ruling).</summary>+ [Test]+ public void EveryRowShowsTheHelpersNameStatusAndDates([Values(false, true)] bool hebrew)+ {+ var text = hebrew ? He : En;+ using var ui = new UiTestKit();+ var bridge = new SimBridge(GameSession.New(C, GoldenRun.Seed, Mode.Historical), text);+ using var presenter = new ObjectivesPresenter(ui.Root, bridge, text);++ void Check(string when)+ {+ var status = Objectives.Status(bridge.Content, bridge.State);+ var rows = ui.Q<ScrollView>("objectives-rows").Query(className: "objectives-row").ToList();+ Assert.AreEqual(status.Count, rows.Count, when + ": one row per objective");+ Assert.AreEqual(C.Objectives.Count, rows.Count, when + ": every objective in objectives.yaml");+ for (int i = 0; i < status.Count; i++)+ {+ var o = status[i];+ // Every objective on main has its name in both strings files (the presenter's objectives.yaml fallback is for #791).+ Assert.IsTrue(text.Has("objectives.name." + o.Id), when + ": " + o.Id + " has a name in this language");+ Assert.AreEqual("objectives-row-" + o.Id, rows[i].name, when + ": the helper's order");+ Assert.AreEqual(text["objectives.name." + o.Id], rows[i].Q<Label>(className: "objectives-name").text, when + ": " + o.Id + " name");+ var line = rows[i].Q<Label>(className: "objectives-status").text;+ Assert.AreEqual(o.Completed is System.DateTime done+ ? text.Format("objectives.done", Date(text, done), Date(text, o.Historical))+ : text.Format("objectives.open", Date(text, o.Historical)), line, when + ": " + o.Id + " status and dates");+ }+ }++ Assert.IsTrue(Objectives.Status(bridge.Content, bridge.State).All(o => !o.Done), "precondition: nothing done at the start");+ Check("at the start");+ var first = C.Objectives[0];+ Assert.IsTrue(Objectives.Record(C, bridge.State, C.RulesAt(bridge.State.Date).Mvp!, first.Id, first.ReferenceDate.AddMonths(-1), new List<Cause>()));+ presenter.Render();+ Assert.IsTrue(Objectives.Status(bridge.Content, bridge.State)[0].Done, "precondition: the first is done");+ Check("after the first is done");+ }++ [UnityTest]+ public IEnumerator TheScreenFitsLaptopAndPhoneInBothLanguages()+ {+ var problems = new List<string>();+ foreach (var hebrew in new[] { false, true })+ foreach (var size in new[] { new Vector2Int(1280, 720), new Vector2Int(390, 844) })+ yield return Rendered(size.x, size.y, hebrew, root =>+ {+ string at = $"{(hebrew ? "he" : "en")} {size.x}x{size.y}";+ var screen = root.Q("screen-objectives").worldBound;+ var window = root.worldBound;+ if (!(screen.width > 0 && screen.height > 0)) problems.Add($"{at}: screen is not visible");+ if (screen.xMin < window.xMin || screen.yMin < window.yMin || screen.xMax > window.xMax || screen.yMax > window.yMax)+ problems.Add($"{at}: screen {screen} leaves window {window}");+ var body = root.Q<ScrollView>("objectives-rows").worldBound;+ var labels = root.Q<ScrollView>("objectives-rows").Query<Label>().ToList();+ if (labels.Count != 2 * C.Objectives.Count) problems.Add($"{at}: {labels.Count} labels, not two per objective");+ foreach (var line in labels)+ {+ if (string.IsNullOrWhiteSpace(line.text)) problems.Add($"{at}: {line.name} is empty");+ if (line.worldBound.xMin < body.xMin - 1 || line.worldBound.xMax > body.xMax + 1)+ problems.Add($"{at}: {line.name} {line.worldBound} overflows body {body}");+ }+ });+ Assert.IsEmpty(problems, string.Join("\n", problems));+ }++ static IEnumerator Rendered(int width, int height, bool hebrew, System.Action<VisualElement> check)+ {+ var rt = new RenderTexture(width, height, 0);+ var ps = Object.Instantiate(AssetDatabase.LoadAssetAtPath<PanelSettings>(UiPaths.Panel));+ ps.targetTexture = rt;+ var go = new GameObject("ObjectivesLayoutTest");+ 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 text = hebrew ? He : En;+ var bridge = new SimBridge(GameSession.New(C, GoldenRun.Seed, Mode.Historical), text);+ var hud = new HudPresenter(root, bridge, text);+ var screen = new ObjectivesPresenter(root, bridge, text);+ var nav = new ScreenNav(root);+ nav.Open("objectives");+ try+ {+ for (int i = 0; i < 30 && !(root.Q("screen-objectives").layout.width > 0); i++) yield return null;+ for (int i = 0; i < 3; i++) yield return null;+ check(root);+ }+ finally+ {+ nav.Dispose(); screen.Dispose(); hud.Dispose();+ Object.DestroyImmediate(go); Object.DestroyImmediate(ps); rt.Release(); Object.DestroyImmediate(rt);+ }+ }+}diff --git a/unity/Assets/Tests/EditMode/ObjectivesScreenTests.cs.meta b/unity/Assets/Tests/EditMode/ObjectivesScreenTests.cs.metanew file mode 100644index 000000000..467a97749--- /dev/null+++ b/unity/Assets/Tests/EditMode/ObjectivesScreenTests.cs.meta@@ -0,0 +1,2 @@+fileFormatVersion: 2+guid: 3f7c1b9e5a2d4e6f8b0c1d2e3f4a5b6cdiff --git a/unity/Assets/Tests/EditMode/PromoHudTests.cs b/unity/Assets/Tests/EditMode/PromoHudTests.csindex 49fe0693b..6bcf06df3 100644--- a/unity/Assets/Tests/EditMode/PromoHudTests.cs+++ b/unity/Assets/Tests/EditMode/PromoHudTests.cs@@ -40,7 +40,7 @@ public class PromoHudTestsusing var ui = new UiTestKit();foreach (var (button, name, glyph) in new[] { ("nav-cabinet", "Cabinet", "columns"), ("nav-budget", "Budget", "ledger"),("nav-defence", "Defence", "helmet"), ("nav-why", "Why?", "question"),- ("nav-how-to-play", "How to play", "book"), ("nav-settings", "Settings", "gear"),+ ("nav-how-to-play", "How to play", "book"), ("nav-objectives", "Objectives", "flag"), ("nav-settings", "Settings", "gear"),("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.csindex 950a44c22..af676b753 100644--- a/unity/Assets/Tests/EditMode/PromoScreensTests.cs+++ b/unity/Assets/Tests/EditMode/PromoScreensTests.cs@@ -944,6 +944,7 @@ public class PromoScreensTestsowned.Add(new BudgetPresenter(root, bridge, Text));owned.Add(new WhyPresenter(root, bridge, Text));owned.Add(new HowToPlayPresenter(root, Text));+ owned.Add(new ObjectivesPresenter(root, bridge, Text));var info = new InfoPanelPresenter(root, bridge, Text, C.SettlementHexes.ToDictionary(x => x.Id, x => x.Id)); owned.Add(info);var nav = new ScreenNav(root); owned.Add(nav);var toast = root.Q<Label>("toast");diff --git a/unity/Assets/Tests/EditMode/TopBarTests.cs b/unity/Assets/Tests/EditMode/TopBarTests.csindex 98fb42f4f..35d096c15 100644--- a/unity/Assets/Tests/EditMode/TopBarTests.cs+++ b/unity/Assets/Tests/EditMode/TopBarTests.cs@@ -625,7 +625,7 @@ public class TopBarTests{var order = root.Query<Button>().ToList().Where(e => e.focusable && e.canGrabFocus && e.tabIndex >= 0).Select(e => e.name).Where(n => n.StartsWith("nav-") || n == "new-game" || n == "end-turn" || n.StartsWith("minimap-")).ToList();- CollectionAssert.AreEqual(new[] { "nav-cabinet", "nav-budget", "nav-defence", "nav-why", "nav-how-to-play", "nav-settings", "new-game", "end-turn", "minimap-overview", "minimap-labels", "minimap-borders" },+ CollectionAssert.AreEqual(new[] { "nav-cabinet", "nav-budget", "nav-defence", "nav-why", "nav-how-to-play", "nav-objectives", "nav-settings", "new-game", "end-turn", "minimap-overview", "minimap-labels", "minimap-borders" },order, (hebrew ? "he" : "en") + ": the Tab order");}, widest: false);}diff --git a/unity/Assets/Tests/EditMode/UiLayoutTests.cs b/unity/Assets/Tests/EditMode/UiLayoutTests.csindex fa90ae781..f8d472b42 100644--- a/unity/Assets/Tests/EditMode/UiLayoutTests.cs+++ b/unity/Assets/Tests/EditMode/UiLayoutTests.cs@@ -391,6 +391,7 @@ public class UiLayoutTestsnew HudPresenter(root, bridge, text), new EventCardPresenter(root, bridge, text, null),new CabinetPresenter(root, bridge, text, null), new BudgetPresenter(root, bridge, text),new DefencePresenter(root, bridge, text), new WhyPresenter(root, bridge, text), new HowToPlayPresenter(root, text),+ new ObjectivesPresenter(root, bridge, text),};var nav = new ScreenNav(root);trydiff --git a/unity/Assets/UI/Game.uxml b/unity/Assets/UI/Game.uxmlindex 2f9bd5213..941984b05 100644--- a/unity/Assets/UI/Game.uxml+++ b/unity/Assets/UI/Game.uxml@@ -18,6 +18,7 @@<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:Button name="nav-how-to-play" text="How to play" class="nav-button rail-button"><Statecraft.Game.UI.UiIcon glyph="book" class="nav-disc" /></ui:Button>+ <ui:Button name="nav-objectives" text="Objectives" class="nav-button rail-button"><Statecraft.Game.UI.UiIcon glyph="flag" class="nav-disc" /></ui:Button><ui:Button name="nav-settings" text="Settings" class="nav-button rail-button"><Statecraft.Game.UI.UiIcon glyph="gear" class="nav-disc" /></ui:Button></ui:VisualElement><ui:VisualElement name="top-bar" class="panel top-bar">@@ -323,6 +324,12 @@</ui:ScrollView><Statecraft.Game.UI.UiFrame /></ui:VisualElement>+ <!-- The objectives (#1189, ObjectivesPresenter): one row per objective, its status and both dates, no score. -->+ <ui:VisualElement name="screen-objectives" class="panel screen">+ <ui:VisualElement class="screen-header"><ui:Label name="objectives-title" text="Objectives" class="title" /></ui:VisualElement>+ <ui:ScrollView name="objectives-rows" class="grow objectives-rows" />+ <Statecraft.Game.UI.UiFrame />+ </ui:VisualElement><!-- Settings (#40, SettingsPresenter): the player's presentation options, kept per browser (SettingsStore), never inthe sim or the save. Each option is a row: its name, and a button that says what is set. --><ui:VisualElement name="screen-settings" class="panel screen">diff --git a/unity/Assets/UI/Statecraft.uss b/unity/Assets/UI/Statecraft.ussindex 7759c35d4..c9a60ae86 100644--- a/unity/Assets/UI/Statecraft.uss+++ b/unity/Assets/UI/Statecraft.uss@@ -222,12 +222,17 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);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: 112px; bottom: 0; width: 72px; background-color: rgba(5, 9, 18, 0.55); }.event-modal .event-gutter { display: flex; }-.left-column .rail-button { width: 50px; height: 50px; margin: 0 0 6px 0; padding: 0; font-size: 1px; color: rgba(0, 0, 0, 0); }+.left-column .rail-button { width: 45px; height: 45px; margin: 0 0 3px 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); }-/* Six discs since How to play (#1041): 50 px, 6 px apart, so the column ends at 112 + 336 px (the five 56 px discs: 340),- above the info panel's top (456 px) in a short, wide window (InfoPanelLayoutTests); the column keeps its 56 px width,- so the backdrop, the screens and the toast keep their places. */-.left-column .rail-button .nav-disc { top: 0; left: 0; width: 50px; height: 50px; padding: 11px; border-radius: 25px; }+/* Seven discs since Objectives (#1189). On the one-row bar: 45 px, 3 px apart, so the column still ends at 112 + 336 px+ (six 50 px discs 6 px apart, #1041: the same), above the info panel's top (456 px) in a short, wide window+ (InfoPanelLayoutTests), and at least 29 screen px in the smallest one-row window (1366x657). The narrow, two-row and+ three-row tiers keep their discs (50 px; 60 px on a phone): the column starts lower there, the info panel is far+ below it, and 960x600 needs 50 px for the 24 screen px floor (LeftColumnTests). The column keeps its 56 px width, so+ the backdrop, the screens and the toast keep their places. */+.left-column .rail-button .nav-disc { top: 0; left: 0; width: 45px; height: 45px; padding: 10.5px; border-radius: 22.5px; }+.hud-narrow .left-column > .rail-button { width: 50px; height: 50px; margin: 0 0 6px 0; }+.hud-narrow .left-column > .rail-button .nav-disc { width: 50px; height: 50px; padding: 11px; border-radius: 25px; }/* A screen with something to do this turn (#1109, HudPresenter.ActionClass): a small gold dot on the disc's upper right,ringed in the column's navy so it reads against the rim; the gold-light of End Turn's waiting highlight (#1034). */.nav-badge {@@ -440,6 +445,11 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);.settings-row { margin-top: 8px; }.how-to-play-body { min-height: 0; }.how-to-play-line { white-space: normal; margin-bottom: 12px; font-size: 18px; }+/* The Objectives screen (#1189): a row per objective, its name over its status and dates; both wrap at 390x844. */+.objectives-rows { min-height: 0; }+.objectives-row { margin-bottom: 14px; }+.objectives-name { white-space: normal; font-size: 18px; -unity-font-style: bold; }+.objectives-status { white-space: normal; font-size: 18px; color: var(--ink-dim); }.settings-name { flex-grow: 1; flex-shrink: 1; min-width: 0; white-space: normal; }.settings-switch { flex-shrink: 0; min-width: 96px; -unity-text-align: middle-center; }/* The quality choice's buttons sit side by side; the one that is set is marked by a gold fill and dark text, not only adiff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yamlindex 1762248f5..29287f873 100644--- a/unity/Assets/UI/strings.en.yaml+++ b/unity/Assets/UI/strings.en.yaml@@ -41,6 +41,7 @@ hud.nav.budget: "Budget"hud.nav.defence: "Defence"hud.nav.why: "Why?"hud.nav.how_to_play: "How to play"+hud.nav.objectives: "Objectives"hud.nav.settings: "Settings"hud.new_game: "New game"hud.end_turn: "End turn"@@ -62,6 +63,14 @@ how_to_play.events: "An event card asks for a decision. Answering it costs Attenhow_to_play.top_bar: "The top bar shows the date, your Attention, Money and the country's main indicators."how_to_play.end_turn: "End turn carries out your orders and moves to the next month. A card you leave unanswered, or have no Attention left to answer, goes to the responsible minister, who decides it for you."how_to_play.why: "After a turn, open Why? to see each change and its cause."+# The Objectives screen (#1189): every objective in objectives.yaml, done or not, the player's date beside the historical+# one, and no score (owner, 20 October 2026). The objective card's wording (#380). {0} the player's date,+# {1} the historical date (objectives.open: {0}). A name falls back to objectives.yaml's when it has no key here.+objectives.title: "Objectives"+objectives.done: "Completed on {0}; historically {1}"+objectives.open: "Not completed yet; historically {0}"+objectives.name.first_new_yishuv: "First new yishuv"+objectives.name.absorb_immigrants: "Absorb the immigrants"# The Settings screen (#40): its title, the tilt-shift option and the button that says what is set.settings.title: "Settings"settings.tiltshift: "Blur at the top and bottom of the map"diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yamlindex d6f6dc0d5..91b245ae0 100644--- a/unity/Assets/UI/strings.he.yaml+++ b/unity/Assets/UI/strings.he.yaml@@ -34,6 +34,8 @@ hud.nav.budget: "תקציב"hud.nav.defence: "ביטחון"hud.nav.why: "למה?"hud.nav.how_to_play: "איך משחקים"+# For the native reviewer (#564)+hud.nav.objectives: "יעדים"hud.nav.settings: "הגדרות"hud.new_game: "משחק חדש"hud.end_turn: "סיום התור"@@ -54,6 +56,12 @@ how_to_play.events: "כרטיס אירוע מבקש מכם החלטה. מענהhow_to_play.top_bar: "הסרגל העליון מציג את התאריך, את תשומת הלב שלכם, את הכסף ואת המדדים העיקריים של המדינה."how_to_play.end_turn: "סיום התור מבצע את ההוראות שלכם ומעביר לחודש הבא. כרטיס שלא עניתם עליו, או שלא נשארה לכם תשומת לב לענות עליו, עובר לשר האחראי, והוא מחליט במקומכם."how_to_play.why: "אחרי תור, פתחו את המסך למה? כדי לראות כל שינוי ואת הסיבה לו."+# The Objectives screen (#1189). For the native reviewer (#564).+objectives.title: "יעדים"+objectives.done: "הושלם ב־{0}; בהיסטוריה ב־{1}"+objectives.open: "טרם הושלם; בהיסטוריה ב־{0}"+objectives.name.first_new_yishuv: "יישוב חדש ראשון"+objectives.name.absorb_immigrants: "קליטת העולים"# The Settings screen (#40). "On" / "Off" as a switch's state, not a command. For the native reviewer (#564).settings.title: "הגדרות"settings.tiltshift: "טשטוש בחלק העליון ובחלק התחתון של המפה"