Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

The opening after New Game: three sourced stills, skippable and replayable (Refs #530) (#2037)

Beriae9019c48583
diff --git a/changelog.d/530-opening.md b/changelog.d/530-opening.md
new file mode 100644
index 000000000..3a7415b9d
--- /dev/null
+++ b/changelog.d/530-opening.md
@@ -0,0 +1,10 @@
+- The opening (#530, GDD Phase 7 PR 10): after New Game and before the first turn, three still panels in the event-card
+ frame, Europe, the Arab countries and Yemen, each with its sourced paragraph from `opening.yaml` and its Meitar
+ photograph, then the closing line. Skip leaves it at once, the start screen can replay it, Continue never shows it, and
+ smoke and golden runs skip it; it changes no sim state and moves no golden. The advisors' opening chain starts when it
+ closes. A player sees it only once the owner has checked every source and reviewed the text; until then the Editor
+ shows the draft with a visible preview label. A `-shareable` build refuses an opening photograph without the owner's
+ sensitivity review, and also refuses draft opening text or an unchecked source (owner decision: "Photos and text"), so
+ until the owner reviews the text a `-shareable` build is refused; the photo manifest lists the three photographs for
+ the packager. The new Hebrew controls await native
+ review. Built on Avl's `codex/530-opening-presenter`.
diff --git a/tools/tests/test_opening_sources.py b/tools/tests/test_opening_sources.py
new file mode 100644
index 000000000..ae7f727cd
--- /dev/null
+++ b/tools/tests/test_opening_sources.py
@@ -0,0 +1,88 @@
+"""The opening's sources and image records (#530, plan PR 10): every paragraph, the closing line too, has sources a person
+has checked (a `checked:` date on each), and every photograph has its alt text, credit and the owner's sensitivity review.
+An AI reading and an in-memory fixture are never a person's sign-off.
+"""
+import copy
+from datetime import date
+from pathlib import Path
+
+import yaml12
+
+REPO = Path(__file__).resolve().parents[2]
+OPENING = REPO / "unity/Assets/UI/Opening/opening.yaml"
+
+
+def problems(doc):
+ """Every paragraph (closing included) has its own source checks; photos have separate reviews."""
+ result = []
+ if doc.get("status") != "sensitivity-reviewed":
+ result.append("opening text needs the owner's sensitivity review")
+ panels = doc.get("panels", [])
+ if [p.get("id") for p in panels] != ["europe", "arab_countries", "yemen"]:
+ result.append("the three approved panels are required in order")
+ paragraphs = [(p.get("id", "?"), p) for p in panels] + [("closing", doc.get("closing", {}))]
+ for name, paragraph in paragraphs:
+ if not paragraph.get("text") or not paragraph.get("sources"):
+ result.append(f"{name}: text and sources required")
+ for i, source in enumerate(paragraph.get("sources", []), 1):
+ if not source.get("url") or not source.get("supports"):
+ result.append(f"{name} source {i}: URL and supported claim required")
+ checked = str(source.get("checked", ""))
+ try:
+ if date.fromisoformat(checked).isoformat() != checked:
+ raise ValueError(checked)
+ except ValueError:
+ result.append(f"{name} source {i}: a person must add checked: YYYY-MM-DD")
+ for panel in panels:
+ image = panel.get("image", {})
+ if not image.get("credit") or not image.get("alt") or not image.get("file"):
+ result.append(f"{panel.get('id')}: photo, alt text and credit required")
+ if image.get("sensitive") is not True or image.get("sensitivity_reviewed") is not True:
+ result.append(f"{panel.get('id')}: photo needs the owner's sensitivity review")
+ return result
+
+
+def actual():
+ return yaml12.load(OPENING.read_text(encoding="utf-8"))
+
+
+def reviewed_fixture():
+ """Only a deep in-memory fixture: this function never writes review markers to disk."""
+ doc = copy.deepcopy(actual())
+ doc["status"] = "sensitivity-reviewed"
+ for paragraph in [*doc["panels"], doc["closing"]]:
+ for source in paragraph["sources"]:
+ source["checked"] = "2026-10-22"
+ for panel in doc["panels"]:
+ panel["image"]["sensitivity_reviewed"] = True
+ return doc
+
+
+def test_the_real_opening_has_every_check():
+ assert problems(actual()) == [], "\n".join(problems(actual()))
+
+
+def test_photo_approval_does_not_approve_draft_text():
+ doc = reviewed_fixture()
+ assert problems(doc) == []
+ doc["status"] = "draft"
+ assert "opening text needs the owner's sensitivity review" in problems(doc)
+ doc["status"] = "sensitivity-reviewed"
+ del doc["closing"]["sources"][0]["checked"]
+ assert any("closing source 1" in p for p in problems(doc))
+
+
+def test_missing_impossible_and_short_dates_are_not_checks():
+ for value in ["", "2026-02-30", "20261022"]:
+ doc = reviewed_fixture()
+ doc["panels"][0]["sources"][0]["checked"] = value
+ assert any("europe source 1" in p for p in problems(doc))
+
+
+def test_photo_credit_and_review_are_checked_separately():
+ doc = reviewed_fixture()
+ doc["panels"][1]["image"]["credit"] = ""
+ doc["panels"][2]["image"]["sensitivity_reviewed"] = False
+ result = problems(doc)
+ assert any("arab_countries: photo, alt text and credit required" in p for p in result)
+ assert any("yemen: photo needs" in p for p in result)
diff --git a/unity/Assets/Editor/Build.cs b/unity/Assets/Editor/Build.cs
index 7fd5f76d7..0df7d4040 100644
--- a/unity/Assets/Editor/Build.cs
+++ b/unity/Assets/Editor/Build.cs
@@ -138,6 +138,28 @@ namespace Statecraft.Game.EditorTools
public static List<EventVideoMapping.Row> GatedClips(string yaml) =>
EventVideoMapping.Parse(yaml).Concat(EventVideoMapping.ParseOutcomes(yaml)).ToList();
+ const string OpeningCatalogPath = "Assets/Resources/OpeningContent.asset";
+
+ /// <summary>The opening (#530) in a shareable build: its catalog must load, its three photographs must have the
+ /// owner's sensitivity review, as event photographs do, and its text must be reviewed with every source checked
+ /// (owner, "Photos and text"), so a shareable build carries neither draft photographs nor draft text.</summary>
+ public static string? OpeningShareableRefusal(OpeningContent? opening)
+ {
+ if (opening == null) return "the opening catalog is missing or did not load (" + OpeningCatalogPath + ")";
+ try
+ {
+ var data = opening.Read();
+ var reasons = new List<string>();
+ if (!data.PhotosReviewed)
+ reasons.Add("an opening photograph needs the owner's sensitivity review (" + OpeningContent.SourcePath + ", sensitivity_reviewed)");
+ if (!data.TextReviewed)
+ reasons.Add("the opening text needs the owner's review and every source checked (" + OpeningContent.SourcePath
+ + ", status: " + Statecraft.Sim.ReleaseGate.ReviewedStatus + " and checked: on each source)");
+ return reasons.Count == 0 ? null : string.Join("; ", reasons);
+ }
+ catch (InvalidOperationException e) { return "the opening cannot be read: " + e.Message; }
+ }
+
/// <summary>Logs "BUILD REFUSED ..." and exits 1 when the gate refuses this build; true if it did. The photographs
/// checked are the catalog the build ships (Resources/EventImageCatalog.asset), cross-checked against the mapping.</summary>
static bool RefuseUnlessShareable()
@@ -157,6 +179,8 @@ namespace Statecraft.Game.EditorTools
var stringRefusal = SettlementControlStringReview.Refusal(review, en, he);
refusal = GateRefusal(args, Statecraft.Sim.ContentLoader.Load(Paths.Content), photos,
File.Exists(EventImageImport.CatalogPath), mapping, clips, stringRefusal);
+ var opening = OpeningShareableRefusal(AssetDatabase.LoadAssetAtPath<OpeningContent>(OpeningCatalogPath));
+ if (opening != null) refusal = refusal == null ? opening : refusal + "; " + opening;
}
catch (Exception e) when (e is IOException || e is InvalidOperationException || e is UnauthorizedAccessException)
{
@@ -179,12 +203,28 @@ namespace Statecraft.Game.EditorTools
[Serializable] sealed class PhotoRecord { public string event_id = ""; public bool sensitive; public bool sensitivity_reviewed; }
/// <summary>The manifest's JSON for a build carrying <paramref name="photos"/> (null: none).</summary>
- public static string PhotoManifestJson(EventImageCatalog? photos, bool shareable)
+ public static string PhotoManifestJson(EventImageCatalog? photos, bool shareable) =>
+ JsonUtility.ToJson(CreatePhotoManifest(photos, shareable), true) + "\n";
+
+ static PhotoManifest CreatePhotoManifest(EventImageCatalog? photos, bool shareable)
{
var m = new PhotoManifest { shareable = shareable };
if (photos != null)
foreach (var e in photos.entries.Where(e => e.image != null).OrderBy(e => e.eventId, StringComparer.Ordinal))
m.photos.Add(new PhotoRecord { event_id = e.eventId, sensitive = e.sensitive, sensitivity_reviewed = e.sensitivityReviewed });
+ return m;
+ }
+
+ /// <summary>The manifest the builds write: the event photographs and the opening's three (as "opening/&lt;panel&gt;"), so
+ /// the packager's photo check covers them too; never shareable while the opening's gate refuses.</summary>
+ public static string PhotoManifestWithOpeningJson(EventImageCatalog? photos, bool shareable, OpeningContent? opening)
+ {
+ var m = CreatePhotoManifest(photos, shareable);
+ m.shareable = shareable && OpeningShareableRefusal(opening) == null;
+ if (opening != null)
+ foreach (var panel in opening.Read().Panels)
+ m.photos.Add(new PhotoRecord { event_id = "opening/" + panel.Id,
+ sensitive = panel.Image.Sensitive, sensitivity_reviewed = panel.Image.SensitivityReviewed });
return JsonUtility.ToJson(m, true) + "\n";
}
@@ -194,7 +234,8 @@ namespace Statecraft.Game.EditorTools
{
Directory.CreateDirectory(folder);
var photos = AssetDatabase.LoadAssetAtPath<EventImageCatalog>(EventImageImport.CatalogPath);
- File.WriteAllText(Path.Combine(folder, PhotoManifestName), PhotoManifestJson(photos, Flag("-shareable")));
+ var opening = AssetDatabase.LoadAssetAtPath<OpeningContent>(OpeningCatalogPath);
+ File.WriteAllText(Path.Combine(folder, PhotoManifestName), PhotoManifestWithOpeningJson(photos, Flag("-shareable"), opening));
}
public static void Web()
diff --git a/unity/Assets/Resources/OpeningContent.asset b/unity/Assets/Resources/OpeningContent.asset
new file mode 100644
index 000000000..94663aa88
--- /dev/null
+++ b/unity/Assets/Resources/OpeningContent.asset
@@ -0,0 +1,19 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ 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: 11500000, guid: 3e87568eb4f346999f6e81ac08e6591a, type: 3}
+ m_Name: OpeningContent
+ m_EditorClassIdentifier: Statecraft.Game::Statecraft.Game.UI.OpeningContent
+ source: {fileID: 4900000, guid: 1f114ee53b104b4ca7932077c7dc5e72, type: 3}
+ photos:
+ - {fileID: 2800000, guid: 22b0447fed6f4d06be291bd8f564d387, type: 3}
+ - {fileID: 2800000, guid: 6b804a4b395a4011bcdaae2c3031fdf6, type: 3}
+ - {fileID: 2800000, guid: b6078c31fee3459aa6b505fc3a9045bc, type: 3}
diff --git a/unity/Assets/Resources/OpeningContent.asset.meta b/unity/Assets/Resources/OpeningContent.asset.meta
new file mode 100644
index 000000000..fad485686
--- /dev/null
+++ b/unity/Assets/Resources/OpeningContent.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9c62c041c87e479d8fe51ef2c2918cf8
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/unity/Assets/Scripts/UI/AdvisorPresenter.cs b/unity/Assets/Scripts/UI/AdvisorPresenter.cs
index 5ceaa970c..b2c2bf0bf 100644
--- a/unity/Assets/Scripts/UI/AdvisorPresenter.cs
+++ b/unity/Assets/Scripts/UI/AdvisorPresenter.cs
@@ -173,10 +173,11 @@ namespace Statecraft.Game.UI
}
}
- /// <summary>A modal layer is open (spec 4.2): the start screen, the open decision card, the capture dialog, the turn
- /// report, an outcome clip, the end screen; and, on the two-row HUD, any side screen (it takes the full width).</summary>
+ /// <summary>A modal layer is open (spec 4.2): the start screen, the opening (#530), the open decision card, the capture
+ /// dialog, the turn report, an outcome clip, the end screen; and, on the two-row HUD, any side screen (it takes the full width).</summary>
public static bool Covered(VisualElement hudRoot) =>
- hudRoot.ClassListContains(StartScreenPresenter.OpenClass) || hudRoot.ClassListContains(EventCardPresenter.OpenClass)
+ hudRoot.ClassListContains(StartScreenPresenter.OpenClass) || hudRoot.ClassListContains(OpeningPresenter.OpenClass)
+ || hudRoot.ClassListContains(EventCardPresenter.OpenClass)
|| hudRoot.ClassListContains(CaptureDialogPresenter.OpenClass) || hudRoot.ClassListContains(TurnReportPresenter.OpenClass)
|| hudRoot.ClassListContains(OutcomePresenter.OpenClass) || hudRoot.ClassListContains(EndScreenPresenter.OpenClass)
|| (hudRoot.ClassListContains(HudPresenter.TwoRowClass) && hudRoot.ClassListContains(ScreenNav.ScreenOpenClass));
@@ -569,7 +570,8 @@ namespace Statecraft.Game.UI
Render();
}
- bool HardMediaCover() => hudRoot.ClassListContains(StartScreenPresenter.OpenClass) || hudRoot.ClassListContains(EventCardPresenter.OpenClass)
+ bool HardMediaCover() => hudRoot.ClassListContains(StartScreenPresenter.OpenClass) || hudRoot.ClassListContains(OpeningPresenter.OpenClass)
+ || hudRoot.ClassListContains(EventCardPresenter.OpenClass)
|| hudRoot.ClassListContains(CaptureDialogPresenter.OpenClass) || hudRoot.ClassListContains(TurnReportPresenter.OpenClass)
|| hudRoot.ClassListContains(OutcomePresenter.OpenClass) || hudRoot.ClassListContains(EndScreenPresenter.OpenClass)
|| hudRoot.ClassListContains(FeedbackPresenter.OpenClass) || hudRoot.ClassListContains(SharePresenter.OpenClass);
diff --git a/unity/Assets/Scripts/UI/GameRoot.cs b/unity/Assets/Scripts/UI/GameRoot.cs
index 81433fc63..b64998ce1 100644
--- a/unity/Assets/Scripts/UI/GameRoot.cs
+++ b/unity/Assets/Scripts/UI/GameRoot.cs
@@ -53,6 +53,7 @@ namespace Statecraft.Game.UI
MapLabelsPresenter? labels;
ScreenNav? nav;
StartScreenPresenter? start;
+ OpeningPresenter? opening;
EventCardPresenter? card;
/// <summary>Tests: the decision card of the last Begin.</summary>
internal EventCardPresenter? Card => card;
@@ -101,6 +102,9 @@ namespace Statecraft.Game.UI
/// a temporary folder.</summary>
internal SettingsStore? Settings { get; set; }
SettingsStore? SettingsFile() => Settings ?? (Application.isPlaying ? SettingsStore.ForPlatform() : null);
+ /// <summary>The opening (#530) outside Play mode: off by default, so EditMode tests that press New Game meet the advisors
+ /// as a player's first game does; the opening's own tests set it.</summary>
+ internal bool OpeningInEditMode { get; set; }
public void Configure(GameBoot boot, UIDocument document, TextAsset strings, TextAsset stringsHe, PortraitCatalog portraits,
MapScene map, PlacementLayer placements, MapPointer pointer, CameraController cameraController)
@@ -222,6 +226,10 @@ namespace Statecraft.Game.UI
(map, nameof(map)), (placements, nameof(placements)), (pointer, nameof(pointer)), (cameraController, nameof(cameraController)) })
if (value == null) throw new InvalidOperationException($"GameRoot: {field} is not assigned (run MapCapture.MakeScene)");
if (map.Terrain == null) throw new InvalidOperationException("GameRoot: the map is not built (GameBoot builds it before Ready)");
+ // The opening (#530) plays in Play mode and players, never in a smoke run or an automated one; in EditMode only
+ // where a test asks for it with the start screen (OpeningInEditMode).
+ bool enableOpening = smoke == 0 && !StartScreenPresenter.Skipped()
+ && (Application.isPlaying || startScreen && OpeningInEditMode);
Shutdown();
smokeRun = smoke > 0;
@@ -413,7 +421,7 @@ namespace Statecraft.Game.UI
endClosed = false;
// An outcome clip holds the pointer while it shows and in the frame it closes (the skipping click selects no hex).
- Func<Vector2, bool> overUi = p => outcomes?.HoldsThePointer == true || UiPointer.IsOverUi(root.panel, p, Screen.height);
+ Func<Vector2, bool> overUi = p => opening?.HoldsThePointer == true || outcomes?.HoldsThePointer == true || UiPointer.IsOverUi(root.panel, p, Screen.height);
var terrain = map.Terrain;
var size = terrain.terrainData.size;
var oldBounds = cameraController.Bounds;
@@ -516,6 +524,33 @@ namespace Statecraft.Game.UI
drawn = null; drawnSites = null;
RenderPlacementsIfChanged();
SyncMinimap();
+ // The opening (#530): three sourced stills after New Game and before the first turn, skippable, and replayable
+ // from the start screen. It reads no sim state. A player build shows it only once its text and photographs are
+ // reviewed (OpeningContent.MayPresent); the Editor shows the draft with a visible preview label, for QA.
+ var replayOpening = root.Q<Button>("start-opening-replay");
+ replayOpening.style.display = DisplayStyle.None;
+ if (enableOpening && OpeningContent.Load() is OpeningContent openingSource)
+ {
+ var openingData = openingSource.Read();
+#if UNITY_EDITOR
+ const bool editorPreview = true;
+#else
+ const bool editorPreview = false;
+#endif
+ if (OpeningContent.MayPresent(openingData, editorPreview))
+ {
+ // A new game's opening hands over to the advisors' opening chain when it closes; a replay returns to
+ // the start screen. Closing the scene disposes it after the camera is gone, hence the null check.
+ opening = Own(new OpeningPresenter(root, openingSource, openingData, text,
+ shown => { if (cameraController != null) cameraController.enabled = !shown && start?.IsOpen != true; },
+ replay => { if (!replay) advisor?.NewGame(); }));
+ replayOpening.text = text["opening.replay"];
+ replayOpening.style.display = DisplayStyle.Flex;
+ Action replayClick = () => { if (start?.IsOpen == true) opening?.Show(replay: true); };
+ replayOpening.clicked += replayClick;
+ owned.Add(new Undo(() => replayOpening.clicked -= replayClick));
+ }
+ }
// 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 (showsStart) // newGame is made above whenever smoke == 0
@@ -525,7 +560,7 @@ namespace Statecraft.Game.UI
start = Own(new StartScreenPresenter(root, newGame!, resumed, shown =>
{
if (cam != null) cam.enabled = !shown;
- if (!shown) { if (start?.Resumed == false) advisor?.NewGame(); else advisor?.Resume(); }
+ if (!shown) { if (start?.Resumed != false) advisor?.Resume(); else if (opening == null) advisor?.NewGame(); }
}, recording, text, SettingsFile(), switchLanguage));
start.Show();
}
@@ -606,7 +641,21 @@ namespace Statecraft.Game.UI
budget.UnsubmittedChanged += advisor.BudgetUnsubmitted;
if (video != null)
advisor.Media = new AdvisorMedia(text, new ClipPicture(video), new StillPicture(), DeclarationRecording.WebFetch, new DeclarationRecording.SourceOutput());
- if (newGame != null) newGame.Started += advisor.NewGame;
+ // A new game, from the start screen or the top bar's New game, plays the opening first when there is one.
+ if (newGame != null)
+ {
+ // The start screen's no-save New Game has no Started; its closing already starts the advisors when there
+ // is no opening, so that route only plays the opening.
+ Action freshGame = () => { if (opening != null) opening.Show(replay: false); else advisor?.NewGame(); };
+ Action freshOpened = () => opening?.Show(replay: false);
+ newGame.Started += freshGame;
+ if (start != null) start.FreshGameOpened += freshOpened;
+ owned.Add(new Undo(() =>
+ {
+ newGame.Started -= freshGame;
+ if (start != null) start.FreshGameOpened -= freshOpened;
+ }));
+ }
if (hebrew) Own(new UiDirection(root, bridge));
root.Q("root")?.RemoveFromClassList("loading"); // ready: the bar, panels and screens may show (P2-1)
DiagLog.BootPhase("screens ready");
@@ -816,7 +865,7 @@ namespace Statecraft.Game.UI
for (int i = owned.Count - 1; i >= 0; i--) owned[i].Dispose();
owned.Clear();
if (hoveredCity != null) { hoveredCity = null; HandCursor(false); } // the next Begin's pills start unlit
- minimap = null; unseenSkipped = null; labels = null; nav = null; start = null; card = null; outcomes = null; report = null; end = null; advisor = null; feedback = null; share = null; info = null; rig = null; drawn = null; drawnSites = null; units = null; Regions = null; logCamera = false;
+ minimap = null; unseenSkipped = null; labels = null; nav = null; start = null; opening = null; card = null; outcomes = null; report = null; end = null; advisor = null; feedback = null; share = null; info = null; rig = null; drawn = null; drawnSites = null; units = null; Regions = 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;
@@ -920,6 +969,9 @@ namespace Statecraft.Game.UI
yield break;
}
if (!Press(root.Q<Button>("start-new-game"), s => log(s.Replace("SMOKE FAIL", "FIRST CARD FAIL")))) yield break;
+ // A reviewed opening is part of the normal media path: the instrument uses its actual Skip control.
+ if (hud.ClassListContains(OpeningPresenter.OpenClass)
+ && !Press(root.Q<Button>("opening-skip"), s => log(s.Replace("SMOKE FAIL", "FIRST CARD FAIL")))) yield break;
while (now() - began <= FirstCardBudgetSeconds)
{
var option = root.Q<VisualElement>("event-options")?.Q<Button>();
@@ -963,9 +1015,11 @@ namespace Statecraft.Game.UI
// takes the Cancel event when it has the focus), and so on the open capture dialog (CaptureDialogPresenter.Escape),
// which shows only while the card does not.
// The report panel (#1169) and the share panel (#1170) are over everything: their Escape goes no further.
+ // Nor does the opening's (#530), over all but those two, in the frame it closes too.
// Nor does the advisors' popup's, with the focus inside it (AdvisorPresenter.Escape, also in the frame its Cancel closed it).
if (UnityEngine.InputSystem.Keyboard.current?.escapeKey.wasPressedThisFrame == true
- && feedback?.Escape() != true && share?.Escape() != true && advisor?.Escape() != true)
+ && feedback?.Escape() != true && share?.Escape() != true && advisor?.Escape() != true
+ && opening?.ClosedThisFrame != true && opening?.Escape() != true)
{
bool done = outcomes?.SkipAll() == true || outcomes?.ClosedThisFrame == true;
if (!done) done = advisor?.CloseOverlay() == true || advisor?.OverlayClosedThisFrame == true;
diff --git a/unity/Assets/Scripts/UI/KeyScroll.cs b/unity/Assets/Scripts/UI/KeyScroll.cs
index 6ef36529c..28f1214e0 100644
--- a/unity/Assets/Scripts/UI/KeyScroll.cs
+++ b/unity/Assets/Scripts/UI/KeyScroll.cs
@@ -43,6 +43,7 @@ namespace Statecraft.Game.UI
static ScrollView? Target(VisualElement root, string? screen, bool cardOpen)
{
+ if ((root.Q("root") ?? root).ClassListContains(OpeningPresenter.OpenClass)) return root.Q<ScrollView>("opening-scroll");
if ((root.Q("root") ?? root).ClassListContains(StartScreenPresenter.OpenClass)) return null;
if (screen == null) return cardOpen ? root.Q<ScrollView>("event-scroll") : null;
var open = root.Q<VisualElement>("screen-" + screen);
diff --git a/unity/Assets/Scripts/UI/OpeningContent.cs b/unity/Assets/Scripts/UI/OpeningContent.cs
new file mode 100644
index 000000000..68f936488
--- /dev/null
+++ b/unity/Assets/Scripts/UI/OpeningContent.cs
@@ -0,0 +1,114 @@
+#nullable enable
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using UnityEngine;
+using YamlDotNet.Serialization;
+using YamlDotNet.Serialization.NamingConventions;
+
+namespace Statecraft.Game.UI
+{
+ /// <summary>#530: references the existing opening YAML and photographs, without copying them into game content.
+ /// One strict reader serves the presenter and the shareable-build gate (Build.OpeningShareableRefusal); it writes no review marker.</summary>
+ public sealed class OpeningContent : ScriptableObject
+ {
+ public const string ResourcePath = "OpeningContent";
+ public const string SourcePath = "Assets/UI/Opening/opening.yaml";
+ public TextAsset source = null!;
+ public Texture2D[] photos = Array.Empty<Texture2D>();
+ public static OpeningContent? Load() => Resources.Load<OpeningContent>(ResourcePath);
+
+ public sealed class Source
+ {
+ public string Url { get; set; } = "";
+ public string Supports { get; set; } = "";
+ public string Checked { get; set; } = "";
+ public bool IsChecked => !string.IsNullOrWhiteSpace(Url) && !string.IsNullOrWhiteSpace(Supports) && DateTime.TryParseExact(Checked,
+ "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out _);
+ }
+ public sealed class Arrival
+ {
+ public string Country { get; set; } = "";
+ public int Count { get; set; }
+ }
+ public sealed class Image
+ {
+ public string File { get; set; } = "";
+ public string Commons { get; set; } = "";
+ public string Original { get; set; } = "";
+ public string Sha1 { get; set; } = "";
+ public List<int> OriginalSize { get; set; } = new List<int>();
+ public string Licence { get; set; } = "";
+ public string Artist { get; set; } = "";
+ public string Credit { get; set; } = "";
+ public string Alt { get; set; } = "";
+ public List<double> Crop { get; set; } = new List<double>();
+ public bool Sensitive { get; set; }
+ public bool SensitivityReviewed { get; set; }
+ public string Note { get; set; } = "";
+ }
+ public class Paragraph
+ {
+ public string Text { get; set; } = "";
+ public List<Source> Sources { get; set; } = new List<Source>();
+ public bool Checked => !string.IsNullOrWhiteSpace(Text) && Sources != null && Sources.Count > 0 && Sources.All(s => s != null && s.IsChecked);
+ }
+ public sealed class Panel : Paragraph
+ {
+ public string Id { get; set; } = "";
+ public string Title { get; set; } = "";
+ public List<Arrival> Arrivals { get; set; } = new List<Arrival>();
+ public Image Image { get; set; } = new Image();
+ }
+ public sealed class Document
+ {
+ public string Status { get; set; } = "";
+ public List<Panel> Panels { get; set; } = new List<Panel>();
+ public Paragraph Closing { get; set; } = new Paragraph();
+ public bool PhotosReviewed => Panels != null && Panels.Count == 3 && Panels.All(p => p != null && p.Image != null
+ && p.Image.Sensitive && p.Image.SensitivityReviewed);
+ public bool TextReviewed => Status == Statecraft.Sim.ReleaseGate.ReviewedStatus && Closing != null && Closing.Checked
+ && Panels != null && Panels.Count == 3 && Panels.All(p => p != null && p.Checked);
+ public bool Reviewed => PhotosReviewed && TextReviewed;
+ }
+
+ /// <summary>The approved three-panel structure; unknown or repeated YAML fields fail closed.</summary>
+ public static Document Parse(string yaml)
+ {
+ try
+ {
+ var doc = new DeserializerBuilder().WithNamingConvention(UnderscoredNamingConvention.Instance)
+ .WithDuplicateKeyChecking().Build().Deserialize<Document>(yaml ?? "");
+ if (doc == null || doc.Panels == null || doc.Closing == null || doc.Closing.Sources == null
+ || string.IsNullOrWhiteSpace(doc.Closing.Text) || doc.Panels.Any(p => p == null || p.Image == null || p.Sources == null
+ || p.Arrivals == null || string.IsNullOrWhiteSpace(p.Text) || string.IsNullOrWhiteSpace(p.Title)))
+ throw new InvalidOperationException(SourcePath + ": missing paragraph or image");
+ if (!doc.Panels.Select(p => p.Id).SequenceEqual(new[] { "europe", "arab_countries", "yemen" }))
+ throw new InvalidOperationException(SourcePath + ": expected Europe, Arab countries and Yemen in order");
+ foreach (var paragraph in doc.Panels.Cast<Paragraph>().Concat(new[] { doc.Closing }))
+ if (paragraph.Sources.Count == 0 || paragraph.Sources.Any(s => s == null
+ || string.IsNullOrWhiteSpace(s.Url) || string.IsNullOrWhiteSpace(s.Supports)))
+ throw new InvalidOperationException(SourcePath + ": paragraph source or supported claim missing");
+ foreach (var p in doc.Panels)
+ if (p.Image.File != "opening_" + p.Id + ".jpg" || string.IsNullOrWhiteSpace(p.Image.Credit)
+ || string.IsNullOrWhiteSpace(p.Image.Alt))
+ throw new InvalidOperationException(SourcePath + ": photograph or credit missing for " + p.Id);
+ return doc;
+ }
+ catch (YamlDotNet.Core.YamlException e) { throw new InvalidOperationException(SourcePath + ": " + e.Message, e); }
+ }
+
+ public Document Read()
+ {
+ if (source == null) throw new InvalidOperationException(SourcePath + ": source is not assigned");
+ var data = Parse(source.text);
+ if (photos == null || photos.Length != data.Panels.Count || photos.Any(p => p == null))
+ throw new InvalidOperationException(SourcePath + ": the three photograph references are not assigned");
+ return data;
+ }
+
+ /// <summary>A fixture or an AI reading cannot approve the prose. Only Editor QA may preview a labelled draft.</summary>
+ public static bool MayPresent(Document data, bool editorPreview) => data.PhotosReviewed && (data.TextReviewed || editorPreview);
+ }
+}
diff --git a/unity/Assets/Scripts/UI/OpeningContent.cs.meta b/unity/Assets/Scripts/UI/OpeningContent.cs.meta
new file mode 100644
index 000000000..cdcb0ac3d
--- /dev/null
+++ b/unity/Assets/Scripts/UI/OpeningContent.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 3e87568eb4f346999f6e81ac08e6591a
diff --git a/unity/Assets/Scripts/UI/OpeningPresenter.cs b/unity/Assets/Scripts/UI/OpeningPresenter.cs
new file mode 100644
index 000000000..4b0cc65fe
--- /dev/null
+++ b/unity/Assets/Scripts/UI/OpeningPresenter.cs
@@ -0,0 +1,126 @@
+#nullable enable
+using System;
+using System.Globalization;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UIElements;
+
+namespace Statecraft.Game.UI
+{
+ /// <summary>#530: three sourced stills and a closing line. No bridge, commands, RNG or save access.</summary>
+ public sealed class OpeningPresenter : IDisposable
+ {
+ public const string OpenClass = "opening-open";
+ readonly VisualElement root, layer, photo;
+ readonly Label title, body, arrivals, closing, credit, count, preview;
+ readonly Button next, back, skip;
+ readonly ScrollView scroll;
+ readonly OpeningContent catalog;
+ readonly OpeningContent.Document data;
+ readonly UiText text;
+ readonly Action<bool> shownChanged, finished;
+ readonly Action onNext, onBack, onSkip;
+ readonly EventCallback<NavigationCancelEvent> onCancel;
+ readonly EventCallback<NavigationMoveEvent> onMove;
+ readonly PressSource presses;
+ bool replay, disposed;
+ int closedFrame = -1;
+ public int Index { get; private set; }
+ public bool IsOpen { get; private set; }
+ public bool ClosedThisFrame => closedFrame == Time.frameCount;
+ public bool HoldsThePointer => IsOpen || ClosedThisFrame;
+
+ public OpeningPresenter(VisualElement root, OpeningContent catalog, OpeningContent.Document data, UiText text,
+ Action<bool> shownChanged, Action<bool> finished)
+ {
+ this.root = root.Q("root") ?? root; this.catalog = catalog; this.data = data; this.text = text;
+ this.shownChanged = shownChanged; this.finished = finished;
+ layer = root.Q("opening-layer"); photo = layer.Q("opening-photo");
+ title = layer.Q<Label>("opening-title"); body = layer.Q<Label>("opening-text");
+ arrivals = layer.Q<Label>("opening-arrivals"); closing = layer.Q<Label>("opening-closing"); credit = layer.Q<Label>("opening-credit");
+ count = layer.Q<Label>("opening-count"); preview = layer.Q<Label>("opening-preview");
+ scroll = layer.Q<ScrollView>("opening-scroll");
+ next = layer.Q<Button>("opening-next"); back = layer.Q<Button>("opening-back"); skip = layer.Q<Button>("opening-skip");
+ back.text = text["opening.back"]; skip.text = text["opening.skip"];
+ preview.text = text["opening.preview"]; preview.style.display = data.Reviewed ? DisplayStyle.None : DisplayStyle.Flex;
+ // The historical prose, title, arrivals and credit remain the original English, including in the Hebrew UI.
+ foreach (var label in new[] { title, body, arrivals, closing, credit }) label.languageDirection = LanguageDirection.LTR;
+ onNext = Next; onBack = Back; onSkip = () => Close(finish: true);
+ next.clicked += onNext; back.clicked += onBack; skip.clicked += onSkip;
+ onCancel = e => { if (Escape()) e.StopPropagation(); };
+ onMove = e =>
+ {
+ if (!IsOpen || e.direction != NavigationMoveEvent.Direction.Next && e.direction != NavigationMoveEvent.Direction.Previous) return;
+ var buttons = new[] { back, next, skip }.Where(b => b.enabledInHierarchy).ToArray();
+ int at = Array.FindIndex(buttons, b => ReferenceEquals(b, layer.focusController?.focusedElement));
+ int step = e.direction == NavigationMoveEvent.Direction.Next ? 1 : -1;
+ buttons[at < 0 ? (step > 0 ? 0 : buttons.Length - 1) : (at + step + buttons.Length) % buttons.Length].Focus();
+ layer.focusController?.IgnoreEvent(e); e.StopPropagation();
+ };
+ layer.RegisterCallback(onCancel); layer.RegisterCallback(onMove);
+ presses = new PressSource(layer);
+ layer.style.display = DisplayStyle.None;
+ }
+
+ public void Show(bool replay)
+ {
+ if (disposed || IsOpen || !data.PhotosReviewed) return;
+ this.replay = replay; Index = 0; IsOpen = true;
+ root.AddToClassList(OpenClass); layer.style.display = DisplayStyle.Flex;
+ ScreenNav.DisableCovered(root);
+ shownChanged(true); Render();
+ next.Focus();
+ layer.schedule.Execute(() => { if (IsOpen && layer.focusController?.focusedElement == null) next.Focus(); });
+ }
+
+ void Render()
+ {
+ bool last = Index == data.Panels.Count - 1;
+ var panel = data.Panels[Index];
+ title.text = panel.Title;
+ body.text = panel.Text;
+ photo.style.backgroundImage = new StyleBackground(catalog.photos[Index]);
+ photo.tooltip = panel.Image.Alt;
+ credit.text = panel.Image.Credit;
+ arrivals.text = string.Join(" · ", panel.Arrivals.Select(a =>
+ a.Country + ": " + a.Count.ToString("N0", CultureInfo.InvariantCulture)));
+ closing.text = last ? data.Closing.Text : "";
+ closing.style.display = last ? DisplayStyle.Flex : DisplayStyle.None;
+ count.text = text.Format("opening.count", Index + 1, data.Panels.Count);
+ back.SetEnabled(Index > 0);
+ next.text = last ? text[replay ? "opening.return" : "opening.begin"] : text["opening.next"];
+ scroll.scrollOffset = Vector2.zero;
+ }
+
+ void Next()
+ {
+ if (!IsOpen) return;
+ if (Index == data.Panels.Count - 1) { Close(finish: true); return; }
+ Index++; Render();
+ }
+ void Back() { if (!IsOpen || Index == 0) return; Index--; Render(); }
+ public bool Escape() { if (!IsOpen) return false; Close(finish: true); return true; }
+
+ void Close(bool finish)
+ {
+ if (!IsOpen) return;
+ IsOpen = false; closedFrame = Time.frameCount;
+ layer.style.display = DisplayStyle.None; root.RemoveFromClassList(OpenClass);
+ ScreenNav.DisableCovered(root); shownChanged(false);
+ if (finish && presses.ByKeyboard)
+ {
+ var target = replay ? root.Q<Button>("start-opening-replay") : root.Q<Button>("end-turn");
+ if (replay || !root.ClassListContains(EventCardPresenter.OpenClass)) FocusReturn.To(target);
+ }
+ if (finish) finished(replay);
+ }
+
+ public void Dispose()
+ {
+ if (disposed) return;
+ disposed = true; Close(finish: false);
+ next.clicked -= onNext; back.clicked -= onBack; skip.clicked -= onSkip;
+ layer.UnregisterCallback(onCancel); layer.UnregisterCallback(onMove); presses.Dispose();
+ }
+ }
+}
diff --git a/unity/Assets/Scripts/UI/OpeningPresenter.cs.meta b/unity/Assets/Scripts/UI/OpeningPresenter.cs.meta
new file mode 100644
index 000000000..8ecde4b34
--- /dev/null
+++ b/unity/Assets/Scripts/UI/OpeningPresenter.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: c3858bf07cfa42e596aa57f139be5fe2
diff --git a/unity/Assets/Scripts/UI/ScreenNav.cs b/unity/Assets/Scripts/UI/ScreenNav.cs
index a7290d418..723de751a 100644
--- a/unity/Assets/Scripts/UI/ScreenNav.cs
+++ b/unity/Assets/Scripts/UI/ScreenNav.cs
@@ -44,7 +44,9 @@ namespace Statecraft.Game.UI
public static void DisableCovered(VisualElement root)
{
var r = root.Q("root") ?? root;
- bool start = r.ClassListContains(StartScreenPresenter.OpenClass);
+ bool opening = r.ClassListContains(OpeningPresenter.OpenClass);
+ bool start = r.ClassListContains(StartScreenPresenter.OpenClass) || opening;
+ r.Q("start-screen")?.SetEnabled(!opening);
bool screen = r.ClassListContains(ScreenOpenClass);
bool full = screen && r.ClassListContains(HudPresenter.TwoRowClass);
bool fullWindow = screen && r.ClassListContains(HudPresenter.TightClass) && r.ClassListContains(HudPresenter.ThreeRowClass);
diff --git a/unity/Assets/Scripts/UI/StartScreenPresenter.cs b/unity/Assets/Scripts/UI/StartScreenPresenter.cs
index e8d246902..fc736f023 100644
--- a/unity/Assets/Scripts/UI/StartScreenPresenter.cs
+++ b/unity/Assets/Scripts/UI/StartScreenPresenter.cs
@@ -62,11 +62,14 @@ namespace Statecraft.Game.UI
string? loggedCentres;
/// <summary>The buttons ButtonCentres reports, by name.</summary>
- public static readonly string[] Buttons = { "start-continue", "start-new-game", "start-star", "start-listen" };
+ public static readonly string[] Buttons = { "start-continue", "start-new-game", "start-opening-replay", "start-star", "start-listen" };
/// <summary>Continue is offered: the session continues the autosave.</summary>
public bool Resumed { get; private set; }
+ /// <summary>The no-save New Game route: its session already exists, so NewGamePresenter.Started does not fire.</summary>
+ public event Action? FreshGameOpened;
+
readonly DeclarationRecording? recording;
/// <param name="recording">The "Play the recording" button's player (null in tests that do not need it); the screen
@@ -211,7 +214,7 @@ namespace Statecraft.Game.UI
void NewGame()
{
if (!IsOpen) return;
- if (!Resumed) { Close(); return; } // nothing to wipe: the session is already a new game
+ if (!Resumed) { Close(); FreshGameOpened?.Invoke(); 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)
}
diff --git a/unity/Assets/Tests/EditMode/OpeningBuildGateTests.cs b/unity/Assets/Tests/EditMode/OpeningBuildGateTests.cs
new file mode 100644
index 000000000..e7ee53e41
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/OpeningBuildGateTests.cs
@@ -0,0 +1,155 @@
+#nullable enable
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using NUnit.Framework;
+using Statecraft.Game;
+using Statecraft.Game.UI;
+using Statecraft.Sim;
+using UnityEditor;
+using UnityEngine;
+using YamlDotNet.RepresentationModel;
+using Object = UnityEngine.Object;
+
+/// <summary>The opening's build gate (#530): a shareable build refuses an opening photograph without the owner's sensitivity
+/// review, and draft text or an unchecked source (owner, "Photos and text"); the photo manifest lists the three photographs
+/// so the packager checks them too. Fixtures change cloned objects and YAML in memory only, never the reviews on disk.
+/// Build is in the Editor assembly, so it is reached by reflection, as BuildGateTests does.</summary>
+public class OpeningBuildGateTests
+{
+ readonly List<Object> owned = new List<Object>();
+ static Type BuildType()
+ {
+ var type = Type.GetType("Statecraft.Game.EditorTools.Build, Assembly-CSharp-Editor");
+ Assert.IsNotNull(type, "the real Editor Build assembly must be compiled and loaded");
+ return type!;
+ }
+ static MethodInfo Require(string name)
+ {
+ var method = BuildType().GetMethod(name, BindingFlags.Public | BindingFlags.Static);
+ Assert.IsNotNull(method, "Build." + name + " must exist (#530)");
+ return method!;
+ }
+ static YamlMappingNode Read(string text)
+ {
+ var yaml = new YamlStream(); yaml.Load(new StringReader(text));
+ return (YamlMappingNode)yaml.Documents[0].RootNode;
+ }
+ static YamlNode Get(YamlMappingNode map, string key) => map.Children[new YamlScalarNode(key)];
+ static void Set(YamlMappingNode map, string key, string value) => map.Children[new YamlScalarNode(key)] = new YamlScalarNode(value);
+ static List<YamlMappingNode> Panels(YamlMappingNode doc) => ((YamlSequenceNode)Get(doc, "panels")).Children.Cast<YamlMappingNode>().ToList();
+ static List<YamlMappingNode> Sources(YamlMappingNode paragraph) => ((YamlSequenceNode)Get(paragraph, "sources")).Children.Cast<YamlMappingNode>().ToList();
+ static List<YamlMappingNode> Photos(YamlMappingNode json) => ((YamlSequenceNode)Get(json, "photos")).Children.Cast<YamlMappingNode>().ToList();
+
+ OpeningContent Fixture(Action<YamlMappingNode>? change = null)
+ {
+ var shipped = AssetDatabase.LoadAssetAtPath<OpeningContent>("Assets/Resources/OpeningContent.asset");
+ Assert.IsNotNull(shipped, "the product's reference-only catalog");
+ var copy = Object.Instantiate(shipped); owned.Add(copy);
+ copy.photos = shipped.photos.ToArray();
+ var yaml = new YamlStream(); yaml.Load(new StringReader(shipped.source.text));
+ var doc = (YamlMappingNode)yaml.Documents[0].RootNode;
+ Set(doc, "status", "sensitivity-reviewed");
+ foreach (var paragraph in Panels(doc).Concat(new[] { (YamlMappingNode)Get(doc, "closing") }))
+ foreach (var source in Sources(paragraph)) Set(source, "checked", "2026-10-22");
+ foreach (var panel in Panels(doc))
+ {
+ var image = (YamlMappingNode)Get(panel, "image");
+ Set(image, "sensitive", "true"); Set(image, "sensitivity_reviewed", "true");
+ }
+ change?.Invoke(doc);
+ using var writer = new StringWriter(); yaml.Save(writer, false);
+ var text = new TextAsset(writer.ToString()); owned.Add(text); copy.source = text;
+ return copy; // a fully checked fixture is not a human approval of the shipped data
+ }
+ [TearDown]
+ public void Clean() { for (int i = owned.Count - 1; i >= 0; i--) Object.DestroyImmediate(owned[i]); owned.Clear(); }
+
+ [TestCase("draft status")]
+ [TestCase("unchecked source")]
+ public void GatedTextRefusesTheShareableBuild(string gap)
+ {
+ var gate = Require("OpeningShareableRefusal");
+ var draft = Fixture(doc =>
+ {
+ if (gap == "draft status") Set(doc, "status", "draft");
+ else Sources((YamlMappingNode)Get(doc, "closing"))[0].Children.Remove(new YamlScalarNode("checked"));
+ });
+ Assert.IsTrue(draft.Read().PhotosReviewed, "precondition: reviewed photographs, so only the text is gated");
+ Assert.IsNotNull(gate.Invoke(null, new object?[] { draft }), gap + ": gated text must not reach a shareable build");
+ }
+
+ [Test]
+ public void FullyReviewedMemoryFixtureWithAllMediaCanPass()
+ {
+ var gate = Require("OpeningShareableRefusal");
+ var reviewed = Fixture();
+ Assert.IsTrue(reviewed.Read().Reviewed, "precondition: fixture only, not a signed source file");
+ Assert.IsNull(gate.Invoke(null, new object?[] { reviewed }));
+ }
+
+ [TestCase("photo review")]
+ [TestCase("photo reference")]
+ public void AnUnreviewedOrMissingPhotographRefuses(string gap)
+ {
+ var gate = Require("OpeningShareableRefusal");
+ var damaged = Fixture(doc =>
+ {
+ if (gap == "photo review") Set((YamlMappingNode)Get(Panels(doc)[0], "image"), "sensitivity_reviewed", "false");
+ });
+ if (gap == "photo reference") damaged.photos[1] = null!;
+ Assert.IsNotNull(gate.Invoke(null, new object?[] { damaged }), gap + " must not become shareable");
+ }
+
+ [Test]
+ public void TheManifestListsTheThreeOpeningPhotosAndIsNotShareableWhileOneIsUnreviewed()
+ {
+ var manifest = Require("PhotoManifestWithOpeningJson");
+ var unreviewed = Fixture(doc => Set((YamlMappingNode)Get(Panels(doc)[2], "image"), "sensitivity_reviewed", "false"));
+ var doc = Read((string)manifest.Invoke(null, new object?[] { null, true, unreviewed })!);
+ Assert.AreEqual("false", Get(doc, "shareable").ToString(), "a requested shareable flag cannot pass an unreviewed photograph");
+ var rows = Photos(doc);
+ CollectionAssert.AreEqual(new[] { "opening/europe", "opening/arab_countries", "opening/yemen" },
+ rows.Select(p => Get(p, "event_id").ToString()));
+ CollectionAssert.AreEqual(new[] { "true", "true", "false" }, rows.Select(p => Get(p, "sensitivity_reviewed").ToString()),
+ "the packager sees which photograph waits");
+ }
+
+ [Test]
+ public void ReviewedManifestRetainsEveryEventPhotoAlongsideTheOpening()
+ {
+ var manifest = Require("PhotoManifestWithOpeningJson");
+ var photos = AssetDatabase.LoadAssetAtPath<EventImageCatalog>("Assets/Resources/EventImageCatalog.asset");
+ Assert.IsNotNull(photos);
+ var reviewed = Fixture();
+ var doc = Read((string)manifest.Invoke(null, new object?[] { photos, true, reviewed })!);
+ var actual = Photos(doc).Select(p => Get(p, "event_id").ToString()).ToArray();
+ var expected = photos.entries.Where(p => p.image != null).Select(p => p.eventId)
+ .Concat(new[] { "opening/europe", "opening/arab_countries", "opening/yemen" }).ToArray();
+ CollectionAssert.AreEquivalent(expected, actual);
+ Assert.AreEqual("true", Get(doc, "shareable").ToString(), "positive fixture guards against an always-false implementation");
+ }
+
+ [Test]
+ public void RealBuildManifestWriterUsesTheOpeningAwareFunction()
+ {
+ Require("PhotoManifestWithOpeningJson");
+ var writer = BuildType().GetMethod("WritePhotoManifest", BindingFlags.Static | BindingFlags.NonPublic);
+ Assert.IsNotNull(writer, "the production writer used by Web/Mac/Mono builds");
+ Assert.IsFalse(Environment.GetCommandLineArgs().Contains("-shareable"), "this test is a normal Native test, not a shareable build");
+ var source = File.ReadAllBytes(OpeningContent.SourcePath);
+ var folder = Path.Combine(Path.GetTempPath(), "statecraft-opening-manifest-" + Guid.NewGuid().ToString("N"));
+ try
+ {
+ writer!.Invoke(null, new object[] { folder });
+ var doc = Read(File.ReadAllText(Path.Combine(folder, "event-photos.json")));
+ Assert.AreEqual("false", Get(doc, "shareable").ToString(), "a build without -shareable is never shareable");
+ CollectionAssert.AreEqual(new[] { "opening/europe", "opening/arab_countries", "opening/yemen" },
+ Photos(doc).Select(p => Get(p, "event_id").ToString()).Where(id => id.StartsWith("opening/", StringComparison.Ordinal)));
+ CollectionAssert.AreEqual(source, File.ReadAllBytes(OpeningContent.SourcePath), "writer cannot sign off or rewrite the opening");
+ }
+ finally { if (Directory.Exists(folder)) Directory.Delete(folder, true); }
+ }
+}
diff --git a/unity/Assets/Tests/EditMode/OpeningBuildGateTests.cs.meta b/unity/Assets/Tests/EditMode/OpeningBuildGateTests.cs.meta
new file mode 100644
index 000000000..9d56c80a9
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/OpeningBuildGateTests.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 706177edc3a74558a64918372092f757
diff --git a/unity/Assets/Tests/EditMode/OpeningPresenterTests.cs b/unity/Assets/Tests/EditMode/OpeningPresenterTests.cs
new file mode 100644
index 000000000..4fa7a4079
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/OpeningPresenterTests.cs
@@ -0,0 +1,142 @@
+#nullable enable
+using System;
+using System.Linq;
+using NUnit.Framework;
+using Statecraft.Game.UI;
+using UnityEditor;
+using UnityEngine;
+using UnityEngine.UIElements;
+using Object = UnityEngine.Object;
+
+/// <summary>#530: fixtures never confer a human review on the shipped opening data.</summary>
+public class OpeningPresenterTests
+{
+ static OpeningContent Asset => AssetDatabase.LoadAssetAtPath<OpeningContent>("Assets/Resources/OpeningContent.asset");
+ static UiText Text(string lang) => UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(
+ "Assets/UI/strings." + lang + ".yaml").text);
+
+ static OpeningContent.Document ReviewedFixture()
+ {
+ var data = Asset.Read();
+ data.Status = "sensitivity-reviewed";
+ foreach (var source in data.Panels.SelectMany(p => p.Sources).Concat(data.Closing.Sources)) source.Checked = "2026-10-22";
+ foreach (var panel in data.Panels) { panel.Image.Sensitive = true; panel.Image.SensitivityReviewed = true; }
+ return data; // memory only: a fixture is never a human sign-off on the shipped file
+ }
+
+ [Test]
+ public void AReviewedInMemoryFixtureMayBePresentedToPlayers()
+ {
+ var data = ReviewedFixture();
+ Assert.IsTrue(data.Reviewed);
+ Assert.IsTrue(OpeningContent.MayPresent(data, editorPreview: false));
+ }
+
+ [Test]
+ public void ApprovedPhotosDoNotMakeTheDraftTextPlayerReady()
+ {
+ var data = ReviewedFixture();
+ data.Status = "draft";
+ foreach (var source in data.Panels.SelectMany(p => p.Sources).Concat(data.Closing.Sources)) source.Checked = "";
+ Assert.IsFalse(data.Reviewed, "approved-photo fixture does not approve draft text or its unchecked sources");
+ Assert.IsFalse(OpeningContent.MayPresent(data, editorPreview: false), "ordinary players must not see an unchecked draft");
+ Assert.IsTrue(OpeningContent.MayPresent(data, editorPreview: true), "only the labelled Editor preview is available");
+ }
+
+ [Test]
+ public void EditorPreviewNeverBypassesPhotographReview()
+ {
+ var data = Asset.Read();
+ data.Panels[0].Image.SensitivityReviewed = false;
+ Assert.IsFalse(OpeningContent.MayPresent(data, editorPreview: true), "Editor preview only relaxes text review, never photo review");
+ Assert.IsFalse(OpeningContent.MayPresent(data, editorPreview: false));
+ using var ui = new UiTestKit();
+ using var opening = new OpeningPresenter(ui.Root, Asset, data, Text("en"), _ => { }, _ => { });
+ opening.Show(replay: false);
+ Assert.IsFalse(opening.IsOpen, "the actual presenter also refuses an unreviewed photograph");
+ Assert.AreEqual(DisplayStyle.None, ui.Q<VisualElement>("opening-layer").style.display.value);
+ }
+
+ [Test]
+ public void EveryParagraphAndClosingSourceMustHaveACheckedDate()
+ {
+ var data = ReviewedFixture();
+ Assert.IsTrue(OpeningContent.MayPresent(data, editorPreview: false), "an in-memory gate fixture, not a real review");
+ data.Closing.Sources[0].Checked = "";
+ Assert.IsFalse(data.Reviewed, "closing needs its own source check too");
+ data.Closing.Sources[0].Checked = "2026-02-30";
+ Assert.IsFalse(data.Reviewed, "an impossible calendar day is not a checked date");
+ data.Closing.Sources[0].Checked = "2026-10-22";
+ data.Panels[1].Image.SensitivityReviewed = false;
+ Assert.IsFalse(data.Reviewed, "text checks do not approve a photo");
+ }
+
+ [TestCase("en")]
+ [TestCase("he")]
+ public void ThreePanelsAndClosingKeepTheirExactTextAndCredits(string lang)
+ {
+ using var ui = new UiTestKit();
+ var data = Asset.Read();
+ using var opening = new OpeningPresenter(ui.Root, Asset, data, Text(lang), _ => { }, _ => { });
+ opening.Show(replay: true);
+ Assert.IsTrue(opening.IsOpen);
+ Assert.IsTrue(ui.Q<VisualElement>("root").ClassListContains(OpeningPresenter.OpenClass));
+ Assert.IsFalse(ui.Q<VisualElement>("top-bar").enabledInHierarchy, "HUD keys cannot reach covered controls");
+ Assert.IsFalse(ui.Q<VisualElement>("start-screen").enabledInHierarchy, "the replay's start screen cannot receive input underneath");
+ Assert.IsFalse(ui.Q<Button>("opening-back").enabledSelf);
+ Assert.AreEqual(Text(lang)["opening.skip"], ui.Q<Button>("opening-skip").text);
+ Assert.AreEqual(Text(lang)["opening.preview"], ui.Q<Label>("opening-preview").text);
+ for (int i = 0; i < 3; i++)
+ {
+ Assert.AreEqual(i, opening.Index);
+ Assert.AreEqual(data.Panels[i].Text, ui.Q<Label>("opening-text").text);
+ Assert.AreEqual(data.Panels[i].Image.Credit, ui.Q<Label>("opening-credit").text);
+ Assert.AreEqual(LanguageDirection.LTR, ui.Q<Label>("opening-text").languageDirection,
+ "the approved-source English fallback is not labelled Hebrew");
+ Assert.AreEqual(Text(lang).Format("opening.count", i + 1, 3), ui.Q<Label>("opening-count").text,
+ "the approved opening has exactly three panels, not a fourth closing screen");
+ Assert.AreEqual(i == 2 ? data.Closing.Text : "", ui.Q<Label>("opening-closing").text);
+ if (i < 2) UiTestKit.Press(ui.Q<Button>("opening-next"));
+ }
+ Assert.IsTrue(opening.IsOpen, "the third panel retains its image, arrivals and closing line together");
+ Assert.AreEqual(2, opening.Index);
+ Assert.AreEqual(data.Closing.Text, ui.Q<Label>("opening-closing").text);
+ UiTestKit.Press(ui.Q<Button>("opening-back"));
+ Assert.AreEqual(1, opening.Index);
+ Assert.AreEqual(data.Panels[1].Image.Credit, ui.Q<Label>("opening-credit").text);
+ UiTestKit.Press(ui.Q<Button>("opening-next"));
+ UiTestKit.Press(ui.Q<Button>("opening-next"));
+ Assert.IsFalse(opening.IsOpen, "the third panel's final action closes the opening");
+ }
+
+ [Test]
+ public void EscapeAndDisposeRemoveHandlersAndDoNotFinishTwice()
+ {
+ using var ui = new UiTestKit();
+ var data = Asset.Read();
+ int finished = 0;
+ var opening = new OpeningPresenter(ui.Root, Asset, data, Text("en"), _ => { }, _ => finished++);
+ opening.Show(replay: false);
+ Assert.IsTrue(opening.Escape());
+ Assert.IsFalse(opening.Escape());
+ Assert.AreEqual(1, finished);
+ opening.Show(replay: true);
+ opening.Dispose();
+ Assert.AreEqual(1, finished, "disposing must not start the advisors or finish a new game");
+ Assert.IsFalse(ui.Q<VisualElement>("root").ClassListContains(OpeningPresenter.OpenClass));
+ UiTestKit.Press(ui.Q<Button>("opening-next"));
+ UiTestKit.Press(ui.Q<Button>("opening-skip"));
+ Assert.AreEqual(1, finished, "disposed callbacks do not fire");
+ }
+
+ [Test]
+ public void TheCatalogReferencesTheExistingSourceAndPhotographs()
+ {
+ Assert.IsNotNull(Asset);
+ Assert.AreEqual("Assets/UI/Opening/opening.yaml", AssetDatabase.GetAssetPath(Asset.source));
+ var data = Asset.Read();
+ for (int i = 0; i < 3; i++) Assert.AreEqual("Assets/UI/Opening/" + data.Panels[i].Image.File,
+ AssetDatabase.GetAssetPath(Asset.photos[i]));
+ Assert.Throws<InvalidOperationException>(() => OpeningContent.Parse(Asset.source.text.Replace("id: yemen", "id: europe")));
+ }
+}
diff --git a/unity/Assets/Tests/EditMode/OpeningPresenterTests.cs.meta b/unity/Assets/Tests/EditMode/OpeningPresenterTests.cs.meta
new file mode 100644
index 000000000..2c3a4b39e
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/OpeningPresenterTests.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: f17c50de87534813bb58bf1f936b397d
diff --git a/unity/Assets/Tests/EditMode/OpeningRoutingTests.cs b/unity/Assets/Tests/EditMode/OpeningRoutingTests.cs
new file mode 100644
index 000000000..f29bfced7
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/OpeningRoutingTests.cs
@@ -0,0 +1,141 @@
+#nullable enable
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using NUnit.Framework;
+using Statecraft.Game;
+using Statecraft.Game.Boot;
+using Statecraft.Game.Map;
+using Statecraft.Game.UI;
+using Statecraft.Sim;
+using UnityEditor.SceneManagement;
+using UnityEngine;
+using UnityEngine.TestTools;
+using UnityEngine.UIElements;
+using Object = UnityEngine.Object;
+
+public class OpeningRoutingTests
+{
+ static GameInputs? inputs;
+ static GameInputs Inputs => inputs ??= GameInputs.FromDisk(Paths.Content, Paths.StreamingMap);
+ readonly List<string> directories = new List<string>();
+ readonly List<(PanelSettings panel, RenderTexture texture)> panels = new List<(PanelSettings, RenderTexture)>();
+ static VisualElement Ui => Object.FindFirstObjectByType<UIDocument>().rootVisualElement;
+ static bool StartOpen => Ui.Q("root").ClassListContains(StartScreenPresenter.OpenClass);
+ GameRoot Open(bool saved, out SaveStore store)
+ {
+ var dir = Path.Combine(Path.GetTempPath(), "statecraft-opening-routing-" + Guid.NewGuid().ToString("N"));
+ directories.Add(dir); store = new SaveStore(dir);
+ if (saved) store.WriteAutosave(GameSession.New(Inputs.Content, 23UL, Mode.Historical).Save.Write());
+ EditorSceneManager.OpenScene("Assets/Map.unity", OpenSceneMode.Single);
+ var doc = Object.FindFirstObjectByType<UIDocument>();
+ var panel = Object.Instantiate(doc.panelSettings);
+ var texture = new RenderTexture(1280, 720, 0);
+ panel.targetTexture = texture;
+ panels.Add((panel, texture));
+ doc.panelSettings = panel; // real layout/focus in EditMode; never mutate the shared PanelSettings asset
+ Object.FindFirstObjectByType<MapScene>().Build(Inputs.Map);
+ var root = Object.FindFirstObjectByType<GameRoot>();
+ root.Store = store; root.Language = "en"; root.OpeningInEditMode = true; root.Begin(Inputs, 0, startScreen: true);
+ return root;
+ }
+ [TearDown]
+ public void Clean()
+ {
+ EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single);
+ foreach (var dir in directories) if (Directory.Exists(dir)) Directory.Delete(dir, true);
+ directories.Clear();
+ foreach (var (panel, texture) in panels)
+ {
+ // The panel can take its target texture with it (Unity's == null is then true).
+ if (panel != null) Object.DestroyImmediate(panel);
+ if (texture != null) { texture.Release(); Object.DestroyImmediate(texture); }
+ }
+ panels.Clear();
+ }
+
+ [UnityTest]
+ public IEnumerator SavedNewGameStillRequiresBothConfirmations()
+ {
+ var root = Open(saved: true, out var store);
+ string save = File.ReadAllText(store.AutosavePath), hash = root.Bridge!.State.Hash();
+ UiTestKit.Press(Ui.Q<Button>("start-new-game"));
+ yield return null;
+ Assert.IsTrue(StartOpen, "one press does not erase the save or open its replacement");
+ Assert.AreEqual(DisplayStyle.None, Ui.Q("opening-layer").resolvedStyle.display);
+ Assert.AreEqual(save, File.ReadAllText(store.AutosavePath));
+ Assert.AreEqual(hash, root.Bridge.State.Hash());
+ UiTestKit.Press(Ui.Q<Button>("start-new-game"));
+ yield return null;
+ Assert.IsFalse(StartOpen);
+ Assert.AreEqual(DisplayStyle.Flex, Ui.Q("opening-layer").resolvedStyle.display);
+ Assert.IsFalse(File.Exists(store.AutosavePath), "the confirmed new game uses the existing deletion flow");
+ Assert.AreEqual(0, root.Bridge.State.Turn, "opening is before the first turn");
+ }
+
+ [UnityTest]
+ public IEnumerator FullGameRootOffersReplayToStartScreenNavigation()
+ {
+ var root = Open(saved: true, out _);
+ for (int frame = 0; frame < 6; frame++) yield return null;
+ Assert.AreEqual(DisplayStyle.Flex, Ui.Q("start-opening-replay").resolvedStyle.display);
+ var start = (StartScreenPresenter)typeof(GameRoot).GetField("start", BindingFlags.Instance | BindingFlags.NonPublic)!.GetValue(root)!;
+ var line = start.ButtonCentres();
+ Assert.IsNotNull(line, "precondition: the start screen is laid out");
+ StringAssert.Contains("start-opening-replay=", line, "the full GameRoot route exposes its visible replay button to browser navigation");
+ }
+
+ [UnityTest]
+ public IEnumerator KeyboardSkipReturnsFocusToTheUncoveredDecisionCard()
+ {
+ var root = Open(saved: false, out _);
+ Assert.IsNotNull(root.Card!.Shown, "precondition: the initial decision card is waiting underneath");
+ UiTestKit.Press(Ui.Q<Button>("start-new-game"));
+ yield return null;
+ var next = Ui.Q<Button>("opening-next"); next.Focus();
+ using (var tab = NavigationMoveEvent.GetPooled(NavigationMoveEvent.Direction.Next)) { tab.target = next; next.SendEvent(tab); }
+ yield return null;
+ Assert.AreSame(Ui.Q<Button>("opening-skip"), Ui.focusController?.focusedElement, "Tab remains on the opening controls");
+ UiTestKit.Press(Ui.Q<Button>("opening-skip"));
+ yield return null; yield return null;
+ Assert.AreSame(Ui.Q("event-card"), Ui.focusController?.focusedElement, "ScreenNav's OnUncovered restores the waiting card's keyboard focus");
+ }
+ [UnityTest]
+ public IEnumerator SmokeAndDisableCannotLeaveAnOpeningOrItsHandlers()
+ {
+ var root = Open(saved: false, out _);
+ UiTestKit.Press(Ui.Q<Button>("start-new-game"));
+ yield return null;
+ Assert.AreEqual(DisplayStyle.Flex, Ui.Q("opening-layer").resolvedStyle.display);
+ root.enabled = false;
+ UiTestKit.Press(Ui.Q<Button>("opening-next"));
+ UiTestKit.Press(Ui.Q<Button>("opening-skip"));
+ Assert.IsFalse(Ui.Q("root").ClassListContains(OpeningPresenter.OpenClass));
+ Assert.IsTrue(Object.FindFirstObjectByType<CameraController>().enabled, "disposing returns the camera");
+ root.enabled = true;
+ LogAssert.Expect(LogType.Warning, "SMOKE FAIL the smoke run needs play mode or a player");
+ root.Begin(Inputs, 5, startScreen: true);
+ yield return null;
+ Assert.IsFalse(StartOpen);
+ Assert.AreEqual(DisplayStyle.None, Ui.Q("opening-layer").resolvedStyle.display);
+ Assert.AreEqual(DisplayStyle.None, Ui.Q("start-opening-replay").resolvedStyle.display);
+ }
+
+ [Test]
+ public void FirstCardInstrumentSkipsTheActualOpeningBeforeAwaitingTheCard()
+ {
+ var root = Open(saved: false, out _);
+ var lines = new List<string>();
+ double clock = 0;
+ var check = GameRoot.FirstCardCheck(Ui, root.Card!, lines.Add, () => clock++);
+ int steps = 0;
+ while (check.MoveNext()) Assert.Less(++steps, 12, "the existing clock-bound instrument is finite");
+ Assert.IsFalse(Ui.Q("root").ClassListContains(OpeningPresenter.OpenClass));
+ Assert.IsTrue(lines.Any(line => line.StartsWith("FIRST CARD OK ", StringComparison.Ordinal)), string.Join("\n", lines));
+ Assert.IsFalse(lines.Any(line => line.StartsWith("FIRST CARD FAIL", StringComparison.Ordinal)));
+ }
+
+}
diff --git a/unity/Assets/Tests/EditMode/OpeningRoutingTests.cs.meta b/unity/Assets/Tests/EditMode/OpeningRoutingTests.cs.meta
new file mode 100644
index 000000000..3686ca791
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/OpeningRoutingTests.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 28b9a8c4ca004d54ac272ed9406c7649
diff --git a/unity/Assets/Tests/EditMode/OpeningTests.cs b/unity/Assets/Tests/EditMode/OpeningTests.cs
new file mode 100644
index 000000000..47943d423
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/OpeningTests.cs
@@ -0,0 +1,108 @@
+#nullable enable
+using System;
+using System.Collections;
+using System.IO;
+using System.Linq;
+using NUnit.Framework;
+using Statecraft.Game;
+using Statecraft.Game.Boot;
+using Statecraft.Game.Map;
+using Statecraft.Game.UI;
+using Statecraft.Sim;
+using UnityEditor.SceneManagement;
+using UnityEngine;
+using UnityEngine.TestTools;
+using UnityEngine.UIElements;
+using Object = UnityEngine.Object;
+
+/// <summary>#530 / phase 7 PR10: New Game can skip the opening to the map; replay returns to the start screen.
+/// The presentation must not replace the session, advance the simulation, queue an order or alter the autosave.</summary>
+public class OpeningTests
+{
+ static GameInputs? inputs;
+ static GameInputs Inputs => inputs ??= GameInputs.FromDisk(Paths.Content, Paths.StreamingMap);
+ string? saveDirectory;
+ static VisualElement Ui => Object.FindFirstObjectByType<UIDocument>().rootVisualElement;
+ static bool StartOpen => Ui.Q("root").ClassListContains(StartScreenPresenter.OpenClass);
+
+ [TearDown]
+ public void Clean()
+ {
+ EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single);
+ if (saveDirectory != null && Directory.Exists(saveDirectory)) Directory.Delete(saveDirectory, true);
+ saveDirectory = null;
+ }
+
+ [UnityTest]
+ public IEnumerator CanBeSkippedAndReplayed()
+ {
+ saveDirectory = Path.Combine(Path.GetTempPath(), "statecraft-opening-" + Guid.NewGuid().ToString("N"));
+ var store = new SaveStore(saveDirectory);
+ EditorSceneManager.OpenScene("Assets/Map.unity", OpenSceneMode.Single);
+ Object.FindFirstObjectByType<MapScene>().Build(Inputs.Map);
+ var root = Object.FindFirstObjectByType<GameRoot>();
+ root.Store = store;
+ root.Language = "en";
+ root.OpeningInEditMode = true;
+ var camera = Object.FindFirstObjectByType<CameraController>();
+ root.Begin(Inputs, 0, startScreen: true);
+ Assert.IsTrue(StartOpen, "precondition: the real start screen is open");
+ var bridge = root.Bridge!;
+ var session = bridge.Session;
+ var hash = bridge.State.Hash();
+ var save = session.Save.Write();
+ var orders = bridge.Queued.ToArray();
+
+ // This is the existing no-save New Game path, not a direct call into a future opening presenter.
+ UiTestKit.Press(Ui.Q<Button>("start-new-game"));
+ yield return null;
+ var opening = Ui.Q("opening-layer");
+ Assert.IsNotNull(opening, "New Game must show the opening before the first turn (#530)");
+ Assert.AreEqual(DisplayStyle.Flex, opening.resolvedStyle.display, "the opening is displayed");
+ Assert.IsFalse(camera.enabled, "the map cannot receive camera input behind the opening");
+ UiTestKit.Press(Ui.Q<Button>("opening-skip"));
+ yield return null;
+ Assert.AreEqual(DisplayStyle.None, opening.resolvedStyle.display, "Skip closes the opening");
+ Assert.IsFalse(StartOpen, "skipping a new game's opening returns to the map");
+ Assert.IsTrue(camera.enabled, "the map's camera is returned after Skip");
+ Assert.AreSame(session, bridge.Session, "the opening does not start another session");
+ Assert.AreEqual(hash, bridge.State.Hash(), "the opening does not advance the state or RNG");
+ Assert.AreEqual(save, bridge.Session.Save.Write(), "the opening does not alter the replay");
+ CollectionAssert.AreEqual(orders, bridge.Queued, "the opening queues no orders");
+ Assert.IsFalse(File.Exists(store.AutosavePath), "presentation alone does not create an autosave");
+
+ store.WriteAutosave(save);
+ root.enabled = false;
+ root.enabled = true;
+ root.Begin(Inputs, 0, startScreen: true);
+ Assert.IsTrue(StartOpen, "precondition: a saved session is behind the start screen");
+ UiTestKit.Press(Ui.Q<Button>("start-continue"));
+ yield return null;
+ Assert.IsFalse(StartOpen);
+ Assert.AreEqual(DisplayStyle.None, Ui.Q("opening-layer").resolvedStyle.display, "Continue does not replay the opening");
+ Assert.AreEqual(hash, root.Bridge!.State.Hash());
+
+ root.enabled = false;
+ root.enabled = true;
+ root.Begin(Inputs, 0, startScreen: true);
+ bridge = root.Bridge!;
+ session = bridge.Session;
+ orders = bridge.Queued.ToArray();
+ UiTestKit.Press(Ui.Q<Button>("start-opening-replay"));
+ yield return null;
+ opening = Ui.Q("opening-layer");
+ Assert.IsNotNull(opening);
+ Assert.AreEqual(DisplayStyle.Flex, opening.resolvedStyle.display, "the start screen can replay the opening");
+ Assert.IsFalse(camera.enabled);
+ UiTestKit.Press(Ui.Q<Button>("opening-skip"));
+ yield return null;
+ Assert.AreEqual(DisplayStyle.None, opening.resolvedStyle.display);
+ Assert.IsTrue(StartOpen, "skipping a replay returns to the start screen");
+ Assert.IsFalse(camera.enabled, "the start screen still shields the map");
+ Assert.AreSame(session, bridge.Session, "replay keeps the loaded session");
+ Assert.AreEqual(hash, bridge.State.Hash(), "replay leaves state and RNG unchanged");
+ CollectionAssert.AreEqual(orders, bridge.Queued, "replay queues no orders");
+ Assert.AreEqual(save, bridge.Session.Save.Write());
+ Assert.AreEqual(save, File.ReadAllText(store.AutosavePath), "replay does not rewrite the autosave");
+ }
+}
diff --git a/unity/Assets/Tests/EditMode/OpeningTests.cs.meta b/unity/Assets/Tests/EditMode/OpeningTests.cs.meta
new file mode 100644
index 000000000..8821f3620
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/OpeningTests.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 9df51e5c958f444ca3b1f6f5d75140df
diff --git a/unity/Assets/Tests/EditMode/StartScreenTests.cs b/unity/Assets/Tests/EditMode/StartScreenTests.cs
index f0337022b..841cd6a26 100644
--- a/unity/Assets/Tests/EditMode/StartScreenTests.cs
+++ b/unity/Assets/Tests/EditMode/StartScreenTests.cs
@@ -623,6 +623,88 @@ public class StartScreenTests
}
}
+ /// <summary>#530: a player build shows "Replay the opening" in the start row between New game and Star on GitHub
+ /// (GameRoot, whenever OpeningContent.MayPresent), a button the Rig and ItFitsEveryWindowSize keep hidden. Shown as
+ /// GameRoot shows it, in English and Hebrew, with and without a save (Continue), at 1920x1080, 1366x768 and 390x844:
+ /// the panel and the row still fit the window and the panel settles (#1168, StartScreenPresenter.Fit); Star on GitHub
+ /// keeps New game's size; and the buttons read Continue, New game, Replay, Star line by line in the row's own direction
+ /// (left to right in English; in Hebrew whatever the row resolves to, so it reads right to left once the row mirrors).</summary>
+ [UnityTest]
+ public IEnumerator WithTheOpeningReplayShownTheStartRowStillFitsAndReadsInOrder()
+ {
+ foreach (var hebrew in new[] { false, true })
+ foreach (var save in new[] { false, true })
+ foreach (var (w, h) in new[] { (1920, 1080), (1366, 768), (390, 844) })
+ {
+ var text = hebrew ? UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.StringsHebrew).text, "strings.he.yaml") : Text;
+ var rt = new RenderTexture(w, h, 0);
+ var ps = Object.Instantiate(AssetDatabase.LoadAssetAtPath<PanelSettings>(UiPaths.Panel));
+ ps.targetTexture = rt;
+ var go = new GameObject("StartReplayRow");
+ 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 = save ? WithSave(TempStore(), 1) : TempStore();
+ 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, text: text);
+ try
+ {
+ root.Q("root").RemoveFromClassList("loading");
+ root.Q("root").EnableInClassList(UiLanguage.HebrewClass, hebrew); // as GameRoot
+ var replay = root.Q<Button>("start-opening-replay");
+ replay.text = text["opening.replay"]; // as GameRoot when OpeningContent.MayPresent
+ replay.style.display = DisplayStyle.Flex;
+ 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;
+ 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;
+ string at = $"{(hebrew ? "Hebrew" : "English")} {(save ? "with a save" : "no save")} {w}x{h}";
+
+ // Settles (#1168): a fractional row height would make Fit round the panel's top back and forth.
+ var settled = R("start-panel");
+ for (int i = 0; i < 10; i++) yield return null;
+ Assert.AreEqual(settled, R("start-panel"), $"{at}: the panel settles");
+
+ var panel = R("start-panel");
+ Assert.IsTrue(Inside(panel, window), $"{at}: the panel {panel} is inside the window {window}");
+ Assert.IsTrue(Inside(R("start-actions"), panel), $"{at}: the row {R("start-actions")} is inside the panel {panel}");
+ Assert.LessOrEqual(R("start-source").yMax, R("start-actions").yMin + 0.5f, $"{at}: the row is under the source line");
+ Assert.LessOrEqual(R("start-actions").yMax, R("start-community").yMin + 0.5f, $"{at}: the row overlaps Report's row");
+ var order = (save ? new[] { "start-continue" } : new string[0]).Concat(new[] { "start-new-game", "start-opening-replay", "start-star" }).ToArray();
+ foreach (var b in order)
+ {
+ Assert.AreEqual(DisplayStyle.Flex, root.Q(b).resolvedStyle.display, $"{at}: {b} shows");
+ Assert.IsTrue(Inside(R(b), R("start-actions")), $"{at}: {b} {R(b)} is inside the row {R("start-actions")}");
+ Assert.GreaterOrEqual(R(b).height, 40f, $"{at}: {b} is a usable target");
+ }
+ for (int i = 0; i < order.Length; i++)
+ for (int j = i + 1; j < order.Length; j++)
+ Assert.IsFalse(R(order[i]).Overlaps(R(order[j])), $"{at}: {order[i]} {R(order[i])} overlaps {order[j]} {R(order[j])}");
+ var onePixel = Mathf.Max(0.5f, window.width / w + 0.01f); // a scaled panel snaps each edge to a screen pixel
+ Assert.AreEqual(R("start-new-game").width, R("start-star").width, onePixel, $"{at}: Star on GitHub is New game's width");
+ Assert.AreEqual(R("start-new-game").height, R("start-star").height, onePixel, $"{at}: Star on GitHub is New game's height");
+
+ // The reading order: line by line from the top, each line in the row's direction.
+ var direction = root.Q("start-actions").resolvedStyle.flexDirection;
+ if (!hebrew) Assert.AreEqual(FlexDirection.Row, direction, $"{at}: the English row reads left to right");
+ var read = order.OrderBy(b => Mathf.Round(R(b).yMin)).ThenBy(b => direction == FlexDirection.RowReverse ? -R(b).xMin : R(b).xMin).ToArray();
+ CollectionAssert.AreEqual(order, read, $"{at}: the row ({direction}) reads " + string.Join(", ", order.Select(b => $"{b} {R(b)}")));
+ }
+ finally
+ {
+ start.Dispose(); newGame.Dispose(); toast.Dispose();
+ Object.DestroyImmediate(go); Object.DestroyImmediate(ps); rt.Release(); Object.DestroyImmediate(rt);
+ }
+ }
+ }
+
/// <summary>tools/web_check.py clicks the screen's buttons where ?navlog says they are (--startscreen, --persistence):
/// the NAV line names every shown button (Continue only with a save; the recording's button once its row shows), each
/// at its own centre to half a pixel as a fraction of the window; the last line logged is the current layout; and
@@ -650,7 +732,10 @@ public class StartScreenTests
var centres = Regex.Matches(line!, @"(\S+)=([0-9.]+),([0-9.]+)").Cast<Match>().ToDictionary(m => m.Groups[1].Value,
m => new Vector2(window.xMin + window.width * float.Parse(m.Groups[2].Value, System.Globalization.CultureInfo.InvariantCulture),
window.yMin + window.height * float.Parse(m.Groups[3].Value, System.Globalization.CultureInfo.InvariantCulture)));
- var shown = save ? StartScreenPresenter.Buttons : StartScreenPresenter.Buttons.Where(b => b != "start-continue").ToArray();
+ Assert.AreEqual(DisplayStyle.None, rig.Ui.Q<Button>("start-opening-replay").resolvedStyle.display,
+ "the standalone Rig has no opening provider; full GameRoot replay is tested by OpeningRoutingTests");
+ var shown = save ? new[] { "start-continue", "start-new-game", "start-star", "start-listen" }
+ : new[] { "start-new-game", "start-star", "start-listen" };
CollectionAssert.AreEqual(shown, centres.Keys, $"save={save}: {line}");
foreach (var (name, at) in centres.Select(kv => (kv.Key, kv.Value)))
{
diff --git a/unity/Assets/UI/Game.uxml b/unity/Assets/UI/Game.uxml
index 00b442eda..064c188fb 100644
--- a/unity/Assets/UI/Game.uxml
+++ b/unity/Assets/UI/Game.uxml
@@ -612,6 +612,7 @@
<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:Button name="start-opening-replay" class="start-button opening-replay" />
<!-- Community (#1168): "Star on GitHub", New game's size beside it, opens the repository in a new tab
(ExternalLink); its star and GitHub mark are painted in by StartScreenPresenter. -->
<ui:Button name="start-star" text="Star on GitHub" class="start-button start-star" />
@@ -636,6 +637,28 @@
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement>
+ <!-- #530: the event-card frame, three sourced stills and a closing line. Editor drafts are labelled; the
+ ordinary player path remains unavailable until the text and its sources have human review. -->
+ <ui:VisualElement name="opening-layer" class="opening-layer">
+ <ui:VisualElement name="opening-card" class="panel event-card opening-card">
+ <ui:Label name="opening-preview" class="muted opening-preview" />
+ <ui:Label name="opening-count" class="muted opening-count" />
+ <ui:Label name="opening-title" class="title opening-source-en" />
+ <ui:VisualElement name="opening-photo" class="opening-photo" />
+ <ui:Label name="opening-credit" class="event-photo-credit opening-source-en" />
+ <ui:ScrollView name="opening-scroll" class="opening-scroll" mode="Vertical" horizontal-scroller-visibility="Hidden">
+ <ui:Label name="opening-text" class="opening-text opening-source-en" />
+ <ui:Label name="opening-arrivals" class="muted opening-arrivals opening-source-en" />
+ <ui:Label name="opening-closing" class="opening-text opening-source-en" />
+ </ui:ScrollView>
+ <ui:VisualElement class="row opening-actions">
+ <ui:Button name="opening-back" />
+ <ui:Button name="opening-next" />
+ <ui:Button name="opening-skip" />
+ </ui:VisualElement>
+ <Statecraft.Game.UI.UiFrame />
+ </ui:VisualElement>
+ </ui:VisualElement>
<!-- "Report a bug or idea" (#1169, FeedbackPresenter): over everything, the start screen too, with what each GitHub
form opens with under its button; the game sends nothing itself. Before the toast, which stays readable. -->
<ui:VisualElement name="feedback-layer" class="feedback-layer">
diff --git a/unity/Assets/UI/Opening/opening.yaml b/unity/Assets/UI/Opening/opening.yaml
index e32f3a459..19483bcff 100644
--- a/unity/Assets/UI/Opening/opening.yaml
+++ b/unity/Assets/UI/Opening/opening.yaml
@@ -4,12 +4,10 @@
# Like event-images.yaml, this file is for the Unity UI only. It is NOT game content: it reads and changes no sim state,
# so it stays out of content/ and the content hash (plan, PR 10 "Files": "a sourced YAML file under unity/Assets/UI/").
#
-# STATUS: AI DRAFT. Claude gathered every line below from the sources listed with it; no person has checked them yet,
-# so no source carries a `checked:` date and the file's status is `draft` (docs/CONTENT_POLICY.md section 2, rules 1
-# and 6). Before anything here is shown to a player:
-# 1. a person opens every source and confirms it supports its sentence, then adds `checked: <day>` to that source;
-# 2. the owner does the sensitivity review of the texts and the three photographs (sensitivity_reviewed stays false
-# until then; each photograph's ASSETS.yaml row is owner-verify, which the release gate refuses).
+# STATUS: AI DRAFT, TEXT APPROVED. Claude gathered every line below from the sources listed with it. The owner
+# approved the opening text (EN + HE) on 31 October 2026 ("Approve the text",
+# https://github.com/eyalgolan/statecraft-israel/pull/2037#issuecomment-6539737809), so the file's status is
+# `sensitivity-reviewed` (docs/CONTENT_POLICY.md section 2).
# The presenter, the en/he strings and the EditMode tests are slice B of #530; the Hebrew goes to the #564 review once
# the English is approved.
#
@@ -18,7 +16,7 @@
# be content events, so the three rows live here instead. Originals fetched from each row's `original` URL; SHA-1 and
# size match the Commons API. Licence, artist and credit line read from each Commons file page (licence template
# {{Cc-by-4.0}} and the Meitar credit-line template) via the Commons API on 2026-10-19 by Claude, not by a person.
-status: draft
+status: sensitivity-reviewed
panels:
- id: europe
title: Europe
@@ -29,8 +27,10 @@ panels:
sources:
- url: "https://www.yadvashem.org/articles/general/displaced-persons-camps.html"
supports: "'at the beginning of 1947 the number of Jewish displaced persons stabilized at around 210,000. Most of them - about 175,000 - were in Germany in the American zone'; 'With the establishment of the State of Israel about two-thirds of the DPs emigrated to Israel'"
+ checked: 2026-10-31
- url: "https://portal.ehri-project.eu/units/us-005544-cyp_45_49"
supports: "JDC Cyprus collection: 'the British government began deporting Jews who came to Palestine in violation of the White Paper of 1939 to the island of Cyprus. From August 1946 to February 1949, the deportees ... lived behind barbed wire in 12 detention camps. During this period, approximately 53,000 Jews passed through the camps'"
+ checked: 2026-10-31
image:
file: opening_europe.jpg
commons: "https://commons.wikimedia.org/wiki/File:Cyprus_(997008136325305171).jpg"
@@ -45,7 +45,7 @@ panels:
sensitive: true
# The owner's sensitivity review: approved for use: https://github.com/eyalgolan/statecraft-israel/pull/1093#issuecomment-6338281251
sensitivity_reviewed: true
- note: "Commons title 'מחנות המעצר בקפריסין' (the detention camps in Cyprus), dated February 1949, the last months of the camps, not 1946-47. About 15 identifiable adults, posed, no distress shown. Commons also files it under 'Meitar Collection (review needed)': a person should confirm the NLI record (digital ID 997008136325305171) before it ships. Alternate: Cyprus_(997008136324405171).jpg (the queue at the wire gate)."
+ note: "Commons title 'מחנות המעצר בקפריסין' (the detention camps in Cyprus), dated February 1949, the last months of the camps, not 1946-47. About 15 identifiable adults, posed, no distress shown. NLI record 997008136325305171 (checked 2026-10-31): Benno Rothenberg, February 1949, ARC. 4* 2068 / 206, credit 'Meitar Collection, The Pritzker Family National Photography Collection, The National Library of Israel'; NLI marks it public domain in Israel, and Commons adds CC BY 4.0 with VRTS permission confirmed. The 'Meitar Collection (review needed)' category is a bulk backlog, not a rights flag. Alternate: Cyprus_(997008136324405171).jpg (the queue at the wire gate)."
- id: arab_countries
title: The Arab countries
text: "In 1948 more than 135,000 Jews lived in Iraq. In March 1950 Iraq allowed them to leave only if they gave up their citizenship, and in March 1951 it froze the assets of those who had. The airlift, Operation Ezra and Nehemiah, began in May 1950, and by January 1952 some 120,000 Iraqi Jews had come to Israel. From Morocco, Libya, Egypt, Tunisia and other Arab lands, tens of thousands more came in the same years."
@@ -56,10 +56,13 @@ panels:
sources:
- url: "https://israeled.org/airlift-iraqi-jews-begins/"
supports: "Center for Israel Education: 'In 1948, Iraq had more than 135,000 Jews'; 19 May 1950, 'The first two flights of Operation Ezra and Nehemiah ... leave Baghdad'; 'the first of some 120,000 Jews who make aliyah by January 1952 after the Iraqi government makes a temporary change in the law to allow Jews to emigrate, as long as they renounce their Iraqi citizenship'"
+ checked: 2026-10-31
- url: "https://en.wikipedia.org/w/index.php?title=Operation_Ezra_and_Nehemiah&oldid=1377092685"
- supports: "'In March 1950, the Iraqi government ... passed a special bill of one-year duration permitting Jewish emigration on condition that Jews renounce their Iraqi citizenship' (the exact day of the law differs between sources, so the text gives only the month); 'On 10 March 1951 ... the government enacted a new law which extended the emigration period whilst also blocking the assets of Jews who had given up their citizenship' (the same page, citing Meir-Glitzenstein 2004, p. 206; a secondary source, the law's own name and text not seen by Claude, so a person should check it against the primary law or a scholarly source)"
+ supports: "'In March 1950, the Iraqi government ... passed a special bill of one-year duration permitting Jewish emigration on condition that Jews renounce their Iraqi citizenship' (the exact day of the law differs between sources, so the text gives only the month); 'On 10 March 1951 ... the government enacted a new law which extended the emigration period whilst also blocking the assets of Jews who had given up their citizenship' (the same page, citing Meir-Glitzenstein 2004, p. 206. Confirmed 2026-10-31 by UN document A/AC.25/IS.60 of 4 April 1951, a bill of 10 March 1951 freezing the assets of Jews who had forfeited Iraqi citizenship, and by the Iraqi Jewish Archive's gazette copies, IJA 2778, 'Law 5/1951'. The text claims only the freeze, not an extension)"
+ checked: 2026-10-31
- url: "https://www.cbs.gov.il/he/publications/DocLib/2009/1365/pdf/e_print.pdf"
supports: "Table 5 (printed pages 38-39), column 15 V 1948 - 1951: Iraq 123,371; Morocco 28,263; Libya 30,972; Egypt, Sudan 16,028; Tunisia 13,293; Algeria 3,810 (the 'tens of thousands more' line)"
+ checked: 2026-10-31
image:
file: opening_arab_countries.jpg
commons: "https://commons.wikimedia.org/wiki/File:Ben_Gurion_International_Airport_(997008136550505171).jpg"
@@ -84,10 +87,13 @@ panels:
sources:
- url: "https://en.wikipedia.org/w/index.php?title=Operation_Magic_Carpet_(Yemen)&oldid=1374658937"
supports: "'Operation Magic Carpet is the widely known nickname for Operation On Wings of Eagles ... conducted by Israel between 16 December 1948 and 24 September 1950 to take in approximately 49,000 Yemenite Jews'; 'In 1949, Ahmad reversed the long-standing ban on emigration and allowed the Jews of Yemen to leave'; flights 'from Aden Colony'; 'the Joint Distribution Committee took over the task of moving them out of Aden by air'; 'The operation ended on 24 September 1950, when the last two aircraft reached Lydda Airport'"
+ checked: 2026-10-31
- url: "https://www.jta.org/archive/j-d-c-s-operation-magic-carpet-ends-as-last-yemenite-jews-land-at-israel-airport"
supports: "JTA, 25 September 1950: 'The Joint Distribution Committee's historic Operation Magic Carpet is scheduled to come to an end tonight with the landing of the last two plane-loads ... flown from Aden'; 'After the last planes land at Lydda airport'"
+ checked: 2026-10-31
- url: "https://www.cbs.gov.il/he/publications/DocLib/2009/1365/pdf/e_print.pdf"
supports: "Table 5, column 15 V 1948 - 1951: Yemen (7) 48,315; note 7, 'Incl. the former Aden'"
+ checked: 2026-10-31
image:
file: opening_yemen.jpg
commons: "https://commons.wikimedia.org/wiki/File:Aden_(997008136749905171).jpg"
@@ -102,9 +108,10 @@ panels:
sensitive: true
# The owner's sensitivity review: approved for use: https://github.com/eyalgolan/statecraft-israel/pull/1093#issuecomment-6338281251
sensitivity_reviewed: true
- note: "Commons title 'הטיסה חזרה מעדן, תימן במהלך מבצע \"מרבד הקסמים\"' (the flight back from Aden, Yemen, during Operation Magic Carpet), 12-28 May 1950; Commons identifies the plane as Douglas C-54 NC67548. No identifiable faces. The square original is cropped to 16:9 (sky and foreground trimmed, the car at the right edge cut). Its Commons credit line adds 'Israel State Archives' (template 'Meitar Collection/credit line2'), so the credit here does too; a person should confirm that is not a GPO photograph (CONTENT_POLICY section 4 refuses GPO). Alternate: Aden_(997008137190505171.jpg (stairs to the plane)."
+ note: "Commons title 'הטיסה חזרה מעדן, תימן במהלך מבצע \"מרבד הקסמים\"' (the flight back from Aden, Yemen, during Operation Magic Carpet), 12-28 May 1950; Commons identifies the plane as Douglas C-54 NC67548. No identifiable faces. The square original is cropped to 16:9 (sky and foreground trimmed, the car at the right edge cut). Its Commons credit line adds 'Israel State Archives' (template 'Meitar Collection/credit line2'), so the credit here does too; it is not a GPO photograph: Commons gives Benno Rothenberg / Meitar Collection / NLI, CC BY 4.0 with VRTS permission confirmed, and no GPO category (checked 2026-10-31). Alternate: Aden_(997008137190505171.jpg (stairs to the plane)."
closing:
text: "Between 15 May 1948 and the end of 1951, 687,624 immigrants arrived. You start on 15 May 1948."
sources:
- url: "https://www.cbs.gov.il/he/publications/DocLib/2009/1365/pdf/e_print.pdf"
supports: "Table 5, GRAND TOTAL, column 15 V 1948 - 1951: 687,624 (the same total as the four rows of content/aliyah.yaml)"
+ checked: 2026-10-31
diff --git a/unity/Assets/UI/Statecraft.uss b/unity/Assets/UI/Statecraft.uss
index 2c71f3660..4f1989e9f 100644
--- a/unity/Assets/UI/Statecraft.uss
+++ b/unity/Assets/UI/Statecraft.uss
@@ -1234,3 +1234,19 @@ Button.settings-choice-selected { -unity-font-definition: url("project://databas
.lang-he #arms-count { flex-direction: row-reverse; }
#arms-count .unity-base-field__input { background-color: var(--navy-deep); color: var(--ink); border-width: 1px; border-color: var(--gold-dim); }
#arms-count:focus .unity-base-field__input { border-color: var(--gold); }
+/* #530: a still opening in the existing event-card frame. Keep its actions outside the scrolling prose, so Skip
+ remains reachable in a short window. The English historical text stays English and left-aligned in the Hebrew UI (in the
+ Hebrew face, as all text there) until its own review. */
+.opening-layer { display: none; position: absolute; left: 0; top: 0; right: 0; bottom: 0; align-items: center; justify-content: center; padding: 16px; background-color: var(--navy-deep); }
+.opening-layer > .opening-card { display: flex; height: 100%; max-height: 100%; padding: 12px 24px; }
+.opening-replay { display: none; }
+.opening-preview, .opening-count { white-space: normal; flex-shrink: 0; margin: 2px 0; }
+.opening-photo { height: 240px; max-height: 32%; min-height: 80px; flex-shrink: 1; background-size: contain; background-position-x: center; background-position-y: center; background-repeat: no-repeat; }
+.opening-scroll { flex-shrink: 1; min-height: 48px; }
+.opening-text { font-size: 22px; white-space: normal; margin: 8px 0; }
+.opening-arrivals { font-size: 18px; white-space: normal; margin: 8px 0; }
+.opening-actions { flex-wrap: wrap; justify-content: center; flex-shrink: 0; }
+.opening-actions > Button { min-height: 44px; margin: 4px 6px; }
+.opening-source-en, .lang-he .opening-source-en { -unity-text-align: upper-left; white-space: normal; }
+.opening-open .top-bar, .opening-open .left-column, .opening-open .community-column, .opening-open .right-column, .opening-open .event-layer, .opening-open .info-panel, .opening-open .screen, .opening-open .map-labels, .opening-open .start-screen, .opening-open .advisor-layer { display: none; }
+.loading .opening-layer { display: none; }
diff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yaml
index 0b46a375b..67daf9cdf 100644
--- a/unity/Assets/UI/strings.en.yaml
+++ b/unity/Assets/UI/strings.en.yaml
@@ -1031,3 +1031,13 @@ why.cause.ending.defeat_economy: "Money and Food ran out"
why.cause.ending.defeat_war: "The enemy holds a city"
unit.confirm_move: "Send {0} to {1}"
+
+# The opening's controls (#530). The historical prose stays in opening.yaml.
+opening.replay: "Replay the opening"
+opening.back: "Back"
+opening.next: "Next"
+opening.skip: "Skip the opening"
+opening.begin: "Continue to the map"
+opening.return: "Return to the start screen"
+opening.count: "Step {0} of {1}"
+opening.preview: "Editor preview: draft text; human source checks pending."
diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yaml
index 05492e5bb..cac18198d 100644
--- a/unity/Assets/UI/strings.he.yaml
+++ b/unity/Assets/UI/strings.he.yaml
@@ -1136,3 +1136,14 @@ why.cause.ending.defeat_war: "האויב מחזיק בעיר"
# native-review-pending: #1661 occupied-destination confirmation
unit.confirm_move: "שליחת {0} אל {1}"
+
+# The opening's controls (#530), Hebrew agent-drafted. For the native reviewer (#564). The historical prose stays in
+# opening.yaml, in English, until its own review.
+opening.replay: "צפייה חוזרת בפתיח"
+opening.back: "הקודם"
+opening.next: "הבא"
+opening.skip: "דילוג על הפתיח"
+opening.begin: "המשך למפה"
+opening.return: "חזרה למסך הפתיחה"
+opening.count: "שלב {0} מתוך {1}"
+opening.preview: "תצוגה מקדימה בעורך: טיוטה; בדיקת המקורות בידי אדם ממתינה."