A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Advisors S3: the encyclopedia replaces How to play (Refs #1519) (#2095)
Beri3a133e1eafb1
diff --git a/README.md b/README.mdindex 8a0433908..3f1bf788c 100644--- a/README.md+++ b/README.md@@ -76,7 +76,7 @@ It is an early, honest prototype.- The Budget screen.- The Defence screen, which shows the escalation ladder and the reserve call-up as the events set them.- Sourced historical events from the 1948 war through the 1951 foreign-currency crisis, most with an archival photograph.-- The "Why?" panel, a turn report after End turn, a short How to play screen, and the advisors David Ben-Gurion, Golda Meyerson and Moshe Dayan, who walk you through the first turn.+- The "Why?" panel, a turn report after End turn, and the advisors David Ben-Gurion, Golda Meyerson and Moshe Dayan, who walk you through the first turn and explain each mechanic in their encyclopedia.- A Timeline screen that sets your course beside the historical record.- An end screen with the outcome, the score and the date you met each objective beside the historical date.- Share: a screenshot of your game for X, Facebook, Instagram, WhatsApp, Telegram or LinkedIn.diff --git a/changelog.d/advisors-s3.md b/changelog.d/advisors-s3.mdnew file mode 100644index 000000000..33517d509--- /dev/null+++ b/changelog.d/advisors-s3.md@@ -0,0 +1,6 @@+### Changed++- How to play becomes the advisors' encyclopedia: 25 short pages, grouped by David Ben-Gurion, Golda Meyerson and Moshe+ Dayan, cover every mechanic, including the 14 that nothing explained before, each with a Show me where it has a+ target; an advisor's "Tell me more" opens its page. In Hebrew, the nine pages that replace How to play have had their+ native read and show; the other 16 wait for theirs (Refs #1484, #1519).diff --git a/tools/README.md b/tools/README.mdindex 4080f943a..873643f8b 100644--- a/tools/README.md+++ b/tools/README.md@@ -63,7 +63,7 @@ Offline data tools (uv inline-script Python). Run from the repo root.the events' `title_he` / `text_he` / options' `text_he` (#1064) and `strings.he.yaml` (#12), only the changed lines;Hebrew content names keep their sources and are edited by hand. Any other language goes to`translations/<lang>/{events,ui,content}.yaml`, which the game does not read yet, and leaves out the advisors- (`advisor.*`) and How to play (`how_to_play.*`), which stay English or Hebrew only for now (owner, #1604). Every language keeps the Hebrew+ (`advisor.*`) and their encyclopedia (`encyclopedia.*`, which replaced How to play), which stay English or Hebrew only for now (owner, #1604). Every language keeps the Hebrewrules (all or none per event, placeholders as in the English, one line, no direction marks; `agent-checked` until anative speaker has read it, #564), and nothing is written while any edited string is refused. It never commits ortouches `status` / `reviewed_by`; a saved Hebrew edit is a `content/` or `unity/` change, so it needs a changelogdiff --git a/tools/tests/test_hebrew_ui.py b/tools/tests/test_hebrew_ui.pyindex 23f5c0147..e464474cb 100644--- a/tools/tests/test_hebrew_ui.py+++ b/tools/tests/test_hebrew_ui.py@@ -171,7 +171,7 @@ def test_the_hebrew_plural_of_a_turn_is_torot_never_torim():תורות, and no Hebrew string may say תורים."""he = strings('strings.he.yaml')assert [key for key, value in he.items() if 'תורים' in value] == []- for key in ('how_to_play.training', 'capture.about.occupy', 'unit.go_to_given', 'city.turns',+ for key in ('advisor.page.training.text', 'capture.about.occupy', 'unit.go_to_given', 'city.turns','defence.turn_quarter', 'defence.turn_month', 'defence.turn_week','advisor.opening.move.text', 'advisor.opening.move.cue.2', 'advisor.ben_gurion.defeat_economy.text'):assert 'תורות' in he[key], keydiff --git a/tools/tests/test_translate.py b/tools/tests/test_translate.pyindex c076fc8b9..d40e547fd 100644--- a/tools/tests/test_translate.py+++ b/tools/tests/test_translate.py@@ -283,15 +283,16 @@ def test_http_refuses_a_bad_language(server, code):assert status == 400 and b"language code" in body-def test_advisors_and_how_to_play_stay_english_or_hebrew(langs):- """Owner, 24 October 2026, on #1604: "Advisors + How to play" stay English or Hebrew only, for now."""- kept = ("ui:advisor.", "ui:how_to_play.")+def test_advisors_and_encyclopedia_stay_english_or_hebrew(langs):+ """Owner, 24 October 2026, on #1604: "Advisors + How to play" stay English or Hebrew only, for now; the advisors'+ encyclopedia replaced How to play (#1519)."""+ kept = ("ui:advisor.", "ui:encyclopedia.")for lang in ("he", "en"):keys = [r["key"] for r in translate.catalog_for("en", lang)["rows"]]- assert any(k.startswith("ui:advisor.") for k in keys) and any(k.startswith("ui:how_to_play.") for k in keys)+ assert any(k.startswith("ui:advisor.") for k in keys) and any(k.startswith("ui:encyclopedia.") for k in keys)keys = [r["key"] for r in translate.catalog_for("en", "fr")["rows"]]assert keys and not any(k.startswith(kept) for k in keys)assert any(k.startswith("ui:why.") for k in keys) and any(k.startswith("ui:info.") for k in keys)- key = next(r["key"] for r in translate.catalog() if r["key"].startswith("ui:how_to_play."))+ key = next(r["key"] for r in translate.catalog() if r["key"].startswith("ui:encyclopedia."))with pytest.raises(translate.Refused, match="English or Hebrew only"):translate.save("fr", {key: "Comment jouer"}, {}, dry=True)diff --git a/tools/translate.py b/tools/translate.pyindex 6c15a0a92..8bc42640e 100644--- a/tools/translate.py+++ b/tools/translate.py@@ -46,8 +46,9 @@ TRANSLATIONS = ROOT / "translations"HE_KEY = re.compile(r"(.+)_he(_f)?$") # name_he, title_he_f, sector_he ...: a content field's Hebrew formLANG = re.compile(r"[a-z]{2,3}(-[A-Za-z0-9]{2,8})*")RTL = {"ar", "ckb", "dv", "fa", "he", "ps", "ur", "yi"}-# Kept in English and Hebrew only, for now: the advisors and How to play (owner, 24 October 2026, on #1604).-HE_EN_ONLY = ("ui:advisor.", "ui:how_to_play.")+# Kept in English and Hebrew only, for now: the advisors and How to play (owner, 24 October 2026, on #1604), which the+# advisors' encyclopedia replaces (#1519).+HE_EN_ONLY = ("ui:advisor.", "ui:encyclopedia.")TOKEN = re.compile(r"\{[^{}]+\}")OFFICE = re.compile(r"\{[a-z0-9_]+\}") # an event's {office_id} placeholder (Offices.Placeholder in the sim)HEBREW = re.compile("[\u05d0-\u05ea]")diff --git a/translations/README.md b/translations/README.mdindex a38350718..507d06dbe 100644--- a/translations/README.md+++ b/translations/README.md@@ -10,7 +10,7 @@ Each language has a folder named by its code (`ro`, `fr`, `pt-BR`), with up to t| File | Holds | Keyed by ||---|---|---|| `events.yaml` | each event's `title`, `text` and `options` (by option id), and `review` | the event id in `content/events/` |-| `ui.yaml` | the UI strings, except the advisors (`advisor.*`) and How to play (`how_to_play.*`), which stay English or Hebrew only for now (owner, 24 October 2026, #1604) | the key in `unity/Assets/UI/strings.en.yaml` |+| `ui.yaml` | the UI strings, except the advisors (`advisor.*`) and their encyclopedia (`encyclopedia.*`, which replaced How to play), which stay English or Hebrew only for now (owner, 24 October 2026, #1604) | the key in `unity/Assets/UI/strings.en.yaml` || `content.yaml` | every content field that has a Hebrew form (`name_he`, `title_he_f`, `sector_he` ...), as `text` and `review` | `<file under content/>#<record path>.<field>`, for example `people.yaml#people.ben_gurion.name` |The rules are the Hebrew ones ([docs/WRITING_EVENTS.md](../docs/WRITING_EVENTS.md)): an event is all or none, placeholdersdiff --git a/unity/Assets/Resources/Advisors/advisor-messages.yaml b/unity/Assets/Resources/Advisors/advisor-messages.yamlindex 45d19470d..99f05ea9b 100644--- a/unity/Assets/Resources/Advisors/advisor-messages.yaml+++ b/unity/Assets/Resources/Advisors/advisor-messages.yaml@@ -18,12 +18,12 @@ messages:# 25 Oct 2026 (recommendations page, item 3).- { id: opening.greeting, advisor: ben_gurion, signal: opening, level: new, he_review: approved, media: { picture: opening.greeting.mp4, narration: { en: opening.greeting.en.wav }, cues: { en: [0.00, 4.31, 6.64] }, label: advisor.media_label, credit: advisor.credit.ben_gurion } }# opening.attention and opening.event: copy-fix wording approved by the owner in chat, 24 October 2026, 04:14 UTC: "Approve all 8".- - { id: opening.attention, advisor: ben_gurion, signal: opening, level: new, he_review: approved, requires: [opening.greeting], actions: [{ show_me: attention }], media: { picture: opening.attention.mp4, narration: { en: opening.attention.en.wav }, cues: { en: [0.00, 4.44] }, label: advisor.media_label, credit: advisor.credit.ben_gurion } }- - { id: opening.city, advisor: meyerson, signal: opening, level: new, he_review: approved, requires: [opening.attention], actions: [{ show_me: city_housing }], media: { picture: opening.city.mp4, narration: { en: opening.city.en.wav }, cues: { en: [0.00, 4.81] }, label: advisor.media_label, credit: advisor.credit.meyerson } }- - { id: opening.training, advisor: meyerson, signal: opening, level: new, he_review: approved, requires: [opening.city], actions: [{ show_me: city_training }], media: { picture: opening.training.mp4, narration: { en: opening.training.en.wav }, cues: { en: [0.00, 4.52, 8.30] }, label: advisor.media_label, credit: advisor.credit.meyerson } }- - { id: opening.move, advisor: dayan, signal: opening, level: new, he_review: approved, requires: [opening.training], actions: [{ show_me: unit_move }], media: { picture: opening.move.mp4, narration: { en: opening.move.en.wav }, cues: { en: [0.00, 5.77] }, label: advisor.media_label, credit: advisor.credit.dayan } }+ - { id: opening.attention, advisor: ben_gurion, signal: opening, level: new, he_review: approved, requires: [opening.greeting], actions: [{ show_me: attention }, { encyclopedia: attention }], media: { picture: opening.attention.mp4, narration: { en: opening.attention.en.wav }, cues: { en: [0.00, 4.44] }, label: advisor.media_label, credit: advisor.credit.ben_gurion } }+ - { id: opening.city, advisor: meyerson, signal: opening, level: new, he_review: approved, requires: [opening.attention], actions: [{ show_me: city_housing }, { encyclopedia: cities }], media: { picture: opening.city.mp4, narration: { en: opening.city.en.wav }, cues: { en: [0.00, 4.81] }, label: advisor.media_label, credit: advisor.credit.meyerson } }+ - { id: opening.training, advisor: meyerson, signal: opening, level: new, he_review: approved, requires: [opening.city], actions: [{ show_me: city_training }, { encyclopedia: training }], media: { picture: opening.training.mp4, narration: { en: opening.training.en.wav }, cues: { en: [0.00, 4.52, 8.30] }, label: advisor.media_label, credit: advisor.credit.meyerson } }+ - { id: opening.move, advisor: dayan, signal: opening, level: new, he_review: approved, requires: [opening.training], actions: [{ show_me: unit_move }, { encyclopedia: units_movement }], media: { picture: opening.move.mp4, narration: { en: opening.move.en.wav }, cues: { en: [0.00, 5.77] }, label: advisor.media_label, credit: advisor.credit.dayan } }- { id: opening.event, advisor: ben_gurion, signal: opening, level: new, he_review: approved, requires: [opening.move], when: { cards_waiting_at_least: 1 }, actions: [{ show_me: decision_waiting }, { open_card: true }], media: { picture: opening.event.mp4, narration: { en: opening.event.en.wav }, cues: { en: [0.00, 5.38] }, label: advisor.media_label, credit: advisor.credit.ben_gurion } }- - { id: opening.objectives, advisor: ben_gurion, signal: opening, level: new, he_review: approved, requires: [opening.event], actions: [{ show_me: nav_objectives }] }+ - { id: opening.objectives, advisor: ben_gurion, signal: opening, level: new, he_review: approved, requires: [opening.event], actions: [{ show_me: nav_objectives }, { encyclopedia: objectives }] }# Spec 6's critical warnings (shown at every help level, Off included) and the defeat lines. Their words and speakers are the# recorded clips' (owner, 24 October 2026: "Adopt clip words"; talking-v3/lines.csv): dayan.city_at_risk is@@ -49,4 +49,34 @@ messages:- { id: meyerson.budget_unsubmitted, advisor: meyerson, signal: budget_unsubmitted, level: warnings, he_review: approved, repeat: every, cooldown_turns: 1, actions: [{ open_screen: budget }] }- { id: dayan.arms_out, advisor: dayan, signal: arms_low, level: warnings, he_review: approved, repeat: every, cooldown_turns: 3, actions: [{ open_screen: defence }], media: { picture: dayan.arms_out.mp4, narration: { en: dayan.arms_out.en.wav }, cues: { en: [0.00, 4.59] }, label: advisor.media_label, credit: advisor.credit.dayan } }-pages: []+# The encyclopedia's pages (spec 10, plan Task 13): one per mechanic, grouped by advisor as spec 3.1 splits them, with the+# Show me target each names. Their text is advisor.page.<id>.title and .text (and .gdd03.text where gdd-0.3 differs). A page+# shows in Hebrew only once its native review approves it (OQ-4): the nine that replace How to play were read by Beri on+# #2095 (1 Nov 2026); the other 16 are pending. The opening steps' Tell me more opens the page of what each step points+# at (plan Task 13).+pages:+ - { id: turns, advisor: ben_gurion, he_review: approved }+ - { id: attention, advisor: ben_gurion, show_me: attention, he_review: approved }+ - { id: events, advisor: ben_gurion, show_me: decision_waiting, he_review: approved }+ - { id: objectives, advisor: ben_gurion, show_me: nav_objectives, he_review: approved }+ - { id: defeat, advisor: ben_gurion, he_review: pending }+ - { id: top_bar, advisor: ben_gurion, show_me: attention, he_review: approved }+ - { id: why, advisor: ben_gurion, show_me: nav_why, he_review: approved }+ - { id: cities, advisor: meyerson, show_me: city_housing, he_review: approved }+ - { id: immigration, advisor: meyerson, show_me: city_housing, he_review: pending }+ - { id: training, advisor: meyerson, show_me: city_training, he_review: approved }+ - { id: projects, advisor: meyerson, he_review: pending }+ - { id: pioneer_work, advisor: meyerson, he_review: pending }+ - { id: corridors, advisor: meyerson, he_review: pending }+ - { id: money_debt, advisor: meyerson, show_me: nav_budget, he_review: pending }+ - { id: budget, advisor: meyerson, show_me: nav_budget, he_review: pending }+ - { id: cabinet, advisor: meyerson, show_me: nav_cabinet, he_review: pending }+ - { id: food, advisor: meyerson, he_review: pending }+ - { id: national_meters, advisor: meyerson, he_review: pending }+ - { id: units_movement, advisor: dayan, show_me: unit_move, he_review: approved }+ - { id: standing_orders, advisor: dayan, he_review: pending }+ - { id: combat, advisor: dayan, show_me: nav_defence, he_review: pending }+ - { id: arms, advisor: dayan, show_me: nav_defence, he_review: pending }+ - { id: truces, advisor: dayan, he_review: pending }+ - { id: capture, advisor: dayan, he_review: pending }+ - { id: enemy_phase, advisor: dayan, he_review: pending }diff --git a/unity/Assets/Scripts/UI/AdvisorCatalog.cs b/unity/Assets/Scripts/UI/AdvisorCatalog.csindex 668bf7ff0..1036ba3f0 100644--- a/unity/Assets/Scripts/UI/AdvisorCatalog.cs+++ b/unity/Assets/Scripts/UI/AdvisorCatalog.cs@@ -171,6 +171,7 @@ namespace Statecraft.Game.UIelse if (m.Repeat != Once && m.Repeat != Every) p.Add($"{at}: repeat must be once or every");if (m.Actions.Count > 2) p.Add($"{at}: at most two actions");foreach (var a in m.Actions) CheckAct(p, at, a, known);+ if (!m.Teaching && m.Actions.Any(a => a.Encyclopedia != "")) p.Add($"{at}: encyclopedia actions are for teaching messages (spec 7.1)");if (m.Quote != "" && !known.Quotes.Contains(m.Quote)) p.Add($"{at}: quote '{m.Quote}' is not on the verified list (spec 3.3)");if (m.Quote != ""){diff --git a/unity/Assets/Scripts/UI/AdvisorPresenter.cs b/unity/Assets/Scripts/UI/AdvisorPresenter.csindex 3d5942c91..d27c97a92 100644--- a/unity/Assets/Scripts/UI/AdvisorPresenter.cs+++ b/unity/Assets/Scripts/UI/AdvisorPresenter.cs@@ -18,6 +18,8 @@ namespace Statecraft.Game.UIpublic Func<Action>? KeepSelection;public Func<Rect?>? MapTarget;public Action? CloseScreens;+ /// <summary>Opens an encyclopedia page by its id (a teaching message's Tell me more, plan Task 13).</summary>+ public Action<string>? OpenPage;}/// <summary>The advisors' popup (spec 4.2, 7.1): one message at a time, in the right column's free upper part or a sheet@@ -72,12 +74,10 @@ namespace Statecraft.Game.UIreadonly VisualElement hudRoot, layer, popup, portrait;readonly Label name, role, words, count, quote, quoteSource;readonly Button showMe, more, notNow, gotIt, close;- readonly Button? reopen;- readonly Action onReopen;GameSession? openingGame;readonly SimBridge bridge; readonly UiText text; readonly AdvisorSession session; readonly PortraitCatalog? portraits;readonly AdvisorHooks hooks; readonly bool hebrew;- readonly Action onChanged, onCover, onShowMe, onGotIt, onNotNow, onClose, onAttention, onLevel;+ readonly Action onChanged, onCover, onShowMe, onGotIt, onNotNow, onClose, onAttention, onLevel, onMore;readonly IReadOnlyList<AdvisorCatalog.Message> chain;readonly Action<IReadOnlyList<Rejection>> onTurn;readonly EventCallback<GeometryChangedEvent> onLaidOut;@@ -146,14 +146,8 @@ namespace Statecraft.Game.UIfloored = new (VisualElement, float)[] { (name, NamePx), (role, RolePx), (words, TextPx), (showMe, ButtonPx), (more, ButtonPx), (notNow, ButtonPx), (gotIt, ButtonPx), (close, ButtonPx), (count, CountPx), (mediaLabel, 15f), (mediaCredit, 15f), (overlayCaption, TextPx), (overlayLabel, 15f), (overlayCredit, 15f), (watch, 15f), (overlayClose, ButtonPx), (quote, QuotePx), (quoteSource, QuoteSourcePx) };onShowMe = ShowMe; onGotIt = GotIt; onNotNow = NotNow;onClose = () => { if (session.Chain.Step >= 0) CloseChain(); else GotIt(); };- reopen = root.Q<Button>("how-to-play-guide");- onReopen = OpenChain; // which closes How to play- if (reopen != null)- {- reopen.text = text["how_to_play.guide"]; reopen.clicked += onReopen;- Display(reopen, chain.Any(m => m.ApprovedIn(hebrew))); // no button that opens nothing (pending Hebrew)- }- showMe.clicked += onShowMe; gotIt.clicked += onGotIt; close.clicked += onClose; notNow.clicked += onNotNow;+ onMore = () => { if (Shown?.Actions.FirstOrDefault(a => a.Encyclopedia != "") is AdvisorCatalog.Act a) this.hooks.OpenPage?.Invoke(a.Encyclopedia); };+ showMe.clicked += onShowMe; gotIt.clicked += onGotIt; close.clicked += onClose; notNow.clicked += onNotNow; more.clicked += onMore;onAttention = () => Notice(AdvisorSignals.AttentionRefused);bridge.RefusedForAttention += onAttention;onChanged = Evaluate; onTurn = _ => Notice(AdvisorSignals.TurnEnded); onCover = CoverChanged; onLaidOut = PlaceWhenLaidOut;@@ -287,7 +281,9 @@ namespace Statecraft.Game.UIportrait.style.backgroundImage = picture == null ? new StyleBackground(StyleKeyword.Null) : new StyleBackground(picture);popup.EnableInClassList(CriticalClass, m.Critical);Display(showMe, m.Actions.Any(a => a.ShowMe != "" || a.OpenScreen != "" || a.OpenCard));- Display(more, false); // Task 13: a page to open+ // Tell me more (plan Task 13): a teaching message's page, only where that page shows (OQ-4: not pending Hebrew).+ Display(more, m.Teaching && hooks.OpenPage != null+ && m.Actions.Any(a => a.Encyclopedia != "" && session.Catalog.FindPage(a.Encyclopedia)?.ApprovedIn(hebrew) == true));Display(notNow, !m.Teaching && !m.Critical);var (number, total) = session.Queue.Position(Turn, hebrew);count.text = total > 1 ? text.Format("advisor.count", number, total) : "";@@ -775,8 +771,7 @@ namespace Statecraft.Game.UIbridge.Changed -= onChanged; bridge.TurnEnded -= onTurn;session.Settings.LevelChanged -= onLevel;if (layer.userData == (object)onCover) layer.userData = null;- if (reopen != null) reopen.clicked -= onReopen;- showMe.clicked -= onShowMe; gotIt.clicked -= onGotIt; close.clicked -= onClose; notNow.clicked -= onNotNow;+ showMe.clicked -= onShowMe; gotIt.clicked -= onGotIt; close.clicked -= onClose; notNow.clicked -= onNotNow; more.clicked -= onMore;hudRoot.RemoveFromClassList(OpenClass);}}diff --git a/unity/Assets/Scripts/UI/EncyclopediaPresenter.cs b/unity/Assets/Scripts/UI/EncyclopediaPresenter.csnew file mode 100644index 000000000..e19460091--- /dev/null+++ b/unity/Assets/Scripts/UI/EncyclopediaPresenter.cs@@ -0,0 +1,123 @@+#nullable enable+using System.Linq;+using Statecraft.Sim;+using UnityEngine.UIElements;++namespace Statecraft.Game.UI+{+ /// <summary>The advisors' encyclopedia (spec 10), which replaces How to play: one page per mechanic from+ /// advisor-messages.yaml, grouped by advisor, each with its title, its text and a Show me when it names a target. A+ /// normal side-menu screen, so ScreenNav owns opening and closing. In Hebrew a page waiting for its native review is+ /// left out (OQ-4), and an advisor with no page shown has no heading.</summary>+ public sealed class EncyclopediaPresenter : System.IDisposable+ {+ readonly VisualElement screen, pagePane;+ readonly ScrollView list;+ readonly Label pageTitle, pageText;+ readonly Button back, showMe, opening;+ readonly UiText text; readonly AdvisorCatalog catalog; readonly ScreenNav nav; readonly AdvisorPresenter? advisor;+ readonly bool hebrew, gdd03, openingShown;+ readonly System.Action onBack, onShowMe, onOpening;++ /// <summary>The page on show, or null while the list shows.</summary>+ public string? ShowingPage { get; private set; }++ public EncyclopediaPresenter(VisualElement root, UiText text, AdvisorCatalog catalog, ScreenNav nav, AdvisorPresenter? advisor,+ string ruleset = SaveGame.GddRuleset)+ {+ this.text = text; this.catalog = catalog; this.nav = nav; this.advisor = advisor;+ hebrew = text["ui.lang"] == UiLanguage.Hebrew;+ gdd03 = ruleset == SaveGame.Gdd03Ruleset; // R-GOV-002: gdd-0.3 has no Attention, so its help never names it (#1688)+ screen = root.Q<VisualElement>("screen-encyclopedia");+ screen.Q<Label>("encyclopedia-title").text = text["encyclopedia.title"];+ list = screen.Q<ScrollView>("encyclopedia-list");+ pagePane = screen.Q<VisualElement>("encyclopedia-page");+ pageTitle = screen.Q<Label>("encyclopedia-page-title"); pageText = screen.Q<Label>("encyclopedia-page-text");+ back = screen.Q<Button>("encyclopedia-back"); showMe = screen.Q<Button>("encyclopedia-show-me");+ opening = screen.Q<Button>("encyclopedia-opening");+ back.text = text["encyclopedia.back"]; showMe.text = text["advisor.show_me"]; opening.text = text["encyclopedia.opening"];+ // Back hands the focus to the entry just read, which Render has just rebuilt (#2095 review).+ onBack = () =>+ {+ var read = ShowingPage; var had = FocusInside();+ Render();+ if (had) FocusReturn.To(list.Q<Button>("encyclopedia-page-" + read));+ };+ onShowMe = () =>+ {+ var target = ShowingPage == null ? "" : catalog.FindPage(ShowingPage)?.ShowMe ?? "";+ if (target == "" || advisor == null) return;+ nav.Close();+ advisor.ShowTarget(target);+ };+ // The advisors' opening chain again (spec 9), which closes this screen. No button that opens nothing: while+ // every opening line is pending in Hebrew the chain cannot open (OQ-4).+ onOpening = () => { nav.Close(); advisor?.OpenChain(); };+ back.clicked += onBack; showMe.clicked += onShowMe; opening.clicked += onOpening;+ openingShown = advisor != null && advisor.Chain.Any(m => m.ApprovedIn(hebrew));+ ScreenNav.OnOpened(screen, Render); // each open starts at the list+ Render();+ }++ /// <summary>A page the player may read here: approved in this language, and none about Attention under gdd-0.3.</summary>+ bool Shown(AdvisorCatalog.Page p) => p.ApprovedIn(hebrew) && !(gdd03 && p.Id == "attention");++ /// <summary>The list: per advisor, in AdvisorCatalog.AdvisorIds' order, a heading and one button per page shown.</summary>+ public void Render()+ {+ ShowingPage = null;+ list.Clear();+ foreach (var id in AdvisorCatalog.AdvisorIds)+ {+ var pages = catalog.Pages.Where(p => p.Advisor == id && Shown(p)).ToList();+ if (pages.Count == 0) continue;+ var heading = new Label(text["advisor." + id + ".name"]) { name = "encyclopedia-advisor-" + id };+ heading.AddToClassList("encyclopedia-advisor");+ list.Add(heading);+ foreach (var p in pages)+ {+ var page = p.Id;+ var button = new Button(() => ShowPage(page)) { name = "encyclopedia-page-" + page, text = text["advisor.page." + page + ".title"] };+ button.AddToClassList("encyclopedia-entry");+ list.Add(button);+ }+ }+ Display(list, true); Display(pagePane, false); Display(opening, openingShown);+ }++ /// <summary>Opens the screen on <paramref name="pageId"/> (an advisor's Tell me more); on the list when that page is not+ /// shown in this language or ruleset.</summary>+ public void Open(string pageId)+ {+ if (nav.Current != "encyclopedia") nav.Open("encyclopedia");+ else Render();+ ShowPage(pageId);+ }++ void ShowPage(string pageId)+ {+ if (catalog.FindPage(pageId) is not AdvisorCatalog.Page p || !Shown(p)) return;+ ShowingPage = p.Id;+ var key = "advisor.page." + p.Id;+ pageTitle.text = text[key + ".title"];+ pageText.text = text[gdd03 && text.Has(key + ".gdd03.text") ? key + ".gdd03.text" : key + ".text"];+ Display(showMe, advisor != null && p.ShowMe != "" && !(gdd03 && p.ShowMe == "attention"));+ // A page shows only Back and Show me; the opening button belongs to the list. Back takes the focus when it was in+ // the screen, since the list that held it is hidden now (#2095 review).+ var had = FocusInside();+ Display(list, false); Display(pagePane, true); Display(opening, false);+ if (had) FocusReturn.To(back);+ }++ /// <summary>Whether the focus is in this screen: as ScreenNav hands it in only on a keyboard open, a page and Back move+ /// it only from inside, and a mouse press elsewhere (Tell me more) keeps it where it is.</summary>+ bool FocusInside() => screen.focusController?.focusedElement is VisualElement f && screen.Contains(f);++ static void Display(VisualElement e, bool shown) => e.style.display = shown ? DisplayStyle.Flex : DisplayStyle.None;++ public void Dispose()+ {+ back.clicked -= onBack; showMe.clicked -= onShowMe; opening.clicked -= onOpening;+ }+ }+}diff --git a/unity/Assets/Scripts/UI/EncyclopediaPresenter.cs.meta b/unity/Assets/Scripts/UI/EncyclopediaPresenter.cs.metanew file mode 100644index 000000000..5a9142c88--- /dev/null+++ b/unity/Assets/Scripts/UI/EncyclopediaPresenter.cs.meta@@ -0,0 +1,2 @@+fileFormatVersion: 2+guid: 3cd0b045866bcf273a8c3fcba27f1533\ No newline at end of filediff --git a/unity/Assets/Scripts/UI/GameRoot.cs b/unity/Assets/Scripts/UI/GameRoot.csindex 95234de9d..42b35a2ab 100644--- a/unity/Assets/Scripts/UI/GameRoot.cs+++ b/unity/Assets/Scripts/UI/GameRoot.cs@@ -71,6 +71,7 @@ namespace Statecraft.Game.UI/// <summary>Set by SwitchLanguage for its Begin (#2054): whether the start screen it rebuilds offered Continue.</summary>bool keptResumed = true;AdvisorPresenter? advisor;+ EncyclopediaPresenter? encyclopedia;/// <summary>Tests supply an in-memory approval copy for Hebrew layout; the shipped review fields are unchanged.</summary>internal AdvisorCatalog? AdvisorCatalogForTests { get; set; }/// <summary>Tests: the advisors' popup of the last Begin, and their session (kept across a language switch).</summary>@@ -301,7 +302,6 @@ namespace Statecraft.Game.UIvar budget = Own(new BudgetPresenter(root, bridge, text));var why = Own(new WhyPresenter(root, bridge, text));Own(new TimelinePresenter(root, bridge, text));- Own(new HowToPlayPresenter(root, text, bridge.Content.Ruleset));Own(new ObjectivesPresenter(root, bridge, text));// The advisors (spec 4.2): their session survives a rebuild over the same game (a language switch keeps the// queue, the history and the opening chain's place) and is new for any other Begin. They show by themselves only@@ -565,7 +565,7 @@ namespace Statecraft.Game.UIstart.Show();}// It shows by itself only where the start screen does (never in the automated runs, nor under ?firstcard, which- // times the first card) and a settings file remembers that it has; How to play opens it again anywhere. Steps 2+ // times the first card) and a settings file remembers that it has; the encyclopedia opens it again anywhere. Steps 2// and 3 show its city as a click there would, without selecting a unit on the city's hex; step 4 shows a unit// that can move, its ring and its card, as a click on it would (OnHexClicked), and centres the camera on its hex.Action showCity = () =>@@ -619,6 +619,7 @@ namespace Statecraft.Game.UInew AdvisorHooks{Card = card, OpenScreen = s => nav?.Open(s), CloseScreens = () => nav?.Close(), ShowCity = showCity, ShowUnit = showUnit, KeepSelection = keepSelection,+ OpenPage = p => encyclopedia?.Open(p),MapTarget = () =>{(int q, int r)? selected = info.Selected;@@ -639,6 +640,9 @@ namespace Statecraft.Game.UI},}));budget.UnsubmittedChanged += advisor.BudgetUnsubmitted;+ // The advisors' encyclopedia (spec 10), which replaces How to play: after the advisor, whose Show me and opening+ // chain its buttons call; an advisor's Tell me more opens its pages (OpenPage above).+ encyclopedia = Own(new EncyclopediaPresenter(root, text, AdvisorSession.Catalog, nav!, advisor, bridge.Content.Ruleset));if (video != null)advisor.Media = new AdvisorMedia(text, new ClipPicture(video), new StillPicture(), DeclarationRecording.WebFetch, new DeclarationRecording.SourceOutput());// A new game, from the start screen or the top bar's New game, plays the opening first when there is one.@@ -865,7 +869,7 @@ namespace Statecraft.Game.UIfor (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; 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;+ minimap = null; unseenSkipped = null; labels = null; nav = null; start = null; opening = null; card = null; outcomes = null; report = null; end = null; advisor = null; encyclopedia = 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;diff --git a/unity/Assets/Scripts/UI/HowToPlayPresenter.cs b/unity/Assets/Scripts/UI/HowToPlayPresenter.csdeleted file mode 100644index 92cdbbe6a..000000000--- a/unity/Assets/Scripts/UI/HowToPlayPresenter.cs+++ /dev/null@@ -1,33 +0,0 @@-#nullable enable-using UnityEngine.UIElements;-using Statecraft.Sim;--namespace Statecraft.Game.UI-{- /// <summary>Fills the short, presentation-only guide to the simulation's existing turn loop (#1041).</summary>- public sealed class HowToPlayPresenter : System.IDisposable- {- readonly VisualElement screen;-- public HowToPlayPresenter(VisualElement root, UiText text, string ruleset = SaveGame.GddRuleset)- {- screen = root.Q<VisualElement>("screen-how-to-play");- screen.Q<Label>("how-to-play-title").text = text["how_to_play.title"];- bool gdd03 = ruleset == SaveGame.Gdd03Ruleset;- foreach (var key in new[] { "turn", "attention", "city", "training", "events", "top_bar", "end_turn", "why" })- {- var line = screen.Q<Label>("how-to-play-" + key.Replace('_', '-'));- if (key == "attention")- {- line.text = gdd03 ? "" : text["how_to_play.attention"];- line.style.display = gdd03 ? DisplayStyle.None : DisplayStyle.Flex;- continue;- }- bool variant = gdd03 && (key == "events" || key == "top_bar" || key == "end_turn");- line.text = text["how_to_play." + (variant ? "gdd03." : "") + key];- }- }-- public void Dispose() { }- }-}diff --git a/unity/Assets/Scripts/UI/HowToPlayPresenter.cs.meta b/unity/Assets/Scripts/UI/HowToPlayPresenter.cs.metadeleted file mode 100644index 0a3dade2f..000000000--- a/unity/Assets/Scripts/UI/HowToPlayPresenter.cs.meta+++ /dev/null@@ -1,2 +0,0 @@-fileFormatVersion: 2-guid: 8490c32a58cb44d58ea92496991d54d4diff --git a/unity/Assets/Scripts/UI/HudPresenter.cs b/unity/Assets/Scripts/UI/HudPresenter.csindex 6c249e560..680e57376 100644--- a/unity/Assets/Scripts/UI/HudPresenter.cs+++ b/unity/Assets/Scripts/UI/HudPresenter.cs@@ -108,7 +108,7 @@ namespace Statecraft.Game.UIstatic readonly (string name, string key)[] Texts ={("nav-cabinet", "hud.nav.cabinet"), ("nav-budget", "hud.nav.budget"), ("nav-defence", "hud.nav.defence"),- ("nav-why", "hud.nav.why"), ("nav-timeline", "nav.timeline"), ("nav-how-to-play", "hud.nav.how_to_play"),+ ("nav-why", "hud.nav.why"), ("nav-timeline", "nav.timeline"), ("nav-encyclopedia", "hud.nav.encyclopedia"),("nav-objectives", "hud.nav.objectives"), ("nav-settings", "hud.nav.settings"),("new-game", "hud.new_game"), ("end-turn", "hud.end_turn"),};diff --git a/unity/Assets/Scripts/UI/KeyScroll.cs b/unity/Assets/Scripts/UI/KeyScroll.csindex 28f1214e0..6a4b564fd 100644--- a/unity/Assets/Scripts/UI/KeyScroll.cs+++ b/unity/Assets/Scripts/UI/KeyScroll.cs@@ -18,7 +18,7 @@ namespace Statecraft.Game.UIstatic readonly Dictionary<string, string> MainViews = new Dictionary<string, string>{["cabinet"] = "cabinet-seats", ["budget"] = "budget-rows", ["defence"] = "defence-body", ["why"] = "why-rows",- ["how-to-play"] = "how-to-play-body", ["timeline"] = "timeline-list", ["objectives"] = "objectives-rows",+ ["encyclopedia"] = "encyclopedia-list", ["timeline"] = "timeline-list", ["objectives"] = "objectives-rows",};/// <summary>A page is the view's height less about one line of text, so the line at the edge stays in sight.</summary>@@ -49,6 +49,9 @@ namespace Statecraft.Game.UIvar open = root.Q<VisualElement>("screen-" + screen);var around = (root.panel?.focusController?.focusedElement as VisualElement)?.GetFirstAncestorOfType<ScrollView>();if (around != null && open != null && open.Contains(around)) return around;+ // An open encyclopedia page hides the list, so its body is the view then (#2095 review).+ if (screen == "encyclopedia" && root.Q<ScrollView>("encyclopedia-list") is ScrollView list && list.style.display.value == DisplayStyle.None)+ return root.Q<ScrollView>("encyclopedia-page-body");return MainViews.TryGetValue(screen, out var main) ? root.Q<ScrollView>(main) : null;}}diff --git a/unity/Assets/Scripts/UI/ScreenNav.cs b/unity/Assets/Scripts/UI/ScreenNav.csindex 723de751a..91dd44aa5 100644--- a/unity/Assets/Scripts/UI/ScreenNav.cs+++ b/unity/Assets/Scripts/UI/ScreenNav.cs@@ -5,13 +5,13 @@ using UnityEngine.UIElements;namespace Statecraft.Game.UI{- /// <summary>The side-menu buttons open the Cabinet, Budget, Defence, Why, Timeline, How to play, Objectives and Settings screens, one at a time; pressing the open+ /// <summary>The side-menu buttons open the Cabinet, Budget, Defence, Why, Timeline, Encyclopedia, Objectives and Settings screens, one at a time; pressing the open/// screen's button again closes it. Every press toggles, synchronously, with no debounce: two presses in one frame (a/// double click, or a click plus Enter) open and close again, so the result depends only on the number of presses/// (HudTests.TwoPressesInOneFrameToggleTwice; playtest 1, item 11).</summary>public sealed class ScreenNav : System.IDisposable{- public static readonly string[] Screens = { "cabinet", "budget", "defence", "why", "timeline", "how-to-play", "objectives", "settings" };+ public static readonly string[] Screens = { "cabinet", "budget", "defence", "why", "timeline", "encyclopedia", "objectives", "settings" };// Transient map confirmations expire even for a narrow screen that leaves the info panel visible.internal static event System.Action<VisualElement>? InfoIntentCovered;diff --git a/unity/Assets/Tests/EditMode/AdvisorCatalogTests.cs b/unity/Assets/Tests/EditMode/AdvisorCatalogTests.csindex 801d6030f..a0d9c2d2a 100644--- a/unity/Assets/Tests/EditMode/AdvisorCatalogTests.cs+++ b/unity/Assets/Tests/EditMode/AdvisorCatalogTests.cs@@ -110,6 +110,7 @@ public class AdvisorCatalogTests[TestCase("{ id: x, advisor: dayan, signal: new_game, level: new, actions: [{ open_card: true }, { open_card: true }, { open_card: true }] }", "at most two actions")][TestCase("{ id: x, advisor: dayan, signal: new_game, level: new, quote: q9 }", "not on the verified list")][TestCase("{ id: x, advisor: dayan, signal: new_game, level: new, he_review: maybe }", "he_review must be")]+ [TestCase("{ id: x, advisor: dayan, signal: new_game, level: warnings, actions: [{ encyclopedia: moon }] }", "encyclopedia actions are for teaching messages")]public void EachBrokenRowIsNamed(string row, string expected){var problems = ProblemsOf("messages:\n - " + row + "\n", "advisor.x.text", "advisor.Bad Id.text");diff --git a/unity/Assets/Tests/EditMode/AdvisorOpeningParityTests.cs b/unity/Assets/Tests/EditMode/AdvisorOpeningParityTests.csindex 2cc4ee1c9..db8e4054a 100644--- a/unity/Assets/Tests/EditMode/AdvisorOpeningParityTests.cs+++ b/unity/Assets/Tests/EditMode/AdvisorOpeningParityTests.cs@@ -266,10 +266,10 @@ public class AdvisorOpeningParityTestsowned.Add(new HudPresenter(Ui.Root, Bridge, text));Nav = Own(new ScreenNav(Ui.Root));Card = Own(new EventCardPresenter(Ui.Root, Bridge, text, null));- Own(new HowToPlayPresenter(Ui.Root, text));var (info, advisor) = PanelAndAdvisor(Ui.Root, Bridge, text, settings, Card, () => Nav.Close());Info = Own(info);Advisor = Own(advisor);+ Own(new EncyclopediaPresenter(Ui.Root, text, AdvisorCatalog.Load(), Nav, Advisor));}T Own<T>(T d) where T : IDisposable { owned.Add(d); return d; }@@ -400,11 +400,11 @@ public class AdvisorOpeningParityTestsfor (int at = 0; at < Steps.Length; at++){- rig.Ui.Press("nav-how-to-play");- Assert.AreEqual("how-to-play", rig.Nav.Current);- Assert.AreEqual(text["how_to_play.guide"], rig.Ui.Q<Button>("how-to-play-guide").text);- rig.Ui.Press("how-to-play-guide");- Assert.IsTrue(rig.Advisor.InChain, "How to play opens it again");+ rig.Ui.Press("nav-encyclopedia");+ Assert.AreEqual("encyclopedia", rig.Nav.Current);+ Assert.AreEqual(text["encyclopedia.opening"], rig.Ui.Q<Button>("encyclopedia-opening").text);+ rig.Ui.Press("encyclopedia-opening");+ Assert.IsTrue(rig.Advisor.InChain, "the encyclopedia opens it again");Assert.IsNull(rig.Nav.Current, "and closes itself");Assert.AreEqual(0, rig.Advisor.ChainStep);for (int i = 0; i < at; i++) rig.Ui.Press("advisor-got-it");@@ -717,7 +717,7 @@ public class AdvisorOpeningParityTestsadvisor.CloseChain();AnswerTheOpeningCards();Assert.IsNull(card.Shown, "precondition: no card left this turn");- UiTestKit.Press(Ui.Q<Button>("nav-how-to-play")); UiTestKit.Press(Ui.Q<Button>("how-to-play-guide"));+ UiTestKit.Press(Ui.Q<Button>("nav-encyclopedia")); UiTestKit.Press(Ui.Q<Button>("encyclopedia-opening"));Assert.IsTrue(advisor.InChain);var seen = new List<string>();for (int shown = 1; advisor.InChain; shown++)@@ -824,11 +824,11 @@ public class AdvisorOpeningParityTestsvar queued = bridge.Queued.Count;void Next(int times) { for (int i = 0; i < times; i++) UiTestKit.Press(Ui.Q<Button>("advisor-got-it")); }- void FromHowToPlay() { UiTestKit.Press(Ui.Q<Button>("nav-how-to-play")); UiTestKit.Press(Ui.Q<Button>("how-to-play-guide")); }+ void FromTheEncyclopedia() { UiTestKit.Press(Ui.Q<Button>("nav-encyclopedia")); UiTestKit.Press(Ui.Q<Button>("encyclopedia-opening")); }Next(Steps.Length); // the advisor that opened by itself, to DoneAssert.IsFalse(game.Advisor.InChain);- FromHowToPlay(); Next(2); UiTestKit.Press(Ui.Q<Button>("advisor-close"));- FromHowToPlay(); Next(3); yield return null; Ui.Q<Button>("advisor-got-it").Focus(); Assert.IsTrue(game.Advisor.Escape());+ FromTheEncyclopedia(); Next(2); UiTestKit.Press(Ui.Q<Button>("advisor-close"));+ FromTheEncyclopedia(); Next(3); yield return null; Ui.Q<Button>("advisor-got-it").Focus(); Assert.IsTrue(game.Advisor.Escape());Assert.IsFalse(game.Advisor.InChain);Assert.AreSame(session, bridge.Session, "the same game");Assert.AreEqual(hash, bridge.State.Hash(), "the state hash");@@ -1100,7 +1100,7 @@ public class AdvisorOpeningEventIdentityTests{var yaml = File.ReadAllText(AdvisorCatalog.Path).Replace("he_review: pending", "he_review: approved").Replace("requires: [opening.move]", "requires: [opening.detour]")- .Replace("pages: []", " - { id: opening.detour, advisor: ben_gurion, signal: opening, level: new, he_review: approved, requires: [opening.move], when: { cards_waiting_at_least: 99 } }\n\npages: []");+ .Replace("\npages:\n", "\n - { id: opening.detour, advisor: ben_gurion, signal: opening, level: new, he_review: approved, requires: [opening.move], when: { cards_waiting_at_least: 99 } }\n\npages:\n");using var rig = new AdvisorTour1688Fixture.Rig(catalog: AdvisorCatalog.Parse(yaml));rig.Advisor.OpenChain();for (int i = 0; i < 4; i++) rig.Advisor.NextStep();diff --git a/unity/Assets/Tests/EditMode/AdvisorOpeningTests.cs b/unity/Assets/Tests/EditMode/AdvisorOpeningTests.csindex 6eb186cd5..9e9d876fd 100644--- a/unity/Assets/Tests/EditMode/AdvisorOpeningTests.cs+++ b/unity/Assets/Tests/EditMode/AdvisorOpeningTests.cs@@ -34,7 +34,7 @@ public class AdvisorOpeningTestspublic readonly AdvisorSession Session;public readonly AdvisorPresenter Advisor;readonly HudPresenter hud;- public Rig(UiText text, SettingsStore? store, bool approved = false, AdvisorSession? session = null)+ public Rig(UiText text, SettingsStore? store, bool approved = false, AdvisorSession? session = null, bool tellMeMore = false){Ui.Root.Q("root").RemoveFromClassList("loading");Ui.Root.Q("root").EnableInClassList(UiLanguage.HebrewClass, text["ui.lang"] == UiLanguage.Hebrew);@@ -42,9 +42,12 @@ public class AdvisorOpeningTestshud = new HudPresenter(Ui.Root, Bridge, text); Nav = new ScreenNav(Ui.Root);Card = new EventCardPresenter(Ui.Root, Bridge, text, null);Session = session ?? new AdvisorSession(approved ? Approved() : Pending(), new AdvisorSettings(store), true);- Advisor = new AdvisorPresenter(Ui.Root, Bridge, text, Session, hooks: new AdvisorHooks { Card = Card, CloseScreens = () => Nav.Close() });+ Advisor = new AdvisorPresenter(Ui.Root, Bridge, text, Session, hooks: new AdvisorHooks { Card = Card, CloseScreens = () => Nav.Close(),+ OpenPage = tellMeMore ? p => Encyclopedia?.Open(p) : null }); // as GameRoot wires Tell me more+ Encyclopedia = new EncyclopediaPresenter(Ui.Root, text, Session.Catalog, Nav, Advisor);}- public void Dispose() { Advisor.Dispose(); Card.Dispose(); Nav.Dispose(); hud.Dispose(); Ui.Dispose(); }+ public readonly EncyclopediaPresenter Encyclopedia;+ public void Dispose() { Encyclopedia.Dispose(); Advisor.Dispose(); Card.Dispose(); Nav.Dispose(); hud.Dispose(); Ui.Dispose(); }}[Test]@@ -54,6 +57,26 @@ public class AdvisorOpeningTestsAssert.AreEqual(5, AdvisorPresenter.EventStep);}+ /// <summary>Tell me more on an opening step (#2095 review): the encyclopedia opens on the step's page over the chain, and+ /// when it closes the chain is still on that step, showing it (RenderChain hides the popup only while a screen covers it).</summary>+ [Test]+ public void TellMeMoreOnAnOpeningStepKeepsTheChainOnItsStep()+ {+ using var rig = new Rig(En, Store(), tellMeMore: true); rig.Advisor.NewGame();+ rig.Advisor.NextStep(); rig.Advisor.NextStep();+ Assert.AreEqual(2, rig.Session.Chain.Step); Assert.AreEqual("opening.city", rig.Advisor.Shown?.Id);+ Assert.AreEqual(DisplayStyle.Flex, rig.Ui.Q<Button>("advisor-more").style.display.value, "the step offers Tell me more");+ rig.Ui.Press("advisor-more");+ Assert.AreEqual("encyclopedia", rig.Nav.Current); Assert.AreEqual("cities", rig.Encyclopedia.ShowingPage);+ Assert.AreEqual(2, rig.Session.Chain.Step, "reading the page does not move the chain");+ rig.Ui.Press("nav-encyclopedia");+ Assert.IsNull(rig.Nav.Current);+ Assert.IsTrue(rig.Advisor.InChain, "the chain is still open");+ Assert.AreEqual(2, rig.Session.Chain.Step, "on the same step");+ Assert.AreEqual("opening.city", rig.Advisor.Shown?.Id);+ Assert.IsTrue(rig.Advisor.IsOpen, "and the step shows again");+ }+[Test]public void ThePendingChainDoesNotOpenInHebrewAndIsNotMarkedSeen(){@@ -61,19 +84,19 @@ public class AdvisorOpeningTestsAssert.IsFalse(rig.Advisor.InChain); Assert.IsFalse(rig.Session.Settings.OpeningSeen);}- /// <summary>While every opening line is pending in Hebrew, How to play has no button that would open nothing, and asking- /// for the chain leaves the screen the player is on open.</summary>+ /// <summary>While every opening line is pending in Hebrew, the encyclopedia has no button that would open nothing, and+ /// asking for the chain leaves the screen the player is on open.</summary>[Test]public void ThePendingChainHasNoReopenButtonInHebrew(){using (var en = new Rig(En, Store()))- Assert.AreEqual(DisplayStyle.Flex, en.Ui.Q<Button>("how-to-play-guide").style.display.value, "English: the button shows");+ Assert.AreEqual(DisplayStyle.Flex, en.Ui.Q<Button>("encyclopedia-opening").style.display.value, "English: the button shows");using var rig = new Rig(He, Store());- Assert.AreEqual(DisplayStyle.None, rig.Ui.Q<Button>("how-to-play-guide").style.display.value, "Hebrew, all pending: no button");- rig.Ui.Press("nav-how-to-play");+ Assert.AreEqual(DisplayStyle.None, rig.Ui.Q<Button>("encyclopedia-opening").style.display.value, "Hebrew, all pending: no button");+ rig.Ui.Press("nav-encyclopedia");rig.Advisor.OpenChain();Assert.IsFalse(rig.Advisor.InChain);- Assert.AreEqual("how-to-play", rig.Nav.Current, "How to play stays open");+ Assert.AreEqual("encyclopedia", rig.Nav.Current, "the encyclopedia stays open");}[Test]@@ -127,11 +150,11 @@ public class AdvisorOpeningTests}[Test]- public void HowToPlaysButtonOpensTheChainAgain()+ public void TheEncyclopediasButtonOpensTheChainAgain(){- using var rig = new Rig(En, Store()); rig.Ui.Press("nav-how-to-play"); rig.Ui.Press("how-to-play-guide");+ using var rig = new Rig(En, Store()); rig.Ui.Press("nav-encyclopedia"); rig.Ui.Press("encyclopedia-opening");Assert.IsTrue(rig.Advisor.InChain); Assert.AreEqual(0, rig.Advisor.ChainStep); Assert.IsNull(rig.Nav.Current);- Assert.AreEqual("Show the opening advice again", rig.Ui.Q<Button>("how-to-play-guide").text);+ Assert.AreEqual("Show the opening advice again", rig.Ui.Q<Button>("encyclopedia-opening").text);}[Test]diff --git a/unity/Assets/Tests/EditMode/AdvisorPopupTests.cs b/unity/Assets/Tests/EditMode/AdvisorPopupTests.csindex fb61d3246..26559bddf 100644--- a/unity/Assets/Tests/EditMode/AdvisorPopupTests.cs+++ b/unity/Assets/Tests/EditMode/AdvisorPopupTests.cs@@ -67,6 +67,34 @@ public class AdvisorPopupTestsstatic bool Displayed(Button b) => b.style.display.value != DisplayStyle.None;+ /// <summary>Spec 7.1, plan Task 13: a teaching message with an encyclopedia action shows Tell me more, which opens that+ /// page through the OpenPage hook; a message without one, or with no hook, has no Tell me more.</summary>+ [Test]+ public void TellMeMoreOpensTheMessagesPage()+ {+ var opened = new List<string>();+ var catalog = Fixture.Replace("level: new, actions: [{ open_screen: budget }]", "level: new, actions: [{ open_screen: budget }, { encyclopedia: p }]") ++ "pages:\n - { id: p, advisor: meyerson }\n";+ using (var rig = new Rig(catalog: catalog, hooks: new AdvisorHooks { OpenPage = opened.Add }))+ {+ rig.Advisor.NewGame();+ Assert.AreEqual("t.teach", rig.Advisor.Shown?.Id);+ Assert.IsTrue(Displayed(rig.Ui.Q<Button>("advisor-more")), "the page to open");+ rig.Ui.Press("advisor-more");+ CollectionAssert.AreEqual(new[] { "p" }, opened);+ }+ using (var rig = new Rig(catalog: catalog))+ {+ rig.Advisor.NewGame();+ Assert.IsFalse(Displayed(rig.Ui.Q<Button>("advisor-more")), "no hook, no Tell me more");+ }+ using (var plain = new Rig())+ {+ plain.Advisor.NewGame();+ Assert.IsFalse(Displayed(plain.Ui.Q<Button>("advisor-more")), "no encyclopedia action, no Tell me more");+ }+ }+/// <summary>Spec 3.2: a real quote shows only from the verified list, styled as a quote with its source under it; the/// advisor's own line stays plain game dialogue.</summary>[Test]@@ -104,7 +132,7 @@ public class AdvisorPopupTestsAssert.AreEqual(text["advisor.show_me"], rig.Ui.Q<Button>("advisor-show-me").text);Assert.IsTrue(Displayed(rig.Ui.Q<Button>("advisor-show-me")), "it has an action");Assert.IsFalse(Displayed(rig.Ui.Q<Button>("advisor-not-now")), "teaching: Tell me more, not Not now");- Assert.IsFalse(Displayed(rig.Ui.Q<Button>("advisor-more")), "no page to open yet (S3)");+ Assert.IsFalse(Displayed(rig.Ui.Q<Button>("advisor-more")), "no encyclopedia action, no page to open");Assert.IsFalse(rig.Ui.Q<VisualElement>("advisor-popup").ClassListContains(AdvisorPresenter.CriticalClass));}diff --git a/unity/Assets/Tests/EditMode/EncyclopediaScreenTests.cs b/unity/Assets/Tests/EditMode/EncyclopediaScreenTests.csnew file mode 100644index 000000000..5119d65dc--- /dev/null+++ b/unity/Assets/Tests/EditMode/EncyclopediaScreenTests.cs@@ -0,0 +1,296 @@+#nullable enable+using System.Collections;+using System.Collections.Generic;+using System.IO;+using System.Linq;+using NUnit.Framework;+using Statecraft.Game;+using Statecraft.Game.UI;+using Statecraft.Sim;+using UnityEditor;+using UnityEngine;+using UnityEngine.TestTools;+using UnityEngine.UIElements;+using Object = UnityEngine.Object;++/// <summary>The advisors' encyclopedia (spec 10), which replaces How to play (#1041): side-menu navigation, the pages grouped+/// by advisor, both languages, gdd-0.3's help without Attention (R-GOV-002), and its two required layouts.</summary>+public class EncyclopediaScreenTests+{+ static readonly Content C = ContentLoader.Load(Paths.Content);+ static UiText En => UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.Strings).text);+ static UiText He => UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.StringsHebrew).text, "strings.he.yaml");+ // Approval of the 16 pages still pending is simulated ONLY in the test's in-memory copy; the shipped catalogue keeps them pending.+ static AdvisorCatalog Approved() => AdvisorCatalog.Parse(File.ReadAllText(AdvisorCatalog.Path).Replace("he_review: pending", "he_review: approved"));++ [Test]+ public void TheSideMenuOpensAndClosesTheScreenInBothLanguages([Values(false, true)] bool hebrew)+ {+ var text = hebrew ? He : En;+ using var ui = new UiTestKit();+ using var nav = new ScreenNav(ui.Root);+ using var pedia = new EncyclopediaPresenter(ui.Root, FixtureText(text), Pages(), nav, null);+ var screen = ui.Q<VisualElement>("screen-encyclopedia");+ Assert.IsFalse(ScreenNav.IsOpen(screen), "hidden at start");+ ui.Press("nav-encyclopedia");+ Assert.IsTrue(ScreenNav.IsOpen(screen), "the side-menu button opens it");+ Assert.AreEqual("encyclopedia", nav.Current);+ Assert.AreEqual(text["encyclopedia.title"], ui.Q<Label>("encyclopedia-title").text);+ ui.Press("nav-encyclopedia");+ Assert.IsFalse(ScreenNav.IsOpen(screen), "pressing the same button closes it");+ Assert.IsNull(nav.Current);+ }++ /// <summary>Spec 10: grouped by advisor; a page shows its title and text; Back returns to the list; in Hebrew a pending+ /// page is left out of the list (OQ-4), and an advisor with no page shown has no heading.</summary>+ [Test]+ public void PagesAreGroupedByAdvisorAndPendingOnesHideInHebrew()+ {+ using var ui = new UiTestKit();+ using var nav = new ScreenNav(ui.Root);+ using var pedia = new EncyclopediaPresenter(ui.Root, FixtureText(En), Pages(), nav, null);+ ui.Press("nav-encyclopedia");+ var list = ui.Q<ScrollView>("encyclopedia-list");+ CollectionAssert.AreEqual(new[] { "encyclopedia-advisor-ben_gurion", "encyclopedia-page-p.bg", "encyclopedia-advisor-dayan", "encyclopedia-page-p.dayan" },+ list.contentContainer.Children().Select(c => c.name).ToArray());+ ui.Press("encyclopedia-page-p.bg");+ Assert.AreEqual("p.bg", pedia.ShowingPage);+ Assert.AreEqual("Title BG.", ui.Q<Label>("encyclopedia-page-title").text);+ Assert.AreEqual("Text BG.", ui.Q<Label>("encyclopedia-page-text").text);+ Assert.AreEqual(DisplayStyle.None, ui.Q<Button>("encyclopedia-show-me").style.display.value, "no advisor to show it");+ ui.Press("encyclopedia-back");+ Assert.IsNull(pedia.ShowingPage);+ Assert.AreEqual(DisplayStyle.Flex, list.style.display.value, "Back shows the list again");++ using var ui2 = new UiTestKit();+ using var nav2 = new ScreenNav(ui2.Root);+ using var he = new EncyclopediaPresenter(ui2.Root, FixtureText(He), Pages(), nav2, null);+ ui2.Press("nav-encyclopedia");+ CollectionAssert.AreEqual(new[] { "encyclopedia-advisor-ben_gurion", "encyclopedia-page-p.bg" },+ ui2.Q<ScrollView>("encyclopedia-list").contentContainer.Children().Select(c => c.name).ToArray(), "p.dayan is pending");+ }++ /// <summary>Open(page), an advisor's Tell me more: the screen opens on that page; on the list for a page not shown.</summary>+ [Test]+ public void OpenShowsThePageAndFallsBackToTheList()+ {+ using var ui = new UiTestKit();+ using var nav = new ScreenNav(ui.Root);+ using var pedia = new EncyclopediaPresenter(ui.Root, FixtureText(He), Pages(), nav, null);+ pedia.Open("p.bg");+ Assert.AreEqual("encyclopedia", nav.Current);+ Assert.AreEqual("p.bg", pedia.ShowingPage);+ pedia.Open("p.dayan");+ Assert.AreEqual("encyclopedia", nav.Current);+ Assert.IsNull(pedia.ShowingPage, "pending in Hebrew: the list instead");+ }++ /// <summary>Spec 10: the mechanics the guide and How to play taught, the 14 nothing taught, immigration and the national+ /// meters: 25 pages, grouped by advisor as spec 3.1 splits them.</summary>+ [Test]+ public void TheShippedPagesCoverEveryMechanic()+ {+ var pages = AdvisorCatalog.Load().Pages.ToDictionary(p => p.Id, p => p.Advisor);+ var expected = new Dictionary<string, string>+ {+ ["turns"] = "ben_gurion", ["attention"] = "ben_gurion", ["events"] = "ben_gurion", ["objectives"] = "ben_gurion",+ ["defeat"] = "ben_gurion", ["top_bar"] = "ben_gurion", ["why"] = "ben_gurion",+ ["cities"] = "meyerson", ["immigration"] = "meyerson", ["training"] = "meyerson", ["projects"] = "meyerson",+ ["pioneer_work"] = "meyerson", ["corridors"] = "meyerson", ["money_debt"] = "meyerson", ["budget"] = "meyerson",+ ["cabinet"] = "meyerson", ["food"] = "meyerson", ["national_meters"] = "meyerson",+ ["units_movement"] = "dayan", ["standing_orders"] = "dayan", ["combat"] = "dayan", ["arms"] = "dayan",+ ["truces"] = "dayan", ["capture"] = "dayan", ["enemy_phase"] = "dayan",+ };+ CollectionAssert.AreEquivalent(expected, pages);+ }++ // R-GOV-002: help is selected by explicit ruleset, never by language or a zero Attention price.+ [Test]+ public void Gdd03HelpContainsNoAttentionInEitherLanguage([Values(false, true)] bool hebrew)+ {+ var text = hebrew ? He : En;+ using var ui = new UiTestKit();+ using var nav = new ScreenNav(ui.Root);+ using var pedia = new EncyclopediaPresenter(ui.Root, text, Approved(), nav, null, SaveGame.Gdd03Ruleset);+ ui.Press("nav-encyclopedia");+ var entries = ui.Q<ScrollView>("encyclopedia-list").contentContainer.Children().Select(c => c.name).ToList();+ CollectionAssert.DoesNotContain(entries, "encyclopedia-page-attention");+ var all = new List<string>(ui.Q<ScrollView>("encyclopedia-list").Query<TextElement>().ToList().Select(t => t.text));+ foreach (var page in Approved().Pages.Where(p => p.Id != "attention"))+ {+ pedia.Open(page.Id);+ Assert.AreEqual(page.Id, pedia.ShowingPage);+ all.Add(ui.Q<Label>("encyclopedia-page-title").text);+ all.Add(ui.Q<Label>("encyclopedia-page-text").text);+ }+ AssertNoAttention(string.Join("\n", all));+ }++ [Test]+ public void OldRulesetsKeepTheAttentionPage([Values(SaveGame.LegacyRuleset, SaveGame.GddRuleset)] string ruleset)+ {+ using var ui = new UiTestKit();+ using var nav = new ScreenNav(ui.Root);+ using var pedia = new EncyclopediaPresenter(ui.Root, En, AdvisorCatalog.Load(), nav, null, ruleset);+ pedia.Open("attention");+ Assert.AreEqual("attention", pedia.ShowingPage);+ Assert.AreEqual(En["advisor.page.attention.text"], ui.Q<Label>("encyclopedia-page-text").text);+ }++ /// <summary>The turns page keeps How to play's End turn guidance (#1688): a unit that needs orders is selected instead,+ /// with its remedies, in both languages and both rulesets; and it states R-TURN-004: every unit order but Send home is+ /// immediate and final, not only moves and attacks (#2095 review).</summary>+ [Test]+ public void TheTurnsPageKeepsNeedsOrdersGuidance([Values(false, true)] bool hebrew, [Values(SaveGame.GddRuleset, SaveGame.Gdd03Ruleset)] string ruleset)+ {+ using var ui = new UiTestKit();+ using var nav = new ScreenNav(ui.Root);+ using var pedia = new EncyclopediaPresenter(ui.Root, hebrew ? He : En, Approved(), nav, null, ruleset);+ pedia.Open("turns");+ var line = ui.Q<Label>("encyclopedia-page-text").text;+ foreach (var phrase in hebrew ? new[] { "ממתינה להוראות", "מסמנת את היחידה", "ביצור", "דלגו", "(התקפה, ביצור, החזקה) מתבצעות מיד", "שליחה הביתה" }+ : new[] { "needs orders", "selects it instead", "fortify", "skip it", "unit orders (attack, fortify, hold) happen at once", "Send home" })+ StringAssert.Contains(phrase, line);+ }++ /// <summary>The Hebrew merge gate of #2095 (owner review, 1 Nov 2026): on the SHIPPED catalogue (AdvisorCatalog.Load(), not+ /// Approved()), the Hebrew encyclopedia lists the nine pages that replace How to play, which Beri read as a native+ /// speaker, so the merge never leaves a Hebrew player an empty encyclopedia.</summary>+ [Test]+ public void TheShippedHebrewEncyclopediaListsTheNineGatePages()+ {+ var gate = new[] { "turns", "attention", "cities", "training", "units_movement", "events", "objectives", "top_bar", "why" };+ using var ui = new UiTestKit();+ using var nav = new ScreenNav(ui.Root);+ using var pedia = new EncyclopediaPresenter(ui.Root, He, AdvisorCatalog.Load(), nav, null);+ ui.Press("nav-encyclopedia");+ var entries = ui.Q<ScrollView>("encyclopedia-list").contentContainer.Children().Select(c => c.name).ToList();+ var missing = gate.Where(p => !entries.Contains("encyclopedia-page-" + p)).ToList();+ Assert.IsEmpty(missing, "gate pages missing from the shipped Hebrew list: " + string.Join(", ", missing));+ }++ /// <summary>Under gdd-0.3 a lost city alone does not end the game (R-END-003, #1668): the defeat page says so.</summary>+ [Test]+ public void Gdd03DefeatPageHasNoWarLoss()+ {+ using var ui = new UiTestKit();+ using var nav = new ScreenNav(ui.Root);+ using var pedia = new EncyclopediaPresenter(ui.Root, En, AdvisorCatalog.Load(), nav, null, SaveGame.Gdd03Ruleset);+ pedia.Open("defeat");+ Assert.AreEqual(En["advisor.page.defeat.gdd03.text"], ui.Q<Label>("encyclopedia-page-text").text);+ }++ static void AssertNoAttention(string all)+ {+ StringAssert.DoesNotContain("Attention", all);+ StringAssert.DoesNotContain("תשומת לב", all);+ StringAssert.DoesNotContain("תשומת הלב", all);+ }++ [UnityTest]+ public IEnumerator TheEncyclopediaFitsLaptopAndPhoneInBothLanguages([Values(SaveGame.GddRuleset, SaveGame.Gdd03Ruleset)] string ruleset)+ {+ var problems = new List<string>();+ foreach (var hebrew in new[] { false, true })+ foreach (var size in new[] { new Vector2Int(1280, 720), new Vector2Int(390, 844) })+ yield return Rendered(size.x, size.y, hebrew, (root, pedia) => Fits(root, problems, $"{ruleset} {(hebrew ? "he" : "en")} {size.x}x{size.y}", pedia, ruleset), ruleset);+ Assert.IsEmpty(problems, string.Join("\n", problems));+ }++ /// <summary>Keyboard focus (#2095 review): from an entry the page takes it on Back, and Back hands it to the entry just+ /// read, so it never sits on a hidden or removed element; the opening button belongs to the list and hides on a page.</summary>+ [UnityTest]+ public IEnumerator FocusGoesFromTheEntryToBackAndBackToTheEntry()+ {+ yield return Rendered(1280, 720, false, (root, pedia) => EntryPageBack(root));+ }++ static IEnumerable EntryPageBack(VisualElement root)+ {+ VisualElement? Focused() => root.panel.focusController.focusedElement as VisualElement;+ var opening = root.Q<Button>("encyclopedia-opening");+ Assert.AreEqual(DisplayStyle.Flex, opening.style.display.value, "precondition: the list offers the opening advice");+ var entry = root.Q<Button>("encyclopedia-page-cities");+ entry.Focus();+ yield return null;+ Assert.AreSame(entry, Focused(), "precondition: the entry has the focus");+ UiTestKit.Press(entry);+ for (int i = 0; i < 2; i++) yield return null;+ Assert.AreSame(root.Q<Button>("encyclopedia-back"), Focused(), "the page: Back has the focus");+ Assert.AreEqual(DisplayStyle.None, opening.style.display.value, "a page shows only Back and Show me");+ UiTestKit.Press(root.Q<Button>("encyclopedia-back"));+ for (int i = 0; i < 2; i++) yield return null;+ Assert.AreSame(root.Q<Button>("encyclopedia-page-cities"), Focused(), "Back: the entry just read has the focus");+ Assert.AreEqual(DisplayStyle.Flex, opening.style.display.value, "the list offers it again");+ }++ static IEnumerable Fits(VisualElement root, List<string> problems, string at, EncyclopediaPresenter pedia, string ruleset)+ {+ var window = root.worldBound;+ void Inside(string what, Rect r, Rect outer)+ {+ if (!(r.width > 0 && r.height > 0)) problems.Add($"{at}: {what} is not visible");+ else if (r.xMin < outer.xMin - 1 || r.yMin < outer.yMin - 1 || r.xMax > outer.xMax + 1 || r.yMax > outer.yMax + 1)+ problems.Add($"{at}: {what} {r} leaves {outer}");+ }+ var screen = root.Q("screen-encyclopedia").worldBound;+ Inside("screen", screen, window);+ var list = root.Q<ScrollView>("encyclopedia-list");+ if (list.contentContainer.childCount == 0) problems.Add($"{at}: the list is empty");+ foreach (var entry in list.contentContainer.Children())+ if (entry.worldBound.xMin < list.worldBound.xMin - 1 || entry.worldBound.xMax > list.worldBound.xMax + 1)+ problems.Add($"{at}: {entry.name} {entry.worldBound} overflows the list {list.worldBound}");+ pedia.Open(ruleset == SaveGame.Gdd03Ruleset ? "cities" : "attention"); // a page with a Show me; gdd-0.3 has no Attention+ for (int i = 0; i < 3; i++) yield return null;+ if (root.Q("encyclopedia-opening").style.display.value != DisplayStyle.None) problems.Add($"{at}: the opening button shows on a page");+ var body = root.Q<ScrollView>("encyclopedia-page-body").worldBound;+ var words = root.Q<Label>("encyclopedia-page-text").worldBound; // it may scroll down, never sideways+ if (!(words.width > 0) || words.xMin < body.xMin - 1 || words.xMax > body.xMax + 1) problems.Add($"{at}: page text {words} overflows {body}");+ foreach (var name in new[] { "encyclopedia-page-title", "encyclopedia-back", "encyclopedia-show-me" })+ Inside(name, root.Q(name).worldBound, screen);+ }++ static AdvisorCatalog Pages() => AdvisorCatalog.Parse("advisors:\n - { id: ben_gurion, person: ben_gurion }\n - { id: meyerson, person: golda_meir }\n - { id: dayan, person: dayan }\n" ++ "messages: []\npages:\n - { id: p.bg, advisor: ben_gurion, show_me: attention, he_review: approved }\n - { id: p.dayan, advisor: dayan }\n");++ static UiText FixtureText(UiText baseText) => UiText.Parse(+ AssetDatabase.LoadAssetAtPath<TextAsset>(baseText["ui.lang"] == UiLanguage.Hebrew ? UiPaths.StringsHebrew : UiPaths.Strings).text ++ "\nadvisor.page.p.bg.title: \"Title BG.\"\nadvisor.page.p.bg.text: \"Text BG.\"\nadvisor.page.p.dayan.title: \"Title D.\"\nadvisor.page.p.dayan.text: \"Text D.\"\n");++ /// <summary>The whole HUD as the game lays it out, the encyclopedia open on its list, with an advisor so Show me shows.+ /// The Hebrew is the test's approved copy (16 shipped pages still wait for their native review).</summary>+ static IEnumerator Rendered(int width, int height, bool hebrew, System.Func<VisualElement, EncyclopediaPresenter, IEnumerable> check,+ string ruleset = SaveGame.GddRuleset)+ {+ var rt = new RenderTexture(width, height, 0);+ var ps = Object.Instantiate(AssetDatabase.LoadAssetAtPath<PanelSettings>(UiPaths.Panel));+ ps.targetTexture = rt;+ var go = new GameObject("EncyclopediaLayoutTest");+ 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;+ root.Q("root").RemoveFromClassList("loading");+ if (hebrew) root.Q("root").AddToClassList(UiLanguage.HebrewClass);+ var text = hebrew ? He : En;+ var bridge = new SimBridge(GameSession.New(C, GoldenRun.Seed, Mode.Historical), text);+ var hud = new HudPresenter(root, bridge, text);+ var nav = new ScreenNav(root);+ var advisor = new AdvisorPresenter(root, bridge, text, new AdvisorSession(Approved(), new AdvisorSettings(null), false));+ var pedia = new EncyclopediaPresenter(root, text, Approved(), nav, advisor, ruleset);+ nav.Open("encyclopedia");+ try+ {+ for (int i = 0; i < 30 && !(root.Q("screen-encyclopedia").layout.width > 0); i++) yield return null;+ for (int i = 0; i < 3; i++) yield return null;+ foreach (var step in check(root, pedia)) yield return step;+ }+ finally+ {+ pedia.Dispose(); advisor.Dispose(); nav.Dispose(); hud.Dispose();+ Object.DestroyImmediate(go); Object.DestroyImmediate(ps); rt.Release(); Object.DestroyImmediate(rt);+ }+ }+}diff --git a/unity/Assets/Tests/EditMode/EncyclopediaScreenTests.cs.meta b/unity/Assets/Tests/EditMode/EncyclopediaScreenTests.cs.metanew file mode 100644index 000000000..d1b68f584--- /dev/null+++ b/unity/Assets/Tests/EditMode/EncyclopediaScreenTests.cs.meta@@ -0,0 +1,2 @@+fileFormatVersion: 2+guid: 691883f3fef30e8a08c447a834210263\ No newline at end of filediff --git a/unity/Assets/Tests/EditMode/HebrewUiTests.cs b/unity/Assets/Tests/EditMode/HebrewUiTests.csindex fc1919490..af5aa6c04 100644--- a/unity/Assets/Tests/EditMode/HebrewUiTests.cs+++ b/unity/Assets/Tests/EditMode/HebrewUiTests.cs@@ -452,13 +452,13 @@ public class HebrewUiTests("meter-security/meter-name", "hud.caption.security"), ("meter-support/meter-name", "hud.caption.support"),("meter-cohesion/meter-name", "hud.caption.cohesion"), ("meter-standing/meter-name", "hud.caption.standing"), ("meter-fx/meter-name", "hud.caption.fx"),("nav-cabinet", "hud.nav.cabinet"), ("nav-budget", "hud.nav.budget"), ("nav-defence", "hud.nav.defence"),- ("nav-why", "hud.nav.why"), ("nav-timeline", "nav.timeline"), ("nav-how-to-play", "hud.nav.how_to_play"), ("nav-objectives", "hud.nav.objectives"),+ ("nav-why", "hud.nav.why"), ("nav-timeline", "nav.timeline"), ("nav-encyclopedia", "hud.nav.encyclopedia"), ("nav-objectives", "hud.nav.objectives"),("new-game", "hud.new_game"), ("end-turn", "hud.end_turn_needs_orders"),("event-draft", "event.draft"),("budget-screen-title", "budget.title"), ("budget-reset", "budget.reset"), ("budget-submit", "budget.submit"),("defence-screen-title", "defence.title"), ("de-escalate", "defence.lower"), ("escalate", "defence.raise"),("why-screen-title", "why.title"),- ("how-to-play-title", "how_to_play.title"), ("objectives-title", "objectives.title"),+ ("encyclopedia-title", "encyclopedia.title"), ("objectives-title", "objectives.title"),("nav-settings", "hud.nav.settings"), ("settings-screen-title", "settings.title"), ("settings-tiltshift-label", "settings.tiltshift"),("settings-quality-label", "settings.quality"), ("settings-quality-auto", "settings.quality.auto"),("settings-quality-high", "settings.quality.high"), ("settings-quality-low", "settings.quality.low"),diff --git a/unity/Assets/Tests/EditMode/HowToPlayScreenTests.cs b/unity/Assets/Tests/EditMode/HowToPlayScreenTests.csdeleted file mode 100644index a2d8b70cd..000000000--- a/unity/Assets/Tests/EditMode/HowToPlayScreenTests.cs+++ /dev/null@@ -1,187 +0,0 @@-#nullable enable-using System.Collections;-using System.Collections.Generic;-using System.Linq;-using NUnit.Framework;-using Statecraft.Game;-using Statecraft.Game.UI;-using Statecraft.Sim;-using UnityEditor;-using UnityEngine;-using UnityEngine.TestTools;-using UnityEngine.UIElements;-using Object = UnityEngine.Object;--/// <summary>The short How to play screen (#1041): side-menu navigation, both languages, and its two required layouts.</summary>-public class HowToPlayScreenTests-{- static readonly Content C = ContentLoader.Load(Paths.Content);- static UiText En => UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.Strings).text);- static UiText He => UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.StringsHebrew).text, "strings.he.yaml");-- [Test]- public void TheSideMenuOpensAndClosesTheScreenInBothLanguages([Values(false, true)] bool hebrew)- {- var text = hebrew ? He : En;- using var ui = new UiTestKit();- using var nav = new ScreenNav(ui.Root);- using var guide = new HowToPlayPresenter(ui.Root, text);- var screen = ui.Q<VisualElement>("screen-how-to-play");-- Assert.IsFalse(ScreenNav.IsOpen(screen), "hidden at start");- ui.Press("nav-how-to-play");- Assert.IsTrue(ScreenNav.IsOpen(screen), "the side-menu button opens it");- Assert.AreEqual("how-to-play", nav.Current);- Assert.AreEqual(text["how_to_play.title"], ui.Q<Label>("how-to-play-title").text);- ui.Press("nav-how-to-play");- Assert.IsFalse(ScreenNav.IsOpen(screen), "pressing the same button closes it");- Assert.IsNull(nav.Current);- }-- [UnityTest]- public IEnumerator TheGuideFitsLaptopAndPhoneInBothLanguages()- {- var problems = new List<string>();- foreach (var hebrew in new[] { false, true })- foreach (var size in new[] { new Vector2Int(1280, 720), new Vector2Int(390, 844) })- yield return Rendered(size.x, size.y, hebrew, root =>- {- string at = $"{(hebrew ? "he" : "en")} {size.x}x{size.y}";- var screen = root.Q("screen-how-to-play").worldBound;- var window = root.worldBound;- if (!(screen.width > 0 && screen.height > 0)) problems.Add($"{at}: screen is not visible");- if (screen.xMin < window.xMin || screen.yMin < window.yMin || screen.xMax > window.xMax || screen.yMax > window.yMax)- problems.Add($"{at}: screen {screen} leaves window {window}");- var body = root.Q<ScrollView>("how-to-play-body").worldBound;- foreach (var line in root.Q<ScrollView>("how-to-play-body").Query<Label>().ToList())- {- if (string.IsNullOrWhiteSpace(line.text)) problems.Add($"{at}: {line.name} is empty");- if (line.worldBound.xMin < body.xMin - 1 || line.worldBound.xMax > body.xMax + 1)- problems.Add($"{at}: {line.name} {line.worldBound} overflows body {body}");- }- });- Assert.IsEmpty(problems, string.Join("\n", problems));- }-- // R-GOV-002: help is selected by explicit ruleset, never by language or a zero Attention price.- [Test]- public void Gdd03HelpContainsNoAttentionInEitherLanguage([Values(false, true)] bool hebrew)- {- var text = hebrew ? He : En;- using var ui = new UiTestKit();- using var guide = new HowToPlayPresenter(ui.Root, text, SaveGame.Gdd03Ruleset);- var attention = ui.Q<Label>("how-to-play-attention");- Assert.IsEmpty(attention.text, "hidden legacy text must not remain accessible");- Assert.AreEqual(DisplayStyle.None, attention.style.display.value);- foreach (var key in new[] { "events", "top_bar", "end_turn" })- Assert.AreEqual(text["how_to_play.gdd03." + key], ui.Q<Label>("how-to-play-" + key.Replace('_', '-')).text);- AssertNoAttention(ui.Root);- }-- [Test]- public void Gdd03EndTurnHelpKeepsNeedsOrdersGuidance([Values(false, true)] bool hebrew)- {- using var ui = new UiTestKit();- using var guide = new HowToPlayPresenter(ui.Root, hebrew ? He : En, SaveGame.Gdd03Ruleset);- var line = ui.Q<Label>("how-to-play-end-turn").text;- foreach (var phrase in hebrew ? new[] { "ממתינה להוראות", "בוחר בה במקום", "ביצור", "לדלג" }- : new[] { "needs orders", "selects it instead", "fortify", "skip it" })- StringAssert.Contains(phrase, line, "Removing Attention must not erase the needs-orders behavior");- }-- [Test]- public void OldRulesetsKeepEveryOriginalHelpLine([Values(false, true)] bool hebrew,- [Values(SaveGame.LegacyRuleset, SaveGame.GddRuleset)] string ruleset)- {- var text = hebrew ? He : En;- using var ui = new UiTestKit();- using var guide = new HowToPlayPresenter(ui.Root, text, ruleset);- foreach (var key in new[] { "turn", "attention", "city", "training", "events", "top_bar", "end_turn", "why" })- Assert.AreEqual(text["how_to_play." + key], ui.Q<Label>("how-to-play-" + key.Replace('_', '-')).text);- Assert.AreNotEqual(DisplayStyle.None, ui.Q<Label>("how-to-play-attention").style.display.value);- }-- [Test]- public void RebuildingTheSameTreeRestoresTheCorrectModeAndLanguage()- {- using var ui = new UiTestKit();- using (var guide = new HowToPlayPresenter(ui.Root, En, SaveGame.GddRuleset)) { }- using (var guide = new HowToPlayPresenter(ui.Root, He, SaveGame.Gdd03Ruleset))- AssertNoAttention(ui.Root);- using (var guide = new HowToPlayPresenter(ui.Root, He, SaveGame.LegacyRuleset))- {- Assert.AreEqual(He["how_to_play.attention"], ui.Q<Label>("how-to-play-attention").text);- Assert.AreNotEqual(DisplayStyle.None, ui.Q<Label>("how-to-play-attention").style.display.value);- Assert.AreEqual(He["how_to_play.events"], ui.Q<Label>("how-to-play-events").text);- }- using (var guide = new HowToPlayPresenter(ui.Root, En, SaveGame.Gdd03Ruleset))- AssertNoAttention(ui.Root);- }-- static void AssertNoAttention(VisualElement root)- {- var lines = root.Q<ScrollView>("how-to-play-body").Query<Label>().ToList();- var all = string.Join("\n", lines.Select(x => x.text));- StringAssert.DoesNotContain("Attention", all);- StringAssert.DoesNotContain("תשומת לב", all);- StringAssert.DoesNotContain("תשומת הלב", all);- }-- [UnityTest]- public IEnumerator Gdd03GuideRendersWithoutAttentionAtLaptopAndPhoneSizesInBothLanguages()- {- foreach (var hebrew in new[] { false, true })- foreach (var size in new[] { new Vector2Int(1280, 720), new Vector2Int(390, 844) })- yield return Rendered(size.x, size.y, hebrew, root =>- {- AssertNoAttention(root);- var attention = root.Q<Label>("how-to-play-attention");- Assert.AreEqual(DisplayStyle.None, attention.resolvedStyle.display);- var screen = root.Q("screen-how-to-play").worldBound;- Assert.Greater(screen.width, 0);- Assert.Greater(screen.height, 0);- var body = root.Q<ScrollView>("how-to-play-body").worldBound;- foreach (var line in root.Q<ScrollView>("how-to-play-body").Query<Label>().ToList())- {- if (line == attention) continue;- Assert.IsNotEmpty(line.text);- Assert.Greater(line.worldBound.height, 0, line.name);- Assert.GreaterOrEqual(line.worldBound.xMin, body.xMin - 1, line.name);- Assert.LessOrEqual(line.worldBound.xMax, body.xMax + 1, line.name);- }- }, SaveGame.Gdd03Ruleset);- }-- static IEnumerator Rendered(int width, int height, bool hebrew, System.Action<VisualElement> check, string ruleset = SaveGame.GddRuleset)- {- var rt = new RenderTexture(width, height, 0);- var ps = Object.Instantiate(AssetDatabase.LoadAssetAtPath<PanelSettings>(UiPaths.Panel));- ps.targetTexture = rt;- var go = new GameObject("HowToPlayLayoutTest");- 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;- root.Q("root").RemoveFromClassList("loading");- if (hebrew) root.Q("root").AddToClassList(UiLanguage.HebrewClass);- var text = hebrew ? He : En;- var bridge = new SimBridge(GameSession.New(C, GoldenRun.Seed, Mode.Historical), text);- var hud = new HudPresenter(root, bridge, text);- var guide = new HowToPlayPresenter(root, text, ruleset);- var nav = new ScreenNav(root);- nav.Open("how-to-play");- try- {- for (int i = 0; i < 30 && !(root.Q("screen-how-to-play").layout.width > 0); i++) yield return null;- for (int i = 0; i < 3; i++) yield return null;- check(root);- }- finally- {- nav.Dispose(); guide.Dispose(); hud.Dispose();- Object.DestroyImmediate(go); Object.DestroyImmediate(ps); rt.Release(); Object.DestroyImmediate(rt);- }- }-}diff --git a/unity/Assets/Tests/EditMode/HowToPlayScreenTests.cs.meta b/unity/Assets/Tests/EditMode/HowToPlayScreenTests.cs.metadeleted file mode 100644index a33da98e4..000000000--- a/unity/Assets/Tests/EditMode/HowToPlayScreenTests.cs.meta+++ /dev/null@@ -1,2 +0,0 @@-fileFormatVersion: 2-guid: c409872840184cce85a24bc58a241159diff --git a/unity/Assets/Tests/EditMode/KeyScrollTests.cs b/unity/Assets/Tests/EditMode/KeyScrollTests.csindex 2447b4e6d..59810dff2 100644--- a/unity/Assets/Tests/EditMode/KeyScrollTests.cs+++ b/unity/Assets/Tests/EditMode/KeyScrollTests.cs@@ -101,6 +101,20 @@ public class KeyScrollTests}}+ /// <summary>An open encyclopedia page hides the list, so the keys scroll the page's body (#2095 review).</summary>+ [UnityTest]+ public IEnumerator ThePageKeysScrollAnOpenEncyclopediaPage()+ {+ using var r = new Rig();+ var nav = r.Own(new ScreenNav(r.Root));+ var pedia = r.Own(new EncyclopediaPresenter(r.Root, Text, AdvisorCatalog.Load(), nav, null));+ pedia.Open("cities");+ var body = r.Root.Q<ScrollView>("encyclopedia-page-body");+ Shorten(body, 40f);+ yield return Frames(4);+ PagesThrough(r.Root, body, "encyclopedia", false, "encyclopedia page");+ }+[UnityTest]public IEnumerator FocusInTheCandidateListScrollsThatListNotTheCards(){diff --git a/unity/Assets/Tests/EditMode/KeyboardTurnTests.cs b/unity/Assets/Tests/EditMode/KeyboardTurnTests.csindex e1b5d2360..c2ed17dcf 100644--- a/unity/Assets/Tests/EditMode/KeyboardTurnTests.cs+++ b/unity/Assets/Tests/EditMode/KeyboardTurnTests.cs@@ -122,7 +122,7 @@ public class KeyboardTurnTests}/// <summary>The side menu, New Game, End Turn: the HUD's own controls, in the order Game.uxml gives them.</summary>- static readonly string[] Menu = { "nav-cabinet", "nav-budget", "nav-defence", "nav-why", "nav-timeline", "nav-how-to-play", "nav-objectives", "nav-settings", "new-game", "end-turn" };+ static readonly string[] Menu = { "nav-cabinet", "nav-budget", "nav-defence", "nav-why", "nav-timeline", "nav-encyclopedia", "nav-objectives", "nav-settings", "new-game", "end-turn" };/// <summary>The open card takes the focus; Tab runs the card, each option in its order, Hide, then the HUD from the side/// menu on (the map stop, the minimap and the info panel are under the card's backdrop and out of reach), and round todiff --git a/unity/Assets/Tests/EditMode/LeftColumnTests.cs b/unity/Assets/Tests/EditMode/LeftColumnTests.csindex d4a608bd2..aa9a65f9e 100644--- a/unity/Assets/Tests/EditMode/LeftColumnTests.cs+++ b/unity/Assets/Tests/EditMode/LeftColumnTests.cs@@ -34,7 +34,7 @@ public class LeftColumnTests("nav-cabinet", "hud.nav.cabinet", "columns"), ("nav-budget", "hud.nav.budget", "ledger"),("nav-defence", "hud.nav.defence", "helmet"), ("nav-why", "hud.nav.why", "question"),("nav-timeline", "nav.timeline", "hourglass"),- ("nav-how-to-play", "hud.nav.how_to_play", "book"), ("nav-objectives", "hud.nav.objectives", "flag"),+ ("nav-encyclopedia", "hud.nav.encyclopedia", "book"), ("nav-objectives", "hud.nav.objectives", "flag"),("nav-settings", "hud.nav.settings", "gear"),};@@ -381,7 +381,7 @@ public class LeftColumnTestsvar order = root.Query<VisualElement>().Where(e => e.focusable && e.canGrabFocus && e.tabIndex >= 0 && e is Button).ToList().Select(e => e.name).Where(n => n.StartsWith("nav-") || n == "new-game" || n == "end-turn" || n.StartsWith("minimap-")).ToList();// Under the open card the minimap column is out of reach (the backdrop covers it); the column and the bar are not.- CollectionAssert.AreEqual(new[] { "nav-cabinet", "nav-budget", "nav-defence", "nav-why", "nav-timeline", "nav-how-to-play", "nav-objectives", "nav-settings", "new-game", "end-turn" },+ CollectionAssert.AreEqual(new[] { "nav-cabinet", "nav-budget", "nav-defence", "nav-why", "nav-timeline", "nav-encyclopedia", "nav-objectives", "nav-settings", "new-game", "end-turn" },order, $"{at}: the Tab order under the open card");var r = root.Q("root");Assert.IsTrue(r.ClassListContains(EventCardPresenter.ModalClass), at + ": precondition: the card is open");diff --git a/unity/Assets/Tests/EditMode/PromoHudTests.cs b/unity/Assets/Tests/EditMode/PromoHudTests.csindex 9620f2a1f..2bdb09e6f 100644--- a/unity/Assets/Tests/EditMode/PromoHudTests.cs+++ b/unity/Assets/Tests/EditMode/PromoHudTests.cs@@ -40,7 +40,7 @@ public class PromoHudTestsusing var ui = new UiTestKit();foreach (var (button, name, glyph) in new[] { ("nav-cabinet", "Cabinet", "columns"), ("nav-budget", "Budget", "ledger"),("nav-defence", "Defence", "helmet"), ("nav-why", "Why?", "question"),- ("nav-timeline", "Timeline", "hourglass"), ("nav-how-to-play", "How to play", "book"), ("nav-objectives", "Objectives", "flag"),+ ("nav-timeline", "Timeline", "hourglass"), ("nav-encyclopedia", "Encyclopedia", "book"), ("nav-objectives", "Objectives", "flag"),("nav-settings", "Settings", "gear"),("new-game", "New game", "restart") }){diff --git a/unity/Assets/Tests/EditMode/PromoScreensTests.cs b/unity/Assets/Tests/EditMode/PromoScreensTests.csindex 6f617e433..5c95bca34 100644--- a/unity/Assets/Tests/EditMode/PromoScreensTests.cs+++ b/unity/Assets/Tests/EditMode/PromoScreensTests.cs@@ -1056,10 +1056,10 @@ public class PromoScreensTestsowned.Add(new DefencePresenter(root, bridge, Text));owned.Add(new BudgetPresenter(root, bridge, Text));owned.Add(new WhyPresenter(root, bridge, Text));- owned.Add(new HowToPlayPresenter(root, Text));owned.Add(new ObjectivesPresenter(root, bridge, Text));var info = new InfoPanelPresenter(root, bridge, Text, C.SettlementHexes.ToDictionary(x => x.Id, x => x.Id)); owned.Add(info);var nav = new ScreenNav(root); owned.Add(nav);+ owned.Add(new EncyclopediaPresenter(root, Text, AdvisorCatalog.Load(), nav, null));var toast = root.Q<Label>("toast");toast.text = "Not done: Not enough attention (need 4.0, have 2.0)";toast.style.display = DisplayStyle.Flex;diff --git a/unity/Assets/Tests/EditMode/TopBarTests.cs b/unity/Assets/Tests/EditMode/TopBarTests.csindex a985956a7..3442e225b 100644--- a/unity/Assets/Tests/EditMode/TopBarTests.cs+++ b/unity/Assets/Tests/EditMode/TopBarTests.cs@@ -630,7 +630,7 @@ public class TopBarTests{var order = root.Query<Button>().ToList().Where(e => e.focusable && e.canGrabFocus && e.tabIndex >= 0).Select(e => e.name).Where(n => n.StartsWith("nav-") || n == "new-game" || n == "end-turn" || n.StartsWith("minimap-")).ToList();- CollectionAssert.AreEqual(new[] { "nav-cabinet", "nav-budget", "nav-defence", "nav-why", "nav-timeline", "nav-how-to-play", "nav-objectives", "nav-settings", "new-game", "end-turn", "minimap-overview", "minimap-labels", "minimap-borders" },+ CollectionAssert.AreEqual(new[] { "nav-cabinet", "nav-budget", "nav-defence", "nav-why", "nav-timeline", "nav-encyclopedia", "nav-objectives", "nav-settings", "new-game", "end-turn", "minimap-overview", "minimap-labels", "minimap-borders" },order, (hebrew ? "he" : "en") + ": the Tab order");}, widest: false);}diff --git a/unity/Assets/Tests/EditMode/UiLayoutTests.cs b/unity/Assets/Tests/EditMode/UiLayoutTests.csindex 28eb6cd1b..2c55ba06f 100644--- a/unity/Assets/Tests/EditMode/UiLayoutTests.cs+++ b/unity/Assets/Tests/EditMode/UiLayoutTests.cs@@ -444,10 +444,11 @@ public class UiLayoutTests{new HudPresenter(root, bridge, text), new EventCardPresenter(root, bridge, text, null),new CabinetPresenter(root, bridge, text, null), new BudgetPresenter(root, bridge, text),- new DefencePresenter(root, bridge, text), new WhyPresenter(root, bridge, text), new HowToPlayPresenter(root, text),+ new DefencePresenter(root, bridge, text), new WhyPresenter(root, bridge, text),new ObjectivesPresenter(root, bridge, text),};var nav = new ScreenNav(root);+ disposables.Add(new EncyclopediaPresenter(root, text, AdvisorCatalog.Load(), nav, null));try{for (int i = 0; i < 20 && float.IsNaN(root.Q("minimap").worldBound.width); i++) yield return null;diff --git a/unity/Assets/UI/Game.uxml b/unity/Assets/UI/Game.uxmlindex 064c188fb..05dde9343 100644--- a/unity/Assets/UI/Game.uxml+++ b/unity/Assets/UI/Game.uxml@@ -18,7 +18,7 @@<ui:Button name="nav-defence" text="Defence" class="nav-button rail-button"><Statecraft.Game.UI.UiIcon glyph="helmet" class="nav-disc" /></ui:Button><ui:Button name="nav-why" text="Why?" class="nav-button rail-button"><Statecraft.Game.UI.UiIcon glyph="question" class="nav-disc" /></ui:Button><ui:Button name="nav-timeline" text="Timeline" class="nav-button rail-button"><Statecraft.Game.UI.UiIcon glyph="hourglass" class="nav-disc" /></ui:Button>- <ui:Button name="nav-how-to-play" text="How to play" class="nav-button rail-button"><Statecraft.Game.UI.UiIcon glyph="book" class="nav-disc" /></ui:Button>+ <ui:Button name="nav-encyclopedia" text="Encyclopedia" class="nav-button rail-button"><Statecraft.Game.UI.UiIcon glyph="book" class="nav-disc" /></ui:Button><ui:Button name="nav-objectives" text="Objectives" class="nav-button rail-button"><Statecraft.Game.UI.UiIcon glyph="flag" class="nav-disc" /></ui:Button><ui:Button name="nav-settings" text="Settings" class="nav-button rail-button"><Statecraft.Game.UI.UiIcon glyph="gear" class="nav-disc" /></ui:Button></ui:VisualElement>@@ -408,21 +408,21 @@<ui:ScrollView name="timeline-list" class="grow" /><Statecraft.Game.UI.UiFrame /></ui:VisualElement>- <!-- A short guide to the existing loop (#1041). It is a normal side-menu screen, so ScreenNav owns opening and closing. -->- <ui:VisualElement name="screen-how-to-play" class="panel screen">- <ui:VisualElement class="screen-header"><ui:Label name="how-to-play-title" text="How to play" class="title" /></ui:VisualElement>- <ui:ScrollView name="how-to-play-body" class="grow how-to-play-body">- <ui:Label name="how-to-play-turn" class="how-to-play-line" />- <ui:Label name="how-to-play-attention" class="how-to-play-line" />- <ui:Label name="how-to-play-city" class="how-to-play-line" />- <ui:Label name="how-to-play-training" class="how-to-play-line" />- <ui:Label name="how-to-play-events" class="how-to-play-line" />- <ui:Label name="how-to-play-top-bar" class="how-to-play-line" />- <ui:Label name="how-to-play-end-turn" class="how-to-play-line" />- <ui:Label name="how-to-play-why" class="how-to-play-line" />- </ui:ScrollView>- <!-- Opens the advisor opening chain again (#1484, AdvisorPresenter), which closes this screen. -->- <ui:Button name="how-to-play-guide" class="how-to-play-guide" />+ <!-- The advisors' encyclopedia (spec 10, EncyclopediaPresenter), which replaces How to play (#1041): one page per+ mechanic, grouped by advisor. A normal side-menu screen, so ScreenNav owns opening and closing. -->+ <ui:VisualElement name="screen-encyclopedia" class="panel screen">+ <ui:VisualElement class="screen-header"><ui:Label name="encyclopedia-title" text="Encyclopedia" class="title" /></ui:VisualElement>+ <ui:ScrollView name="encyclopedia-list" class="grow encyclopedia-list" />+ <ui:VisualElement name="encyclopedia-page" class="grow encyclopedia-page">+ <ui:Label name="encyclopedia-page-title" class="title encyclopedia-page-title" />+ <ui:ScrollView name="encyclopedia-page-body" class="grow"><ui:Label name="encyclopedia-page-text" class="encyclopedia-text" /></ui:ScrollView>+ <ui:VisualElement class="row encyclopedia-actions">+ <ui:Button name="encyclopedia-back" />+ <ui:Button name="encyclopedia-show-me" />+ </ui:VisualElement>+ </ui:VisualElement>+ <!-- Opens the advisors' opening chain again (spec 9), which closes this screen. -->+ <ui:Button name="encyclopedia-opening" class="encyclopedia-opening" /><Statecraft.Game.UI.UiFrame /></ui:VisualElement><!-- The objectives (#1189, ObjectivesPresenter): one row per objective, its status and both dates, no score. -->diff --git a/unity/Assets/UI/Statecraft.uss b/unity/Assets/UI/Statecraft.ussindex caed7e56b..ff1384189 100644--- a/unity/Assets/UI/Statecraft.uss+++ b/unity/Assets/UI/Statecraft.uss@@ -501,8 +501,15 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);.screen .row.grow > .grow { min-height: 0; flex-shrink: 1; }/* Settings (#40): an option's name takes the row's width and wraps; its button keeps room for "On" / "Off". */.settings-row { margin-top: 8px; }-.how-to-play-body { min-height: 0; }-.how-to-play-line { white-space: normal; margin-bottom: 12px; font-size: 18px; }+/* The advisors' encyclopedia (spec 10): the list of pages by advisor, or one page; either scrolls, never grows out. */+.encyclopedia-list, .encyclopedia-page { min-height: 0; }+.encyclopedia-advisor { color: var(--gold); letter-spacing: 1px; margin-top: 10px; margin-bottom: 4px; white-space: normal; }+.encyclopedia-entry { min-height: 44px; white-space: normal; -unity-text-align: middle-left; }+.lang-he .encyclopedia-entry { -unity-text-align: middle-right; }+.encyclopedia-page-title { white-space: normal; margin-bottom: 8px; }+.encyclopedia-text { white-space: normal; font-size: 18px; }+.encyclopedia-actions { flex-shrink: 0; margin-top: 8px; }+.encyclopedia-actions > Button { min-height: 44px; }/* The Objectives screen (#1189): a row per objective, its name over its status and dates; both wrap at 390x844. */.objectives-rows { min-height: 0; }.objectives-row { margin-bottom: 14px; }@@ -564,9 +571,9 @@ Button.settings-choice-selected { -unity-font-definition: url("project://databas.end-screen-note { white-space: normal; margin-bottom: 14px; color: var(--ink-dim); }.turn-report-actions { justify-content: flex-end; margin-top: 8px; flex-shrink: 0; }.turn-report-actions > Button { margin-left: 8px; }-/* How to play's button that opens the opening advice again: under the lines, never squeezed by them. */-.how-to-play-guide { flex-shrink: 0; align-self: flex-start; min-height: 44px; margin-top: 8px; }-.lang-he .how-to-play-guide { align-self: flex-end; }+/* The encyclopedia's button that opens the opening advice again: under the list, never squeezed by it. */+.encyclopedia-opening { flex-shrink: 0; align-self: flex-start; min-height: 44px; margin-top: 8px; }+.lang-he .encyclopedia-opening { align-self: flex-end; }/* The advisors' popup (spec 7.1, AdvisorPresenter): placed in code in the free upper part of the right column (AdvisorLayout),400 px wide; not modal, so the layer takes no pointer. It slides 16 px in from the right while it fades in (0.25 s) andfades out (0.15 s): ScreenNav's opening and closing classes, with a slide instead of the screens' scale (spec 16). */diff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yamlindex d39948a09..82df039fa 100644--- a/unity/Assets/UI/strings.en.yaml+++ b/unity/Assets/UI/strings.en.yaml@@ -43,7 +43,7 @@ hud.nav.budget: "Budget"hud.nav.budget_unsubmitted: "Budget: your changes are not submitted. End turn will not apply them until you submit them."hud.nav.defence: "Defence"hud.nav.why: "Why?"-hud.nav.how_to_play: "How to play"+hud.nav.encyclopedia: "Encyclopedia"hud.nav.objectives: "Objectives"hud.nav.settings: "Settings"hud.new_game: "New game"@@ -57,29 +57,75 @@ defence.title: "Defence"defence.lower: "Lower the level"defence.raise: "Raise the level"why.title: "Why did this happen?"-# The short guide (#1041). These describe the existing sim without balance values, so rule changes stay in the sim.-how_to_play.title: "How to play"-how_to_play.turn: "Each turn is one month. Look over the country, give your orders, then press End turn."-how_to_play.attention: "Most orders cost Attention, shown in the top bar. It refills at the start of each turn, and Attention you leave unspent does not carry over."-how_to_play.city: "Select a city on the map to review its housing and jobs. Choose how many people should work; the change takes effect when you end the turn."-how_to_play.training: "Train civilians without work as recruits at a military camp, or as halutzim (pioneers) at a Hakhshara (pioneer training camp). Each button shows the cost and training time."-how_to_play.events: "An event card asks for a decision. Answering it costs Attention, and your choice takes effect when you end the turn."-how_to_play.top_bar: "The top bar shows the date, your Attention, Money and the country's main indicators."-how_to_play.end_turn: "End turn moves to the next month. While one of your units still needs orders, the button selects it instead: move it, fortify it, hold or skip it. A card you leave unanswered, or have no Attention left to answer, goes to the responsible minister, who decides it for you."-how_to_play.why: "After a turn, open Why? to see each change and its cause."--# GDD 0.3 help (#1688): old-mode help above stays unchanged.-how_to_play.gdd03.events: "An event card asks for a decision. Your choice takes effect when you end the turn."-how_to_play.gdd03.top_bar: "The top bar shows the date, Money and the country's main indicators."-how_to_play.gdd03.end_turn: "End turn moves to the next month. While one of your units still needs orders, the button selects it instead: move it, fortify it, hold or skip it. A card you leave unanswered goes to the responsible minister, who decides it for you."+# The advisors' encyclopedia (spec 10), which replaces How to play (#1041): its title, Back from a page, and the button that+# opens the advisors' opening chain again (#1484). The pages are advisor.page.<id>.title and .text (below).+encyclopedia.title: "Encyclopedia"+encyclopedia.back: "Back"+encyclopedia.opening: "Show the opening advice again"+# The encyclopedia's 25 pages (spec 10, plan Task 13; advisor-messages.yaml pages:), grouped by advisor, each written from+# the rules it cites (docs/rules/mvp.md) without balance values, as How to play's lines were; the nine pages How to play+# covered start from its lines. A .gdd03.text variant is what gdd-0.3 shows (R-GOV-002: no Attention there, #1688; its+# attacks spend no Arms, R-COMBAT-004; a lost city alone does not end it, R-END-003). The capture page names no Deport:+# it is not in play (mvp.deport_in_play, R-CTRL-007). Agent-drafted for the owner's content review (spec 17).+advisor.page.turns.title: "Turns and End turn"+advisor.page.turns.text: "Each turn is one month. Look over the country, give your orders, then press End turn to move to the next month. Moves and unit orders (attack, fortify, hold) happen at once and cannot be undone; Send home and every other order wait for End turn, and until then you can change or withdraw them. While one of your units still needs orders, the button selects it instead: move it, fortify it, hold or skip it."+advisor.page.attention.title: "Attention each turn"+advisor.page.attention.text: "Most orders cost Attention, shown in the top bar. It refills at the start of each turn, and Attention you leave unspent does not carry over. Moves and unit orders cost none, and a refused order gives its Attention back. A card you have no Attention left to answer goes to the responsible minister."+advisor.page.events.title: "Event cards"+advisor.page.events.text: "An event card asks for a decision and shows what each option changes. Your choice takes effect when you end the turn, and its effects never arrive later. A card you leave unanswered goes to the responsible minister, who decides it for you, and a more competent minister more often picks the recommended option. A card usually reaches you the turn before history decided it."+advisor.page.objectives.title: "Objectives and score"+advisor.page.objectives.text: "Objectives are the campaign's goals: a yishuv founded, a road or railway completed, a growing population housed and at work. Completing one awards points and opens its card, and finishing before history did earns a bonus. The Objectives screen sets your date beside the historical one. The score counts objectives and prisoners returned, never enemy losses."+advisor.page.defeat.title: "How the game ends"+advisor.page.defeat.text: "The campaign ends on its last turn, or sooner in defeat. When the debt is at its ceiling and the Food stock is empty at a turn's end, the defeat counter runs, and when it reaches its limit the game is lost; either one alone ends nothing. If an enemy military unit holds one of our cities at the end of any turn, the game is lost at once, even in a truce."+advisor.page.defeat.gdd03.text: "The campaign ends on its last turn, or sooner in defeat. When the debt is at its ceiling and the Food stock is empty at a turn's end, the defeat counter runs, and when it reaches its limit the game is lost; either one alone ends nothing. Losing a city does not end the game by itself."+advisor.page.top_bar.title: "The top bar"+advisor.page.top_bar.text: "The top bar shows the date, your Attention, Money and the country's main indicators."+advisor.page.top_bar.gdd03.text: "The top bar shows the date, Money and the country's main indicators."+advisor.page.why.title: "The Why? screen"+advisor.page.why.text: "After a turn, open Why? to see each change and its cause. Money borrowed, battles fought, people put to work: each line names what changed and why. When a number surprises you, look there first."+advisor.page.cities.title: "Cities, housing and jobs"+advisor.page.cities.text: "I always start with housing. Select a city on the map to see its housing, jobs and people; every filled job brings in Money. A city fills its jobs by itself until you set the number of workers yourself, and your change takes effect when you end the turn. People beyond the housing still live in the city, but crowding wears down its housing condition, and Social cohesion follows."+advisor.page.immigration.title: "Immigration and refugees"+advisor.page.immigration.text: "The immigrants arrive as the historical figures bring them, and each city takes a share in proportion to its people. They wait as refugees, and each turn some of them become civilians without work; how many depends on the minister in charge of immigration. There is no cap: those beyond a city's housing stay in it as overflow."+advisor.page.training.title: "Training civilians"+advisor.page.training.text: "Train civilians without work as recruits at a military camp, as halutzim (pioneers) at a Hakhshara (pioneer training camp), or as craftsmen where the city has industry. Each button shows the cost and training time; military training also needs Arms. When training ends, recruits become a military unit, halutzim become groups ready for pioneer work, and craftsmen stay in the city and earn more in a job."+advisor.page.projects.title: "City projects"+advisor.page.projects.text: "A city project builds housing or industry on a hex near the city. Its cost is paid when it starts, borrowed if Money runs short, and it needs no workers. When it is finished it adds housing, a better housing condition or jobs, as its kind says, and a cancelled project's Money is lost. Some kinds wait for an event to unlock them, or need a resource the city has, as a winery needs land for grapes."+advisor.page.pioneer_work.title: "Pioneer work"+advisor.page.pioneer_work.text: "A halutz group takes one project at a time on a designated site: build a yishuv, plow fields, drain a swamp, or build a military camp or a Hakhshara. The cost is paid when the work starts, and if you stop it, the work done and the Money are lost. A plowed field adds Food every turn, but some fields wait until their yishuv is built or their swamp is drained. With enough service, a group becomes veteran pioneers and works faster."+advisor.page.corridors.title: "Roads and railways"+advisor.page.corridors.text: "Halutz groups build a road or railway segment by segment, in any order, several at once. Stopping a segment loses its progress and the Money paid. A finished corridor needs no upkeep and produces nothing by itself, but units move more cheaply along its built segments. Completing one can also count toward an objective."+advisor.page.money_debt.title: "Money and debt"+advisor.page.money_debt.text: "Money comes in from taxes and from every filled job, and goes out on government spending, the upkeep of our military formations, training and building. When a cost is more than we have, it is still paid: Money stops at zero and the rest becomes debt. Debt and foreign currency sit under Money, and the Budget screen shows them. Once the debt reaches its ceiling and Food is empty too, the defeat counter starts."+advisor.page.budget.title: "The budget"+advisor.page.budget.text: "The budget divides spending among the ministries, a share for each, and the shares always make up the whole. Each ministry's share sets its spending effect, which speeds or slows its minister's work. Press Submit the budget and it takes effect at End turn; changes you do not submit do not apply. Where the legislature must approve it, a vote against keeps the old budget, unless its vote does not bind."+advisor.page.cabinet.title: "The cabinet"+advisor.page.cabinet.text: "Each minister runs a share of the work: building, absorbing immigrants, roads and the rest. A capable minister with a well-funded office gets it done faster, and an empty post slows it, so fill a vacancy from the Cabinet screen. The coalition's stability still sways its votes, but it does not bring the government down in this game."+advisor.page.food.title: "The Food stock"+advisor.page.food.text: "I watch this stock every month. Food is one national stock: each turn plowed fields add their harvest, the country eats what it needs, and an import refills the stock, unless our foreign currency has run out. A shortage lowers Social cohesion, and an empty stock while the debt is at its ceiling starts the defeat counter."+advisor.page.national_meters.title: "The national meters"+advisor.page.national_meters.text: "Social cohesion rises and falls with housing, work, Food, rationing and security. International support moves with the choices made on event cards. Neither one ends the game, but some events take notice when either runs low, and the end report shows both. Battles and moves leave both untouched."+advisor.page.units_movement.title: "Moving units"+advisor.page.units_movement.text: "A unit moves the moment you give the order, and a move cannot be undone. Terrain sets the cost of each hex, and a unit that has not moved this turn can always enter one neighbouring hex. A farther destination becomes a route, and End turn carries the unit onward along it. No unit enters water or a hex an enemy unit holds."+advisor.page.standing_orders.title: "Standing orders"+advisor.page.standing_orders.text: "A unit keeps its order turn after turn until you give another. Fortify takes a turn to set, then the unit defends more strongly on that hex until it moves; Hold keeps the position and adds nothing. A unit with no order needs orders, and End turn selects it until you give one or skip it this turn. Send home is the only way home: it waits for End turn, and it is refused until the armistice on the unit's front is signed."+advisor.page.combat.title: "Combat and attacks"+advisor.page.combat.text: "An attack happens the moment you order it: one unit, against an enemy on a neighbouring hex, or within range for artillery, and it uses the rest of the unit's moves. Before you commit, the preview shows the strength ratio and what each side may lose. Losses fall on the strongest unit, defenders may retreat, and only the fighting units change, never a city, its residents or the score. Lost strength comes back only through Reinforce, in a city."+advisor.page.arms.title: "The Arms stock"+advisor.page.arms.text: "Arms are one national stock. Military training takes them when it starts, and each attack spends them. Buy Arms with Money on the Defence screen; they arrive at once. When the stock runs short, training and attacks that need Arms are refused."+advisor.page.arms.gdd03.text: "Arms are one national stock. Military training takes them when it starts. Buy Arms with Money on the Defence screen; they arrive at once. When the stock runs short, training that needs Arms is refused."+advisor.page.truces.title: "During a truce"+advisor.page.truces.text: "Accept a truce on its card, and our attack orders are refused until the truce ends; refuse it, and nothing binds us. Moves and every other order still stand. Inside a truce the enemy does not attack either, whatever you chose. While a truce binds us, the Defence screen shows when it ends."+advisor.page.capture.title: "Capturing a place"+advisor.page.capture.text: "A military unit that stops on an enemy-held place open to capture takes it at once; passing through does not. The capture dialog then lists its answers in a fixed order, each with what it changes at once or the reason it is refused. Raid and withdraw brings our units out and returns the place to enemy control; Occupy keeps one unit there for a set number of turns, at a Money cost each turn. The choice is yours; it takes effect at End turn, and until it is given, the units stay."+advisor.page.enemy_phase.title: "The enemy's turn"+advisor.page.enemy_phase.text: "When you end the turn, every enemy unit receives its orders, by the same rules as ours. In the historical game each Arab force follows its own script toward its historical target. A unit off its script attacks a neighbouring position only when it has a clear edge, and otherwise fortifies. The enemy's attacks are fought as the turn resolves, and none comes inside a truce window."# The Objectives screen (#1189): every objective in objectives.yaml, done or not, the player's date beside the historical# one, and no score (owner, 20 October 2026). The objective card's wording (#380). {0} the player's date,# {1} the historical date (objectives.open: {0}). The names are objectives.yaml's (#1208).objectives.title: "Objectives"objectives.done: "Completed on {0}; historically {1}"objectives.open: "Not completed yet; historically {0}"-# How to play's button that opens the advisor opening chain again (#1484).-how_to_play.guide: "Show the opening advice again"# The advisors (spec 3.1 and 7.1; AdvisorPresenter). Their names as the popup shows them: Golda Meyerson's first appearance# in a profile adds "(later Meir)" (owner, 23 October 2026). "Advisor" is a game role, not an office they held.advisor.ben_gurion.name: "David Ben-Gurion"diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yamlindex 80ea04e32..5e16e1651 100644--- a/unity/Assets/UI/strings.he.yaml+++ b/unity/Assets/UI/strings.he.yaml@@ -37,7 +37,8 @@ hud.nav.budget: "תקציב"hud.nav.budget_unsubmitted: "תקציב: השינויים עוד לא הוגשו. בלי הגשה, סיום התור לא יחיל אותם."hud.nav.defence: "ביטחון"hud.nav.why: "למה?"-hud.nav.how_to_play: "איך משחקים"+# The encyclopedia (spec 10), which replaces How to play. Agent-drafted. For the native reviewer (#564).+hud.nav.encyclopedia: "אנציקלופדיה"# For the native reviewer (#564)hud.nav.objectives: "יעדים"hud.nav.settings: "הגדרות"@@ -52,32 +53,83 @@ defence.title: "ביטחון"defence.lower: "הורדת הדרגה"defence.raise: "העלאת הדרגה"why.title: "למה זה קרה?"-# The short How to play guide (#1041). For the native reviewer (#564).-how_to_play.title: "איך משחקים"-how_to_play.turn: "כל תור הוא חודש אחד. בחנו את מצב המדינה, תנו הוראות ואז לחצו על סיום התור."-how_to_play.attention: "רוב ההוראות עולות תשומת לב, המוצגת בסרגל העליון. היא מתמלאת מחדש בתחילת כל תור, ותשומת לב שלא ניצלתם אינה עוברת לתור הבא."-how_to_play.city: "בחרו עיר במפה כדי לראות את הדיור ואת המשרות בה. קבעו את מספר העובדים; השינוי יתבצע בסיום התור."-how_to_play.training: "בעיר שיש בה מחנה צבאי או מחנה הכשרה אפשר לאמן אזרחים ללא עבודה כמגויסים או להכשיר אותם כחלוצים. הכפתור מראה כמה עולה האימון וכמה תורות הוא נמשך."-how_to_play.events: "כרטיס אירוע מבקש מכם החלטה. מענה עליו עולה תשומת לב, והבחירה שלכם נכנסת לתוקף בסיום התור."-how_to_play.top_bar: "הסרגל העליון מציג את התאריך, את תשומת הלב שלכם, את הכסף ואת המדדים העיקריים של המדינה."-# Civ movement U4: agent-drafted Hebrew; native review: owner, 25 Oct 2026 (recommendations page, item 7).-how_to_play.end_turn: "סיום התור מעביר לחודש הבא. כל עוד אחת היחידות שלכם ממתינה להוראות, הכפתור בוחר בה במקום זאת: יש להזיז אותה, לתת לה פקודת ביצור או החזקה, או לדלג עליה בתור הזה. כרטיס שלא עניתם עליו, או שלא נשארה לכם תשומת לב לענות עליו, עובר לשר האחראי, והוא מחליט במקומכם."-# The Why screen named in a sentence goes in gershayim: owner, 25 Oct 2026.-how_to_play.why: "אחרי תור, פתחו את המסך ״למה?״ כדי לראות כל שינוי ואת הסיבה לו."--# GDD 0.3 help (#1688): old-mode help above stays unchanged.-# Hebrew drafts: agent-checked; native review pending (#564).-how_to_play.gdd03.events: "כרטיס אירוע מבקש מכם החלטה. הבחירה שלכם נכנסת לתוקף בסיום התור."-# Hebrew drafts: agent-checked; native review pending (#564).-how_to_play.gdd03.top_bar: "הסרגל העליון מציג את התאריך, את הכסף ואת המדדים העיקריים של המדינה."-# Hebrew drafts: agent-checked; native review pending (#564).-how_to_play.gdd03.end_turn: "סיום התור מעביר לחודש הבא. כל עוד אחת היחידות שלכם ממתינה להוראות, הכפתור בוחר בה במקום זאת: יש להזיז אותה, לתת לה פקודת ביצור או החזקה, או לדלג עליה בתור הזה. כרטיס שלא עניתם עליו עובר לשר האחראי, והוא מחליט במקומכם."+# The advisors' encyclopedia (spec 10), which replaces How to play (#1041). Agent-drafted; encyclopedia.opening keeps How+# to play's button text. For the native reviewer (#564).+encyclopedia.title: "אנציקלופדיה"+encyclopedia.back: "חזרה"+encyclopedia.opening: "הצגת עצות הפתיחה שוב"+# The encyclopedia's 25 pages (spec 10, plan Task 13). AI-drafted Hebrew; a page is he_review: pending in+# advisor-messages.yaml and does not show in Hebrew until a native reviewer approves it (OQ-4). The nine pages that replace+# How to play were read by Beri on #2095 (each marked below); the other 16 wait. For the native reviewer (#564).+# advisor.page.turns: approved by Beri, a native speaker, on #2095 (1 Nov 2026): title as written, text+# with its last sentence edited.+advisor.page.turns.title: "תורות וסיום התור"+advisor.page.turns.text: "כל תור הוא חודש אחד. בחנו את מצב המדינה, תנו הוראות ואז לחצו על סיום התור כדי לעבור לחודש הבא. תנועה ופקודות ליחידות (התקפה, ביצור, החזקה) מתבצעות מיד ואי אפשר לבטל אותן; שליחה הביתה וכל הוראה אחרת ממתינות לסיום התור, ועד אז אפשר לשנות אותן או להסיר אותן. כל עוד אחת היחידות שלכם ממתינה להוראות, לחיצה על סיום התור לא מסיימת אותו אלא מסמנת את היחידה: הזיזו אותה, תנו לה פקודת ביצור או החזקה, או דלגו עליה בתור הזה."+# advisor.page.attention: approved by Beri, a native speaker, on #2095 (1 Nov 2026): title and text as written.+advisor.page.attention.title: "תשומת לב בכל תור"+advisor.page.attention.text: "רוב ההוראות עולות תשומת לב, המוצגת בסרגל העליון. היא מתמלאת מחדש בתחילת כל תור, ותשומת לב שלא ניצלתם אינה עוברת לתור הבא. תנועה ופקודות ליחידות אינן עולות תשומת לב, והוראה שנדחתה מחזירה לכם את מה שעלתה. כרטיס שלא נשארה לכם תשומת לב לענות עליו עובר לשר האחראי."+# advisor.page.events: approved by Beri, a native speaker, on #2095 (1 Nov 2026): title and text as written.+advisor.page.events.title: "כרטיסי אירוע"+advisor.page.events.text: "כרטיס אירוע מבקש מכם החלטה ומראה מה כל אפשרות משנה. הבחירה שלכם נכנסת לתוקף בסיום התור, וההשפעות שלה לעולם אינן מגיעות מאוחר יותר. כרטיס שלא עניתם עליו עובר לשר האחראי, והוא מחליט במקומכם; שר בעל כישורים רבים יותר בוחר לרוב באפשרות המומלצת. כרטיס מגיע אליכם בדרך כלל בתור שלפני ההכרעה ההיסטורית."+# advisor.page.objectives: approved by Beri, a native speaker, on #2095 (1 Nov 2026): title and text as written.+advisor.page.objectives.title: "יעדים וניקוד"+advisor.page.objectives.text: "היעדים הם מטרות המערכה: יישוב שהוקם, כביש או מסילה שהושלמו, אוכלוסייה גדלה שיש לה דיור ועבודה. השלמת יעד מעניקה נקודות ופותחת את הכרטיס שלו, והשלמה לפני המועד ההיסטורי מזכה בבונוס. המסך ״יעדים״ מציג את התאריך שלכם לצד התאריך ההיסטורי. הניקוד סופר יעדים ושבויים שהוחזרו, ולעולם לא אבדות של האויב."+advisor.page.defeat.title: "איך המשחק נגמר"+advisor.page.defeat.text: "המערכה נגמרת בתור האחרון שלה, או קודם לכן בהפסד. כשהחוב בתקרה ומלאי המזון ריק בסוף התור, מונה ההפסד רץ, וכשהוא מגיע לגבולו המשחק אבוד; כל אחד מהם לבדו אינו מסיים דבר. אם יחידה צבאית של האויב מחזיקה באחת הערים שלנו בסוף תור כלשהו, המשחק אבוד מיד, גם בזמן הפוגה."+advisor.page.defeat.gdd03.text: "המערכה נגמרת בתור האחרון שלה, או קודם לכן בהפסד. כשהחוב בתקרה ומלאי המזון ריק בסוף התור, מונה ההפסד רץ, וכשהוא מגיע לגבולו המשחק אבוד; כל אחד מהם לבדו אינו מסיים דבר. אובדן עיר לבדו אינו מסיים את המשחק."+# advisor.page.top_bar: approved by Beri, a native speaker, on #2095 (1 Nov 2026): title, text and+# gdd03.text as written.+advisor.page.top_bar.title: "הסרגל העליון"+advisor.page.top_bar.text: "הסרגל העליון מציג את התאריך, את תשומת הלב שלכם, את הכסף ואת המדדים העיקריים של המדינה."+advisor.page.top_bar.gdd03.text: "הסרגל העליון מציג את התאריך, את הכסף ואת המדדים העיקריים של המדינה."+# advisor.page.why: approved by Beri, a native speaker, on #2095 (1 Nov 2026): title and text as written.+advisor.page.why.title: "המסך ״למה?״"+advisor.page.why.text: "אחרי תור, פתחו את המסך ״למה?״ כדי לראות כל שינוי ואת הסיבה לו. כסף שנלווה, קרבות שהתנהלו, אנשים שיצאו לעבודה: כל שורה מראה מה השתנה ולמה. כשמספר מפתיע אתכם, חפשו קודם שם."+# advisor.page.cities: approved by Beri, a native speaker, on #2095 (1 Nov 2026): title as written, text+# with its first sentence edited.+advisor.page.cities.title: "ערים, דיור ותעסוקה"+advisor.page.cities.text: "כשאני בוחנת עיר, אני תמיד מתחילה מהדיור. בחרו עיר במפה כדי לראות את הדיור, המשרות והאנשים בה; כל משרה מאוישת מכניסה כסף. העיר מאיישת את המשרות שלה בעצמה עד שתקבעו אתם את מספר העובדים, והשינוי שלכם יתבצע בסיום התור. אנשים שאין להם מקום בדיור עדיין גרים בעיר, אבל הצפיפות שוחקת את מצב הדיור, והלכידות החברתית יורדת בעקבותיו."+advisor.page.immigration.title: "עלייה ופליטים"+advisor.page.immigration.text: "העולים מגיעים לפי הנתונים ההיסטוריים, וכל עיר מקבלת חלק לפי מספר האנשים בה. הם ממתינים כפליטים, ובכל תור חלק מהם הופכים לאזרחים ללא עבודה; כמה מהם, תלוי בשר האחראי על העלייה. אין תקרה: מי שאין לו מקום בדיור של העיר נשאר בה כעודף."+# advisor.page.training: approved by Beri, a native speaker, on #2095 (1 Nov 2026): title and text as written.+advisor.page.training.title: "הכשרת אזרחים"+advisor.page.training.text: "בעיר שיש בה מחנה צבאי או מחנה הכשרה אפשר לאמן אזרחים ללא עבודה כמגויסים או להכשיר אותם כחלוצים, ובעיר שיש בה תעשייה גם כבעלי מלאכה. הכפתור מראה כמה עולה האימון וכמה תורות הוא נמשך; אימון צבאי דורש גם נשק. בסוף האימון המגויסים הופכים ליחידה צבאית, החלוצים לקבוצות שמוכנות לעבודה חלוצית, ובעלי המלאכה נשארים בעיר ומרוויחים יותר כשהם עובדים."+advisor.page.projects.title: "מיזמים עירוניים"+advisor.page.projects.text: "מיזם עירוני בונה דיור או תעשייה במשושה סמוך לעיר. העלות משולמת כשהוא מתחיל, בהלוואה אם אין מספיק כסף, והוא אינו דורש עובדים. כשהוא מושלם הוא מוסיף דיור, משפר את מצב הדיור או מוסיף משרות, לפי סוגו, והכסף של מיזם שבוטל אובד. סוגים מסוימים ממתינים לאירוע שיפתח אותם, או דורשים משאב שיש בעיר, כמו יקב שזקוק לאדמה לגידול ענבים."+advisor.page.pioneer_work.title: "עבודה חלוצית"+advisor.page.pioneer_work.text: "קבוצת חלוצים לוקחת על עצמה מיזם אחד בכל פעם באתר ייעודי: הקמת יישוב, חריש שדות, ייבוש ביצה, או הקמת מחנה צבאי או מחנה הכשרה. העלות משולמת כשהעבודה מתחילה, ואם עוצרים אותה, העבודה שנעשתה והכסף אובדים. שדה חרוש מוסיף מזון בכל תור, אבל יש שדות שממתינים עד שהיישוב שלהם ייבנה או עד שהביצה שלהם תיובש. אחרי שירות מספיק, הקבוצה הופכת לחלוצים ותיקים ועובדת מהר יותר."+advisor.page.corridors.title: "כבישים ומסילות"+advisor.page.corridors.text: "קבוצות חלוצים בונות כביש או מסילה קטע אחר קטע, בכל סדר, וכמה קטעים במקביל. עצירת העבודה על קטע מאבדת את ההתקדמות ואת הכסף ששולם. כביש או מסילה שהושלמו אינם דורשים אחזקה ואינם מניבים דבר בעצמם, אבל יחידות נעות לאורך הקטעים הבנויים בעלות נמוכה יותר. השלמה של כביש או מסילה יכולה גם להיחשב לטובת יעד."+advisor.page.money_debt.title: "כסף וחוב"+advisor.page.money_debt.text: "כסף נכנס ממסים ומכל משרה מאוישת, ויוצא על הוצאות הממשלה, על אחזקת העוצבות הצבאיות שלנו, על אימון ועל בנייה. כשעלות גבוהה ממה שיש לנו, היא משולמת בכל זאת: הכסף נעצר באפס והיתרה הופכת לחוב. החוב ומטבע החוץ נמצאים תחת הכסף, ומסך התקציב מציג אותם. ברגע שהחוב מגיע לתקרה וגם המזון אזל, מונה ההפסד מתחיל לרוץ."+advisor.page.budget.title: "חלוקת התקציב"+advisor.page.budget.text: "התקציב מחלק את ההוצאה בין המשרדים, חלק לכל משרד, והחלקים תמיד מסתכמים בשלם. החלק של כל משרד קובע את השפעת ההוצאה שלו, שמאיצה או מאטה את עבודת השר. לחצו על הגשת התקציב והוא ייכנס לתוקף בסיום התור; שינויים שלא הגשתם לא ייכנסו לתוקף. כשהתקציב טעון אישור של בית המחוקקים, הצבעה נגדו משאירה את התקציב הקודם, אלא אם ההצבעה אינה מחייבת."+advisor.page.cabinet.title: "השרים והממשלה"+advisor.page.cabinet.text: "כל שר אחראי על חלק מהעבודה: בנייה, קליטת עולים, כבישים ועוד. שר בעל כישורים ומשרד עם תקציב טוב מקדמים את העבודה מהר יותר, ותפקיד פנוי מאט אותה, ולכן כדאי למנות מישהו לתפקיד פנוי במסך ״ממשלה״. היציבות של הקואליציה עדיין משפיעה על ההצבעות שלה, אבל היא אינה מפילה את הממשלה במשחק הזה."+advisor.page.food.title: "מלאי המזון"+advisor.page.food.text: "אני עוקבת אחרי המלאי הזה בכל חודש. המזון הוא מלאי לאומי אחד: בכל תור השדות החרושים מוסיפים את היבול שלהם, המדינה אוכלת את מה שהיא צריכה, ויבוא ממלא את המלאי מחדש, אלא אם מטבע החוץ שלנו אזל. מחסור מוריד את הלכידות החברתית, ומלאי ריק כשהחוב בתקרה מפעיל את מונה ההפסד."+advisor.page.national_meters.title: "המדדים הלאומיים"+advisor.page.national_meters.text: "הלכידות החברתית עולה ויורדת עם הדיור, התעסוקה, המזון, הקיצוב והביטחון. התמיכה הבינלאומית זזה בעקבות הבחירות בכרטיסי האירוע. אף אחת מהן אינה מסיימת את המשחק, אבל אירועים מסוימים מגיבים כשאחת מהן נמוכה, ודוח הסיום מציג את שתיהן. קרבות ותנועת יחידות אינם משנים אף אחת מהן."+# advisor.page.units_movement: approved by Beri, a native speaker, on #2095 (1 Nov 2026): title and text as written.+advisor.page.units_movement.title: "תנועת יחידות"+advisor.page.units_movement.text: "יחידה נעה ברגע שנותנים לה את ההוראה, ואי אפשר לבטל תנועה. השטח קובע את העלות של כל משושה, ויחידה שעוד לא זזה בתור הזה תמיד יכולה להיכנס למשושה סמוך אחד. יעד רחוק יותר הופך למסלול, וסיום התור ממשיך להוביל את היחידה לאורכו. שום יחידה אינה נכנסת למים או למשושה שיש בו יחידת אויב."+advisor.page.standing_orders.title: "פקודות קבע"+advisor.page.standing_orders.text: "יחידה שומרת על הפקודה שלה תור אחרי תור, עד שנותנים לה פקודה אחרת. ביצור דורש תור אחד כדי להיכנס לתוקף, ומאז היחידה מתגוננת חזק יותר במשושה שלה עד שהיא זזה; החזקה שומרת על העמדה ואינה מוסיפה דבר. יחידה בלי פקודה ממתינה להוראות, וסיום התור בוחר בה עד שתיתנו לה פקודה או תדלגו עליה בתור הזה. שליחה הביתה היא הדרך היחידה הביתה: היא ממתינה לסיום התור, והיא נדחית עד שנחתם הסכם שביתת הנשק בחזית של היחידה."+advisor.page.combat.title: "קרב והתקפות"+advisor.page.combat.text: "התקפה מתבצעת ברגע שנותנים את הפקודה: יחידה אחת, נגד אויב במשושה סמוך, או בטווח שלה אם זו ארטילריה, והיא מנצלת את שארית התנועה של היחידה. לפני שמתחייבים, התחזית מראה את יחס הכוחות ואת מה שכל צד עלול לאבד. האבדות נופלות על היחידה החזקה ביותר, המגינים עשויים לסגת, ורק היחידות הלוחמות משתנות, אף פעם לא עיר, תושביה או הניקוד. כוח שאבד חוזר רק באמצעות תגבור, בעיר."+advisor.page.arms.title: "מלאי הנשק"+advisor.page.arms.text: "הנשק הוא מלאי לאומי אחד. אימון צבאי לוקח ממנו כשהוא מתחיל, וכל התקפה מוציאה ממנו. אפשר לקנות נשק בכסף במסך ״ביטחון״, והוא מגיע מיד. כשהמלאי חסר, אימון והתקפות שדורשים נשק נדחים."+advisor.page.arms.gdd03.text: "הנשק הוא מלאי לאומי אחד. אימון צבאי לוקח ממנו כשהוא מתחיל. אפשר לקנות נשק בכסף במסך ״ביטחון״, והוא מגיע מיד. כשהמלאי חסר, אימון שדורש נשק נדחה."+advisor.page.truces.title: "בזמן הפוגה"+advisor.page.truces.text: "אם מקבלים הפוגה בכרטיס שלה, פקודות ההתקפה שלנו נדחות עד שההפוגה נגמרת; אם דוחים אותה, דבר אינו מחייב אותנו. תנועה וכל שאר הפקודות נשארות בתוקף. בזמן הפוגה גם האויב אינו תוקף, בלי קשר לבחירה שלכם. כל עוד ההפוגה מחייבת אותנו, המסך ״ביטחון״ מראה מתי היא נגמרת."+advisor.page.capture.title: "כיבוש מקום"+advisor.page.capture.text: "יחידה צבאית שעוצרת במקום שבידי האויב ושאפשר לכבוש אותו, כובשת אותו מיד; מעבר דרכו אינו כובש אותו. אז חלון הכיבוש מציג את התשובות בסדר קבוע, ולצד כל אחת מה היא משנה מיד או למה היא נדחית. ״פשיטה ונסיגה״ מוציאה את הכוחות שלנו ומחזירה את המקום לשליטת האויב; ״שחרור״ משאיר שם יחידה אחת מספר קבוע של תורות, בעלות כספית בכל תור. הבחירה שלכם; היא נכנסת לתוקף בסיום התור, ועד שהיא ניתנת, הכוחות נשארים."+advisor.page.enemy_phase.title: "התור של האויב"+advisor.page.enemy_phase.text: "בסיום התור כל יחידת אויב מקבלת את הפקודות שלה, לפי אותם כללים שחלים עלינו. במשחק ההיסטורי כל כוח ערבי פועל לפי תסריט משלו, לעבר היעד ההיסטורי שלו. יחידה שיצאה מהתסריט תוקפת עמדה סמוכה רק כשיש לה יתרון ברור, ואחרת היא מתבצרת. ההתקפות של האויב נערכות כשהתור מוכרע, ואף אחת מהן אינה מגיעה בזמן הפוגה."# The Objectives screen (#1189). For the native reviewer (#564).objectives.title: "יעדים"objectives.done: "הושלם ב־{0}; בהיסטוריה ב־{1}"objectives.open: "טרם הושלם; בהיסטוריה ב־{0}"-# How to play's button that opens the advisor opening chain again (#1484). For the native reviewer (#564).-how_to_play.guide: "הצגת עצות הפתיחה שוב"# The advisors (spec 3.1, 14): the names as in people.yaml (name_he) and the spec; "יועצת" for Meyerson, the speaker's own# gender. Agent-drafted. For the native reviewer (#564).advisor.ben_gurion.name: "דוד בן-גוריון"