narraleaf-react 0.0.1-beta.11 → 0.0.1-beta.13

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.
@@ -6,7 +6,6 @@ import { StorableData } from "./store/type";
6
6
  import { MenuComponent, SayComponent } from "../player/elements/type";
7
7
  export interface SavedGame {
8
8
  name: string;
9
- version: string;
10
9
  meta: {
11
10
  created: number;
12
11
  updated: number;
@@ -15,10 +14,8 @@ export interface SavedGame {
15
14
  store: {
16
15
  [key: string]: StorableData;
17
16
  };
18
- elementState: RawData<ElementStateRaw>[];
19
- nodeChildIdMap: Record<string, string>;
17
+ elementStates: RawData<ElementStateRaw>[];
20
18
  stage: PlayerStateData;
21
- currentScene: number;
22
19
  currentAction: string | null;
23
20
  };
24
21
  }
@@ -25,9 +25,9 @@ export type PlayerState = {
25
25
  }[];
26
26
  };
27
27
  export type PlayerStateData = {
28
- elements: {
29
- scene: string;
30
- ele: {
28
+ scenes: {
29
+ sceneId: string;
30
+ elements: {
31
31
  images: string[];
32
32
  };
33
33
  }[];
@@ -76,6 +76,7 @@ export declare class GameState {
76
76
  createMenu(menu: MenuData, afterChoose?: (choice: Choice) => void, scene?: Scene): void;
77
77
  createImage(image: Image, scene?: Scene): this;
78
78
  disposeImage(image: Image, scene?: Scene): this;
79
+ forceReset(): void;
79
80
  playSound(howl: Howler.Howl, onEnd?: () => void): any;
80
81
  getHowl(): typeof Howler.Howl;
81
82
  animateImage<T extends keyof ImageEventTypes>(type: T, target: Image, args: ImageEventTypes[T], onEnd: () => void): undefined;
@@ -83,7 +84,7 @@ export declare class GameState {
83
84
  offSrcManager(srcManager: SrcManager): this;
84
85
  getStorable(): Storable;
85
86
  toData(): PlayerStateData;
86
- loadData(data: PlayerStateData, actions: LogicAction.Actions[]): void;
87
+ loadData(data: PlayerStateData, elementMap: Map<string, LogicAction.GameElement>): void;
87
88
  private getElementMap;
88
89
  private removeElements;
89
90
  private _getLastSceneIfNot;