A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
ui: the Declaration of Independence start screen (refs #247) (#255)
Eyal Golan7e1d0ffcc522
diff --git a/ASSETS.yaml b/ASSETS.yamlindex 555db99bd..96ac98bf0 100644--- a/ASSETS.yaml+++ b/ASSETS.yaml@@ -35,6 +35,23 @@ rules:source: "Web copy of promo/final/03-gameplay-1936.png (published 2026-10-10); same provenance as promo/final"status: owner-verifynote: "Owner-ruled README hero, captioned as concept art. Blocker if D5 disallows redistribution: the owner rules, an agent never drops it. D-H: no Civilization VII icon, logo or wordmark."+ - glob: "unity/Assets/UI/StartScreen/declaration-hall.jpg"+ licence: CC0-1.0+ ai_generated: true+ source: "Dreamina (dreamina.capcut.com), model GPT Image 2.5, 2026-10-12, with promo/final/03-gameplay-1936.png as the style reference; the start screen's painting. Option C of promo/start-screen (prompt in promo/start-screen/prompt-c.txt), resized from 1536x864 to 1920x1080 (Lanczos) and saved as JPEG; the Dreamina AI badge is kept"+ status: owner-verify+ note: "Decision D1: AI-only images CC0 / no rights claimed. Content policy: no identifiable real person (the hall from behind the audience, tiny soft-focus figures at the table, the frame between the flags holds an abstract warm blur with no figure or face in it, not a portrait). The model gave 1536x864 with a reference image; Dreamina's own upscale was not run (no free credits left), so the 1920x1080 is a plain resize."+ - glob: "promo/start-screen/declaration-hall-option-*.png"+ licence: CC0-1.0+ ai_generated: true+ source: "Dreamina (dreamina.capcut.com), model GPT Image 2.5, 2026-10-12, 1536x864 as downloaded, with promo/final/03-gameplay-1936.png as the style reference; prompts in promo/start-screen/prompt-b.txt and -c.txt"+ status: owner-verify+ note: "Decision D1: AI-only images CC0 / no rights claimed. Two options for the start screen; C is used."+ - glob: "docs/sources/declaration-1948/*.txt"+ licence: Public-Domain+ source: "The Declaration of the Establishment of the State of Israel: the Hebrew as published in Iton Rishmi (Official Gazette) No. 1, 14 May 1948, via https://he.wikisource.org/wiki/הכרזה_על_הקמת_מדינת_ישראל; the English translation via https://avalon.law.yale.edu/20th_century/israel.asp, checked against the Israel MFA's https://www.gov.il/en/pages/declaration-of-establishment-state-of-israel (all 2026-10-12)"+ status: owner-verify+ note: "The start screen quotes two lines of each (Game.uxml; StartScreenTests checks them against these files). No copyright is claimed or needed: an official State publication of 1948, and the State's copyright in its works (50 years from creation, Israeli Copyright Act 2007, s. 42) has expired in any case. Owner to confirm the legal reading."# --- Reference sheets composed from the public-domain portraits ---- glob: "promo/ref/*-sheet.jpg"licence: Public-Domain@@ -73,10 +90,15 @@ rules:ai_generated: truenote: "The contributor reports the drawing was AI-assisted (PR #169); flagged for the AI-content disclosure by controller ruling."# --- Fonts ---- - glob: "unity/Assets/UI/Fonts/*.ttf"+ - glob: "unity/Assets/UI/Fonts/EBGaramond-*.ttf"licence: OFL-1.1source: "https://github.com/octaviopardo/EBGaramond12 @ 106a4a6d377987459ae5e68673a4570f13b957fb (unity/Assets/UI/Fonts/SOURCE.txt)"status: verified+ - glob: "unity/Assets/UI/Fonts/FrankRuhlLibre/*.ttf"+ licence: OFL-1.1+ source: "https://github.com/fontef/frankruhllibre @ 2372d1998e51dc011f86554c0d23f1ccf44afddf, fonts/ttf/ (unity/Assets/UI/Fonts/FrankRuhlLibre/SOURCE.txt), unmodified"+ status: verified+ note: "The Hebrew face (EB Garamond has no Hebrew glyphs; #193); first used for the start screen's quotations."# --- Map data ---- glob: "unity/Assets/StreamingAssets/map/heightmap.*"licence: Copernicus-DEMdiff --git a/CHANGELOG.md b/CHANGELOG.mdindex 6ac414f1a..d59a93cc7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -8,6 +8,11 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB## [Unreleased]### Added+- A start screen (#247): a painting of the 14 May 1948 ceremony in the Tel Aviv Museum hall (AI-generated concept art+ with no identifiable person), two lines of the Declaration of Independence in the official Hebrew with the official+ English under each, and Continue (only with a save) and New Game (with the top bar's two-press confirmation). Automated+ runs skip it (golden, smoke, shot, the profiles, units, borderproof), as does `?nostart`. The Hebrew is set in Frank Ruhl+ Libre (OFL) and laid out right to left by UI Toolkit's advanced text generator (#193).- Units in play: the map draws the 1948 brigades, 101 Squadron and the first navy ships as Civ-style tokens at theirdated, sourced positions (`content/map/units_1948.yaml`, map-only, outside the content hash). The figures follow thereserve call-up, the squadron flies at security level 4 or 5 (an Avia S-199, then the Spitfire from its first sourceddiff --git a/LICENSING.md b/LICENSING.mdindex 7414d3fb8..c7e613fa8 100644--- a/LICENSING.md+++ b/LICENSING.md@@ -8,11 +8,12 @@ Different parts of this repository are under different licences. Where a file is| Game content (text and data) | `content/` (events, people, offices, model, rules, map YAML/JSON), except the third-party map data below | [CC BY-SA 4.0](LICENSES/CC-BY-SA-4.0.txt), credit "Statecraft: Israel contributors". The text paraphrases its cited sources, many from Wikipedia (CC BY-SA), so share-alike applies; each entry lists its sources || Original docs, art and UI assets | `docs/`, the root `*.md` files (except `LICENSE`), `ASSETS.yaml`, `ASSETS.portraits.yaml`, `promo/shots.json`, `promo/CREDITS.md`, `tools/README.md`, `reports/` (our own text), `research_notes/` (our own text), `unity/Assets/UI/*.uxml`, `*.uss`, `strings.en.yaml`, `unity/Assets/Materials/`, `unity/Assets/Resources/Units/` (materials), `unity/Assets/Shaders/`, `unity/Assets/UI/*.asset`, `unity/Assets/WebGLTemplates/Statecraft/favicon.ico`, `unity/Assets/Resources/EventImageCatalog.asset` (the event-photo catalog: alt texts, credits and flags; the pictures it points to are under their own licences below), `promo/ref/geo-reference.png` | [CC BY 4.0](LICENSES/CC-BY-4.0.txt), credit "Statecraft: Israel contributors" || Unity template-derived files | `unity/Assets/Settings/` (URP assets, renderers, volume profiles), `spikes/m0/unity/Assets/Settings/`, `spikes/m0/unity/Assets/UI Toolkit/UnityThemes/`, and any Shader Graph generated from a Unity template (for example `unity/Assets/Shaders/StatecraftTerrain.shadergraph`, from "Terrain Simple") | Created from Unity's project or graph templates and edited; under the [Unity Companion License](https://unity.com/legal/licenses/unity-companion-license) (use with Unity), not MIT |-| AI-generated images | `promo/final/01`–`08`, `promo/ref/*-src.jpg`, `docs/images/hero-concept-1936.jpg` | Marked [CC0 1.0](LICENSES/CC0-1.0.txt). No rights are claimed. Purely AI-generated output may not be copyrightable. Made with the ElevenLabs Image API (see `promo/CREDITS.md`). |+| AI-generated images | `promo/final/01`–`08`, `promo/ref/*-src.jpg`, `docs/images/hero-concept-1936.jpg`, `promo/start-screen/*.png`, `unity/Assets/UI/StartScreen/declaration-hall.jpg` | Marked [CC0 1.0](LICENSES/CC0-1.0.txt). No rights are claimed. Purely AI-generated output may not be copyrightable. Made with the ElevenLabs Image API (see `promo/CREDITS.md`), except the start screen's painting and its options, made with Dreamina (`ASSETS.yaml`). |+| Quoted public-domain text | `docs/sources/declaration-1948/` | The Declaration of the Establishment of the State of Israel (1948): the Hebrew of the Official Gazette and the English translation. Public domain; sources in each file and in `ASSETS.yaml`. || In-engine captures | `promo/final/09`, `10`, `docs/images/build-*.jpg`, `docs/images/social-preview.jpg`, `spikes/m0/evidence/*.jpg`, `spikes/m0/evidence/*.txt` (logs) | CC BY 4.0. They show the Copernicus-derived terrain; see below. || Portraits | `unity/Assets/UI/Portraits/`, `promo/ref/people/`, `promo/ref/*-sheet.jpg` | Public-domain photographs from Wikimedia Commons, plus one CC0 file (Moshe Dayan, 1962). Per-file sources are in `content/people.yaml` and `promo/CREDITS.md`. || Event-card photographs | `unity/Assets/UI/EventImages/*.jpg` | Archival photographs from Wikimedia Commons, each under its own licence: CC BY 4.0 (Meitar Collection, National Library of Israel; credits in [NOTICE](NOTICE)), CC0 1.0 (Nationaal Archief) or public domain (US National Archives). All are adapted (graded and cropped). Per-file records in `ASSETS.yaml`; the mapping `event-images.yaml` beside them is CC BY 4.0 like the other UI assets. |-| Fonts | `unity/Assets/UI/Fonts/` | EB Garamond, [SIL Open Font License 1.1](unity/Assets/UI/Fonts/OFL.txt) |+| Fonts | `unity/Assets/UI/Fonts/` | EB Garamond, [SIL Open Font License 1.1](unity/Assets/UI/Fonts/OFL.txt); Frank Ruhl Libre (`FrankRuhlLibre/`), [SIL Open Font License 1.1](unity/Assets/UI/Fonts/FrankRuhlLibre/OFL.txt) || Terrain heightmap | `unity/Assets/StreamingAssets/map/heightmap.*`, `content/map/hexes.json` (elevations) | Derived from Copernicus GLO-30 under the Copernicus DEM licence. Required notice: "produced using Copernicus WorldDEM-30 (c) DLR e.V. 2010-2014 and (c) Airbus Defence and Space GmbH 2014-2018 provided under COPERNICUS by the European Union and ESA; all rights reserved" || Precipitation grid | `content/map/precip_bio12.*` | CHELSA V2.1, CC0 1.0 (Karger et al. 2017, 2021; see `tools/README.md`) || 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)") |@@ -21,6 +22,6 @@ Different parts of this repository are under different licences. Where a file isHistorical 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.-Still being checked by the owner: the ElevenLabs terms for the AI images, the data.gov.il terms for the rain-gauge data, and the US public-domain status of each portrait (decisions D5, D6 and D-P in [docs/oss/DECISIONS.md](docs/oss/DECISIONS.md); per-file status in [ASSETS.yaml](ASSETS.yaml)). These files were published before the checks. If a check fails, the file is removed from the current tree; git history keeps it. Attribution texts: [NOTICE](NOTICE) and [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md).+Still being checked by the owner: the ElevenLabs and Dreamina terms for the AI images, the data.gov.il terms for the rain-gauge data, and the US public-domain status of each portrait (decisions D5, D-D, D6 and D-P in [docs/oss/DECISIONS.md](docs/oss/DECISIONS.md); per-file status in [ASSETS.yaml](ASSETS.yaml)). These files were published before the checks. If a check fails, the file is removed from the current tree; git history keeps it. Attribution texts: [NOTICE](NOTICE) and [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md)."Civilization" is a trademark of Take-Two Interactive. It is mentioned only to describe the genre. This project is not affiliated with or endorsed by its owners.diff --git a/NOTICE b/NOTICEindex c0e760a1d..4d09e3575 100644--- a/NOTICE+++ b/NOTICE@@ -120,7 +120,15 @@ Public domain or CC0 (credited as a courtesy):and cropped.https://commons.wikimedia.org/wiki/File:Photograph_of_President_Truman_in_the_Oval_Office,_evidently_receiving_a_Menorah_as_a_gift_from_the_Prime_Minister_of..._-_NARA_-_200318.jpg-Fonts: EB Garamond, SIL Open Font License 1.1 (unity/Assets/UI/Fonts/OFL.txt).+Fonts: EB Garamond, SIL Open Font License 1.1 (unity/Assets/UI/Fonts/OFL.txt). Frank Ruhl Libre, Copyright 2015 The+Frank Ruhl Libre Project Authors, SIL Open Font License 1.1 (unity/Assets/UI/Fonts/FrankRuhlLibre/OFL.txt).++The start screen quotes the Declaration of the Establishment of the State of Israel (14 May 1948): the Hebrew as+published in Iton Rishmi (Official Gazette) No. 1, and the official English translation of the Israel Ministry of Foreign+Affairs (https://www.gov.il/en/pages/declaration-of-establishment-state-of-israel). An official State publication, in the+public domain; sources in docs/sources/declaration-1948/.Builds also contain YamlDotNet, Copyright (c) Antoine Aubry and contributors, MIT (LICENSES/YamlDotNet-MIT.txt), and-the Unity runtime, used under the Unity Terms of Service.+the Unity runtime, used under the Unity Terms of Service. The Unity runtime includes the ICU data file that+UI Toolkit's advanced text generator uses (Hebrew on the start screen): Copyright (c) 2016 and later Unicode, Inc. and+others, Unicode License v3 (https://www.unicode.org/license.txt).diff --git a/THIRD-PARTY-NOTICES.md b/THIRD-PARTY-NOTICES.mdindex 5fb59eb33..dbe299f08 100644--- a/THIRD-PARTY-NOTICES.md+++ b/THIRD-PARTY-NOTICES.md@@ -18,8 +18,9 @@ required attribution texts are in [`NOTICE`](NOTICE).| Portraits (Wikimedia Commons) | `promo/ref/people/`, `unity/Assets/UI/Portraits/` | Public domain or CC0, per file | None legally; 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` || 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` |-| AI-generated concept art | `promo/final/01`–`08`, `promo/ref/*-src.jpg`, `docs/images/hero-concept-1936.jpg` | CC0 / no rights claimed (`LICENSING.md`); generator terms under owner review (D5) | Disclose as AI-generated (Steam and itch.io require it) |+| AI-generated concept art | `promo/final/01`–`08`, `promo/ref/*-src.jpg`, `docs/images/hero-concept-1936.jpg`, `promo/start-screen/*.png`, `unity/Assets/UI/StartScreen/declaration-hall.jpg` (in every build) | CC0 / no rights claimed (`LICENSING.md`); generator terms under owner review (D5) | Disclose as AI-generated (Steam and itch.io require it) |Code dependencies are fetched at build or run time under their own licences and are not vendored: NuGet packages in`sim/**/*.csproj` (YamlDotNet MIT; test-only: xUnit Apache-2.0, Microsoft.NET.Test.Sdk MIT, xunit.runner.visualstudiodiff --git a/docs/ai-disclosure.md b/docs/ai-disclosure.mdindex ffd2d5dff..3e23d6b78 100644--- a/docs/ai-disclosure.md+++ b/docs/ai-disclosure.md@@ -13,4 +13,6 @@ This is not a licence clearance or a completed store content survey. owner-verif| docs/images/hero-concept-1936.jpg | ASSETS.yaml | Web copy of promo/final/03-gameplay-1936.png (published 2026-10-10); same provenance as promo/final | owner-verify || promo/final/0[1-8]-*.png | ASSETS.yaml | ElevenLabs Image API /v1/flows/image (GPT Image 2.5, Nano Banana Pro), prompts in promo/shots.json, generated 2026-10-08/09 by promo/gen.py; text fixes by promo/patch.py | owner-verify || promo/ref/*-src.jpg | ASSETS.yaml | Earlier promo/gen.py outputs used as edit inputs for the *_fix shots in promo/shots.json (commit d42bd6b) | owner-verify |+| promo/start-screen/declaration-hall-option-*.png | ASSETS.yaml | Dreamina (dreamina.capcut.com), model GPT Image 2.5, 2026-10-12, 1536x864 as downloaded, with promo/final/03-gameplay-1936.png as the style reference; prompts in promo/start-screen/prompt-b.txt and -c.txt | owner-verify |+| unity/Assets/UI/StartScreen/declaration-hall.jpg | ASSETS.yaml | Dreamina (dreamina.capcut.com), model GPT Image 2.5, 2026-10-12, with promo/final/03-gameplay-1936.png as the style reference; the start screen's painting. Option C of promo/start-screen (prompt in promo/start-screen/prompt-c.txt), resized from 1536x864 to 1920x1080 (Lanczos) and saved as JPEG; the Dreamina AI badge is kept | owner-verify || unity/Assets/WebGLTemplates/Statecraft/favicon.ico | ASSETS.yaml | Original geometric drawing for the WebGL page's tab icon (issue #47): a gold hexagon with a cream serif I on navy, in the loading page's colours; 16, 32 and 48 px; made 2026-10-11 for PR #169 | verified |diff --git a/docs/oss/DECISIONS.md b/docs/oss/DECISIONS.mdindex f45ded0c3..31cb1d675 100644--- a/docs/oss/DECISIONS.md+++ b/docs/oss/DECISIONS.md@@ -17,6 +17,7 @@ are already public. If a check fails, the file is removed from the tip with the- [x] D5 The ElevenLabs Terms of Service for the account's plan on 2026-10-08/09, and the image models' output terms, allow public redistribution of the AI promo images and the hero. Owner verifies. Decided (owner-delegated check, 2026-10-10): allowed. The images came through ElevenLabs on its paid Pro plan (account tier `pro`; about 383k credits were already in use on 2026-10-08, beyond any free allowance), and its Terms of Service give the user all rights in Output (s. 4(c)(ii)); the free-plan non-commercial limit (s. 1(c)(i)) does not apply. OpenAI's Terms of Use assign Output to the user; Google's Gemini API terms do not claim ownership of generated content.- [x] D6 The data.gov.il terms allow redistribution of the IMS station normals (`content/map/precip_stations.json`). Owner verifies. Decided (owner-delegated check, 2026-10-10): allowed. The data.gov.il licence (https://data.gov.il/he/terms-of-use, updated 30/08/2025) grants a worldwide, royalty-free, perpetual licence to copy, distribute, publish and make derivatives, commercially or not, on condition of crediting the source; NOTICE and the file header credit IMS, dataset 481 and the URL.- [x] D7 Security and conduct contact. Decided (2026-10-11): GitHub private reporting for both security and conduct (conduct reports start the title with "Conduct:"); the profile has no public email. The owner may later add a dedicated contact, and then updates SECURITY.md, CODE_OF_CONDUCT.md and the issue-form config together.+- [ ] D-D The Dreamina terms allow the start screen painting (`unity/Assets/UI/StartScreen/declaration-hall.jpg`, in every build) and its option images (`promo/start-screen/*.png`) to be shipped and marked CC0 (`ASSETS.yaml`, issue #247, PR #255). Check on 2026-10-12 (factual, not legal advice), of the public pages only, with no login. Source: Dreamina Terms of Service, "Last updated: January 22, 2026", https://dreamina.capcut.com/clause/dreamina-terms-of-service (the site footer's link, https://www.capcut.com/clause/dreamina-terms-of-service?region=US&lang=en, serves the same text; US users fall under separate Dreamina US terms, which do not apply to the owner). (1) Ownership: s. 8 gives the user the Inputs and Outputs "as between you and us" if the user complies with the terms, and it gives ByteDance and other users a perpetual, royalty-free licence to use them. No plan tier is mentioned, and the CapCut Trust Center (https://www.capcut.com/trust/legal) says "All user-generated content you create on our platform belongs to you." (2) Commercial use: **restricted.** S. 1 reads "Our Services are generally provided for private, non-commercial use." S. 7 bars using the Services "or any content therein for any commercial or unauthorized purposes". S. 2 allows commercial use only "if permitted" under additional terms, and no such terms are public. The pricing page (https://dreamina.capcut.com/ai-tool/pricing) renders by script, so no plan's rights could be read, and the Standard plan's rights are unverified. `ASSETS.yaml` records that no free credits were left for an upscale, so which plan made the image is itself unconfirmed. Since the user owns the Output, marking it CC0 is a licence of the user's own rights, and the terms do not forbid redistribution of Outputs. (3) Watermark or attribution: the terms ask for none for Outputs; s. 6 forbids removing proprietary notices or marks the Services display, and the kept "AI" badge is consistent with that. (4) Real places and events: no specific rule; the general bans apply (publicity and privacy rights, defamation, false information meant to harm others). The painting shows no identifiable person. **Recommendation:** fine for the free, non-commercial game and the CC0 marking. Any paid release (Steam, or a paid itch page) needs written commercial-use rights for the plan used, or a replacement image from a generator whose terms allow commercial use (as in D5). Owner approval relayed by the coordinator on 2026-10-12 in the session ("I approve"). It is recorded here, but the line stays open until the owner confirms the scope; the owner can tick it by replying: "D-D decided: Dreamina output is approved for free, non-commercial distribution and CC0 marking; before any paid release I will confirm commercial rights for the plan used or replace the image."- [ ] D8 Name clearance for "Statecraft: Israel" (USPTO, EUIPO, Steam). Owner checks. Search on 2026-10-10 (factual, not legal advice): USPTO word mark STATECRAFT is live in class 9 (97497997, registered, Endstate Authentic LLC: downloadable multimedia incl. for the video game industry), pending in classes 9/41 (99035932, Metis Endeavor Advisory: podcasts), and registered in classes 35/45 (87598607, Statecraft PLLC); Steam already lists two political strategy games, "Statecraft" (2025, app 3944850) and "Statecraft: Corrupted Democracy" (2026, app 2838620). EUIPO/TMview not yet searched. Verdict: caution; needs the owner's call (keep, or get advice before any commercial release). Decided:- [x] D9 Unity edit-mode tests stay out of CI. Recommended: yes, local gate with pasted evidence. Decided (owner, 2026-10-10): yes, as recommended.- [x] D10 I know that my personal email (commit d42bd6b, `promo/fetch_portraits.py`) and the internal plans, specs and research notes in history are public and cannot be removed (owner ruling: no history rewriting); key rotation is the only remedy for a secret. Decided (owner, 2026-10-10): acknowledged.diff --git a/docs/sources/declaration-1948/en.txt b/docs/sources/declaration-1948/en.txtnew file mode 100644index 000000000..99582b79c--- /dev/null+++ b/docs/sources/declaration-1948/en.txt@@ -0,0 +1,46 @@+# Declaration of the Establishment of the State of Israel: the English translation as mirrored by the Avalon Project,+# Yale Law School: https://avalon.law.yale.edu/20th_century/israel.asp (fetched 2026-10-12; tags removed, whitespace+# collapsed, no word changed). The official translation is the Israel Ministry of Foreign Affairs' (published with the+# Hebrew in the Official Gazette No. 1, 14 May 1948): https://www.gov.il/en/pages/declaration-of-establishment-state-of-israel+# (read in a browser 2026-10-12; the site refuses scripted requests). Avalon's wording differs from the MFA page in places+# the start screen does not quote (e.g. "remained faithful" for "kept faith", "THE ALMIGHTY" for the "ROCK OF ISRAEL",+# US spelling). The two lines the start screen quotes are word for word the same on both pages, except that the MFA page+# prints "(14TH MAY,1948)" without the space.++ERETZ-ISRAEL [(Hebrew) - The Land of Israel] was the birthplace of the Jewish people. Here their spiritual, religious and political identity was shaped. Here they first attained to statehood, created cultural values of national and universal significance and gave to the world the eternal Book of Books.++After being forcibly exiled from their land, the people remained faithful to it throughout their Dispersion and never ceased to pray and hope for their return to it and for the restoration in it of their political freedom.++Impelled by this historic and traditional attachment, Jews strove in every successive generation to re-establish themselves in their ancient homeland. In recent decades they returned in their masses. Pioneers, ma'pilim [(Hebrew) - immigrants coming to Eretz-Israel in defiance of restrictive legislation] and defenders, they made deserts bloom, revived the Hebrew language, built villages and towns, and created a thriving community controlling its own economy and culture, loving peace but knowing how to defend itself, bringing the blessings of progress to all the country's inhabitants, and aspiring towards independent nationhood.++In the year 5657 (1897), at the summons of the spiritual father of the Jewish State, Theodore Herzl, the First Zionist Congress convened and proclaimed the right of the Jewish people to national rebirth in its own country.++This right was recognized in the Balfour Declaration of the 2nd November, 1917, and re-affirmed in the Mandate of the League of Nations which, in particular, gave international sanction to the historic connection between the Jewish people and Eretz-Israel and to the right of the Jewish people to rebuild its National Home.++The catastrophe which recently befell the Jewish people - the massacre of millions of Jews in Europe - was another clear demonstration of the urgency of solving the problem of its homelessness by re-establishing in Eretz-Israel the Jewish State, which would open the gates of the homeland wide to every Jew and confer upon the Jewish people the status of a fully privileged member of the comity of nations.++Survivors of the Nazi holocaust in Europe, as well as Jews from other parts of the world, continued to migrate to Eretz-Israel, undaunted by difficulties, restrictions and dangers, and never ceased to assert their right to a life of dignity, freedom and honest toil in their national homeland.++In the Second World War, the Jewish community of this country contributed its full share to the struggle of the freedom- and peace-loving nations against the forces of Nazi wickedness and, by the blood of its soldiers and its war effort, gained the right to be reckoned among the peoples who founded the United Nations.++On the 29th November, 1947, the United Nations General Assembly passed a resolution calling for the establishment of a Jewish State in Eretz-Israel; the General Assembly required the inhabitants of Eretz-Israel to take such steps as were necessary on their part for the implementation of that resolution. This recognition by the United Nations of the right of the Jewish people to establish their State is irrevocable.++This right is the natural right of the Jewish people to be masters of their own fate, like all other nations, in their own sovereign State.++ACCORDINGLY WE, MEMBERS OF THE PEOPLE'S COUNCIL, REPRESENTATIVES OF THE JEWISH COMMUNITY OF ERETZ-ISRAEL AND OF THE ZIONIST MOVEMENT, ARE HERE ASSEMBLED ON THE DAY OF THE TERMINATION OF THE BRITISH MANDATE OVER ERETZ-ISRAEL AND, BY VIRTUE OF OUR NATURAL AND HISTORIC RIGHT AND ON THE STRENGTH OF THE RESOLUTION OF THE UNITED NATIONS GENERAL ASSEMBLY, HEREBY DECLARE THE ESTABLISHMENT OF A JEWISH STATE IN ERETZ-ISRAEL, TO BE KNOWN AS THE STATE OF ISRAEL.++WE DECLARE that, with effect from the moment of the termination of the Mandate being tonight, the eve of Sabbath, the 6th Iyar, 5708 (15th May, 1948), until the establishment of the elected, regular authorities of the State in accordance with the Constitution which shall be adopted by the Elected Constituent Assembly not later than the 1st October 1948, the People's Council shall act as a Provisional Council of State, and its executive organ, the People's Administration, shall be the Provisional Government of the Jewish State, to be called "Israel".++THE STATE OF ISRAEL will be open for Jewish immigration and for the Ingathering of the Exiles; it will foster the development of the country for the benefit of all its inhabitants; it will be based on freedom, justice and peace as envisaged by the prophets of Israel; it will ensure complete equality of social and political rights to all its inhabitants irrespective of religion, race or sex; it will guarantee freedom of religion, conscience, language, education and culture; it will safeguard the Holy Places of all religions; and it will be faithful to the principles of the Charter of the United Nations.++THE STATE OF ISRAEL is prepared to cooperate with the agencies and representatives of the United Nations in implementing the resolution of the General Assembly of the 29th November, 1947, and will take steps to bring about the economic union of the whole of Eretz-Israel.++WE APPEAL to the United Nations to assist the Jewish people in the building-up of its State and to receive the State of Israel into the comity of nations.++WE APPEAL - in the very midst of the onslaught launched against us now for months - to the Arab inhabitants of the State of Israel to preserve peace and participate in the upbuilding of the State on the basis of full and equal citizenship and due representation in all its provisional and permanent institutions.++WE EXTEND our hand to all neighboring states and their peoples in an offer of peace and good neighborliness, and appeal to them to establish bonds of cooperation and mutual help with the sovereign Jewish people settled in its own land. The State of Israel is prepared to do its share in a common effort for the advancement of the entire Middle East.++WE APPEAL to the Jewish people throughout the Diaspora to rally round the Jews of Eretz-Israel in the tasks of immigration and upbuilding and to stand by them in the great struggle for the realization of the age-old dream - the redemption of Israel.++PLACING OUR TRUST IN THE ALMIGHTY, WE AFFIX OUR SIGNATURES TO THIS PROCLAMATION AT THIS SESSION OF THE PROVISIONAL COUNCIL OF STATE, ON THE SOIL OF THE HOMELAND, IN THE CITY OF TEL-AVIV, ON THIS SABBATH EVE, THE 5TH DAY OF IYAR, 5708 (14TH MAY, 1948).diff --git a/docs/sources/declaration-1948/he.txt b/docs/sources/declaration-1948/he.txtnew file mode 100644index 000000000..d6eed7f32--- /dev/null+++ b/docs/sources/declaration-1948/he.txt@@ -0,0 +1,48 @@+# Declaration of the Establishment of the State of Israel: the official Hebrew text as published in Iton Rishmi+# (Official Gazette) No. 1, 5 Iyar 5708 (14 May 1948). Transcribed from Hebrew Wikisource, wiki markup removed by a+# script (layout and link templates, bold and letter-spacing only; no word changed):+# https://he.wikisource.org/wiki/הכרזה_על_הקמת_מדינת_ישראל (fetched 2026-10-12)+# Public domain: an official 1948 State publication (ASSETS.yaml). The start screen quotes from it+# verbatim; StartScreenTests checks every quoted line against this file.++בארץ־ישראל קם העם היהודי, בה עוצבה דמותו הרוחנית, הדתית והמדינית, בה חי חיי קוממיות ממלכתית, בה יצר נכסי תרבות לאומיים וכלל־אנושיים והוריש לעולם כולו את ספר הספרים הנצחי.++לאחר שהוגלה העם מארצו בכוח הזרוע שמר לה אמונים בכל ארצות פזוריו, ולא חדל מתפלה ומתקוה לשוב לארצו ולחדש בתוכה את חירותו המדינית.++מתוך קשר היסטורי ומסורתי זה חתרו היהודים בכל דור לשוב ולהאחז במולדתם העתיקה; ובדורות האחרונים שבו לארצם בהמונים, וחלוצים, מעפילים ומגינים הפריחו נשמות, החיו שפתם העברית, בנו כפרים וערים, והקימו ישוב גדל והולך השליט על משקו ותרבותו, שוחר שלום ומגן על עצמו, מביא ברכת הקידמה לכל תושבי הארץ ונושא נפשו לעצמאות ממלכתית.++בשנת תרנ״ז (1897) נתכנס הקונגרס הציוני לקול קריאתו של הוגה חזון המדינה היהודית תיאודור הרצל והכריז על זכות העם היהודי לתקומה לאומית בארצו.++זכות זו הוכרה בהצהרת בלפור מיום ב׳ בנובמבר 1917 ואושרה במנדט מטעם חבר הלאומים, אשר נתן במיוחד תוקף בין־לאומי לקשר ההיסטורי שבין העם היהודי לבין ארץ־ישראל ולזכות העם היהודי להקים מחדש את ביתו הלאומי.++השואה שנתחוללה על עם ישראל בזמן האחרון, בה הוכרעו לטבח מיליונים יהודים באירופה, הוכיחה מחדש בעליל את ההכרח בפתרון בעית העם היהודי מחוסר המולדת והעצמאות על ידי חידוש המדינה היהודית בארץ־ישראל, אשר תפתח לרווחה את שערי המולדת לכל יהודי ותעניק לעם היהודי מעמד של אומה שוות־זכויות בתוך משפחת העמים.++שארית הפליטה שניצלה מהטבח הנאצי האיום באירופה ויהודי ארצות אחרות לא חדלו להעפיל לארץ־ישראל, על אף כל קושי, מניעה וסכנה, ולא פסקו לתבוע את זכותם לחיי כבוד, חירות ועמל־ישרים במולדת עמם.++במלחמת העולם השניה תרם הישוב העברי בארץ את מלוא־חלקו למאבק האומות השוחרות חירות ושלום נגד כוחות הרשע הנאצי, ובדם חייליו ובמאמצו המלחמתי קנה לו את הזכות להמנות עם העמים מייסדי ברית האומות המאוחדות.++ב־29 בנובמבר 1947 קיבלה עצרת האומות המאוחדות החלטה המחייבת הקמת מדינה יהודית בארץ־ישראל; העצרת תבעה מאת תושבי ארץ־ישראל לאחוז בעצמם בכל הצעדים הנדרשים מצדם הם לביצוע ההחלטה. הכרה זו של האומות המאוחדות בזכות העם היהודי להקים את מדינתו אינה ניתנת להפקעה.++זוהי זכותו הטבעית של העם היהודי להיות ככל עם ועם עומד ברשות עצמו במדינתו הריבונית.++לפיכך נתכנסנו, אנו חברי מועצת העם, נציגי הישוב העברי והתנועה הציונית, ביום סיום המנדט הבריטי על ארץ־ישראל, ובתוקף זכותנו הטבעית וההיסטורית ועל יסוד החלטת עצרת האומות המאוחדות אנו מכריזים בזאת על הקמת מדינה יהודית בארץ־ישראל, היא מדינת ישראל.++אנו קובעים שהחל מרגע סיום המנדט, הלילה, אור ליום שבת ו׳ אייר תש״ח, 15 במאי 1948, ועד להקמת השלטונות הנבחרים והסדירים של המדינה בהתאם לחוקה שתיקבע על־ידי האספה המכוננת הנבחרת לא יאוחר מ־1 באוקטובר 1948 – תפעל מועצת העם כמועצת מדינה זמנית, ומוסד הביצוע שלה, מנהלת־העם, יהווה את הממשלה הזמנית של המדינה היהודית, אשר תיקרא בשם ישראל.++מדינת ישראל תהא פתוחה לעליה יהודית ולקיבוץ גלויות; תשקוד על פיתוח הארץ לטובת כל תושביה; תהא מושתתה על יסודות החירות, הצדק והשלום לאור חזונם של נביאי ישראל; תקיים שויון זכויות חברתי ומדיני גמור לכל אזרחיה בלי הבדל דת, גזע ומין; תבטיח חופש דת, מצפון, לשון, חינוך ותרבות; תשמור על המקומות הקדושים של כל הדתות; ותהיה נאמנה לעקרונותיה של מגילת האומות המאוחדות.++מדינת ישראל תהא מוכנה לשתף פעולה עם המוסדות והנציגים של האומות המאוחדות בהגשמת החלטת העצרת מיום 29 בנובמבר 1947 ותפעל להקמת האחדות הכלכלית של ארץ־ישראל בשלמותה.++אנו קוראים לאומות המאוחדות לתת יד לעם היהודי בבנין מדינתו ולקבל את מדינת ישראל לתוך משפחת העמים.++אנו קוראים – גם בתוך התקפת־הדמים הנערכת עלינו זה חדשים – לבני העם הערבי תושבי מדינת ישראל לשמור על השלום וליטול חלקם בבנין המדינה על יסוד אזרחות מלאה ושווה ועל יסוד נציגות מתאימה בכל מוסדותיה, הזמניים והקבועים.++אנו מושיטים יד שלום ושכנות טובה לכל המדינות השכנות ועמיהן, וקוראים להם לשיתוף פעולה ועזרה הדדית עם העם העברי העצמאי בארצו. מדינת ישראל מוכנה לתרום חלקה במאמץ משותף לקידמת המזרח התיכון כולו.++אנו קוראים אל העם היהודי בכל התפוצות להתלכד סביב הישוב בעליה ובבנין ולעמוד לימינו במערכה הגדולה על הגשמת שאיפת הדורות לגאולת ישראל.++מתוך בטחון בצור ישראל הננו חותמים בחתימת ידינו לעדות על הכרזה זו, במושב מועצת המדינה הזמנית, על אדמת המולדת, בעיר תל־אביב, היום הזה, ערב שבת, ה׳ אייר תש״ח, 14 במאי 1948.++דוד בן־גוריון++דניאל אוסטר, מרדכי בנטוב, יצחק בן־צבי, אליהו ברלין, פריץ ברנשטיין, הרב וולף גולד, מאיר גרבובסקי, יצחק גרינבוים, ד״ר אברהם גרנובסקי, אליהו דובקין, מאיר וילנר–קובנר, זרח ורהפטיג, הרצל ורדי, רחל כהן, הרב קלמן כהנא, סעדיה כובאשי, הרב יצחק מאיר לוין, מאיר דוד לוינשטיין, צבי לוריא, גולדה מאירסון, נחום ניר, צבי סגל, הרב יהודה ליב הכהן פישמן, דוד צבי פנקס, אהרן ציזלינג, משה קולודני, אליעזר קפלן, אברהם קצנלסון, פליכס רוזנבליט, דוד רמז, ברל רפטור, מרדכי שטנר, בן־ציון שטרנברג, בכור שיטרית, משה שפירא, משה שרתוק.diff --git a/promo/start-screen/declaration-hall-option-b.png b/promo/start-screen/declaration-hall-option-b.pngnew file mode 100644index 000000000..c0cbad551Binary files /dev/null and b/promo/start-screen/declaration-hall-option-b.png differdiff --git a/promo/start-screen/declaration-hall-option-c.png b/promo/start-screen/declaration-hall-option-c.pngnew file mode 100644index 000000000..4be9c93baBinary files /dev/null and b/promo/start-screen/declaration-hall-option-c.png differdiff --git a/promo/start-screen/prompt-b.txt b/promo/start-screen/prompt-b.txtnew file mode 100644index 000000000..fb2645160--- /dev/null+++ b/promo/start-screen/prompt-b.txt@@ -0,0 +1 @@+Use the reference image only for its art style: a golden-hour miniature diorama with tilt-shift depth of field, warm sunlit ochre and cream palette, painterly, highly detailed scale-model look. Do not copy its map, buildings or interface. Scene: the hall of the Tel Aviv Museum on the afternoon of 14 May 1948, seen from high in the side aisle at a three-quarter angle, looking across the hall toward the front wall. Rows of seated audience in dark 1940s suits and hats, small and anonymous, seen from the side and behind, faces turned away or lost in soft focus. At the front, a long table covered in white cloth with a row of tiny figures, too small and blurred for any face to be seen. On the front wall, two tall vertical blue-and-white flags with the Star of David, and between them a large gilded frame holding only a soft, abstract, unreadable blur of warm colour, no person in it. Tall windows along the side wall throw long beams of late-afternoon sunlight across the hall, light dust in the air, cream walls, wooden floor. Keep the table and flags near the centre of the frame and leave the lower part of the image simple and darker. Calm, solemn, historic mood. No text, no letters, no logos, no interface, no recognizable people, no visible faces.diff --git a/promo/start-screen/prompt-c.txt b/promo/start-screen/prompt-c.txtnew file mode 100644index 000000000..88abd1988--- /dev/null+++ b/promo/start-screen/prompt-c.txt@@ -0,0 +1 @@+Use the reference image only for its art style: a golden-hour miniature diorama with tilt-shift depth of field, warm sunlit ochre and cream palette, painterly, highly detailed scale-model look. Do not copy its map, buildings or interface. Scene: the hall of the Tel Aviv Museum on the afternoon of 14 May 1948, seen from above and behind the last rows, looking down the central aisle to the front of a modest 1940s hall. The audience in dark 1940s suits and hats fills the lower half of the image, seen only from behind as dark, soft, anonymous shapes. Far away at the front, a long white-clothed table on a low stage with a row of tiny figures, too small and soft-focus for any face to be seen. On the front wall, two tall vertical blue-and-white flags with the Star of David, and between them a plain dark wooden frame holding only an abstract soft blur of warm brown tones, no person in it. Late-afternoon sunlight falls in long diagonal beams from high windows, light dust in the air, cream walls. The table and flags sit in the centre of the upper half of the frame. Calm, solemn, historic mood. No text, no letters, no logos, no interface, no recognizable people, no visible faces.diff --git a/unity/Assets/Editor/UiAssets.cs b/unity/Assets/Editor/UiAssets.csindex 57eb8464f..71617e293 100644--- a/unity/Assets/Editor/UiAssets.cs+++ b/unity/Assets/Editor/UiAssets.cs@@ -6,11 +6,15 @@ using UnityEngine.UIElements;namespace Statecraft.Game.EditorTools{/// <summary>Creates the UI Toolkit PanelSettings asset (tech notes 1.3): scale with screen size against 1920x1080,- /// matching width and height equally, with the default runtime theme. An asset, not a runtime instance, so its theme- /// and shader references are included in player builds (the M0 Shader.Find lesson). Idempotent.+ /// matching width and height equally, with the default runtime theme and the ICU data of the advanced text generator.+ /// An asset, not a runtime instance, so its theme, shader and ICU references are included in player builds (the M0+ /// Shader.Find lesson). Idempotent./// Run headless: Unity -batchmode -CI false -GITHUB_ACTIONS false -TF_BUILD false -quit -projectPath unity -executeMethod Statecraft.Game.EditorTools.UiAssets.Create</summary>public static class UiAssets{+ /// <summary>The ICU data Unity ships for the advanced text generator (a built-in extra resource, about 380 KB).</summary>+ public const string IcuData = "icudt73l.bytes";+public static void Create(){var theme = AssetDatabase.LoadAssetAtPath<ThemeStyleSheet>(UiPaths.Theme);@@ -22,6 +26,14 @@ namespace Statecraft.Game.EditorToolsps.referenceResolution = new Vector2Int(1920, 1080);ps.screenMatchMode = PanelScreenMatchMode.MatchWidthOrHeight;ps.match = 0.5f;+ // The advanced text generator (right-to-left Hebrew on the start screen; #193) reads ICU data from the panel+ // settings. With UI Toolkit's "Enable Advanced Text" on (ProjectSettings/UIToolkitProjectSettings.asset) the+ // editor assigns it on load; it is saved here so the asset, and so the player build, always carries it.+ var so = new SerializedObject(ps);+ var icu = so.FindProperty("m_ICUDataAsset");+ if (icu == null) throw new System.InvalidOperationException("PanelSettings has no m_ICUDataAsset (Unity version change?)");+ icu.objectReferenceValue = AssetDatabase.GetBuiltinExtraResource<TextAsset>(IcuData);+ so.ApplyModifiedPropertiesWithoutUndo();EditorUtility.SetDirty(ps);AssetDatabase.SaveAssets();}diff --git a/unity/Assets/Scripts/UI/GameRoot.cs b/unity/Assets/Scripts/UI/GameRoot.csindex d8529cb92..44cbd435e 100644--- a/unity/Assets/Scripts/UI/GameRoot.cs+++ b/unity/Assets/Scripts/UI/GameRoot.cs@@ -19,7 +19,8 @@ namespace Statecraft.Game.UI/// the minimap to the camera, and State.Placements to the placement layer. Disabling it disposes all of that./// With "smoke" in the page URL (WebGL, e.g. ?smoke=5) or -smoke N (desktop) it starts a fresh game with the golden/// seed (the player's autosave is neither read nor written), plays N turns through the UI's own buttons and logs- /// "SMOKE OK ..." (or "SMOKE FAIL ...").+ /// "SMOKE OK ..." (or "SMOKE FAIL ..."). In a player, unless an automated run skips it (StartScreenPresenter.Skipped),+ /// the start screen shows over the started game before its first turn, with the camera keys stopped until it closes./// ExecuteAlways only so that disabling it disposes the presenters in edit mode too (tests); GameBoot raises Ready/// in play mode and players only.</summary>[ExecuteAlways]@@ -45,6 +46,7 @@ namespace Statecraft.Game.UIinternal Statecraft.Game.Map.Units.UnitLayer? Units => units;MapLabelsPresenter? labels;ScreenNav? nav;+ StartScreenPresenter? start;CameraRig? rig;List<(string, int, int, DateTime)>? drawn;@@ -108,11 +110,13 @@ namespace Statecraft.Game.UIpublic static int SmokeTurns() =>SmokeTurns(Application.absoluteURL, Environment.GetCommandLineArgs(), Application.platform == RuntimePlatform.WebGLPlayer);- /// <summary>GameBoot.Ready: starts the game, smoke-testing when the URL or command line asks.</summary>- public void Begin(GameInputs inputs) => Begin(inputs, SmokeTurns());+ /// <summary>GameBoot.Ready: starts the game, smoke-testing when the URL or command line asks, with the start screen+ /// unless an automated run skips it.</summary>+ public void Begin(GameInputs inputs) => Begin(inputs, SmokeTurns(), Application.isPlaying && !StartScreenPresenter.Skipped());- /// <summary>Starts (or restarts) the game over the built map. <paramref name="smoke"/> > 0 plays that many turns.</summary>- internal void Begin(GameInputs inputs, int smoke)+ /// <summary>Starts (or restarts) the game over the built map. <paramref name="smoke"/> > 0 plays that many turns;+ /// <paramref name="startScreen"/> shows the start screen first (never in a smoke run, which has no New Game).</summary>+ internal void Begin(GameInputs inputs, int smoke, bool startScreen = false){if (inputs == null) throw new ArgumentNullException(nameof(inputs));foreach (var (value, field) in new (UnityEngine.Object?, string)[] { (document, nameof(document)), (strings, nameof(strings)),@@ -125,9 +129,10 @@ namespace Statecraft.Game.UIvar store = Store ?? SaveStore.ForPlatform();var notes = new List<string>();// A smoke run is reproducible: a fresh game with the golden seed, never the player's autosave.+ bool resumed;var session = smoke > 0- ? GameStart.Begin(inputs.Content, store, () => GoldenRun.Seed, notes, text, fresh: true)- : GameStart.Begin(inputs.Content, store, GameStart.NewSeed, notes, text);+ ? GameStart.Begin(inputs.Content, store, () => GoldenRun.Seed, notes, text, out resumed, fresh: true)+ : GameStart.Begin(inputs.Content, store, GameStart.NewSeed, notes, text, out resumed);DiagLog.BootPhase($"session started (turn {session.State.Turn}, replayed)");var bridge = Bridge = new SimBridge(session, text);var root = document.rootVisualElement;@@ -181,9 +186,10 @@ namespace Statecraft.Game.UI// A smoke session never touches the player's save: no autosave, and no New Game (which deletes the autosave).// Leaving New Game out is safer than handing it a throwaway store: no file is ever deleted, no path has to be// right on every platform, and the scripted run never presses it.+ NewGamePresenter? newGame = null;if (smoke == 0){- Own(new NewGamePresenter(root, bridge, store, toast, text, GameStart.NewSeed));+ newGame = Own(new NewGamePresenter(root, bridge, store, toast, text, GameStart.NewSeed));Own(GameStart.Autosave(bridge, store, text, toast.Append)); // appends: the turn's refusals stay visible}@@ -227,6 +233,14 @@ namespace Statecraft.Game.UIdrawn = null;RenderPlacementsIfChanged();SyncMinimap();+ // The start screen goes up in the same frame the loading state ends, so the HUD never flashes before it. While it+ // shows, the camera keys are off (keyboard pan would otherwise move the hidden map; plan amendment A4).+ if (startScreen && newGame != null)+ {+ var cam = cameraController;+ start = Own(new StartScreenPresenter(root, newGame, resumed, shown => { if (cam != null) cam.enabled = !shown; }));+ start.Show();+ }root.Q("root")?.RemoveFromClassList("loading"); // ready: the bar, panels and screens may show (P2-1)DiagLog.BootPhase("screens ready");@@ -277,7 +291,7 @@ namespace Statecraft.Game.UIStopAllCoroutines();for (int i = owned.Count - 1; i >= 0; i--) owned[i].Dispose();owned.Clear();- minimap = null; labels = null; nav = null; rig = null; drawn = null; units = null; logCamera = false;+ minimap = null; labels = null; nav = null; start = null; rig = null; drawn = null; units = null; logCamera = false;// A ?profile run cut short (a stopped coroutine never reaches its restore line) must not leave the terrain at the// profile's pixel error (Task 24 review M1). Nothing else changes it, so restoring is always right.if (map != null && map.Terrain != null) map.Terrain.heightmapPixelError = MapBuilder.TerrainPixelError;@@ -320,8 +334,9 @@ namespace Statecraft.Game.UIvoid Update(){// Escape closes the open screen even when no element has the keyboard focus (ScreenNav also takes the UI- // Cancel event from a focused element; closing twice is harmless).- if (UnityEngine.InputSystem.Keyboard.current?.escapeKey.wasPressedThisFrame == true) nav?.Close();+ // Cancel event from a focused element; closing twice is harmless). On the start screen it withdraws an open New+ // Game request (StartScreenPresenter.Escape; idempotent too).+ if (UnityEngine.InputSystem.Keyboard.current?.escapeKey.wasPressedThisFrame == true) { start?.Escape(); nav?.Close(); }SyncMinimap();if (!logCamera || rig == null || (rig.Distance == loggedDistance && rig.Yaw == loggedYaw)) return;loggedDistance = rig.Distance; loggedYaw = rig.Yaw;diff --git a/unity/Assets/Scripts/UI/GameStart.cs b/unity/Assets/Scripts/UI/GameStart.csindex b70eea0a5..4d6927919 100644--- a/unity/Assets/Scripts/UI/GameStart.cs+++ b/unity/Assets/Scripts/UI/GameStart.cs@@ -14,8 +14,16 @@ namespace Statecraft.Game.UI{public static ulong NewSeed() => (ulong)DateTime.UtcNow.Ticks;- public static GameSession Begin(Content c, SaveStore store, Func<ulong> newSeed, List<string> notes, UiText text, bool fresh = false)+ public static GameSession Begin(Content c, SaveStore store, Func<ulong> newSeed, List<string> notes, UiText text, bool fresh = false) =>+ Begin(c, store, newSeed, notes, text, out _, fresh);++ /// <summary>Begin, also saying whether the session continues the autosave (<paramref name="resumed"/>): false for a+ /// new game, whether there was no save, the save was set aside, or <paramref name="fresh"/> ignored it. The start+ /// screen offers Continue only when it is true.</summary>+ public static GameSession Begin(Content c, SaveStore store, Func<ulong> newSeed, List<string> notes, UiText text, out bool resumed,+ bool fresh = false){+ resumed = false;if (!fresh){try@@ -24,6 +32,7 @@ namespace Statecraft.Game.UIif (saved == null) return GameSession.New(c, newSeed(), Mode.Historical);var loaded = GameSession.Load(c, saved, out var warnings);notes.AddRange(warnings);+ resumed = true;return loaded;}catch (Exception e) // any failure (a bad save, a replay that throws): never block the startdiff --git a/unity/Assets/Scripts/UI/NewGamePresenter.cs b/unity/Assets/Scripts/UI/NewGamePresenter.csindex b9da72311..a90f327eb 100644--- a/unity/Assets/Scripts/UI/NewGamePresenter.cs+++ b/unity/Assets/Scripts/UI/NewGamePresenter.cs@@ -6,7 +6,8 @@ using UnityEngine.UIElements;namespace Statecraft.Game.UI{/// <summary>New Game asks for a second press (no browser confirm dialogs in WebGL), then deletes the autosave and- /// starts a new Historical game. Ending a turn in between cancels the request.</summary>+ /// starts a new Historical game. Ending a turn in between cancels the request. The start screen's New Game goes through+ /// the same two presses (Press), so neither button can wipe the save with one stray press (#175, B6).</summary>public sealed class NewGamePresenter : IDisposable{readonly VisualElement root; readonly SimBridge bridge; readonly SaveStore store; readonly ToastPresenter toast; readonly UiText text; readonly Func<ulong> seed;@@ -29,7 +30,20 @@ namespace Statecraft.Game.UIpublic bool Armed { get; private set; }- void Press()+ /// <summary>Raised after the second press has started the new game.</summary>+ public event Action? Started;++ /// <summary>Withdraws an open request (the start screen's Continue and Escape): disarms and takes the prompt off the+ /// toast. Nothing happens when no request is open.</summary>+ public void Cancel()+ {+ if (!Armed) return;+ Armed = false;+ toast.Clear();+ }++ /// <summary>One press of New Game: the first arms and shows the prompt, the second starts the new game.</summary>+ public void Press(){if (!Armed) { Armed = true; toast.Show(text["newgame.confirm"]); return; }Armed = false;@@ -38,6 +52,7 @@ namespace Statecraft.Game.UItry { store.DeleteAutosave(); } catch (Exception e) { deleted = false; UnityEngine.Debug.LogWarning("Autosave could not be deleted: " + e); }bridge.Replace(GameSession.New(bridge.Content, seed(), Mode.Historical));if (deleted) toast.Clear(); else toast.Show(text["newgame.delete_failed"]);+ Started?.Invoke();}}}diff --git a/unity/Assets/Scripts/UI/StartScreenPresenter.cs b/unity/Assets/Scripts/UI/StartScreenPresenter.csnew file mode 100644index 000000000..9ec4b5026--- /dev/null+++ b/unity/Assets/Scripts/UI/StartScreenPresenter.cs@@ -0,0 +1,175 @@+#nullable enable+using System;+using System.Linq;+using Statecraft.Game.Boot;+using UnityEngine;+using UnityEngine.UIElements;++namespace Statecraft.Game.UI+{+ /// <summary>The start screen: a painting of the 14 May 1948 ceremony in the Tel Aviv Museum hall, two lines of the+ /// Declaration of Independence in the official Hebrew with the official English under each (the lines live in+ /// Game.uxml; StartScreenTests checks them against docs/sources/declaration-1948), and Continue / New Game. GameRoot+ /// shows it over the started game before the first turn; automated runs skip it (Skipped).+ /// Continue shows only when the session continues the autosave (GameStart.Begin's resumed) and simply closes the screen:+ /// that session is the save, already replayed. New Game with no save closes it too (the session is already a new game);+ /// with a save it goes through NewGamePresenter's two presses, the same flow as the top bar's New Game, so one stray+ /// 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 painting's AI badge (its top-left corner)+ /// shows at every window shape (Fit).</summary>+ public sealed class StartScreenPresenter : IDisposable+ {+ /// <summary>On the "root" element while the start screen shows.</summary>+ public const string OpenClass = "start-open";+ /// <summary>On the start screen when the painting is a full-width band with the panel under it (Fit).</summary>+ public const string BandClass = "start-band";+ /// <summary>The painting's width over its height (Assets/UI/StartScreen/declaration-hall.jpg, 1920x1080).</summary>+ public const float ArtAspect = 16f / 9f;+ /// <summary>The URL flag (WebGL) or command-line flag (desktop, "-nostart") that skips the screen by hand.</summary>+ public const string NoStartFlag = "nostart";+ /// <summary>The HUD regions under the screen: hidden by the stylesheet and disabled while it shows, so no key reaches+ /// them (a hidden button can still report that it takes focus until the next layout pass).</summary>+ public static readonly string[] Hud = { "top-bar", "right-column", "info-panel" };++ /// <summary>Whether the screen is skipped: the automated runs (the golden check, the smoke run, the shot, frame and+ /// pixel-error profiles, the unit showcase and the border proof, all of which drive or measure the map straight away),+ /// or "nostart" asked for by hand. Flags follow each instrument's own rule: a whole URL query parameter on WebGL+ /// (UrlFlags.Has), a command-line flag on desktop.</summary>+ public static bool Skipped(string? url, string[] args, bool webgl)+ {+ if (GameRoot.SmokeTurns(url, args, webgl) > 0) return true;+ var flags = new[] { NoStartFlag, "golden", "shot", "vprofile", "profile", "units", Statecraft.Game.Map.BorderProof.Flag };+ return webgl ? flags.Any(f => UrlFlags.Has(url, f)) : flags.Any(f => args.Contains("-" + f));+ }++ public static bool Skipped() =>+ Skipped(Application.absoluteURL, Environment.GetCommandLineArgs(), Application.platform == RuntimePlatform.WebGLPlayer);++ readonly VisualElement hudRoot, screen, art, body, panel;+ readonly Button continueButton, newGameButton;+ readonly NewGamePresenter newGame;+ readonly Action<bool>? shownChanged;+ readonly EventCallback<NavigationCancelEvent> onCancel;+ readonly EventCallback<GeometryChangedEvent> onGeometry;+ readonly Action onContinue, onNewGame, onStarted;++ /// <summary>Continue is offered: the session continues the autosave.</summary>+ public bool Resumed { get; private set; }++ public StartScreenPresenter(VisualElement root, NewGamePresenter newGame, bool resumed, Action<bool>? shownChanged = null)+ {+ this.newGame = newGame; this.shownChanged = shownChanged; Resumed = resumed;+ hudRoot = root.Q("root") ?? root;+ screen = root.Q<VisualElement>("start-screen");+ art = screen.Q<VisualElement>("start-art");+ body = screen.Q<VisualElement>("start-body");+ panel = screen.Q<VisualElement>("start-panel");+ continueButton = screen.Q<Button>("start-continue");+ newGameButton = screen.Q<Button>("start-new-game");+ onContinue = Continue; onNewGame = NewGame; onStarted = Started;+ continueButton.clicked += onContinue;+ newGameButton.clicked += onNewGame;+ newGame.Started += onStarted;+ // Escape (the UI's Cancel) from a focused start button withdraws an open New Game request. GameRoot also polls+ // the Escape key for when no element has the focus (Escape); doing it twice is harmless.+ onCancel = e => { if (Escape()) e.StopPropagation(); };+ screen.RegisterCallback(onCancel);+ onGeometry = _ => Fit();+ screen.RegisterCallback(onGeometry);+ panel.RegisterCallback(onGeometry); // the panel's height decides where it goes+ }++ public bool IsOpen => hudRoot.ClassListContains(OpenClass);++ /// <summary>Shows the screen with Continue only when there is a save to continue, and puts the keyboard focus on the+ /// first button.</summary>+ public void Show()+ {+ continueButton.style.display = Resumed ? DisplayStyle.Flex : DisplayStyle.None;+ hudRoot.AddToClassList(OpenClass);+ foreach (var name in Hud) hudRoot.Q(name)?.SetEnabled(false);+ Fit();+ // Focus once the styles have resolved (a button still hidden by the stylesheet cannot take it).+ var first = Resumed ? continueButton : newGameButton;+ first.Focus();+ screen.schedule.Execute(() => { if (IsOpen && first.focusController?.focusedElement == null) first.Focus(); });+ DiagLog.BootPhase("start screen shown");+ shownChanged?.Invoke(true);+ }++ /// <summary>Hides the screen; the game is on the map. Safe to call when it is not open.</summary>+ public void Close()+ {+ if (!IsOpen) return;+ hudRoot.RemoveFromClassList(OpenClass);+ foreach (var name in Hud) hudRoot.Q(name)?.SetEnabled(true);+ var focused = screen.focusController?.focusedElement as VisualElement;+ if (focused != null && screen.Contains(focused)) focused.Blur();+ shownChanged?.Invoke(false);+ }++ /// <summary>Escape on the screen: withdraws an open New Game request. True when it did.</summary>+ public bool Escape()+ {+ if (!IsOpen || !newGame.Armed) return false;+ newGame.Cancel();+ return true;+ }++ void Continue()+ {+ if (!IsOpen || !Resumed) return;+ newGame.Cancel();+ Close();+ }++ void NewGame()+ {+ if (!IsOpen) return;+ if (!Resumed) { Close(); return; } // nothing to wipe: the session is already a new game+ newGame.Press(); // arms on the first press; the second starts the new game (Started closes)+ }++ void Started()+ {+ Resumed = false; // the save is gone (or will be replaced): nothing to continue any more+ Close();+ }++ /// <summary>Lays the painting out for the window. At 16:9 and wider it fills the window (cover, cropped at the+ /// bottom) with the panel at the foot over the audience. In a narrower window that is tall enough for the painting's+ /// full-width 16:9 band and the panel under it (a phone held upright, a square window), the band and the panel are+ /// stacked and centred together (BandClass), so nothing of the painting is cropped. Otherwise (16:10, 4:3) it fills+ /// the window anchored at its top-left corner, so only its right-hand side is cropped and the AI badge stays.</summary>+ void Fit()+ {+ var size = screen.layout.size;+ if (float.IsNaN(size.x) || size.x <= 0 || size.y <= 0) return;+ var bandHeight = size.x / ArtAspect;+ var panelHeight = panel.layout.height;+ var band = size.x / size.y < ArtAspect - 0.001f && !float.IsNaN(panelHeight) && panelHeight > 0+ && bandHeight + panelHeight + BodyPadding <= size.y;+ screen.EnableInClassList(BandClass, band);+ var top = band ? Mathf.Floor((size.y - bandHeight - panelHeight - BodyPadding) / 2f) : 0f;+ art.style.top = band ? top : new StyleLength(StyleKeyword.Null);+ art.style.height = band ? bandHeight : new StyleLength(StyleKeyword.Null);+ body.style.top = band ? top + bandHeight : new StyleLength(StyleKeyword.Null);+ body.style.justifyContent = band ? Justify.FlexStart : new StyleEnum<Justify>(StyleKeyword.Null);+ }++ /// <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;++ public void Dispose()+ {+ Close();+ continueButton.clicked -= onContinue;+ newGameButton.clicked -= onNewGame;+ newGame.Started -= onStarted;+ screen.UnregisterCallback(onCancel);+ screen.UnregisterCallback(onGeometry);+ panel.UnregisterCallback(onGeometry);+ }+ }+}diff --git a/unity/Assets/Scripts/UI/StartScreenPresenter.cs.meta b/unity/Assets/Scripts/UI/StartScreenPresenter.cs.metanew file mode 100644index 000000000..eaaf6b952--- /dev/null+++ b/unity/Assets/Scripts/UI/StartScreenPresenter.cs.meta@@ -0,0 +1,2 @@+fileFormatVersion: 2+guid: b47ead61692254cdcb39e5c89512fc1c\ No newline at end of filediff --git a/unity/Assets/Scripts/UI/UiPaths.cs b/unity/Assets/Scripts/UI/UiPaths.csindex e382bc16b..247896e59 100644--- a/unity/Assets/Scripts/UI/UiPaths.cs+++ b/unity/Assets/Scripts/UI/UiPaths.cs@@ -12,5 +12,7 @@ namespace Statecraft.Game.UIpublic const string Strings = Folder + "/strings.en.yaml";public const string FontRegular = Folder + "/Fonts/EBGaramond-Regular.ttf";public const string FontSemiBold = Folder + "/Fonts/EBGaramond-SemiBold.ttf";+ /// <summary>The Hebrew face (EB Garamond has no Hebrew; #193): Frank Ruhl Libre, OFL.</summary>+ public const string FontHebrew = Folder + "/Fonts/FrankRuhlLibre/FrankRuhlLibre-Medium.ttf";}}diff --git a/unity/Assets/Tests/EditMode/StartScreenTests.cs b/unity/Assets/Tests/EditMode/StartScreenTests.csnew file mode 100644index 000000000..7e6f00ce3--- /dev/null+++ b/unity/Assets/Tests/EditMode/StartScreenTests.cs@@ -0,0 +1,545 @@+#nullable enable+using System;+using System.Collections;+using System.Collections.Generic;+using System.IO;+using System.Linq;+using System.Text.RegularExpressions;+using NUnit.Framework;+using Statecraft.Game;+using Statecraft.Game.Boot;+using Statecraft.Game.Map;+using Statecraft.Game.UI;+using Statecraft.Sim;+using UnityEditor;+using UnityEditor.SceneManagement;+using UnityEngine;+using UnityEngine.TestTools;+using UnityEngine.UIElements;+using Object = UnityEngine.Object;++/// <summary>The start screen (StartScreenPresenter): the quoted lines are word for word the official texts, Continue only+/// with a save, New Game only through its two presses, Escape, automated runs skipping it, its layout at the four window+/// sizes it must fit, and the Hebrew laid out right to left.</summary>+public class StartScreenTests+{+ static readonly Content C = ContentLoader.Load(Paths.Content);+ static UiText Text => UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.Strings).text);+ static string Source(string name) => File.ReadAllText(Path.Combine(Paths.RepoRoot, "docs", "sources", "declaration-1948", name));++ readonly List<string> temp = new List<string>();+ SaveStore TempStore()+ {+ var dir = Path.Combine(Path.GetTempPath(), "statecraft-start-" + Guid.NewGuid().ToString("N"));+ temp.Add(dir);+ return new SaveStore(dir);+ }++ [TearDown]+ public void Clean()+ {+ EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single); // after the scene tests+ foreach (var d in temp) { try { if (Directory.Exists(d)) Directory.Delete(d, true); } catch (Exception) { } }+ temp.Clear();+ }++ // --- The text ---------------------------------------------------------------------------------------------------++ /// <summary>The lines exactly as Game.uxml shows them, checked twice: against these literals (a change shows in review)+ /// and as verbatim passages of the sources in docs/sources/declaration-1948 (the Hebrew of Iton Rishmi No. 1, the+ /// English translation). A leading ellipsis marks a sentence quoted from its middle.</summary>+ static readonly (string name, string text, string source)[] Quoted =+ {+ ("start-he-proclamation", "…אנו מכריזים בזאת על הקמת מדינה יהודית בארץ־ישראל, היא מדינת ישראל.", "he.txt"),+ ("start-en-proclamation", "…HEREBY DECLARE THE ESTABLISHMENT OF A JEWISH STATE IN ERETZ-ISRAEL, TO BE KNOWN AS THE STATE OF ISRAEL.", "en.txt"),+ ("start-he-date", "בעיר תל־אביב, היום הזה, ערב שבת, ה׳ אייר תש״ח, 14 במאי 1948.", "he.txt"),+ ("start-en-date", "IN THE CITY OF TEL-AVIV, ON THIS SABBATH EVE, THE 5TH DAY OF IYAR, 5708 (14TH MAY, 1948).", "en.txt"),+ };++ [Test]+ public void TheQuotedLinesAreWordForWordTheOfficialTexts()+ {+ using var ui = new UiTestKit();+ foreach (var (name, text, source) in Quoted)+ {+ var shown = ui.Q<Label>(name).text;+ Assert.AreEqual(text, shown, name);+ var passage = shown.StartsWith("…", StringComparison.Ordinal) ? shown.Substring(1) : shown;+ StringAssert.Contains(passage, Source(source), $"{name} is not a verbatim passage of docs/sources/declaration-1948/{source}");+ Assert.IsFalse(Regex.IsMatch(shown, "[--]"), $"{name}: no direction marks; the text generator orders it");+ }+ // The Hebrew punctuation is the source's own: maqaf (U+05BE), geresh (U+05F3) and gershayim (U+05F4), not a hyphen+ // or quotation marks that would look alike.+ var date = ui.Q<Label>("start-he-date").text;+ StringAssert.Contains("תל־אביב", date);+ StringAssert.Contains("ה׳ אייר תש״ח", date);+ StringAssert.Contains("בארץ־ישראל", ui.Q<Label>("start-he-proclamation").text);+ StringAssert.Contains("Official Gazette No. 1, 14 May 1948", ui.Q<Label>("start-source").text);+ StringAssert.Contains("AI-generated", ui.Q<Label>("start-source").text);+ }++ [UnityTest]+ public IEnumerator TheHebrewIsSetInFrankRuhlLibreThroughTheAdvancedTextGenerator()+ {+ using var ui = new RenderedUi();+ ui.Root.Q("root").AddToClassList(StartScreenPresenter.OpenClass);+ for (int i = 0; i < 3; i++) yield return null; // resolved styles need a style pass+ var font = AssetDatabase.LoadAssetAtPath<Font>(UiPaths.FontHebrew);+ Assert.IsNotNull(font, UiPaths.FontHebrew);+ foreach (var name in new[] { "start-he-proclamation", "start-he-date" })+ {+ var label = ui.Q<Label>(name);+ Assert.AreEqual("Advanced", label.resolvedStyle.unityTextGenerator.ToString(), name);+ Assert.AreEqual(LanguageDirection.RTL, label.languageDirection, $"{name}: a right-to-left paragraph (its full stop goes on the left)");+ var fontAsset = label.resolvedStyle.unityFontDefinition.fontAsset;+ var resolved = fontAsset != null ? fontAsset.sourceFontFile : label.resolvedStyle.unityFontDefinition.font;+ Assert.AreSame(font, resolved, name);+ foreach (var c in label.text.Where(c => c > 0x7f))+ Assert.IsTrue(font.HasCharacter(c), $"{name}: Frank Ruhl Libre has no glyph for U+{(int)c:X4}");+ }+ }++ /// <summary>The advanced text generator is on for the project (Project Settings, UI Toolkit, Enable Advanced Text) and+ /// the panel settings carry its ICU data, so a player build lays the Hebrew out right to left (UiAssets.Create).</summary>+ [Test]+ public void AdvancedTextIsOnAndThePanelCarriesItsIcuData()+ {+ var settings = File.ReadAllText(Path.Combine(Paths.RepoRoot, "unity", "ProjectSettings", "UIToolkitProjectSettings.asset"));+ StringAssert.Contains("m_EnableAdvancedText: 1", settings);+ var icu = new SerializedObject(AssetDatabase.LoadAssetAtPath<PanelSettings>(UiPaths.Panel)).FindProperty("m_ICUDataAsset");+ Assert.IsNotNull(icu);+ Assert.IsNotNull(icu.objectReferenceValue, "StatecraftPanel.asset has no ICU data (run UiAssets.Create)");+ StringAssert.Contains("m_ICUDataAsset: {fileID: 20204, guid: 0000000000000000f000000000000000, type: 0}",+ File.ReadAllText(Path.Combine(Paths.RepoRoot, "unity", UiPaths.Panel)), "saved in the asset, not only assigned on load");+ }++ // --- Automation ---------------------------------------------------------------------------------------------------++ [Test]+ public void AutomatedRunsSkipTheScreen()+ {+ var none = new string[0];+ foreach (var q in new[] { "?golden", "?golden&smoke=5", "?smoke", "?smoke=5", "?golden&shot", "?shot", "?vprofile", "?profile",+ "?units", "?borderproof", "?nostart", "?bootlog&golden" })+ Assert.IsTrue(StartScreenPresenter.Skipped("http://localhost:8000/index.html" + q, none, webgl: true), q);+ foreach (var q in new[] { "", "?bootlog", "?navlog", "?camlog", "?smoke=0", "?goldenx", "?nostartx", "?shots" })+ Assert.IsFalse(StartScreenPresenter.Skipped("http://localhost:8000/index.html" + q, none, webgl: true), q);+ foreach (var args in new[] { new[] { "-golden" }, new[] { "-smoke", "5" }, new[] { "-smoke" }, new[] { "-shot" }, new[] { "-vprofile" },+ new[] { "-profile" }, new[] { "-units" }, new[] { "-" + BorderProof.Flag }, new[] { "-nostart" } })+ Assert.IsTrue(StartScreenPresenter.Skipped(null, args, webgl: false), string.Join(" ", args));+ Assert.IsFalse(StartScreenPresenter.Skipped(null, new[] { "-batchmode" }, webgl: false));+ Assert.IsFalse(StartScreenPresenter.Skipped(null, new[] { "-smoke", "0" }, webgl: false));+ // A flag on the desktop does not count on the web and the other way round (each instrument's own rule).+ Assert.IsFalse(StartScreenPresenter.Skipped("http://localhost/index.html", new[] { "-golden" }, webgl: true));+ Assert.IsFalse(StartScreenPresenter.Skipped("http://localhost/index.html?golden", none, webgl: false));+ }++ // --- Behaviour ------------------------------------------------------------------------------------------------------++ /// <summary>Game.uxml on a panel that renders into a 1920x1080 texture, so layout, style and focus run as in a player+ /// once frames pass (UiTestKit's panel has no target and is not laid out in edit mode).</summary>+ sealed class RenderedUi : IDisposable+ {+ readonly GameObject go; readonly PanelSettings ps; readonly RenderTexture rt;+ public readonly UIDocument Doc;+ public VisualElement Root => Doc.rootVisualElement;++ public RenderedUi(int w = 1920, int h = 1080)+ {+ rt = new RenderTexture(w, h, 0);+ ps = Object.Instantiate(AssetDatabase.LoadAssetAtPath<PanelSettings>(UiPaths.Panel));+ ps.targetTexture = rt;+ go = new GameObject("StartScreenTest");+ go.SetActive(false);+ Doc = go.AddComponent<UIDocument>();+ Doc.panelSettings = ps;+ Doc.visualTreeAsset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(UiPaths.GameUxml);+ go.SetActive(true);+ }++ public T Q<T>(string name) where T : VisualElement+ {+ var e = Root.Q<T>(name);+ Assert.IsNotNull(e, name);+ return e;+ }++ public void Press(string name) => UiTestKit.Press(Q<Button>(name));+ public void Dispose() { Object.DestroyImmediate(go); Object.DestroyImmediate(ps); rt.Release(); Object.DestroyImmediate(rt); }+ }++ /// <summary>The start the way GameRoot makes it: GameStart.Begin over the store, the toast, New Game and the screen.</summary>+ sealed class Rig : IDisposable+ {+ public readonly RenderedUi Ui = new RenderedUi();+ public readonly SimBridge Bridge;+ public readonly ToastPresenter Toast;+ public readonly NewGamePresenter NewGame;+ public readonly StartScreenPresenter Start;+ public readonly List<bool> Shown = new List<bool>();++ public Rig(SaveStore store)+ {+ var notes = new List<string>();+ Bridge = new SimBridge(GameStart.Begin(C, store, () => 4UL, notes, Text, out var resumed), Text);+ Toast = new ToastPresenter(Ui.Root, Bridge, Text);+ NewGame = new NewGamePresenter(Ui.Root, Bridge, store, Toast, Text, () => 5UL);+ GameStart.Autosave(Bridge, store, Text);+ Ui.Root.Q("root").RemoveFromClassList("loading");+ Start = new StartScreenPresenter(Ui.Root, NewGame, resumed, Shown.Add);+ Start.Show();+ }++ public bool ContinueShown => Ui.Q<Button>("start-continue").style.display.value == DisplayStyle.Flex;+ public void Dispose() { Start.Dispose(); NewGame.Dispose(); Toast.Dispose(); Ui.Dispose(); }+ }++ static SaveStore WithSave(SaveStore store, int turns)+ {+ var played = new SimBridge(GameSession.New(C, 9, Mode.Historical), Text);+ for (int i = 0; i < turns; i++) played.EndTurn();+ store.WriteAutosave(played.Session.Save.Write());+ return store;+ }++ [Test]+ public void WithoutASaveThereIsNoContinueAndNewGameSimplyBegins()+ {+ var store = TempStore();+ using var rig = new Rig(store);+ Assert.IsTrue(rig.Start.IsOpen);+ Assert.IsFalse(rig.Start.Resumed);+ Assert.IsFalse(rig.ContinueShown, "no save: no Continue");+ var session = rig.Bridge.Session;+ rig.Ui.Press("start-continue"); // hidden, and ignored even if pressed+ Assert.IsTrue(rig.Start.IsOpen);+ rig.Ui.Press("start-new-game");+ Assert.IsFalse(rig.Start.IsOpen, "one press: there is nothing to lose");+ Assert.AreSame(session, rig.Bridge.Session, "the session already is a new game");+ Assert.AreEqual(new[] { true, false }, rig.Shown.ToArray(), "the camera keys are stopped, then given back");+ Assert.IsFalse(Directory.Exists(store.Directory) && Directory.GetFiles(store.Directory).Length > 0);+ }++ [Test]+ public void ContinueShowsOnlyWithASaveAndLoadsIt()+ {+ var store = WithSave(TempStore(), 3);+ var saved = File.ReadAllText(store.AutosavePath);+ using var rig = new Rig(store);+ Assert.IsTrue(rig.Start.Resumed);+ Assert.IsTrue(rig.ContinueShown);+ Assert.AreEqual(3, rig.Bridge.State.Turn, "the session under the screen is the save, replayed");+ rig.Ui.Press("start-continue");+ Assert.IsFalse(rig.Start.IsOpen);+ Assert.AreEqual(3, rig.Bridge.State.Turn);+ Assert.AreEqual(saved, File.ReadAllText(store.AutosavePath), "Continue never touches the save");+ rig.Bridge.EndTurn();+ Assert.AreEqual(4, rig.Bridge.State.Turn, "and play goes on from it");+ }++ [Test]+ public void AnUnreadableSaveOffersNoContinue()+ {+ var store = TempStore();+ store.WriteAutosave("not a save\n");+ LogAssert.Expect(LogType.Warning, new Regex("Autosave rejected"));+ using var rig = new Rig(store);+ Assert.IsFalse(rig.Start.Resumed);+ Assert.IsFalse(rig.ContinueShown, "the save was set aside: there is nothing to continue");+ }++ [Test]+ public void NewGameOverASaveGoesThroughTheConfirmation()+ {+ var store = WithSave(TempStore(), 2);+ using var rig = new Rig(store);+ rig.Ui.Press("start-new-game");+ Assert.IsTrue(rig.Start.IsOpen, "the first press only asks");+ Assert.IsTrue(rig.NewGame.Armed);+ Assert.AreEqual(Text["newgame.confirm"], rig.Ui.Q<Label>("toast").text);+ Assert.AreEqual(DisplayStyle.Flex, rig.Ui.Q<Label>("toast").style.display.value);+ Assert.IsTrue(File.Exists(store.AutosavePath), "one press never wipes the save");+ Assert.AreEqual(2, rig.Bridge.State.Turn);+ rig.Ui.Press("start-new-game");+ Assert.IsFalse(rig.Start.IsOpen);+ Assert.AreEqual(0, rig.Bridge.State.Turn, "a new game");+ Assert.IsFalse(File.Exists(store.AutosavePath), "the abandoned save is gone");+ Assert.IsFalse(rig.Start.Resumed);+ }++ [Test]+ public void EscapeAndContinueWithdrawTheRequest()+ {+ var store = WithSave(TempStore(), 2);+ using var rig = new Rig(store);+ rig.Ui.Press("start-new-game");+ Assert.IsTrue(rig.NewGame.Armed);+ using (var e = NavigationCancelEvent.GetPooled()) { e.target = rig.Ui.Q<Button>("start-new-game"); rig.Ui.Q<Button>("start-new-game").SendEvent(e); }+ Assert.IsFalse(rig.NewGame.Armed, "Escape withdraws it");+ Assert.AreEqual(DisplayStyle.None, rig.Ui.Q<Label>("toast").style.display.value, "and takes the prompt down");+ Assert.IsTrue(rig.Start.IsOpen, "Escape does not leave the screen");+ Assert.IsFalse(rig.Start.Escape(), "nothing left to withdraw");+ rig.Ui.Press("start-new-game");+ Assert.IsTrue(rig.NewGame.Armed);+ rig.Ui.Press("start-continue");+ Assert.IsFalse(rig.Start.IsOpen);+ Assert.IsFalse(rig.NewGame.Armed, "Continue withdraws it: the top bar's New Game starts again from one press");+ Assert.AreEqual(DisplayStyle.None, rig.Ui.Q<Label>("toast").style.display.value);+ rig.Ui.Press("new-game");+ Assert.AreEqual(2, rig.Bridge.State.Turn, "a single press on the top bar only asks");+ Assert.IsTrue(File.Exists(store.AutosavePath));+ }++ [UnityTest]+ public IEnumerator WhileItShowsTheHudIsHiddenAndOnlyItsButtonsTakeFocus()+ {+ var store = WithSave(TempStore(), 1);+ using var rig = new Rig(store);+ yield return null; yield return null;+ foreach (var hud in new[] { "top-bar", "right-column", "info-panel", "map-labels" })+ Assert.AreEqual(DisplayStyle.None, rig.Ui.Root.Q(hud).resolvedStyle.display, hud);+ foreach (var b in new[] { "end-turn", "new-game", "nav-cabinet", "build-camp" })+ {+ Assert.IsFalse(rig.Ui.Q<Button>(b).canGrabFocus, $"{b} is out of reach under the start screen");+ rig.Ui.Q<Button>(b).Focus();+ Assert.AreNotSame(rig.Ui.Q<Button>(b), rig.Ui.Root.focusController?.focusedElement, $"{b} cannot be focused");+ }+ var cont = rig.Ui.Q<Button>("start-continue");+ cont.Focus();+ Assert.AreSame(cont, rig.Ui.Root.focusController?.focusedElement, "Continue has the focus");+ // Tab walks the two buttons only.+ var seen = new List<string>();+ for (int i = 0; i < 4; i++)+ {+ var at = (VisualElement)rig.Ui.Root.focusController!.focusedElement;+ using (var e = NavigationMoveEvent.GetPooled(NavigationMoveEvent.Direction.Next)) { e.target = at; at.SendEvent(e); }+ yield return null;+ seen.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"), "Tab stays on the two buttons: " + string.Join(", ", seen));+ rig.Ui.Press("start-continue");+ yield return null; yield return null;+ Assert.AreEqual(DisplayStyle.Flex, rig.Ui.Root.Q("top-bar").resolvedStyle.display);+ Assert.AreEqual(DisplayStyle.None, rig.Ui.Root.Q("start-screen").resolvedStyle.display);+ Assert.IsTrue(rig.Ui.Q<Button>("end-turn").canGrabFocus, "the HUD is back");+ }++ // --- Layout ------------------------------------------------------------------------------------------------------++ /// <summary>At each window size the owner named (a 1080p and a 768p screen, a small 16:10 window, a phone held upright):+ /// the screen covers the window; the painting keeps its 16:9 (a full-width band below 16:9, so nothing is cropped) and+ /// starts at the window's top (the AI badge in its top-left corner shows); the panel, its lines and both buttons are+ /// inside the window and the panel; no line overlaps another or is squeezed below its font size; the panel leaves the+ /// painting's upper half (the flags and the table) clear.</summary>+ [UnityTest]+ public IEnumerator ItFitsEveryWindowSize()+ {+ foreach (var (w, h) in new[] { (1920, 1080), (1366, 768), (960, 600), (390, 844) })+ {+ var rt = new RenderTexture(w, h, 0);+ var ps = Object.Instantiate(AssetDatabase.LoadAssetAtPath<PanelSettings>(UiPaths.Panel));+ ps.targetTexture = rt;+ var go = new GameObject("StartLayout");+ 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;+ var store = WithSave(TempStore(), 1);+ var bridge = new SimBridge(GameStart.Begin(C, store, () => 4UL, new List<string>(), Text, out var resumed), Text);+ var toast = new ToastPresenter(root, bridge, Text);+ var newGame = new NewGamePresenter(root, bridge, store, toast, Text, () => 5UL);+ var start = new StartScreenPresenter(root, newGame, resumed);+ try+ {+ root.Q("root").RemoveFromClassList("loading");+ start.Show();+ for (int i = 0; i < 20 && (float.IsNaN(root.Q("start-panel").worldBound.width) || root.Q("start-panel").worldBound.width <= 0); i++) yield return null;+ for (int i = 0; i < 4; i++) yield return null; // the band height is set from the first layout+ var window = root.panel.visualTree.worldBound;+ Rect R(string name) => root.Q(name).worldBound;+ string at = $"{w}x{h} ({window.width:0}x{window.height:0} logical)";+ bool Inside(Rect inner, Rect outer) => inner.xMin >= outer.xMin - 0.5f && inner.xMax <= outer.xMax + 0.5f && inner.yMin >= outer.yMin - 0.5f && inner.yMax <= outer.yMax + 0.5f;++ Assert.IsTrue(Inside(window, R("start-screen")), $"{at}: the screen {R("start-screen")} covers the window");+ var art = R("start-art");+ var panel = R("start-panel");+ Assert.AreEqual(window.width, art.width, 0.5f, $"{at}: the painting is full width");+ Assert.IsTrue(Inside(panel, window), $"{at}: the panel {panel} is inside the window");+ var tall = window.width / window.height < StartScreenPresenter.ArtAspect;+ if (root.Q("start-screen").ClassListContains(StartScreenPresenter.BandClass))+ {+ Assert.IsTrue(tall, at);+ Assert.AreEqual(art.width / StartScreenPresenter.ArtAspect, art.height, 2f, $"{at}: the band keeps 16:9 (to pixel snapping): nothing is cropped");+ Assert.IsTrue(Inside(art, window), $"{at}: the band {art} is inside the window");+ Assert.GreaterOrEqual(panel.yMin, art.yMax - 0.5f, $"{at}: the panel {panel} is under the band {art}");+ Assert.AreEqual(art.yMin - window.yMin, window.yMax - panel.yMax, 20f, $"{at}: the band and the panel are centred together");+ }+ else+ {+ Assert.AreEqual(window.yMin, art.yMin, 0.5f, $"{at}: the painting starts at the top");+ Assert.AreEqual(window.height, art.height, 0.5f, $"{at}: the painting fills the window");+ // Cover, anchored top-left: the painting's upper half (the flags and the table) stays clear of the panel.+ var painted = Mathf.Max(window.height, window.width / StartScreenPresenter.ArtAspect);+ Assert.GreaterOrEqual(panel.yMin, window.yMin + painted * 0.5f - 0.5f, $"{at}: the panel {panel} covers the painting's upper half");+ }+ if (h > w) Assert.IsTrue(root.Q("start-screen").ClassListContains(StartScreenPresenter.BandClass), $"{at}: a phone held upright stacks the painting over the panel");+ var lines = new[] { "start-title", "start-he-proclamation", "start-en-proclamation", "start-he-date", "start-en-date", "start-source", "start-actions" };+ foreach (var name in lines)+ {+ var r = R(name);+ Assert.IsTrue(Inside(r, panel), $"{at}: {name} {r} leaves the panel {panel}");+ if (root.Q(name) is Label l) Assert.GreaterOrEqual(r.height + 0.5f, l.resolvedStyle.fontSize, $"{at}: {name} collapsed");+ }+ for (int i = 1; i < lines.Length; i++)+ Assert.LessOrEqual(R(lines[i - 1]).yMax, R(lines[i]).yMin + 0.5f, $"{at}: {lines[i - 1]} overlaps {lines[i]}");+ foreach (var b in new[] { "start-continue", "start-new-game" })+ {+ var r = R(b);+ Assert.AreEqual(DisplayStyle.Flex, root.Q(b).resolvedStyle.display, $"{at}: {b} shows");+ Assert.IsTrue(Inside(r, R("start-actions")) && Inside(r, panel), $"{at}: {b} {r} is inside the panel");+ Assert.GreaterOrEqual(r.height, 40f, $"{at}: {b} is a usable target");+ }+ Assert.IsFalse(R("start-continue").Overlaps(R("start-new-game")), at);+ }+ finally+ {+ start.Dispose(); newGame.Dispose(); toast.Dispose();+ Object.DestroyImmediate(go); Object.DestroyImmediate(ps); rt.Release(); Object.DestroyImmediate(rt);+ }+ }+ }++ // --- The scene ---------------------------------------------------------------------------------------------------++ static GameInputs? inputs;+ static GameInputs Inputs => inputs ??= GameInputs.FromDisk(Paths.Content, Paths.StreamingMap);++ GameRoot OpenScene(SaveStore store)+ {+ EditorSceneManager.OpenScene("Assets/Map.unity", OpenSceneMode.Single);+ Object.FindFirstObjectByType<MapScene>().Build(Inputs.Map);+ var root = Object.FindFirstObjectByType<GameRoot>();+ root.Store = store;+ return root;+ }++ static VisualElement Ui => Object.FindFirstObjectByType<UIDocument>().rootVisualElement;+ static bool StartOpen => Ui.Q("root").ClassListContains(StartScreenPresenter.OpenClass);++ /// <summary>Map.unity as a player boots it: the start screen over the continued save, the camera keys off until it closes.</summary>+ [Test]+ public void ThePlayerBootShowsTheScreenOverTheContinuedSaveAndStopsTheCamera()+ {+ var store = WithSave(TempStore(), 2);+ var root = OpenScene(store);+ var cam = Object.FindFirstObjectByType<CameraController>();+ root.Begin(Inputs, 0, startScreen: true);+ Assert.IsTrue(StartOpen);+ Assert.IsFalse(Ui.Q("root").ClassListContains("loading"));+ Assert.AreEqual(2, root.Bridge!.State.Turn, "the map's first turn waits behind the screen: the session is the save");+ Assert.IsFalse(cam.enabled, "the camera keys are off");+ UiTestKit.Press(Ui.Q<Button>("start-continue"));+ Assert.IsFalse(StartOpen);+ Assert.IsTrue(cam.enabled);+ root.enabled = false; // disposing with the screen open gives the camera back too+ root.enabled = true;+ root.Begin(Inputs, 0, startScreen: true);+ Assert.IsTrue(StartOpen && !cam.enabled);+ root.enabled = false;+ Assert.IsTrue(cam.enabled);+ Assert.IsFalse(StartOpen);+ }++ /// <summary>Automation never meets the screen: a smoke run (no New Game, so no screen even when asked), the tests'+ /// and tools' Begin(inputs, n), and the Ready path in the editor (not playing).</summary>+ [Test]+ public void AutomatedBootsNeverShowTheScreen()+ {+ var root = OpenScene(TempStore());+ LogAssert.Expect(LogType.Warning, "SMOKE FAIL the smoke run needs play mode or a player");+ root.Begin(Inputs, 5, startScreen: true);+ Assert.IsFalse(StartOpen, "smoke");+ root.Begin(Inputs, 0);+ Assert.IsFalse(StartOpen, "Begin(inputs, n)");+ root.Begin(Inputs);+ Assert.IsFalse(StartOpen, "GameBoot.Ready outside play mode");+ Assert.IsTrue(Object.FindFirstObjectByType<CameraController>().enabled);+ }++ // --- Right to left -----------------------------------------------------------------------------------------------++ /// <summary>The Hebrew is laid out right to left (#193), rendered through the start screen's own style and direction+ /// (Frank Ruhl Libre, the advanced generator, RTL). "שי" is shin then yod in logical order: right to left, the big shin+ /// is drawn on the right and the small yod on its left, so the ink leans right; drawn left to right (a reversed line,+ /// what the standard generator does: the control) it leans left. "ש." checks the paragraph's direction: a right-to-left+ /// paragraph puts the full stop on the left of the shin (ink leans right), a left-to-right one (the second control) on its+ /// right.</summary>+ [UnityTest]+ public IEnumerator HebrewIsLaidOutRightToLeft()+ {+ const int W = 400, H = 320;+ var rt = new RenderTexture(W, H, 0);+ var ps = Object.Instantiate(AssetDatabase.LoadAssetAtPath<PanelSettings>(UiPaths.Panel));+ ps.targetTexture = rt;+ ps.scaleMode = PanelScaleMode.ConstantPixelSize; ps.scale = 1f;+ ps.clearColor = true; ps.colorClearValue = Color.black;+ var go = new GameObject("RtlTest");+ go.SetActive(false);+ var doc = go.AddComponent<UIDocument>();+ doc.panelSettings = ps;+ go.SetActive(true);+ doc.rootVisualElement.styleSheets.Add(AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/UI/Statecraft.uss"));+ void Make(int row, bool advanced, string text, LanguageDirection direction = LanguageDirection.RTL)+ {+ var l = new Label(text);+ if (advanced) { l.AddToClassList("start-he"); l.languageDirection = direction; }+ else l.style.unityFontDefinition = new StyleFontDefinition(AssetDatabase.LoadAssetAtPath<Font>(UiPaths.FontHebrew));+ l.style.position = Position.Absolute; l.style.left = 20; l.style.top = row * 80; l.style.width = 360; l.style.height = 80;+ l.style.fontSize = 60; l.style.color = Color.white; l.style.unityTextAlign = TextAnchor.MiddleCenter;+ l.style.marginLeft = l.style.marginRight = l.style.marginTop = l.style.marginBottom = 0;+ l.style.whiteSpace = WhiteSpace.NoWrap;+ doc.rootVisualElement.Add(l);+ }+ Make(0, advanced: true, "\u05E9\u05D9"); // שי+ Make(1, advanced: false, "\u05E9\u05D9");+ Make(2, advanced: true, "\u05E9."); // ש.+ Make(3, advanced: true, "\u05E9.", LanguageDirection.LTR); // the control: a left-to-right paragraph+ var tex = new Texture2D(W, H, TextureFormat.RGBA32, false);+ try+ {+ // The ink's centre of mass relative to the middle of its extent, as a share of the extent: > 0 leans right.+ float Lean(int row)+ {+ var cols = new float[W];+ for (int y = H - 80 * (row + 1); y < H - 80 * row; y++) // ReadPixels row 0 is the bottom+ for (int x = 0; x < W; x++) cols[x] += tex.GetPixel(x, y).grayscale;+ float total = cols.Sum();+ if (total < 20f) return float.NaN;+ int first = Array.FindIndex(cols, c => c > 0.5f), last = Array.FindLastIndex(cols, c => c > 0.5f);+ float centre = 0; for (int x = 0; x < W; x++) centre += x * cols[x];+ centre /= total;+ return (centre - (first + last) / 2f) / Mathf.Max(1, last - first);+ }+ float rtl = float.NaN, ltr = float.NaN, stop = float.NaN, ltrStop = float.NaN;+ for (int frame = 0; frame < 30 && (float.IsNaN(rtl) || float.IsNaN(ltr) || float.IsNaN(stop) || float.IsNaN(ltrStop)); frame++)+ {+ yield return null;+ RenderTexture.active = rt;+ tex.ReadPixels(new Rect(0, 0, W, H), 0, 0); tex.Apply();+ RenderTexture.active = null;+ rtl = Lean(0); ltr = Lean(1); stop = Lean(2); ltrStop = Lean(3);+ }+ Assert.IsFalse(float.IsNaN(rtl) || float.IsNaN(ltr) || float.IsNaN(stop) || float.IsNaN(ltrStop), "the labels were not drawn (no ink in the render)");+ Assert.AreEqual("Advanced", doc.rootVisualElement[0].resolvedStyle.unityTextGenerator.ToString());+ Assert.AreEqual("Standard", doc.rootVisualElement[1].resolvedStyle.unityTextGenerator.ToString());+ Assert.Less(ltr, -0.05f, $"control: drawn left to right, the shin comes first and the ink leans left ({ltr:0.000})");+ Assert.Greater(rtl, 0.05f, $"the start screen's Hebrew is drawn right to left: the ink leans right ({rtl:0.000})");+ Assert.Less(ltrStop, -0.05f, $"control: a left-to-right paragraph puts the full stop on the right ({ltrStop:0.000})");+ Assert.Greater(stop, 0.05f, $"a right-to-left paragraph: the full stop is on the left ({stop:0.000})");+ }+ finally { Object.DestroyImmediate(tex); Object.DestroyImmediate(go); Object.DestroyImmediate(ps); rt.Release(); Object.DestroyImmediate(rt); }+ }+}diff --git a/unity/Assets/Tests/EditMode/StartScreenTests.cs.meta b/unity/Assets/Tests/EditMode/StartScreenTests.cs.metanew file mode 100644index 000000000..f83025ee6--- /dev/null+++ b/unity/Assets/Tests/EditMode/StartScreenTests.cs.meta@@ -0,0 +1,2 @@+fileFormatVersion: 2+guid: 374959576bc994c3ba38fd48a834018d\ No newline at end of filediff --git a/unity/Assets/UI/Fonts/FrankRuhlLibre.meta b/unity/Assets/UI/Fonts/FrankRuhlLibre.metanew file mode 100644index 000000000..c68d5bb39--- /dev/null+++ b/unity/Assets/UI/Fonts/FrankRuhlLibre.meta@@ -0,0 +1,8 @@+fileFormatVersion: 2+guid: b50c05876e3244ba0a58c11d4fc4f5a5+folderAsset: yes+DefaultImporter:+ externalObjects: {}+ userData:+ assetBundleName:+ assetBundleVariant:diff --git a/unity/Assets/UI/Fonts/FrankRuhlLibre/FrankRuhlLibre-Medium.ttf b/unity/Assets/UI/Fonts/FrankRuhlLibre/FrankRuhlLibre-Medium.ttfnew file mode 100644index 000000000..81ebaf02bBinary files /dev/null and b/unity/Assets/UI/Fonts/FrankRuhlLibre/FrankRuhlLibre-Medium.ttf differdiff --git a/unity/Assets/UI/Fonts/FrankRuhlLibre/FrankRuhlLibre-Medium.ttf.meta b/unity/Assets/UI/Fonts/FrankRuhlLibre/FrankRuhlLibre-Medium.ttf.metanew file mode 100644index 000000000..13e6825dc--- /dev/null+++ b/unity/Assets/UI/Fonts/FrankRuhlLibre/FrankRuhlLibre-Medium.ttf.meta@@ -0,0 +1,21 @@+fileFormatVersion: 2+guid: fd143ce4669114eceae8c7edde001ac4+TrueTypeFontImporter:+ externalObjects: {}+ serializedVersion: 4+ fontSize: 16+ forceTextureCase: -2+ characterSpacing: 0+ characterPadding: 1+ includeFontData: 1+ fontNames:+ - Frank Ruhl Libre+ fallbackFontReferences: []+ customCharacters:+ fontRenderingMode: 0+ ascentCalculationMode: 1+ useLegacyBoundsCalculation: 0+ shouldRoundAdvanceValue: 1+ userData:+ assetBundleName:+ assetBundleVariant:diff --git a/unity/Assets/UI/Fonts/FrankRuhlLibre/OFL.txt b/unity/Assets/UI/Fonts/FrankRuhlLibre/OFL.txtnew file mode 100644index 000000000..c7f8fbdc1--- /dev/null+++ b/unity/Assets/UI/Fonts/FrankRuhlLibre/OFL.txt@@ -0,0 +1,105 @@+Copyright 2015 The Frank Ruhl Libre Project Authors (https://github.com/fontef/frankruhllibre)++This Font Software is licensed under the SIL Open Font License, Version 1.1.+This license is copied below, and is also available with a FAQ at:+https://scripts.sil.org/OFL+++-----------------------------------------------------------+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007+-----------------------------------------------------------++PREAMBLE+The goals of the Open Font License (OFL) are to stimulate worldwide+development of collaborative font projects, to support the font creation+efforts of academic and linguistic communities, and to provide a free and+open framework in which fonts may be shared and improved in partnership+with others.++The OFL allows the licensed fonts to be used, studied, modified and+redistributed freely as long as they are not sold by themselves. The+fonts, including any derivative works, can be bundled, embedded,+redistributed and/or sold with any software provided that any reserved+names are not used by derivative works. The fonts and derivatives,+however, cannot be released under any other type of license. The+requirement for fonts to remain under this license does not apply+to any document created using the fonts or their derivatives.++DEFINITIONS+"Font Software" refers to the set of files released by the Copyright+Holder(s) under this license and clearly marked as such. This may+include source files, build scripts and documentation.++"Reserved Font Name" refers to any names specified as such after the+copyright statement(s).++"Original Version" refers to the collection of Font Software components as+distributed by the Copyright Holder(s).++"Modified Version" refers to any derivative made by adding to, deleting,+or substituting -- in part or in whole -- any of the components of the+Original Version, by changing formats or by porting the Font Software to a+new environment.++"Author" refers to any designer, engineer, programmer, technical+writer or other person who contributed to the Font Software.++PERMISSION & CONDITIONS+Permission is hereby granted, free of charge, to any person obtaining+a copy of the Font Software, to use, study, copy, merge, embed, modify,+redistribute, and sell modified and unmodified copies of the Font+Software, subject to the following conditions:++1) Neither the Font Software nor any of its individual components,+in Original or Modified Versions, may be sold by itself.++2) Original or Modified Versions of the Font Software may be bundled,+redistributed and/or sold with any software, provided that each copy+contains the above copyright notice and this license. These can be+included either as stand-alone text files, human-readable headers or+in the appropriate machine-readable metadata fields within text or+binary files as long as those fields can be easily viewed by the user.++3) No Modified Version of the Font Software may use the Reserved Font+Name(s) unless explicit written permission is granted by the corresponding+Copyright Holder. This restriction only applies to the primary font name as+presented to the users.++4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font+Software shall not be used to promote, endorse or advertise any+Modified Version, except to acknowledge the contribution(s) of the+Copyright Holder(s) and the Author(s) or with their explicit written+permission.++5) The Font Software, modified or unmodified, in part or in whole,+must be distributed entirely under this license, and must not be+distributed under any other license. The requirement for fonts to+remain under this license does not apply to any document created+using the Font Software.++TERMINATION+This license becomes null and void if any of the above conditions are+not met.++DISCLAIMER+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM+OTHER DEALINGS IN THE FONT SOFTWARE.+© 2022 GitHub, Inc.+Terms+Privacy+Security+Status+Docs+Contact GitHub+Pricing+API+Training+Blog+Aboutdiff --git a/unity/Assets/UI/Fonts/FrankRuhlLibre/OFL.txt.meta b/unity/Assets/UI/Fonts/FrankRuhlLibre/OFL.txt.metanew file mode 100644index 000000000..d6a028e17--- /dev/null+++ b/unity/Assets/UI/Fonts/FrankRuhlLibre/OFL.txt.meta@@ -0,0 +1,7 @@+fileFormatVersion: 2+guid: ef46457a965954053b6a61f14df9cbd7+TextScriptImporter:+ externalObjects: {}+ userData:+ assetBundleName:+ assetBundleVariant:diff --git a/unity/Assets/UI/Fonts/FrankRuhlLibre/SOURCE.txt b/unity/Assets/UI/Fonts/FrankRuhlLibre/SOURCE.txtnew file mode 100644index 000000000..444bf6153--- /dev/null+++ b/unity/Assets/UI/Fonts/FrankRuhlLibre/SOURCE.txt@@ -0,0 +1,4 @@+Frank Ruhl Libre (static TTF, Medium), SIL Open Font License 1.1 (OFL.txt in this folder), by Yanek Iontef.+Source: https://github.com/fontef/frankruhllibre at commit 2372d1998e51dc011f86554c0d23f1ccf44afddf, fonts/ttf/+(the commit google/fonts ofl/frankruhllibre/METADATA.pb names). Unmodified.+sha256 73b01157af9e1ff5d4a2690a23a7c14cb746fa71d8b0b72d07d980df6a60d0ea FrankRuhlLibre-Medium.ttfdiff --git a/unity/Assets/UI/Fonts/FrankRuhlLibre/SOURCE.txt.meta b/unity/Assets/UI/Fonts/FrankRuhlLibre/SOURCE.txt.metanew file mode 100644index 000000000..9e416eee2--- /dev/null+++ b/unity/Assets/UI/Fonts/FrankRuhlLibre/SOURCE.txt.meta@@ -0,0 +1,7 @@+fileFormatVersion: 2+guid: c917fa5d86b244e9b8a0dc6d40314a66+TextScriptImporter:+ externalObjects: {}+ userData:+ assetBundleName:+ assetBundleVariant:diff --git a/unity/Assets/UI/Game.uxml b/unity/Assets/UI/Game.uxmlindex 12ad66dac..4f6875fe1 100644--- a/unity/Assets/UI/Game.uxml+++ b/unity/Assets/UI/Game.uxml@@ -238,6 +238,31 @@<ui:ScrollView name="why-rows" class="grow" /><Statecraft.Game.UI.UiFrame /></ui:VisualElement>+ <!-- The start screen (StartScreenPresenter): shown over the started game before its first turn (never in automated+ runs). The painting is AI-generated concept art (ASSETS.yaml), with no identifiable person. The two quotations+ are the Declaration of the Establishment of the State of Israel, word for word: the official Hebrew (Iton+ Rishmi No. 1, 14 May 1948) with the official English translation under each line; StartScreenTests checks them+ against docs/sources/declaration-1948. The Hebrew labels use the advanced text generator, which lays out+ right-to-left text (#193), with a right-to-left base direction (each line starts with a neutral ellipsis or ends with a full stop, which would otherwise take the left-to-right default). Drawn above the HUD and below the toast, which carries New Game's prompt. -->+ <ui:VisualElement name="start-screen" class="start-screen">+ <ui:VisualElement name="start-art" class="start-art" picking-mode="Ignore" />+ <ui:VisualElement name="start-body" class="start-body" picking-mode="Ignore">+ <ui:VisualElement name="start-panel" class="panel start-panel">+ <ui:Label name="start-title" text="Statecraft: Israel" class="start-title" />+ <ui:VisualElement class="gold-rule start-rule" />+ <ui:Label name="start-he-proclamation" text="…אנו מכריזים בזאת על הקמת מדינה יהודית בארץ־ישראל, היא מדינת ישראל." class="start-he" language-direction="RTL" />+ <ui:Label name="start-en-proclamation" text="…HEREBY DECLARE THE ESTABLISHMENT OF A JEWISH STATE IN ERETZ-ISRAEL, TO BE KNOWN AS THE STATE OF ISRAEL." class="start-en" />+ <ui:Label name="start-he-date" text="בעיר תל־אביב, היום הזה, ערב שבת, ה׳ אייר תש״ח, 14 במאי 1948." class="start-he start-he-date" language-direction="RTL" />+ <ui:Label name="start-en-date" text="IN THE CITY OF TEL-AVIV, ON THIS SABBATH EVE, THE 5TH DAY OF IYAR, 5708 (14TH MAY, 1948)." class="start-en" />+ <ui:Label name="start-source" text="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." class="start-source" />+ <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" />+ </ui:VisualElement>+ <Statecraft.Game.UI.UiFrame />+ </ui:VisualElement>+ </ui:VisualElement>+ </ui:VisualElement><ui:Label name="toast" class="panel toast" /></ui:VisualElement></ui:UXML>diff --git a/unity/Assets/UI/StartScreen.meta b/unity/Assets/UI/StartScreen.metanew file mode 100644index 000000000..329de77f3--- /dev/null+++ b/unity/Assets/UI/StartScreen.meta@@ -0,0 +1,8 @@+fileFormatVersion: 2+guid: d5cd313d00b94cf0b267f67fb00997ac+folderAsset: yes+DefaultImporter:+ externalObjects: {}+ userData:+ assetBundleName:+ assetBundleVariant:diff --git a/unity/Assets/UI/StartScreen/declaration-hall.jpg b/unity/Assets/UI/StartScreen/declaration-hall.jpgnew file mode 100644index 000000000..addf0d34bBinary files /dev/null and b/unity/Assets/UI/StartScreen/declaration-hall.jpg differdiff --git a/unity/Assets/UI/StartScreen/declaration-hall.jpg.meta b/unity/Assets/UI/StartScreen/declaration-hall.jpg.metanew file mode 100644index 000000000..9c0cc056c--- /dev/null+++ b/unity/Assets/UI/StartScreen/declaration-hall.jpg.meta@@ -0,0 +1,130 @@+fileFormatVersion: 2+guid: 1a0697fa9c9d4c8bbdce52a9c88758be+TextureImporter:+ internalIDToNameTable: []+ externalObjects: {}+ serializedVersion: 13+ mipmaps:+ mipMapMode: 0+ enableMipMap: 0+ sRGBTexture: 1+ linearTexture: 0+ fadeOut: 0+ borderMipMap: 0+ mipMapsPreserveCoverage: 0+ alphaTestReferenceValue: 0.5+ mipMapFadeDistanceStart: 1+ mipMapFadeDistanceEnd: 3+ bumpmap:+ convertToNormalMap: 0+ externalNormalMap: 0+ heightScale: 0.25+ normalMapFilter: 0+ flipGreenChannel: 0+ isReadable: 0+ streamingMipmaps: 0+ streamingMipmapsPriority: 0+ vTOnly: 0+ ignoreMipmapLimit: 0+ grayScaleToAlpha: 0+ generateCubemap: 6+ cubemapConvolution: 0+ seamlessCubemap: 0+ textureFormat: 1+ maxTextureSize: 2048+ textureSettings:+ serializedVersion: 2+ filterMode: 1+ aniso: 1+ mipBias: 0+ wrapU: 1+ wrapV: 1+ wrapW: 1+ nPOTScale: 0+ lightmap: 0+ compressionQuality: 50+ spriteMode: 0+ spriteExtrude: 1+ spriteMeshType: 1+ alignment: 0+ spritePivot: {x: 0.5, y: 0.5}+ spritePixelsToUnits: 100+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}+ spriteGenerateFallbackPhysicsShape: 1+ alphaUsage: 1+ alphaIsTransparency: 0+ spriteTessellationDetail: -1+ textureType: 0+ textureShape: 1+ singleChannelComponent: 0+ flipbookRows: 1+ flipbookColumns: 1+ maxTextureSizeSet: 0+ compressionQualitySet: 0+ textureFormatSet: 0+ ignorePngGamma: 0+ applyGammaDecoding: 0+ swizzle: 50462976+ cookieLightType: 0+ platformSettings:+ - serializedVersion: 4+ buildTarget: DefaultTexturePlatform+ maxTextureSize: 2048+ resizeAlgorithm: 0+ textureFormat: -1+ textureCompression: 1+ compressionQuality: 90+ crunchedCompression: 1+ allowsAlphaSplitting: 0+ overridden: 0+ ignorePlatformSupport: 0+ androidETC2FallbackOverride: 0+ forceMaximumCompressionQuality_BC6H_BC7: 0+ - serializedVersion: 4+ buildTarget: Standalone+ maxTextureSize: 2048+ resizeAlgorithm: 0+ textureFormat: -1+ textureCompression: 1+ compressionQuality: 90+ crunchedCompression: 1+ allowsAlphaSplitting: 0+ overridden: 0+ ignorePlatformSupport: 0+ androidETC2FallbackOverride: 0+ forceMaximumCompressionQuality_BC6H_BC7: 0+ - serializedVersion: 4+ buildTarget: WebGL+ maxTextureSize: 2048+ resizeAlgorithm: 0+ textureFormat: -1+ textureCompression: 1+ compressionQuality: 90+ crunchedCompression: 1+ allowsAlphaSplitting: 0+ overridden: 0+ ignorePlatformSupport: 0+ androidETC2FallbackOverride: 0+ forceMaximumCompressionQuality_BC6H_BC7: 0+ spriteSheet:+ serializedVersion: 2+ sprites: []+ outline: []+ customData:+ physicsShape: []+ bones: []+ spriteID:+ internalID: 0+ vertices: []+ indices:+ edges: []+ weights: []+ secondaryTextures: []+ spriteCustomMetadata:+ entries: []+ nameFileIdTable: {}+ mipmapLimitGroupName:+ pSDRemoveMatte: 0+ userData:+ assetBundleName:+ assetBundleVariant:diff --git a/unity/Assets/UI/Statecraft.uss b/unity/Assets/UI/Statecraft.ussindex 8ea65467c..12a6ef6ec 100644--- a/unity/Assets/UI/Statecraft.uss+++ b/unity/Assets/UI/Statecraft.uss@@ -420,3 +420,47 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);.anchor-lower-centre { translate: -50% -100%; }.anchor-lower-left { translate: 0 -100%; }.anchor-lower-right { translate: -100% -100%; }++/* The start screen (StartScreenPresenter): the painting of the 14 May 1948 hall, two lines of the Declaration (official+ Hebrew, official English under each), Continue and New Game. Hidden until GameRoot shows it; while it shows (.start-open+ on the root) the HUD under it is hidden, so it takes no focus and no clicks, and the painting is opaque over the map.+ The painting fills the window (cover, anchored at the top-left, so the Dreamina AI badge in that corner stays in view)+ and the panel sits at the foot over the audience; a tall window (.start-band) stacks the whole painting, as a+ full-width band, over the panel (StartScreenPresenter.Fit). */+.start-screen { display: none; position: absolute; left: 0; top: 0; right: 0; bottom: 0; background-color: var(--navy-deep); }+.start-open .start-screen { display: flex; }+.start-open .top-bar, .start-open .right-column, .start-open .info-panel, .start-open .screen, .start-open .map-labels { display: none; }+.start-art {+ position: absolute; left: 0; top: 0; right: 0; bottom: 0;+ background-image: url("project://database/Assets/UI/StartScreen/declaration-hall.jpg");+ background-size: cover; background-position-x: left; background-position-y: top; background-repeat: no-repeat;+}+.start-band .start-art { bottom: auto; }+.start-body { position: absolute; left: 0; top: 0; right: 0; bottom: 0; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 16px 28px 16px; }+.start-band .start-body { padding-top: 16px; padding-bottom: 16px; }+.start-panel {+ width: 1240px; max-width: 100%; flex-shrink: 0; align-items: center; padding: 18px 40px 20px 40px;+ background-color: rgba(9, 14, 26, 0.88);+}+.start-title {+ -unity-font-definition: url("project://database/Assets/UI/Fonts/EBGaramond-SemiBold.ttf");+ font-size: 50px; color: var(--gold-light); letter-spacing: 2px; -unity-text-align: middle-center; margin: 0;+}+.start-rule { width: 60%; margin: 2px 0 10px 0; }+/* Hebrew in Frank Ruhl Libre (EB Garamond has no Hebrew; #193) through the advanced text generator, which orders+ right-to-left text and the numbers in it (StartScreenTests renders it and checks the order). */+.start-he {+ -unity-font-definition: url("project://database/Assets/UI/Fonts/FrankRuhlLibre/FrankRuhlLibre-Medium.ttf");+ -unity-text-generator: advanced;+ font-size: 34px; color: var(--ink); -unity-text-align: middle-center; white-space: normal; margin: 4px 0 0 0;+}+.start-he-date { font-size: 28px; margin-top: 12px; }+.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; }+.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;+}+/* New Game's prompt (the toast) shows at the top of the start screen, clear of the AI badge and the panel. */+.start-open .toast { top: 24px; left: 25%; right: 25%; width: auto; }diff --git a/unity/Assets/UI/StatecraftPanel.asset b/unity/Assets/UI/StatecraftPanel.assetindex 742812fd2..c936984e1 100644--- a/unity/Assets/UI/StatecraftPanel.asset+++ b/unity/Assets/UI/StatecraftPanel.asset@@ -47,6 +47,6 @@ MonoBehaviour:m_SDFShader: {fileID: 19011, guid: 0000000000000000f000000000000000, type: 0}m_BitmapShader: {fileID: 9001, guid: 0000000000000000f000000000000000, type: 0}m_SpriteShader: {fileID: 19012, guid: 0000000000000000f000000000000000, type: 0}- m_ICUDataAsset: {fileID: 0}+ m_ICUDataAsset: {fileID: 20204, guid: 0000000000000000f000000000000000, type: 0}forceGammaRendering: 0textSettings: {fileID: 0}diff --git a/unity/ProjectSettings/UIToolkitProjectSettings.asset b/unity/ProjectSettings/UIToolkitProjectSettings.assetnew file mode 100644index 000000000..9f2776d62--- /dev/null+++ b/unity/ProjectSettings/UIToolkitProjectSettings.asset@@ -0,0 +1,17 @@+%YAML 1.1+%TAG !u! tag:unity3d.com,2011:+--- !u!114 &1+MonoBehaviour:+ m_ObjectHideFlags: 53+ m_CorrespondingSourceObject: {fileID: 0}+ m_PrefabInstance: {fileID: 0}+ m_PrefabAsset: {fileID: 0}+ m_GameObject: {fileID: 0}+ m_Enabled: 1+ m_EditorHideFlags: 0+ m_Script: {fileID: 15135, guid: 0000000000000000e000000000000000, type: 0}+ m_Name:+ m_EditorClassIdentifier: UnityEditor.dll::UnityEditor.UIElements.UIToolkitProjectSettings+ m_EnableAdvancedText: 1+ m_ConsistentAttributeOrderingWhenExporting: 0+ m_EnableLowLevelDebugger: 0