narraleaf-react 1.1.1 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,15 @@ export declare class VfxAction<T extends Values<typeof VfxActionTypes> = Values<
18
18
  readonly setRate: "vfx:setRate";
19
19
  };
20
20
  executeAction(gameState: GameState, injection: ActionExecutionInjection): Awaitable<CalledActionResult>;
21
+ /**
22
+ * A pause, a resume or a rate change aimed at an overlay that is no longer on the stage.
23
+ *
24
+ * An overlay leaves the stage with the scene that started it, so a handle kept in script and used
25
+ * after that scene is gone has nothing to talk to. It does nothing and says so - what `hide` on an
26
+ * overlay that is not shown has always done, and what a clip's transport does - rather than
27
+ * stopping the story.
28
+ */
29
+ private skipOffStage;
21
30
  private changeStateBase;
22
31
  private changeState;
23
32
  private changeStateAsync;
@@ -54,8 +54,13 @@ export type VfxStateRaw = {
54
54
  * A full-screen looping video overlay for particle and ambience effects
55
55
  * (falling petals, light dust, rain, snow, fog, light flares).
56
56
  *
57
- * The effect is a pre-rendered video that plays above the scenes and videos of the
58
- * stage; camera transforms apply to it like any other stage content.
57
+ * The effect is a pre-rendered video that plays over the scene that shows it, above that scene's
58
+ * sprites and videos; camera transforms apply to it like any other stage content.
59
+ *
60
+ * Like everything else on the stage, an overlay belongs to the scene that shows it: rain started in
61
+ * one scene stops when the story jumps to another, waits hidden and paused while its scene has
62
+ * called another, and comes back when the call returns. A scene that wants the rain to go on shows
63
+ * it itself.
59
64
  */
60
65
  export declare class Vfx extends Actionable<VfxStateRaw> {
61
66
  /**
@@ -104,8 +109,8 @@ export declare class Vfx extends Actionable<VfxStateRaw> {
104
109
  *
105
110
  * A paused video decodes nothing, so a hidden overlay costs no frame time — and keeping the
106
111
  * element means the next {@link show} has a decoder already holding the clip instead of starting
107
- * over. Both halves of the same decision: stop the work, keep the warmth. Only a new game or a
108
- * load clears the stage.
112
+ * over. Both halves of the same decision: stop the work, keep the warmth. The overlay leaves the
113
+ * stage when its scene does.
109
114
  *
110
115
  * The action waits for the fade-out to finish. Calling it while the overlay is
111
116
  * not shown is a no-op (a weak warning is logged).
@@ -141,6 +141,14 @@ export type PlayerStateData = {
141
141
  * scenes, and a clip no scene names is given to the scene the story is running in.
142
142
  */
143
143
  videos?: string[];
144
+ /**
145
+ * The ids of the overlays this scene put on the stage, the same way
146
+ * {@link videos} names its clips. Their state is in {@link PlayerStateData.vfx}.
147
+ *
148
+ * Written only when the scene has any. Absent in saves written before overlays belonged
149
+ * to scenes, and an overlay no scene names is given to the scene the story is running in.
150
+ */
151
+ vfx?: string[];
144
152
  };
145
153
  }[];
146
154
  audio: AudioManagerDataRaw;
@@ -172,6 +180,12 @@ export type PlayerStateElementSnapshot = {
172
180
  * clips belonged to scenes; read as none.
173
181
  */
174
182
  videos?: [Video, VideoStateRaw][];
183
+ /**
184
+ * The overlays this scene had on the stage, each with its state, in stage order - for the same
185
+ * reason as {@link videos}. Absent in snapshots taken before overlays belonged to scenes; read as
186
+ * none.
187
+ */
188
+ vfx?: [Vfx, VfxStateRaw][];
175
189
  };
176
190
  export type PlayerAction = CalledActionResult;
177
191
  interface StageUtils {
@@ -236,6 +250,12 @@ export declare class GameState {
236
250
  * the stage order of clips is not grouped by scene.
237
251
  */
238
252
  private videoOwners;
253
+ /**
254
+ * Which scene each overlay on the stage belongs to: the one running when it went on. An overlay
255
+ * is a stage object like any other - rain started in a scene stops when the scene is left - and
256
+ * it is drawn beside its scene's root for the reason a clip is (see {@link videoOwners}).
257
+ */
258
+ private vfxOwners;
239
259
  private videoMissingReporter;
240
260
  /** Sources already reported as unwarmed, so one clip in a loop does not report every pass. */
241
261
  private readonly reportedUnwarmedVideos;
@@ -588,6 +608,11 @@ export declare class GameState {
588
608
  * come back with it when the step is undone.
589
609
  */
590
610
  private releaseVideosOf;
611
+ /**
612
+ * The overlay half of leaving a scene, the same as {@link releaseVideosOf}: rain the scene started
613
+ * stops when the scene is left, and the overlay goes back to its authored state.
614
+ */
615
+ private releaseVfxOf;
591
616
  private syncNvlDerivedState;
592
617
  private emitNvlStateChange;
593
618
  private resolveNvlAdvance;
@@ -0,0 +1 @@
1
+ export {};