feat(state): runtime performAction and nav story signals

This commit is contained in:
ginnoir
2026-06-11 21:16:27 -05:00
parent adf730702d
commit 239b2506ec
5 changed files with 257 additions and 65 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ export function storyEventsToLogEntries(events: StoryEvent[]): StoryLogEntry[] {
.map((e) => ({ nodeId: e.nodeId, prose: e.prose, choiceLabel: e.choiceLabel }));
}
export function shouldAutoOpenPanel(
export function shouldAutoNavigateToStory(
prefs: GamePrefs,
nodeId: string,
content: GameContent,
@@ -39,7 +39,7 @@ export function processStoryTriggers(
const logEntries = storyEventsToLogEntries(events);
const shouldOpenPanel =
enteredNodeIds.length > 0 &&
enteredNodeIds.some((id) => shouldAutoOpenPanel(prefs, id, content));
enteredNodeIds.some((id) => shouldAutoNavigateToStory(prefs, id, content));
const eventLogLines = logEntries.map((e) =>
e.choiceLabel
? `Story: ${e.choiceLabel}`