A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
UI: a Star on GitHub button in Settings and on the start screen (Fixes #1168) (#1178)
Beriacc1292cf831
diff --git a/LICENSES/Octicons-MIT.txt b/LICENSES/Octicons-MIT.txtnew file mode 100644index 000000000..aa1fa80ed--- /dev/null+++ b/LICENSES/Octicons-MIT.txt@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2026 GitHub Inc.++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.diff --git a/LICENSING.md b/LICENSING.mdindex 7c818022e..58bfc9b2e 100644--- a/LICENSING.md+++ b/LICENSING.md@@ -26,6 +26,7 @@ Different parts of this repository are under different licences. Where a file is| Rain-gauge data | `content/map/precip_stations.json` | Israel Meteorological Service, data.gov.il dataset 481, under the licence stated on the dataset ("Other (Open)") || Unity engine and packages | `unity/Packages/`, `unity/ProjectSettings/` | Configuration only. The Unity engine and its packages are under Unity's own terms and are not included. Two editor-only packages come from OpenUPM under their own licences and are not included either: `com.ivanmurzak.unity.mcp` (Unity-MCP, Apache-2.0) and its dependency `extensions.unity.playerprefsex` (MIT); see [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md). No Asset Store content is in this repository. || In every build | `YamlDotNet.dll` | MIT, Copyright (c) Antoine Aubry and contributors ([LICENSES/YamlDotNet-MIT.txt](LICENSES/YamlDotNet-MIT.txt)) |+| The star and the GitHub mark on the start screen's "Star on GitHub" button | `unity/Assets/Scripts/UI/UiIcon.cs` (`StarPath`, `MarkGithubPath`: Octicons `star-fill-24` and `mark-github-24`, primer/octicons at 6dbe38e4, written out as cubic segments; #1168) | MIT, Copyright (c) 2026 GitHub Inc. ([LICENSES/Octicons-MIT.txt](LICENSES/Octicons-MIT.txt)). The GitHub mark is GitHub's trademark (see [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md)) |Historical facts are not owned by anyone. The text describing them paraphrases the cited sources. The research notes and reports quote short passages from their sources for commentary; those quotes remain © their authors.diff --git a/NOTICE b/NOTICEindex 14461bc30..347cbdf06 100644--- a/NOTICE+++ b/NOTICE@@ -168,7 +168,9 @@ published in Iton Rishmi (Official Gazette) No. 1, and the official English tranAffairs (https://www.gov.il/en/pages/declaration-of-establishment-state-of-israel). An official State publication, in thepublic domain; sources in docs/sources/declaration-1948/.-Builds also contain YamlDotNet, Copyright (c) Antoine Aubry and contributors, MIT (LICENSES/YamlDotNet-MIT.txt), and+Builds also contain YamlDotNet, Copyright (c) Antoine Aubry and contributors, MIT (LICENSES/YamlDotNet-MIT.txt), two+Octicons drawn in code (star-fill and mark-github, the start screen's Star on GitHub button), Copyright (c) 2026 GitHub+Inc., MIT (LICENSES/Octicons-MIT.txt), andthe Unity runtime, used under the Unity Terms of Service. The Unity runtime includes the ICU data file thatUI Toolkit's advanced text generator uses (Hebrew on the start screen): Copyright (c) 2016 and later Unicode, Inc. andothers, Unicode License v3 (https://www.unicode.org/license.txt).diff --git a/THIRD-PARTY-NOTICES.md b/THIRD-PARTY-NOTICES.mdindex cce03b21a..30b6cb473 100644--- a/THIRD-PARTY-NOTICES.md+++ b/THIRD-PARTY-NOTICES.md@@ -17,6 +17,7 @@ required attribution texts are in [`NOTICE`](NOTICE).| Wikipedia text and coordinates | cited throughout `content/` | CC BY-SA 4.0 | Attribution (source URL per entry); share-alike, which is why `content/` is CC BY-SA 4.0 || Portraits (Wikimedia Commons) | `promo/ref/people/`, `unity/Assets/UI/Portraits/` | Public domain, CC0, CC BY 4.0 or CC BY-SA 4.0, per file | Public domain and CC0: none legally. CC BY 4.0 and CC BY-SA 4.0: keep the credit (artist, licence, source) in `NOTICE`; a portrait cropped from a CC BY-SA 4.0 photograph is itself CC BY-SA 4.0. The per-file record in `ASSETS.portraits.yaml` is kept as provenance || Event-card photographs (Wikimedia Commons: Meitar Collection / National Library of Israel, Nationaal Archief, US National Archives) | `unity/Assets/UI/EventImages/` | CC BY 4.0, CC0 1.0 or public domain, per file | CC BY 4.0: keep the credit line (photographer, Meitar Collection, National Library of Israel, The Pritzker Family National Photography Collection; licence; "graded and cropped") in `NOTICE` and under the picture in the game; per-file records in `ASSETS.yaml` |+| Octicons `star-fill-24` and `mark-github-24` (GitHub's Primer icons, https://github.com/primer/octicons at 6dbe38e4), written out as cubic segments in code | `unity/Assets/Scripts/UI/UiIcon.cs` (`StarPath`, `MarkGithubPath`), in every build | MIT, Copyright (c) 2026 GitHub Inc. | Keep `LICENSES/Octicons-MIT.txt` with the source and with builds (both packagers copy `LICENSES/` whole); the GitHub mark is also a trademark, see below || EB Garamond | `unity/Assets/UI/Fonts/` | SIL Open Font License 1.1 | Keep `OFL.txt` with the fonts; do not sell the fonts on their own || Frank Ruhl Libre | `unity/Assets/UI/Fonts/FrankRuhlLibre/` | SIL Open Font License 1.1 | Keep `OFL.txt` with the fonts; do not sell the fonts on their own || Unity template-derived files | `unity/Assets/Settings/`, `spikes/m0/unity/Assets/Settings/`, `spikes/m0/unity/Assets/UI Toolkit/UnityThemes/`, and Shader Graphs generated from a Unity template (`unity/Assets/Shaders/StatecraftTerrain.shadergraph`) | Unity Companion License | Use with Unity; see `LICENSING.md` |@@ -52,9 +53,11 @@ each font's licence: `unity/Assets/UI/Fonts/OFL.txt` as `OFL-EBGaramond.txt` and## Third-party trademarksNames below belong to their owners and are used only to say truthfully what this project uses, runs on or is compared-with. None of them endorses this project, and this repository ships none of their logos.+with. None of them endorses this project, and this repository ships none of their logos except the GitHub mark below.- Unity is a trademark of Unity Technologies.+- GitHub and the GitHub mark are trademarks of GitHub, Inc. The mark (Octicons `mark-github`, MIT) appears only on the+ start screen's "Star on GitHub" button, which opens this project's repository on GitHub (#1168).- Civilization and Civilization VII are trademarks of Take-Two Interactive Software; they are named as a genre and stylereference.- ElevenLabs is a trademark of Eleven Labs, Inc.diff --git a/changelog.d/1168.md b/changelog.d/1168.mdnew file mode 100644index 000000000..384d7b60c--- /dev/null+++ b/changelog.d/1168.md@@ -0,0 +1,6 @@+- A "Star on GitHub" button opens the game's repository in a new tab: in a new Community row in Settings and beside New+ game on the start screen, at New game's size with a star and the GitHub mark (Octicons, MIT, drawn in code), with no+ fill and a grey edge, so it stays secondary. On the web a press arms a one-shot listener for its release, so the+ browser opens the tab inside the player's own gesture and does not block it (`ExternalLink.jslib`); any new press on+ the canvas cancels an arm its release never reached. The editor and desktop builds use `Application.OpenURL`. English+ and Hebrew labels; Beri approved the Hebrew as a native speaker (refs #564; fixes #1168).diff --git a/unity/Assets/Scripts/UI/ExternalLink.cs b/unity/Assets/Scripts/UI/ExternalLink.csnew file mode 100644index 000000000..b1f26b05d--- /dev/null+++ b/unity/Assets/Scripts/UI/ExternalLink.cs@@ -0,0 +1,48 @@+#nullable enable+using System;+using UnityEngine;+using UnityEngine.UIElements;++namespace Statecraft.Game.UI+{+ /// <summary>Opens a web page outside the game (#1168: the "Star on GitHub" buttons in Settings and on the start screen).+ /// On WebGL a browser lets a page open a new tab only inside the player's own click or key event, and Unity handles+ /// input on the next frame, outside it, so Application.OpenURL there can be popup-blocked. ExternalLink.jslib instead+ /// arms a one-shot listener for the press's release (pointerup on #unity-canvas, or keyup), which calls window.open+ /// inside that real gesture. That is why Bind opens on the press (pointer down, or the keyboard's Submit, which comes on+ /// key down) and not on `clicked`, which comes on the release, too late to arm anything; so a press dragged off the+ /// button still opens the page. In the editor and in desktop builds Open falls back to Application.OpenURL.</summary>+ public static class ExternalLink+ {+ /// <summary>The game's repository, which the Star buttons open.</summary>+ public const string Repository = "https://github.com/eyalgolan/statecraft-israel";++ /// <summary>What Open does with the URL. Tests put a recorder here (and put Default back), so no browser opens.</summary>+ public static Action<string> Opener = Default;++ public static void Open(string url) => Opener(url);++ /// <summary>Opens <paramref name="url"/> when the button is pressed with the primary pointer or the keyboard's Submit.+ /// The returned action unwires it (a presenter's Dispose).</summary>+ public static Action Bind(Button button, string url)+ {+ EventCallback<PointerDownEvent> onPointer = e => { if (e.button == 0) Open(url); };+ EventCallback<NavigationSubmitEvent> onSubmit = _ => Open(url);+ // TrickleDown: runs before the button's Clickable, whatever it does with the event.+ button.RegisterCallback(onPointer, TrickleDown.TrickleDown);+ button.RegisterCallback(onSubmit, TrickleDown.TrickleDown);+ return () =>+ {+ button.UnregisterCallback(onPointer, TrickleDown.TrickleDown);+ button.UnregisterCallback(onSubmit, TrickleDown.TrickleDown);+ };+ }++#if UNITY_WEBGL && !UNITY_EDITOR+ [System.Runtime.InteropServices.DllImport("__Internal")] static extern void StatecraftOpenOnRelease(string url);+ public static void Default(string url) => StatecraftOpenOnRelease(url);+#else+ public static void Default(string url) => Application.OpenURL(url);+#endif+ }+}diff --git a/unity/Assets/Scripts/UI/ExternalLink.cs.meta b/unity/Assets/Scripts/UI/ExternalLink.cs.metanew file mode 100644index 000000000..1fc96b6bc--- /dev/null+++ b/unity/Assets/Scripts/UI/ExternalLink.cs.meta@@ -0,0 +1,2 @@+fileFormatVersion: 2+guid: 36d45f32f7fc49a4b587a601a3e48d16diff --git a/unity/Assets/Scripts/UI/ExternalLink.jslib b/unity/Assets/Scripts/UI/ExternalLink.jslibnew file mode 100644index 000000000..8f2168163--- /dev/null+++ b/unity/Assets/Scripts/UI/ExternalLink.jslib@@ -0,0 +1,33 @@+// Opens a URL in a new tab inside the player's own gesture (#1168, ExternalLink.cs). Unity handles a press on the next+// frame, outside the browser's event, where window.open is popup-blocked; so a press arms a one-shot listener for its+// release (pointerup on the canvas, or keyup for the keyboard's Enter / Space), and the release opens the tab.+// Whichever comes first opens it and removes both; a second keyboard or gamepad press before the release only replaces+// the URL (a canvas press disarms first, see below). A release that never reaches the listener (a quick tap whose+// pointerup beat the next frame, a release off the canvas, a gamepad's Submit) would leave it armed for an unrelated+// later click, so it disarms itself after 1.5 s and opens nothing then, and a new press on the canvas (pointerdown)+// disarms it at once: a tap shorter than a frame is released before Unity arms the listener, and the next click+// anywhere would otherwise open the tab. A press on the button itself arms it again on the next frame, after its own+// pointerdown.+mergeInto(LibraryManager.library, {+ StatecraftOpenOnRelease: function (urlPtr) {+ var url = UTF8ToString(urlPtr);+ if (typeof window === "undefined") return;+ var armed = window.statecraftOpenOnRelease;+ if (armed) { armed.url = url; return; }+ var canvas = document.querySelector("#unity-canvas") || document;+ armed = window.statecraftOpenOnRelease = { url: url };+ var timer;+ var disarm = function () {+ clearTimeout(timer);+ canvas.removeEventListener("pointerup", open);+ canvas.removeEventListener("pointerdown", disarm);+ document.removeEventListener("keyup", open);+ window.statecraftOpenOnRelease = null;+ };+ var open = function () { disarm(); window.open(armed.url, "_blank", "noopener"); };+ canvas.addEventListener("pointerup", open);+ canvas.addEventListener("pointerdown", disarm);+ document.addEventListener("keyup", open);+ timer = setTimeout(disarm, 1500);+ },+});diff --git a/unity/Assets/Scripts/UI/ExternalLink.jslib.meta b/unity/Assets/Scripts/UI/ExternalLink.jslib.metanew file mode 100644index 000000000..d145897f6--- /dev/null+++ b/unity/Assets/Scripts/UI/ExternalLink.jslib.meta@@ -0,0 +1,32 @@+fileFormatVersion: 2+guid: ea601112b35e4084b0acaa773f302ffb+PluginImporter:+ externalObjects: {}+ serializedVersion: 2+ iconMap: {}+ executionOrder: {}+ defineConstraints: []+ isPreloaded: 0+ isOverridable: 0+ isExplicitlyReferenced: 0+ validateReferences: 1+ platformData:+ - first:+ Any:+ second:+ enabled: 0+ settings: {}+ - first:+ Editor: Editor+ second:+ enabled: 0+ settings:+ DefaultValueInitialized: true+ - first:+ WebGL: WebGL+ second:+ enabled: 1+ settings: {}+ userData:+ assetBundleName:+ assetBundleVariant:diff --git a/unity/Assets/Scripts/UI/SettingsPresenter.cs b/unity/Assets/Scripts/UI/SettingsPresenter.csindex a1816fa71..2f9cb9307 100644--- a/unity/Assets/Scripts/UI/SettingsPresenter.cs+++ b/unity/Assets/Scripts/UI/SettingsPresenter.cs@@ -10,8 +10,9 @@ using UnityEngine.UIElements;namespace Statecraft.Game.UI{/// <summary>The Settings screen (#40), opened from the left column's gear like the other screens (ScreenNav). Its options:- /// the graphics quality (GraphicsQuality: Auto / High / Low), the sound effects volume (GameAudio, #39), the UI's language (#1036), the UI scale (100% / 125% / 150%)- /// and the tilt-shift blur. The blur option turns it off and on: applied at once (TiltShift.Enabled, what the "tiltshift"+ /// the graphics quality (GraphicsQuality: Auto / High / Low), the sound effects volume (GameAudio, #39), the UI's language (#1036),+ /// the UI scale (100% / 125% / 150%), the tilt-shift blur, and a Community row whose "Star on GitHub" opens the repository+ /// (#1168, ExternalLink). The blur option turns it off and on: applied at once (TiltShift.Enabled, what the "tiltshift"/// toggle sets) and kept in the SettingsStore, so it holds after a reload. A stored "off" only ever turns the blur off, so ?notiltshift still boots without it. The/// button says what is set ("On" / "Off"), not only a colour: the player's choice (Enabled), not the web tier's/// automatic last fallback step (TiltShift.FallbackOff), which it never changes.</summary>@@ -39,6 +40,7 @@ namespace Statecraft.Game.UIreadonly Action<string>? switchLanguage;readonly PanelSettings? panel; readonly Vector2Int reference; int uiScale = UiScales[0], chosen = UiScales[0];readonly (Button button, int percent, Action pick)[] scales;+ readonly Action unbindStar;/// <param name="store">Where the choice is kept; null keeps nothing (the option still works until the page closes).</param>/// <param name="switchLanguage">Puts the UI in the language pressed (GameRoot builds the screens again); null changes@@ -116,6 +118,11 @@ namespace Statecraft.Game.UI// The fit depends on the window's shape, which a resize changes: the offer and the applied scale follow the// root's geometry (as TopBarInset does). The file keeps the choice, so a shape that holds it again gets it back.root.RegisterCallback<GeometryChangedEvent>(OnGeometry);+ // Community (#1168): Star on GitHub opens the repository in a new tab.+ screen.Q<Label>("settings-community-label").text = text["settings.community"];+ var star = screen.Q<Button>("settings-star");+ star.text = text["community.star"];+ unbindStar = ExternalLink.Bind(star, ExternalLink.Repository);ScreenNav.OnOpened(screen, Show); // a dev toggle may have changed it while the screen was shutShow();}@@ -127,6 +134,7 @@ namespace Statecraft.Game.UIforeach (var (b, _, pick) in languages) b.clicked -= pick;foreach (var (b, _, pick) in sound) b.clicked -= pick;foreach (var (b, _, pick) in scales) b.clicked -= pick;+ unbindStar();root.UnregisterCallback<GeometryChangedEvent>(OnGeometry);if (panel != null) panel.referenceResolution = reference;if (screen.userData is Action) screen.userData = null;diff --git a/unity/Assets/Scripts/UI/StartScreenPresenter.cs b/unity/Assets/Scripts/UI/StartScreenPresenter.csindex 6d388142c..dd1ea6351 100644--- a/unity/Assets/Scripts/UI/StartScreenPresenter.cs+++ b/unity/Assets/Scripts/UI/StartScreenPresenter.cs@@ -17,7 +17,7 @@ namespace Statecraft.Game.UI/// press never wipes the save (#175, B6). Continue and Escape withdraw an open request./// While it shows, the root has OpenClass (Statecraft.uss hides the HUD under it, so Tab reaches only these buttons)/// and <c>shownChanged</c> is told, so GameRoot can stop the camera keys. The panel's source line says the painting is- /// AI-generated.</summary>+ /// AI-generated. Beside New game, "Star on GitHub" opens the repository in a new tab (#1168, ExternalLink).</summary>public sealed class StartScreenPresenter : IDisposable{/// <summary>On the "root" element while the start screen shows.</summary>@@ -51,6 +51,8 @@ namespace Statecraft.Game.UIreadonly EventCallback<GeometryChangedEvent> onGeometry;readonly Action onContinue, onNewGame, onStarted;readonly PressSource presses;+ readonly Action unbindStar;+ readonly Button starButton;/// <summary>Continue is offered: the session continues the autosave.</summary>public bool Resumed { get; private set; }@@ -78,7 +80,11 @@ namespace Statecraft.Game.UI{screen.Q<Label>("start-source").text = text["start.source"];continueButton.text = text["start.continue"]; newGameButton.text = text["start.new_game"];+ screen.Q<Button>("start-star").text = text["community.star"];}+ starButton = screen.Q<Button>("start-star");+ unbindStar = ExternalLink.Bind(starButton, ExternalLink.Repository); // #1168+ starButton.generateVisualContent += PaintStarSigns;onContinue = Continue; onNewGame = NewGame; onStarted = Started;continueButton.clicked += onContinue;newGameButton.clicked += onNewGame;@@ -182,6 +188,21 @@ namespace Statecraft.Game.UI/// <summary>The start body's top and bottom padding together in the band layout (Statecraft.uss .start-band .start-body).</summary>const float BodyPadding = 32f;+ /// <summary>Star on GitHub's star and GitHub mark (#1168), side by side in the button's left padding (the right in+ /// Hebrew; Statecraft.uss .start-star keeps 80 px for them), painted into the button so it stays a leaf sized by its+ /// text (UiIcon.Paint). Lit while the button has the keyboard focus, as the other gold signs.</summary>+ static void PaintStarSigns(MeshGenerationContext m)+ {+ const float Size = 22f, Edge = 18f, Gap = 6f;+ var e = m.visualElement;+ bool rtl = UiLanguage.Within(e), lit = UiIcon.IsFocused(e);+ float y = (e.layout.height - Size) / 2f;+ float first = rtl ? e.layout.width - Edge - Size : Edge;+ float second = rtl ? first - Gap - Size : first + Size + Gap;+ UiIcon.Paint(m, "star", new Rect(first, y, Size, Size), lit);+ UiIcon.Paint(m, "mark-github", new Rect(second, y, Size, Size), lit);+ }+public void Dispose(){Hide(giveFocus: false);@@ -189,6 +210,8 @@ namespace Statecraft.Game.UIcontinueButton.clicked -= onContinue;newGameButton.clicked -= onNewGame;newGame.Started -= onStarted;+ unbindStar();+ starButton.generateVisualContent -= PaintStarSigns;screen.UnregisterCallback(onCancel);screen.UnregisterCallback(onGeometry);panel.UnregisterCallback(onGeometry);diff --git a/unity/Assets/Scripts/UI/UiIcon.cs b/unity/Assets/Scripts/UI/UiIcon.csindex 956f230dc..dfe8e87c4 100644--- a/unity/Assets/Scripts/UI/UiIcon.cs+++ b/unity/Assets/Scripts/UI/UiIcon.cs@@ -8,7 +8,7 @@ namespace Statecraft.Game.UI{/// <summary>A small vector icon drawn with Painter2D (no image asset), in the promo's style (promo/final/03): a gold coin/// for the Treasury, figures for Immigration and Public Support, a blue shield for Security, a globe for International- /// Standing, a banknote for Foreign Currency, two linked rings for Social cohesion, gold line icons for the screen buttons, and a terrain sign per biome. Each+ /// Standing, a banknote for Foreign Currency, two linked rings for Social cohesion, gold line icons for the screen buttons, a star and the GitHub mark for "Star on GitHub" (#1168), and a terrain sign per biome. Each/// glyph is drawn in a 24 x 24 design box, scaled to the element's content box and centred in it. In UXML:/// <c><Statecraft.Game.UI.UiIcon glyph="coin" /></c>. An unknown glyph draws nothing.</summary>[UxmlElement]@@ -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,- ["hourglass"] = Hourglass,+ ["hourglass"] = Hourglass, ["star"] = Star, ["mark-github"] = MarkGithub,["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,@@ -293,6 +293,81 @@ namespace Statecraft.Game.UIp.BeginPath(); p.MoveTo(at(8.6f, 20)); p.LineTo(at(12, 16.4f)); p.LineTo(at(15.4f, 20)); p.ClosePath(); p.Fill();}+ // --- the start screen's "Star on GitHub" signs (#1168): Octicons star-fill-24 and mark-github-24 (GitHub's Primer+ // icons, primer/octicons at 6dbe38e4, MIT, THIRD-PARTY-NOTICES.md and LICENSES/Octicons-MIT.txt). Each SVG path is+ // one closed outline in the same 24 x 24 box, written out as absolute cubic segments (its lines and its corner arcs+ // as cubics), so Painter2D fills it without an SVG parser. Filled in the gold glyphs' colour.+ static void Star(Painter2D p, Func<float, float, Vector2> at, float s, Color gold) => FillCubics(p, at, StarPath, gold);++ static void MarkGithub(Painter2D p, Func<float, float, Vector2> at, float s, Color gold) => FillCubics(p, at, MarkGithubPath, gold);++ /// <summary>Fills the outline <paramref name="d"/>: a start point, then (control 1, control 2, end) per segment.</summary>+ static void FillCubics(Painter2D p, Func<float, float, Vector2> at, float[] d, Color fill)+ {+ p.fillColor = fill;+ p.BeginPath(); p.MoveTo(at(d[0], d[1]));+ for (int i = 2; i + 5 < d.Length; i += 6) p.BezierCurveTo(at(d[i], d[i + 1]), at(d[i + 2], d[i + 3]), at(d[i + 4], d[i + 5]));+ p.ClosePath(); p.Fill();+ }++ static readonly float[] StarPath =+ {+ 12.672f, 0.668f,+ 13.692f, 2.734f, 14.711f, 4.799f, 15.731f, 6.865f,+ 18.01f, 7.196f, 20.29f, 7.527f, 22.569f, 7.858f,+ 22.852f, 7.899f, 23.087f, 8.097f, 23.175f, 8.369f,+ 23.264f, 8.64f, 23.19f, 8.939f, 22.985f, 9.138f,+ 21.336f, 10.746f, 19.686f, 12.353f, 18.037f, 13.961f,+ 18.426f, 16.232f, 18.816f, 18.502f, 19.205f, 20.773f,+ 19.253f, 21.054f, 19.137f, 21.338f, 18.906f, 21.506f,+ 18.675f, 21.673f, 18.37f, 21.696f, 18.117f, 21.563f,+ 16.078f, 20.491f, 14.039f, 19.419f, 12f, 18.347f,+ 9.961f, 19.419f, 7.923f, 20.491f, 5.884f, 21.563f,+ 5.631f, 21.696f, 5.325f, 21.674f, 5.094f, 21.506f,+ 4.863f, 21.338f, 4.748f, 21.053f, 4.796f, 20.772f,+ 5.185f, 18.502f, 5.575f, 16.231f, 5.964f, 13.961f,+ 4.315f, 12.353f, 2.665f, 10.746f, 1.016f, 9.138f,+ 0.811f, 8.939f, 0.737f, 8.641f, 0.825f, 8.369f,+ 0.914f, 8.097f, 1.149f, 7.899f, 1.432f, 7.859f,+ 3.711f, 7.528f, 5.991f, 7.196f, 8.27f, 6.865f,+ 9.289f, 4.799f, 10.308f, 2.734f, 11.327f, 0.668f,+ 11.453f, 0.412f, 11.714f, 0.25f, 12f, 0.25f,+ 12.285f, 0.25f, 12.546f, 0.412f, 12.672f, 0.668f+ };++ static readonly float[] MarkGithubPath =+ {+ 10.226f, 17.284f,+ 7.261f, 16.924f, 5.172f, 14.791f, 5.172f, 12.028f,+ 5.172f, 10.905f, 5.576f, 9.692f, 6.25f, 8.884f,+ 5.958f, 8.143f, 6.003f, 6.57f, 6.34f, 5.919f,+ 7.238f, 5.807f, 8.451f, 6.279f, 9.17f, 6.929f,+ 10.023f, 6.66f, 10.922f, 6.525f, 12.023f, 6.525f,+ 13.123f, 6.525f, 14.022f, 6.66f, 14.83f, 6.907f,+ 15.526f, 6.278f, 16.762f, 5.807f, 17.66f, 5.919f,+ 17.975f, 6.525f, 18.02f, 8.098f, 17.727f, 8.861f,+ 18.447f, 9.715f, 18.828f, 10.861f, 18.828f, 12.028f,+ 18.828f, 14.791f, 16.739f, 16.88f, 13.73f, 17.262f,+ 14.493f, 17.756f, 15.01f, 18.834f, 15.01f, 20.069f,+ 15.01f, 20.848f, 15.01f, 21.626f, 15.01f, 22.405f,+ 15.01f, 23.079f, 15.571f, 23.461f, 16.245f, 23.191f,+ 20.311f, 21.641f, 23.5f, 17.576f, 23.5f, 12.545f,+ 23.5f, 6.188f, 18.334f, 1f, 11.978f, 1f,+ 5.62f, 1f, 0.5f, 6.188f, 0.5f, 12.545f,+ 0.5f, 17.531f, 3.667f, 21.665f, 7.935f, 23.214f,+ 8.541f, 23.439f, 9.125f, 23.034f, 9.125f, 22.428f,+ 9.125f, 21.829f, 9.125f, 21.229f, 9.125f, 20.63f,+ 8.783f, 20.773f, 8.417f, 20.849f, 8.047f, 20.854f,+ 6.564f, 20.854f, 5.688f, 20.046f, 5.06f, 18.541f,+ 4.813f, 17.934f, 4.543f, 17.575f, 4.026f, 17.508f,+ 3.756f, 17.485f, 3.667f, 17.373f, 3.667f, 17.238f,+ 3.667f, 16.968f, 4.117f, 16.767f, 4.565f, 16.767f,+ 5.217f, 16.767f, 5.778f, 17.171f, 6.362f, 18.002f,+ 6.812f, 18.653f, 7.283f, 18.945f, 7.845f, 18.945f,+ 8.406f, 18.945f, 8.765f, 18.743f, 9.282f, 18.226f,+ 9.664f, 17.845f, 9.956f, 17.508f, 10.226f, 17.283f+ };+// --- the info panel's fact rows (gold line art, as the promo's row signs; HUD round 1) ---/// <summary>The region row: a folded map of three panels.</summary>static void Region(Painter2D p, Func<float, float, Vector2> at, float s, Color gold)diff --git a/unity/Assets/Tests/EditMode/HebrewUiTests.cs b/unity/Assets/Tests/EditMode/HebrewUiTests.csindex cfc49f3a3..6532c8afc 100644--- a/unity/Assets/Tests/EditMode/HebrewUiTests.cs+++ b/unity/Assets/Tests/EditMode/HebrewUiTests.cs@@ -294,6 +294,7 @@ public class HebrewUiTests("settings-sound-low", "settings.sound.low"), ("settings-sound-high", "settings.sound.high"),("settings-language-label", "settings.language"), ("settings-language-note", "settings.language.note"),("settings-uiscale-label", "settings.uiscale"),+ ("settings-community-label", "settings.community"), ("settings-star", "community.star"), ("start-star", "community.star"),("start-source", "start.source"), ("start-recording-credit", "start.recording_credit"),("start-continue", "start.continue"), ("start-new-game", "start.new_game"),};diff --git a/unity/Assets/Tests/EditMode/SettingsScreenTests.cs b/unity/Assets/Tests/EditMode/SettingsScreenTests.csindex eab450a86..49c3554e2 100644--- a/unity/Assets/Tests/EditMode/SettingsScreenTests.cs+++ b/unity/Assets/Tests/EditMode/SettingsScreenTests.cs@@ -441,6 +441,61 @@ public class SettingsScreenTestsAssert.AreEqual("גודל הממשק", He["settings.uiscale"]);}+ /// <summary>#1168: the Community row's "Star on GitHub" asks to open exactly the repository, once per press, from the+ /// mouse (on pointer down, where the web build arms its listener: ExternalLink) and from the keyboard. Through the+ /// injectable opener, so no browser opens.</summary>+ [Test]+ public void TheStarButtonOpensTheRepositoryOncePerPress([Values(false, true)] bool hebrew)+ {+ var text = hebrew ? He : En;+ var opened = new List<string>();+ ExternalLink.Opener = opened.Add;+ try+ {+ using var ui = new UiTestKit();+ using (new SettingsPresenter(ui.Root, text, new SettingsStore(dir)))+ {+ var star = ui.Q<Button>("settings-star");+ Assert.AreEqual(text["community.star"], star.text);+ Assert.AreEqual(text["settings.community"], ui.Q<Label>("settings-community-label").text);+ PressWithPointer(star);+ CollectionAssert.AreEqual(new[] { "https://github.com/eyalgolan/statecraft-israel" }, opened, "a click");+ UiTestKit.Press(star);+ Assert.AreEqual(2, opened.Count, "Enter or Space");+ using (var right = PointerDownEvent.GetPooled()) { right.target = star; SetButton(right, 1); star.SendEvent(right); }+ Assert.AreEqual(2, opened.Count, "a right click opens nothing");+ }+ UiTestKit.Press(ui.Q<Button>("settings-star"));+ Assert.AreEqual(2, opened.Count, "disposed, the button is unwired");+ }+ finally { ExternalLink.Opener = ExternalLink.Default; }+ }++ /// <summary>The two labels; Beri approved their Hebrew as a native speaker on #1178.</summary>+ [Test]+ public void TheCommunityLabelsAreInBothLanguages()+ {+ Assert.AreEqual("Community", En["settings.community"]);+ Assert.AreEqual("Star on GitHub", En["community.star"]);+ Assert.AreEqual("קהילה", He["settings.community"]);+ Assert.AreEqual("סימון בכוכב בגיטהאב", He["community.star"]);+ }++ /// <summary>A mouse press as the player makes it (StartScreenTests.PressWithPointer): a primary-button pointer down+ /// (GetPooled leaves the button at -1), then the button's Clickable fires on the release.</summary>+ internal static void PressWithPointer(Button b)+ {+ using (var down = PointerDownEvent.GetPooled()) { down.target = b; SetButton(down, 0); b.SendEvent(down); }+ using var click = ClickEvent.GetPooled();+ click.target = b;+ typeof(Clickable).GetMethod("Invoke", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic,+ null, new[] { typeof(EventBase) }, null)!.Invoke(b.clickable, new object[] { click });+ }++ /// <summary>PointerDownEvent.button has no public setter.</summary>+ static void SetButton(PointerDownEvent e, int button) =>+ typeof(PointerDownEvent).GetProperty("button")!.SetValue(e, button);+static void AssertUiScale(UiTestKit ui, int set){foreach (var (name, percent) in UiScaleButtons)@@ -514,13 +569,17 @@ public class SettingsScreenTestsforeach (var name in new[] { "settings-screen-title", "settings-tiltshift-label", "settings-tiltshift","settings-quality-label", "settings-quality-auto", "settings-quality-high", "settings-quality-low","settings-language-label", "settings-language-en", "settings-language-he", "settings-language-note",- "settings-uiscale-label", "settings-uiscale-100", "settings-uiscale-125", "settings-uiscale-150" })+ "settings-uiscale-label", "settings-uiscale-100", "settings-uiscale-125", "settings-uiscale-150",+ "settings-community-label", "settings-star" }){var e = root.Q<TextElement>(name);Assert.IsFalse(string.IsNullOrWhiteSpace(e.text), $"{at}: {name} has its text");Assert.IsTrue(Inside(e.worldBound, screen), $"{at}: {name} {e.worldBound} leaves the screen {screen}");Assert.IsTrue(UiLayoutTests.TextFits(e), $"{at}: {name} '{e.text}' is cut ({e.contentRect})");}+ // The Community row (#1168) runs right to left in Hebrew, like the language row: the button left of its name.+ var starAt = root.Q("settings-star").worldBound; var communityAt = root.Q("settings-community-label").worldBound;+ Assert.AreEqual(hebrew, starAt.xMax <= communityAt.xMin + 0.5f, $"{at}: the Star button {starAt} beside its name {communityAt}");// The set choice reads as set while it has the focus a press leaves on it: dark text on the gold fill.var low = root.Q<Button>("settings-quality-low");using (var e = NavigationSubmitEvent.GetPooled()) { e.target = low; low.SendEvent(e); }diff --git a/unity/Assets/Tests/EditMode/StartScreenTests.cs b/unity/Assets/Tests/EditMode/StartScreenTests.csindex 266b662d0..048921737 100644--- a/unity/Assets/Tests/EditMode/StartScreenTests.cs+++ b/unity/Assets/Tests/EditMode/StartScreenTests.cs@@ -252,6 +252,27 @@ public class StartScreenTestsAssert.IsFalse(Directory.Exists(store.Directory) && Directory.GetFiles(store.Directory).Length > 0);}+ /// <summary>#1168: the start screen's "Star on GitHub" asks to open exactly the repository, once per press (mouse or+ /// keyboard), through the injectable opener; the screen stays open.</summary>+ [Test]+ public void TheStarButtonOpensTheRepositoryAndLeavesTheScreenOpen()+ {+ var opened = new List<string>();+ ExternalLink.Opener = opened.Add;+ try+ {+ using var rig = new Rig(TempStore());+ var star = rig.Ui.Q<Button>("start-star");+ Assert.AreEqual("Star on GitHub", star.text);+ SettingsScreenTests.PressWithPointer(star);+ CollectionAssert.AreEqual(new[] { "https://github.com/eyalgolan/statecraft-israel" }, opened, "a click");+ rig.Ui.Press("start-star");+ Assert.AreEqual(2, opened.Count, "Enter or Space");+ Assert.IsTrue(rig.Start.IsOpen, "the screen stays open");+ }+ finally { ExternalLink.Opener = ExternalLink.Default; }+ }+[Test]public void ContinueShowsOnlyWithASaveAndLoadsIt(){@@ -339,7 +360,7 @@ public class StartScreenTestsvar cont = rig.Ui.Q<Button>("start-continue");cont.Focus();Assert.AreSame(cont, rig.Ui.Root.focusController?.focusedElement, "Continue has the focus");- // Tab walks the screen's buttons only: Continue, New Game and the recording's button.+ // Tab walks the screen's buttons only: Continue, New Game, the recording's button and Star on GitHub (#1168).var seen = new List<string>();for (int i = 0; i < 4; i++){@@ -349,7 +370,7 @@ public class StartScreenTestsseen.Add((rig.Ui.Root.focusController.focusedElement as VisualElement)?.name ?? "none");}Assert.AreEqual("start-new-game", seen[0], "Tab moves from Continue to New Game: " + string.Join(", ", seen));- Assert.IsTrue(seen.All(n => n == "start-continue" || n == "start-new-game" || n == "start-listen"), "Tab stays on the screen's buttons: " + string.Join(", ", seen));+ Assert.IsTrue(seen.All(n => n == "start-continue" || n == "start-new-game" || n == "start-listen" || n == "start-star"), "Tab stays on the screen's buttons: " + string.Join(", ", seen));CollectionAssert.Contains(seen, "start-listen", "Tab reaches the recording's button: " + string.Join(", ", seen));rig.Ui.Press("start-continue");yield return null; yield return null;@@ -557,6 +578,18 @@ public class StartScreenTestsAssert.GreaterOrEqual(r.height, 40f, $"{at}: {b} is a usable target");}Assert.IsFalse(R("start-continue").Overlaps(R("start-new-game")), at);+ // #1168 review: Star on GitHub is New game's size, beside it or (in a narrow window) wrapped under it, and+ // secondary in colour: no fill and no gold edge.+ var star = R("start-star");+ Assert.IsTrue(Inside(star, R("start-actions")) && Inside(star, panel), $"{at}: the Star button {star} is with New game, inside the panel");+ var onePixel = Mathf.Max(0.5f, window.width / w + 0.01f); // a scaled panel snaps each edge to a screen pixel+ Assert.AreEqual(R("start-new-game").height, star.height, onePixel, $"{at}: the Star button is New game's height");+ Assert.AreEqual(R("start-new-game").width, star.width, onePixel, $"{at}: the Star button is New game's width");+ Assert.IsFalse(star.Overlaps(R("start-new-game")) || star.Overlaps(R("start-continue")), $"{at}: the Star button overlaps a button");+ var starStyle = root.Q("start-star").resolvedStyle; var newGameStyle = root.Q("start-new-game").resolvedStyle;+ Assert.AreEqual(newGameStyle.fontSize, starStyle.fontSize, $"{at}: the Star button's text is New game's size");+ Assert.Less(starStyle.backgroundColor.a, 0.01f, $"{at}: the Star button has no fill (secondary to New game)");+ Assert.AreNotEqual(newGameStyle.borderTopColor, starStyle.borderTopColor, $"{at}: the Star button's edge is not New game's gold");}finally{diff --git a/unity/Assets/UI/Game.uxml b/unity/Assets/UI/Game.uxmlindex 941984b05..311ee0d04 100644--- a/unity/Assets/UI/Game.uxml+++ b/unity/Assets/UI/Game.uxml@@ -374,6 +374,11 @@<ui:Button name="settings-uiscale-150" text="150%" class="settings-switch" /></ui:VisualElement></ui:VisualElement>+ <!-- Community (#1168): "Star on GitHub" opens the repository in a new tab (ExternalLink). -->+ <ui:VisualElement class="row settings-row">+ <ui:Label name="settings-community-label" text="Community" class="settings-name" />+ <ui:Button name="settings-star" text="Star on GitHub" class="settings-switch" />+ </ui:VisualElement><Statecraft.Game.UI.UiFrame /></ui:VisualElement><!-- The turn report (#1037, TurnReportPresenter): after End Turn, each top-bar number that changed and the sim's causes.@@ -428,6 +433,9 @@<ui:VisualElement name="start-actions" class="start-actions"><ui:Button name="start-continue" text="Continue" class="start-button" /><ui:Button name="start-new-game" text="New game" class="start-button" />+ <!-- Community (#1168): "Star on GitHub", New game's size beside it, opens the repository in a new tab+ (ExternalLink); its star and GitHub mark are painted in by StartScreenPresenter. -->+ <ui:Button name="start-star" text="Star on GitHub" class="start-button start-star" /></ui:VisualElement><ui:VisualElement name="start-caption" class="start-caption" picking-mode="Ignore"><ui:Label name="start-caption-he" text="…אנו מכריזים בזאת על הקמת מדינה יהודית בארץ־ישראל, היא מדינת ישראל." class="start-he start-caption-he" language-direction="RTL" picking-mode="Ignore" />diff --git a/unity/Assets/UI/Statecraft.uss b/unity/Assets/UI/Statecraft.ussindex c9a60ae86..9586568c2 100644--- a/unity/Assets/UI/Statecraft.uss+++ b/unity/Assets/UI/Statecraft.uss@@ -792,15 +792,26 @@ Button.settings-choice-selected { -unity-font-definition: url("project://databas.start-en { font-size: 18px; color: var(--ink-dim); letter-spacing: 1px; -unity-text-align: middle-center; white-space: normal; margin: 2px 0 0 0; }.start-source { font-size: 15px; color: var(--ink-dim); -unity-text-align: middle-center; white-space: normal; margin: 14px 0 0 0; }.start-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; margin-top: 14px; }+/* A whole-pixel height (#1168): with Star on GitHub wrapped under New game on a phone held upright, a fractional row+ height shifts the panel's lines off whole pixels and the band layout (StartScreenPresenter.Fit) then rounds the+ panel's top back and forth, a layout that never settles. 50 px is the text's own height (49.5) rounded up. 300 px+ wide: Star on GitHub's label and its two signs (about 260 px in English, 290 in Hebrew) fit, so all are one size. */.start-button {-unity-font-definition: url("project://database/Assets/UI/Fonts/EBGaramond-SemiBold.ttf");- font-size: 24px; min-width: 220px; margin: 4px 10px; padding: 8px 24px; -unity-text-align: middle-center;+ font-size: 24px; min-width: 300px; height: 50px; margin: 4px 10px; padding: 8px 24px; -unity-text-align: middle-center;}/* The recording (DeclarationRecording): a quiet button and its credit under the source line; while it plays, its words ascaptions in a dark strip just above the panel, over the painting (the panel is the strip's positioned parent, so thestrip follows it in every layout). */.start-recording { display: none; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 8px; }.start-listen { font-size: 18px; padding: 4px 16px; margin: 2px 10px; -unity-text-align: middle-center; }+/* Star on GitHub (#1168): a .start-button, New game's size, beside it (the row wraps it under New game in a narrow+ window). Its star and GitHub mark are painted into the left padding (the right in Hebrew; StartScreenPresenter+ PaintStarSigns). Secondary to New game in colour: no fill and a grey edge instead of the gold one; hover and keyboard+ focus still light it like any button (Button:hover and :focus are the more specific rules). */+.start-star { background-color: rgba(0, 0, 0, 0); border-color: var(--ink-dim); padding-left: 80px; -unity-text-align: middle-left; }+/* The label starts right after the signs, on their side. "Button." so it beats .lang-he .start-button (centred, later). */+.lang-he Button.start-star { padding-left: 24px; padding-right: 80px; -unity-text-align: middle-right; }.start-recording-credit { font-size: 15px; color: var(--ink-dim); margin: 2px 6px; }.start-caption {display: none; position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 12px; padding: 8px 20px 10px 20px;diff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yamlindex 29287f873..2bb553061 100644--- a/unity/Assets/UI/strings.en.yaml+++ b/unity/Assets/UI/strings.en.yaml@@ -90,6 +90,9 @@ settings.sound.high: "High"settings.language: "Language"settings.language.note: "Event cards are English only for now."settings.uiscale: "UI scale"+# The Community row and the start screen's button (#1168): it opens the repository in a new tab (ExternalLink).+settings.community: "Community"+community.star: "Star on GitHub"event.draft: "DRAFT"start.source: "From the Declaration of the Establishment of the State of Israel (Official Gazette No. 1, 14 May 1948) and its official English translation. Painting: AI-generated."start.recording_credit: "Recording: Ralph Hellinger, Israel State Archives"diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yamlindex 91b245ae0..bc4016987 100644--- a/unity/Assets/UI/strings.he.yaml+++ b/unity/Assets/UI/strings.he.yaml@@ -86,6 +86,12 @@ settings.language.note: "כרטיסי האירועים באנגלית בלבד# The UI scale choice (#40): "the size of the interface"; its buttons are numbers (100%, 125%, 150%). For the native# reviewer (#564).settings.uiscale: "גודל הממשק"+# The Community row and the start screen's button (#1168): "קהילה" for the row; the button is a noun phrase ("marking+# with a star on GitHub"), like the other buttons, so no verb agrees with the player's gender; GitHub in Hebrew letters,+# as the static texts carry no Latin (HebrewUiTests). Approved by Beri, a native speaker, on #1178 (20 Oct 2026). For+# the native reviewer (#564).+settings.community: "קהילה"+community.star: "סימון בכוכב בגיטהאב"event.draft: "טיוטה"start.source: "מתוך ההכרזה על הקמת מדינת ישראל (עיתון רשמי מס׳ 1, 14 במאי 1948) ותרגומה הרשמי לאנגלית. הציור נוצר בבינה מלאכותית."# The recordist's name as the Israel State Archives spells it in its own description of item