feat(vega-gnn): suppress ranking/relations pages during espionage alerts
When a fresh espionage notification is pending, skip ranking metrics and relations pages so the alert reads as a focused notification rather than being interleaved with unrelated charts. Reopening GNN without pending events (using history) always shows the full experience, providing an escape hatch for players who want the charts.
This commit is contained in:
parent
57a8a14ade
commit
8f0b079fa4
|
|
@ -583,11 +583,20 @@ export function openGnnScreen(scene, rules, state, art, opts = {}) {
|
||||||
const storyEvents = usingHistory ? (state.gnn?.history ?? []) : pending;
|
const storyEvents = usingHistory ? (state.gnn?.history ?? []) : pending;
|
||||||
|
|
||||||
const storyPages = storyEvents.map((ev) => ({ kind: 'story', desc: Gnn.describeGnnStory(rules, state, ev) }));
|
const storyPages = storyEvents.map((ev) => ({ kind: 'story', desc: Gnn.describeGnnStory(rules, state, ev) }));
|
||||||
const rankingPages = Gnn.RANKING_METRICS.map((metric) => ({ kind: 'ranking', metric }));
|
// A spying/sabotage notification is a targeted alert, not a newscast —
|
||||||
// Always-accessible: present every time GNN opens, independent of
|
// skip the ranking/relations pages so it reads as "here's what just
|
||||||
// whether there's a pending story — same footing as the ranking pages.
|
// happened," not "here's what just happened, now flip through five
|
||||||
const relationsPage = { kind: 'relations' };
|
// unrelated charts" (Brian's ask). Only suppresses on a FRESH pending
|
||||||
const pages = [...storyPages, ...rankingPages, relationsPage];
|
// notification; reopening GNN on demand with nothing pending
|
||||||
|
// (usingHistory) always gets the full experience back — that reopen IS
|
||||||
|
// the escape hatch for a player who does want the charts.
|
||||||
|
const isEspionageAlert = !usingHistory
|
||||||
|
&& storyPages.some((p) => p.desc.kind === 'espionage' || p.desc.kind === 'espionageResult');
|
||||||
|
const rankingPages = isEspionageAlert ? [] : Gnn.RANKING_METRICS.map((metric) => ({ kind: 'ranking', metric }));
|
||||||
|
// Always-accessible otherwise: present every time GNN opens, independent
|
||||||
|
// of whether there's a pending story — same footing as the ranking pages.
|
||||||
|
const relationsPage = isEspionageAlert ? null : { kind: 'relations' };
|
||||||
|
const pages = [...storyPages, ...rankingPages, ...(relationsPage ? [relationsPage] : [])];
|
||||||
|
|
||||||
const root = scene.add.container(0, 0).setDepth(D.gnn);
|
const root = scene.add.container(0, 0).setDepth(D.gnn);
|
||||||
root.add(scene.add.rectangle(0, 0, GAME_WIDTH, GAME_HEIGHT, 0x030509, 0.99)
|
root.add(scene.add.rectangle(0, 0, GAME_WIDTH, GAME_HEIGHT, 0x030509, 0.99)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue