A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
UI: Jerusalem info panel names West Jerusalem as Israeli-held (Fixes #2039) (#2400)
Beri00cc3c810ed3
diff --git a/changelog.d/2039-jerusalem-panel.md b/changelog.d/2039-jerusalem-panel.mdnew file mode 100644index 000000000..03ec29069--- /dev/null+++ b/changelog.d/2039-jerusalem-panel.md@@ -0,0 +1,6 @@+### Fixed++- The info panel for Jerusalem's hex names West Jerusalem as Israeli-held (#2039): "Held by Israel (West Jerusalem)"+ from 11 June 1948, and "Israeli side of the armistice line (West Jerusalem)" once the Jordan agreement is in force. It+ said "Held by Arab forces" because the hex also holds the Old City. The map's colours are unchanged. The Hebrew awaits+ a native read (#564).diff --git a/unity/Assets/Scripts/UI/InfoPanelPresenter.cs b/unity/Assets/Scripts/UI/InfoPanelPresenter.csindex f5fc3e81a..cd7583c15 100644--- a/unity/Assets/Scripts/UI/InfoPanelPresenter.cs+++ b/unity/Assets/Scripts/UI/InfoPanelPresenter.cs@@ -674,8 +674,9 @@ namespace Statecraft.Game.UI}/// <summary>The region lines for a hex on a date: its armistice zone (name, agreement, date) if one is in force, else- /// its 1948 sub-district; then each armistice line in force through it.</summary>- public static string RegionText(MapRegions regions, UiText text, int q, int r, System.DateTime date)+ /// its 1948 sub-district; then each armistice line in force through it. <paramref name="jerusalem"/>: the hex is the+ /// Jerusalem settlement's (see ControlText).</summary>+ public static string RegionText(MapRegions regions, UiText text, int q, int r, System.DateTime date, bool jerusalem = false){// Isolate a Hebrew date from the surrounding English fallback names: otherwise the row's// LTR paragraph can place its day before its year/month (the mixed-language #558 browser regression).@@ -686,7 +687,7 @@ namespace Statecraft.Game.UI}var parts = new List<string>();var zone = regions.ZoneAt(q, r, date);- var control = ControlText(regions, text, q, r, date);+ var control = ControlText(regions, text, q, r, date, jerusalem);// a demilitarized zone is named by its own line below; the control line would only repeat "Demilitarized zone"if (control != "" && !(zone != null && regions.Control?.At(q, r, date).side == Control1948.Side.Dmz)) parts.Add(control);// the sub-district only while the map draws the sub-district bands (before the first sourced line, or with no side data)@@ -704,14 +705,19 @@ namespace Statecraft.Game.UI/// <summary>Who held the hex on a date (owner rulings 2026-10-14; the colours claim military control, nothing else):/// "Held by Israel", "Held by Arab forces (Egypt)" while the period's legend is the 1948 one, the side of the armistice- /// line where that hex's front has switched; "" with no side data or before the first period.</summary>- public static string ControlText(MapRegions regions, UiText text, int q, int r, System.DateTime date)+ /// line where that hex's front has switched; "" with no side data or before the first period. The hex the game names+ /// Jerusalem also holds the Old City, so the data puts it on the Arab side from 11 June 1948; its panel names the+ /// Israeli-held West Jerusalem instead, and the map keeps its colour (#2039, owner ruling 2 Nov 2026: "Keep hexes, fix+ /// the panel").</summary>+ public static string ControlText(MapRegions regions, UiText text, int q, int r, System.DateTime date, bool jerusalem = false){var p = regions.ControlPeriod(date);if (p == null || regions.Control == null) return "";var (side, holder) = regions.Control.At(q, r, date);bool armistice = p.Legend == Control1948.Legend.Armistice || (p.Legend == Control1948.Legend.Mixed && ArmisticeHere(p, side, holder));string By(string plain, string by) => holder == null ? text[plain] : text.Format(by, text["control.holder_" + holder]);+ if (jerusalem && side == Control1948.Side.Arab)+ return text[armistice ? "info.control_side_israel_west_jerusalem" : "info.control_israel_west_jerusalem"];return side switch{Control1948.Side.Israel => text[armistice ? "info.control_side_israel" : "info.control_israel"],@@ -948,7 +954,7 @@ namespace Statecraft.Game.UIsubtitle.text = hex == null ? "" : text.Format("info.hex", text["info.biome." + hex.Biome], hex.ElevM); // no debug coordinates in player text (playtest 2, P2-6)// The armistice zone in force, else the sub-district on 15 May 1948, and any armistice line in force through the// hex, each with its agreement (true lines drawn to the nearest hex edge: the owner's ruling).- region.text = regions == null ? "" : RegionText(regions, text, q, r, s.Date);+ region.text = regions == null ? "" : RegionText(regions, text, q, r, s.Date, c.SettlementHexes.Any(x => x.Q == q && x.R == r && x.Id == "jerusalem"));settlements.text = owned.Count > 0 ? text.Format("info.owned", string.Join(", ", owned)) : "";// A town in a water hex is drawn on its nearest land hex (Tiberias, in the lake, on the 70 m hex): one line says// so, so this hex's elevation does not read as the town's (#204).diff --git a/unity/Assets/Tests/EditMode/InfoPanelLayoutTests.cs b/unity/Assets/Tests/EditMode/InfoPanelLayoutTests.csindex 6fd883fd1..61a088355 100644--- a/unity/Assets/Tests/EditMode/InfoPanelLayoutTests.cs+++ b/unity/Assets/Tests/EditMode/InfoPanelLayoutTests.cs@@ -40,7 +40,8 @@ public class InfoPanelLayoutTestsstatic IEnumerator Rendered(int w, int h, GameSession g, System.Action<VisualElement, InfoPanelPresenter> act, System.Action<VisualElement> check,UiText? text = null, bool hebrew = false, System.Action<VisualElement>? settled = null,System.Func<Statecraft.Game.Map.Units.PlacedToken?>? unit = null, System.Func<int, string?>? unitName = null,- System.Action<IReadOnlyCollection<(int q, int r)>>? showReachable = null, int uiScale = 100)+ System.Action<IReadOnlyCollection<(int q, int r)>>? showReachable = null, int uiScale = 100,+ MapRegions? regions = null){var t = text ?? Text;var rt = new RenderTexture(w, h, 0);@@ -59,7 +60,7 @@ public class InfoPanelLayoutTestsvar bridge = new SimBridge(g, t);var hud = new HudPresenter(root, bridge, t);var card = new EventCardPresenter(root, bridge, t, null);- var info = new InfoPanelPresenter(root, bridge, t, Names(), regions: Regions(), selectedUnit: unit, unitName: unitName, showReachable: showReachable);+ var info = new InfoPanelPresenter(root, bridge, t, Names(), regions: regions ?? Regions(), selectedUnit: unit, unitName: unitName, showReachable: showReachable);try{act(root, info);@@ -156,6 +157,32 @@ public class InfoPanelLayoutTestsAssert.IsEmpty(problems, string.Join("\n", problems));}+ /// <summary>#2039, owner ruling of 2 Nov 2026 ("Keep hexes, fix the panel"): the hex the game names Jerusalem also holds+ /// the Old City, so the control data puts it on the Arab side from 11 June 1948 and the map colours it so; its panel line+ /// names West Jerusalem as Israeli-held instead, in English and Hebrew. The opening period keeps its no-man's land.</summary>+ [UnityTest]+ public IEnumerator TheJerusalemPanelNamesWestJerusalemAsIsraeliHeld([Values(false, true)] bool hebrew)+ {+ var t = hebrew ? UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.StringsHebrew).text, "strings.he.yaml") : Text;+ var regions = new MapRegions(Subdistricts1948.Parse(MapFile(Subdistricts1948.FileName)), Armistice1949.Parse(MapFile(Armistice1949.FileName)),+ Control1948.Parse(MapFile(Control1948.FileName)));+ var jerusalem = C.SettlementHexes.Single(s => s.Id == "jerusalem");+ var g = GameSession.New(C, GoldenRun.Seed, Mode.Historical);+ var expected = new[]+ {+ (new System.DateTime(1948, 5, 15), hebrew ? "שטח הפקר" : "No-man's land"),+ (new System.DateTime(1948, 8, 1), hebrew ? "בשליטת ישראל (מערב ירושלים)" : "Held by Israel (West Jerusalem)"),+ (new System.DateTime(1949, 9, 1), hebrew ? "הצד הישראלי של קו שביתת הנשק (מערב ירושלים)" : "Israeli side of the armistice line (West Jerusalem)"),+ };+ foreach (var (date, line) in expected)+ {+ g.State.Date = date;+ yield return Rendered(1920, 1080, g, (root, info) => info.Show(jerusalem.Q, jerusalem.R),+ root => Assert.AreEqual(line, root.Q<Label>("info-region").text.Split('\n')[0], $"{date:yyyy-MM-dd}"),+ text: t, hebrew: hebrew, regions: regions);+ }+ }+/// <summary>#40, owner decision of 22 Oct 2026 (a condition on #1135): the info panel is a ScrollView, whose rows the scroll/// content container lays out, and in Hebrew they still mirror: the hex's terrain sign sits right of its facts, as on/// the row-reversed panel before (#550). In English it sits left of them. At every window size and scale, Lydda's hex.</summary>diff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yamlindex 7f488ef90..f37766458 100644--- a/unity/Assets/UI/strings.en.yaml+++ b/unity/Assets/UI/strings.en.yaml@@ -600,6 +600,8 @@ info.control_arab_by: "Held by Arab forces ({0})"info.control_side_israel: "Israeli side of the armistice line"info.control_side_arab: "Arab side of the armistice line"info.control_side_arab_by: "Arab side of the armistice line ({0})"+info.control_israel_west_jerusalem: "Held by Israel (West Jerusalem)"+info.control_side_israel_west_jerusalem: "Israeli side of the armistice line (West Jerusalem)"info.control_contested: "Contested"info.control_no_mans_land: "No-man's land"info.control_dmz: "Demilitarized zone"diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yamlindex 7dbcfe5e2..2d6974f8a 100644--- a/unity/Assets/UI/strings.he.yaml+++ b/unity/Assets/UI/strings.he.yaml@@ -675,6 +675,12 @@ info.control_arab_by: "בשליטת כוחות ערביים ({0})"info.control_side_israel: "הצד הישראלי של קו שביתת הנשק"info.control_side_arab: "הצד הערבי של קו שביתת הנשק"info.control_side_arab_by: "הצד הערבי של קו שביתת הנשק ({0})"+# The Jerusalem hex's control line (#2039): the hex also holds the Old City, and its panel names West Jerusalem.+# Agent-drafted Hebrew, both: native-review-pending (#564).+# native-review-pending+info.control_israel_west_jerusalem: "בשליטת ישראל (מערב ירושלים)"+# native-review-pending+info.control_side_israel_west_jerusalem: "הצד הישראלי של קו שביתת הנשק (מערב ירושלים)"info.control_contested: "שטח שבמחלוקת"info.control_no_mans_land: "שטח הפקר"info.control_dmz: "אזור מפורז"