narrat 1.2.0 → 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.
package/lib/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version: 1.2.0 - June 25, 2022 14:14:05
1
+ // Version: 1.2.1 - June 25, 2022 14:20:12
2
2
  import 'es6-promise/auto';
3
3
  import { ref, reactive, readonly, defineComponent, openBlock, createElementBlock, normalizeStyle, createElementVNode, createCommentVNode, Fragment, renderList, normalizeClass, createBlock, Transition, withCtx, renderSlot, createTextVNode, computed, resolveComponent, withDirectives, vModelText, toDisplayString, TransitionGroup, createVNode, createApp } from 'vue';
4
4
  import { defineStore, mapState, createPinia } from 'pinia';
@@ -3432,6 +3432,9 @@ const useAudio = defineStore('audio', {
3432
3432
  loadSaveData(data) {
3433
3433
  this.currentMusic = data.currentMusic;
3434
3434
  },
3435
+ reset() {
3436
+ this.stopMusic();
3437
+ },
3435
3438
  },
3436
3439
  });
3437
3440
 
@@ -3581,6 +3584,9 @@ const useDialogStore = defineStore('dialog', {
3581
3584
  clearDialog() {
3582
3585
  this.dialog.splice(0, this.dialog.length);
3583
3586
  },
3587
+ reset() {
3588
+ this.dialog = [];
3589
+ },
3584
3590
  },
3585
3591
  });
3586
3592
 
@@ -4885,11 +4891,13 @@ const useMain = defineStore('main', {
4885
4891
  },
4886
4892
  reset() {
4887
4893
  this.ready = false;
4888
- this.playing = false;
4889
4894
  this.errors = [];
4890
- this.flowState = 'menu';
4891
4895
  this.modal = false;
4892
4896
  this.paused = false;
4897
+ useVM().reset();
4898
+ useAudio().reset();
4899
+ this.playing = false;
4900
+ this.ready = true;
4893
4901
  },
4894
4902
  generateSaveData() {
4895
4903
  return {
@@ -9500,7 +9508,7 @@ async function startApp(config, options) {
9500
9508
  });
9501
9509
  registerBaseCommands(vm);
9502
9510
  logManager.setupDebugger(options.debug);
9503
- console.log('%c Narrat game engine – 1.2.0 - June 25, 2022 14:14:05', 'background: #222; color: #bada55');
9511
+ console.log('%c Narrat game engine – 1.2.1 - June 25, 2022 14:20:12', 'background: #222; color: #bada55');
9504
9512
  vm.callHook('onNarratSetup');
9505
9513
  app.mount('#game-holder');
9506
9514
  if (options.debug) {
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version: 1.2.0 - June 25, 2022 14:14:05
1
+ // Version: 1.2.1 - June 25, 2022 14:20:12
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -3436,6 +3436,9 @@ const useAudio = pinia.defineStore('audio', {
3436
3436
  loadSaveData(data) {
3437
3437
  this.currentMusic = data.currentMusic;
3438
3438
  },
3439
+ reset() {
3440
+ this.stopMusic();
3441
+ },
3439
3442
  },
3440
3443
  });
3441
3444
 
@@ -3585,6 +3588,9 @@ const useDialogStore = pinia.defineStore('dialog', {
3585
3588
  clearDialog() {
3586
3589
  this.dialog.splice(0, this.dialog.length);
3587
3590
  },
3591
+ reset() {
3592
+ this.dialog = [];
3593
+ },
3588
3594
  },
3589
3595
  });
3590
3596
 
@@ -4889,11 +4895,13 @@ const useMain = pinia.defineStore('main', {
4889
4895
  },
4890
4896
  reset() {
4891
4897
  this.ready = false;
4892
- this.playing = false;
4893
4898
  this.errors = [];
4894
- this.flowState = 'menu';
4895
4899
  this.modal = false;
4896
4900
  this.paused = false;
4901
+ useVM().reset();
4902
+ useAudio().reset();
4903
+ this.playing = false;
4904
+ this.ready = true;
4897
4905
  },
4898
4906
  generateSaveData() {
4899
4907
  return {
@@ -9504,7 +9512,7 @@ async function startApp(config, options) {
9504
9512
  });
9505
9513
  registerBaseCommands(vm);
9506
9514
  logManager.setupDebugger(options.debug);
9507
- console.log('%c Narrat game engine – 1.2.0 - June 25, 2022 14:14:05', 'background: #222; color: #bada55');
9515
+ console.log('%c Narrat game engine – 1.2.1 - June 25, 2022 14:20:12', 'background: #222; color: #bada55');
9508
9516
  vm.callHook('onNarratSetup');
9509
9517
  app.mount('#game-holder');
9510
9518
  if (options.debug) {
@@ -8,4 +8,5 @@ export declare const useAudio: import("pinia").StoreDefinition<"audio", AudioSta
8
8
  setMusic(music: string, soundId: number): void;
9
9
  generateSaveData(): AudioSave;
10
10
  loadSaveData(data: AudioSave): void;
11
+ reset(): void;
11
12
  }>;
@@ -23,5 +23,6 @@ export declare const useDialogStore: import("pinia").StoreDefinition<"dialog", D
23
23
  loadSaveData(data: DialogSave): void;
24
24
  addDialog(dialog: AddDialogParams): void;
25
25
  clearDialog(): void;
26
+ reset(): void;
26
27
  }>;
27
28
  export {};
@@ -96,6 +96,7 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
96
96
  }): void;
97
97
  addDialog(dialog: import("./dialog-store").AddDialogParams): void;
98
98
  clearDialog(): void;
99
+ reset(): void;
99
100
  }>;
100
101
  vm: import("pinia").Store<"vm", import("./vm-store").VMState, {
101
102
  currentStack(state: {
@@ -242,6 +243,7 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
242
243
  setMusic(music: string, soundId: number): void;
243
244
  generateSaveData(): import("./audio-store").AudioSave;
244
245
  loadSaveData(data: import("./audio-store").AudioSave): void;
246
+ reset(): void;
245
247
  }>;
246
248
  rendering: import("pinia").Store<"rendering", import("./rendering-store").RenderingState, {}, {
247
249
  updateScreenSize(width: number, height: number, textWidth: number): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "narrat",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "narrat narrative engine",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",