A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
GDD 0.3: How to play has no Attention under gdd-0.3 (2b) (Refs #1688) (#1768)
Eyal Golane5f804087cd2
diff --git a/changelog.d/1688-gdd03-help.md b/changelog.d/1688-gdd03-help.mdnew file mode 100644index 000000000..2407457d1--- /dev/null+++ b/changelog.d/1688-gdd03-help.md@@ -0,0 +1,3 @@+### Fixed++- How to play omits Attention and uses ruleset-specific event, top-bar and End-turn help under gdd-0.3. Earlier rulesets keep their original guide. New Hebrew help is a draft pending native review. (Refs #1688)diff --git a/unity/Assets/Scripts/UI/GameRoot.cs b/unity/Assets/Scripts/UI/GameRoot.csindex 719150f3a..2ac25c37b 100644--- a/unity/Assets/Scripts/UI/GameRoot.cs+++ b/unity/Assets/Scripts/UI/GameRoot.cs@@ -287,7 +287,7 @@ namespace Statecraft.Game.UIvar budget = Own(new BudgetPresenter(root, bridge, text));var why = Own(new WhyPresenter(root, bridge, text));Own(new TimelinePresenter(root, bridge, text));- Own(new HowToPlayPresenter(root, text));+ Own(new HowToPlayPresenter(root, text, bridge.Content.Ruleset));Own(new ObjectivesPresenter(root, bridge, text));// The advisors (spec 4.2): their session survives a rebuild over the same game (a language switch keeps the// queue, the history and the opening chain's place) and is new for any other Begin. They show by themselves onlydiff --git a/unity/Assets/Scripts/UI/HowToPlayPresenter.cs b/unity/Assets/Scripts/UI/HowToPlayPresenter.csindex 295010d3c..92cdbbe6a 100644--- a/unity/Assets/Scripts/UI/HowToPlayPresenter.cs+++ b/unity/Assets/Scripts/UI/HowToPlayPresenter.cs@@ -1,5 +1,6 @@#nullable enableusing UnityEngine.UIElements;+using Statecraft.Sim;namespace Statecraft.Game.UI{@@ -8,12 +9,23 @@ namespace Statecraft.Game.UI{readonly VisualElement screen;- public HowToPlayPresenter(VisualElement root, UiText text)+ public HowToPlayPresenter(VisualElement root, UiText text, string ruleset = SaveGame.GddRuleset){screen = root.Q<VisualElement>("screen-how-to-play");screen.Q<Label>("how-to-play-title").text = text["how_to_play.title"];+ bool gdd03 = ruleset == SaveGame.Gdd03Ruleset;foreach (var key in new[] { "turn", "attention", "city", "training", "events", "top_bar", "end_turn", "why" })- screen.Q<Label>("how-to-play-" + key.Replace('_', '-')).text = text["how_to_play." + key];+ {+ var line = screen.Q<Label>("how-to-play-" + key.Replace('_', '-'));+ if (key == "attention")+ {+ line.text = gdd03 ? "" : text["how_to_play.attention"];+ line.style.display = gdd03 ? DisplayStyle.None : DisplayStyle.Flex;+ continue;+ }+ bool variant = gdd03 && (key == "events" || key == "top_bar" || key == "end_turn");+ line.text = text["how_to_play." + (variant ? "gdd03." : "") + key];+ }}public void Dispose() { }diff --git a/unity/Assets/Tests/EditMode/HowToPlayScreenTests.cs b/unity/Assets/Tests/EditMode/HowToPlayScreenTests.csindex 14e22f9e2..a2d8b70cd 100644--- a/unity/Assets/Tests/EditMode/HowToPlayScreenTests.cs+++ b/unity/Assets/Tests/EditMode/HowToPlayScreenTests.cs@@ -63,7 +63,96 @@ public class HowToPlayScreenTestsAssert.IsEmpty(problems, string.Join("\n", problems));}- static IEnumerator Rendered(int width, int height, bool hebrew, System.Action<VisualElement> check)+ // R-GOV-002: help is selected by explicit ruleset, never by language or a zero Attention price.+ [Test]+ public void Gdd03HelpContainsNoAttentionInEitherLanguage([Values(false, true)] bool hebrew)+ {+ var text = hebrew ? He : En;+ using var ui = new UiTestKit();+ using var guide = new HowToPlayPresenter(ui.Root, text, SaveGame.Gdd03Ruleset);+ var attention = ui.Q<Label>("how-to-play-attention");+ Assert.IsEmpty(attention.text, "hidden legacy text must not remain accessible");+ Assert.AreEqual(DisplayStyle.None, attention.style.display.value);+ foreach (var key in new[] { "events", "top_bar", "end_turn" })+ Assert.AreEqual(text["how_to_play.gdd03." + key], ui.Q<Label>("how-to-play-" + key.Replace('_', '-')).text);+ AssertNoAttention(ui.Root);+ }++ [Test]+ public void Gdd03EndTurnHelpKeepsNeedsOrdersGuidance([Values(false, true)] bool hebrew)+ {+ using var ui = new UiTestKit();+ using var guide = new HowToPlayPresenter(ui.Root, hebrew ? He : En, SaveGame.Gdd03Ruleset);+ var line = ui.Q<Label>("how-to-play-end-turn").text;+ foreach (var phrase in hebrew ? new[] { "ממתינה להוראות", "בוחר בה במקום", "ביצור", "לדלג" }+ : new[] { "needs orders", "selects it instead", "fortify", "skip it" })+ StringAssert.Contains(phrase, line, "Removing Attention must not erase the needs-orders behavior");+ }++ [Test]+ public void OldRulesetsKeepEveryOriginalHelpLine([Values(false, true)] bool hebrew,+ [Values(SaveGame.LegacyRuleset, SaveGame.GddRuleset)] string ruleset)+ {+ var text = hebrew ? He : En;+ using var ui = new UiTestKit();+ using var guide = new HowToPlayPresenter(ui.Root, text, ruleset);+ foreach (var key in new[] { "turn", "attention", "city", "training", "events", "top_bar", "end_turn", "why" })+ Assert.AreEqual(text["how_to_play." + key], ui.Q<Label>("how-to-play-" + key.Replace('_', '-')).text);+ Assert.AreNotEqual(DisplayStyle.None, ui.Q<Label>("how-to-play-attention").style.display.value);+ }++ [Test]+ public void RebuildingTheSameTreeRestoresTheCorrectModeAndLanguage()+ {+ using var ui = new UiTestKit();+ using (var guide = new HowToPlayPresenter(ui.Root, En, SaveGame.GddRuleset)) { }+ using (var guide = new HowToPlayPresenter(ui.Root, He, SaveGame.Gdd03Ruleset))+ AssertNoAttention(ui.Root);+ using (var guide = new HowToPlayPresenter(ui.Root, He, SaveGame.LegacyRuleset))+ {+ Assert.AreEqual(He["how_to_play.attention"], ui.Q<Label>("how-to-play-attention").text);+ Assert.AreNotEqual(DisplayStyle.None, ui.Q<Label>("how-to-play-attention").style.display.value);+ Assert.AreEqual(He["how_to_play.events"], ui.Q<Label>("how-to-play-events").text);+ }+ using (var guide = new HowToPlayPresenter(ui.Root, En, SaveGame.Gdd03Ruleset))+ AssertNoAttention(ui.Root);+ }++ static void AssertNoAttention(VisualElement root)+ {+ var lines = root.Q<ScrollView>("how-to-play-body").Query<Label>().ToList();+ var all = string.Join("\n", lines.Select(x => x.text));+ StringAssert.DoesNotContain("Attention", all);+ StringAssert.DoesNotContain("תשומת לב", all);+ StringAssert.DoesNotContain("תשומת הלב", all);+ }++ [UnityTest]+ public IEnumerator Gdd03GuideRendersWithoutAttentionAtLaptopAndPhoneSizesInBothLanguages()+ {+ 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 =>+ {+ AssertNoAttention(root);+ var attention = root.Q<Label>("how-to-play-attention");+ Assert.AreEqual(DisplayStyle.None, attention.resolvedStyle.display);+ var screen = root.Q("screen-how-to-play").worldBound;+ Assert.Greater(screen.width, 0);+ Assert.Greater(screen.height, 0);+ var body = root.Q<ScrollView>("how-to-play-body").worldBound;+ foreach (var line in root.Q<ScrollView>("how-to-play-body").Query<Label>().ToList())+ {+ if (line == attention) continue;+ Assert.IsNotEmpty(line.text);+ Assert.Greater(line.worldBound.height, 0, line.name);+ Assert.GreaterOrEqual(line.worldBound.xMin, body.xMin - 1, line.name);+ Assert.LessOrEqual(line.worldBound.xMax, body.xMax + 1, line.name);+ }+ }, SaveGame.Gdd03Ruleset);+ }++ static IEnumerator Rendered(int width, int height, bool hebrew, System.Action<VisualElement> check, string ruleset = SaveGame.GddRuleset){var rt = new RenderTexture(width, height, 0);var ps = Object.Instantiate(AssetDatabase.LoadAssetAtPath<PanelSettings>(UiPaths.Panel));@@ -80,7 +169,7 @@ public class HowToPlayScreenTestsvar text = hebrew ? He : En;var bridge = new SimBridge(GameSession.New(C, GoldenRun.Seed, Mode.Historical), text);var hud = new HudPresenter(root, bridge, text);- var guide = new HowToPlayPresenter(root, text);+ var guide = new HowToPlayPresenter(root, text, ruleset);var nav = new ScreenNav(root);nav.Open("how-to-play");trydiff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yamlindex 04d784f01..f571bf74f 100644--- a/unity/Assets/UI/strings.en.yaml+++ b/unity/Assets/UI/strings.en.yaml@@ -66,6 +66,11 @@ 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 moves to the next month. While one of your units still needs orders, the button selects it instead: move it, fortify it, hold or skip it. 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."++# GDD 0.3 help (#1688): old-mode help above stays unchanged.+how_to_play.gdd03.events: "An event card asks for a decision. Your choice takes effect when you end the turn."+how_to_play.gdd03.top_bar: "The top bar shows the date, Money and the country's main indicators."+how_to_play.gdd03.end_turn: "End turn moves to the next month. While one of your units still needs orders, the button selects it instead: move it, fortify it, hold or skip it. A card you leave unanswered goes to the responsible minister, who decides it for you."# 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}). The names are objectives.yaml's (#1208).diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yamlindex 7f2e6dcd6..83aa40c55 100644--- a/unity/Assets/UI/strings.he.yaml+++ b/unity/Assets/UI/strings.he.yaml@@ -63,6 +63,14 @@ how_to_play.top_bar: "הסרגל העליון מציג את התאריך, אתhow_to_play.end_turn: "סיום התור מעביר לחודש הבא. כל עוד אחת היחידות שלכם ממתינה להוראות, הכפתור בוחר בה במקום זאת: יש להזיז אותה, לתת לה פקודת ביצור או החזקה, או לדלג עליה בתור הזה. כרטיס שלא עניתם עליו, או שלא נשארה לכם תשומת לב לענות עליו, עובר לשר האחראי, והוא מחליט במקומכם."# The Why screen named in a sentence goes in gershayim: owner, 25 Oct 2026.how_to_play.why: "אחרי תור, פתחו את המסך ״למה?״ כדי לראות כל שינוי ואת הסיבה לו."++# GDD 0.3 help (#1688): old-mode help above stays unchanged.+# Hebrew drafts: agent-checked; native review pending (#564).+how_to_play.gdd03.events: "כרטיס אירוע מבקש מכם החלטה. הבחירה שלכם נכנסת לתוקף בסיום התור."+# Hebrew drafts: agent-checked; native review pending (#564).+how_to_play.gdd03.top_bar: "הסרגל העליון מציג את התאריך, את הכסף ואת המדדים העיקריים של המדינה."+# Hebrew drafts: agent-checked; native review pending (#564).+how_to_play.gdd03.end_turn: "סיום התור מעביר לחודש הבא. כל עוד אחת היחידות שלכם ממתינה להוראות, הכפתור בוחר בה במקום זאת: יש להזיז אותה, לתת לה פקודת ביצור או החזקה, או לדלג עליה בתור הזה. כרטיס שלא עניתם עליו עובר לשר האחראי, והוא מחליט במקומכם."# The Objectives screen (#1189). For the native reviewer (#564).objectives.title: "יעדים"objectives.done: "הושלם ב־{0}; בהיסטוריה ב־{1}"