narrat 2.0.11 → 2.0.12

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.
Files changed (104) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +105 -105
  3. package/dist/app.vue.d.ts +96 -96
  4. package/dist/components/MainMenu.vue.d.ts +12 -12
  5. package/dist/components/Skills.vue.d.ts +22 -22
  6. package/dist/components/debug/debug-menu.vue.d.ts +48 -48
  7. package/dist/components/dialog-picture.vue.d.ts +9 -9
  8. package/dist/components/game-dialog.vue.d.ts +65 -65
  9. package/dist/components/hud.vue.d.ts +12 -12
  10. package/dist/components/inventory-ui.vue.d.ts +30 -30
  11. package/dist/components/loading-bar.vue.d.ts +10 -10
  12. package/dist/components/menu-buttons.vue.d.ts +26 -26
  13. package/dist/components/notification-toast.vue.d.ts +6 -6
  14. package/dist/components/quests-ui.vue.d.ts +20 -20
  15. package/dist/components/screen-layer.vue.d.ts +54 -0
  16. package/dist/components/screens.vue.d.ts +46 -46
  17. package/dist/components/utils/modal.vue.d.ts +6 -6
  18. package/dist/components/volume-controls.vue.d.ts +7 -7
  19. package/dist/config.d.ts +158 -158
  20. package/dist/constants.d.ts +1 -1
  21. package/dist/data/characters.json +62 -62
  22. package/dist/data/config.json +187 -184
  23. package/dist/data/example.rpy +369 -367
  24. package/dist/data/refactor.rpy +30 -30
  25. package/dist/defaultConfig.d.ts +2 -2
  26. package/dist/demo/demo.d.ts +1 -1
  27. package/dist/dialog-box.vue.d.ts +37 -37
  28. package/dist/exports/config.d.ts +1 -1
  29. package/dist/exports/display.d.ts +2 -2
  30. package/dist/exports/plugins.d.ts +20 -20
  31. package/dist/fonts/OpenDyslexic.ttf.svg +2326 -2326
  32. package/dist/img/backgrounds/test-layers.gif +0 -0
  33. package/dist/lib/lib.d.ts +15 -15
  34. package/dist/lib.css +1 -1
  35. package/dist/main.d.ts +5 -5
  36. package/dist/narrat.es.js +135 -85
  37. package/dist/narrat.es.js.map +1 -1
  38. package/dist/narrat.umd.js +71 -70
  39. package/dist/narrat.umd.js.map +1 -1
  40. package/dist/plugins/NarratPlugin.d.ts +11 -11
  41. package/dist/stores/audio-store.d.ts +12 -12
  42. package/dist/stores/dialog-store.d.ts +31 -31
  43. package/dist/stores/hud-stats-store.d.ts +22 -22
  44. package/dist/stores/inventory-store.d.ts +37 -37
  45. package/dist/stores/main-store.d.ts +339 -338
  46. package/dist/stores/notification-store.d.ts +12 -12
  47. package/dist/stores/quest-log.d.ts +39 -39
  48. package/dist/stores/rendering-store.d.ts +13 -13
  49. package/dist/stores/screens-store.d.ts +23 -22
  50. package/dist/stores/skills.d.ts +36 -36
  51. package/dist/stores/vm-store.d.ts +155 -155
  52. package/dist/types/app-types.d.ts +4 -4
  53. package/dist/types/character-types.d.ts +27 -27
  54. package/dist/types/dialog-box-types.d.ts +10 -10
  55. package/dist/types/game-save.d.ts +21 -21
  56. package/dist/types/parser.d.ts +93 -93
  57. package/dist/types/state.d.ts +3 -3
  58. package/dist/utils/ajax.d.ts +1 -1
  59. package/dist/utils/audio-loader.d.ts +13 -13
  60. package/dist/utils/characters.d.ts +5 -5
  61. package/dist/utils/data-helpers.d.ts +19 -19
  62. package/dist/utils/debounce.d.ts +14 -14
  63. package/dist/utils/error-handling.d.ts +3 -3
  64. package/dist/utils/helpers.d.ts +6 -6
  65. package/dist/utils/images-loader.d.ts +6 -6
  66. package/dist/utils/logger.d.ts +11 -11
  67. package/dist/utils/object-iterators.d.ts +8 -8
  68. package/dist/utils/promises.d.ts +1 -1
  69. package/dist/utils/randomId.d.ts +1 -1
  70. package/dist/utils/save-helpers.d.ts +3 -3
  71. package/dist/utils/skillchecks.d.ts +17 -17
  72. package/dist/utils/string-helpers.d.ts +3 -3
  73. package/dist/utils/time-helpers.d.ts +2 -2
  74. package/dist/vm/commands/arithmetic-commands.d.ts +17 -17
  75. package/dist/vm/commands/audio-commands.d.ts +8 -8
  76. package/dist/vm/commands/choice.d.ts +37 -37
  77. package/dist/vm/commands/clear_dialog.d.ts +2 -2
  78. package/dist/vm/commands/command-helpers.d.ts +2 -2
  79. package/dist/vm/commands/command-plugin.d.ts +43 -43
  80. package/dist/vm/commands/flow-commands.d.ts +14 -14
  81. package/dist/vm/commands/if.d.ts +10 -10
  82. package/dist/vm/commands/index.d.ts +2 -2
  83. package/dist/vm/commands/inventory-commands.d.ts +15 -15
  84. package/dist/vm/commands/logic-command.d.ts +42 -42
  85. package/dist/vm/commands/notify.d.ts +4 -4
  86. package/dist/vm/commands/quest-commands.d.ts +30 -30
  87. package/dist/vm/commands/screen-commands.d.ts +12 -8
  88. package/dist/vm/commands/set.d.ts +6 -6
  89. package/dist/vm/commands/skill-commands.d.ts +33 -33
  90. package/dist/vm/commands/stats-commands.d.ts +12 -12
  91. package/dist/vm/commands/string-commands.d.ts +9 -9
  92. package/dist/vm/commands/text-field.d.ts +7 -7
  93. package/dist/vm/commands/text.d.ts +13 -13
  94. package/dist/vm/commands/wait.d.ts +4 -4
  95. package/dist/vm/vm-helpers.d.ts +16 -16
  96. package/dist/vm/vm-parser.d.ts +19 -19
  97. package/dist/vm/vm-parser.test.d.ts +1 -1
  98. package/dist/vm/vm.d.ts +19 -19
  99. package/package.json +79 -79
  100. package/CHANGELOG.md +0 -844
  101. package/dist/.DS_Store +0 -0
  102. package/dist/img/.DS_Store +0 -0
  103. package/dist/music/.DS_Store +0 -0
  104. package/dist/sounds/.DS_Store +0 -0
package/dist/narrat.es.js CHANGED
@@ -681,13 +681,13 @@ var _export_sfc = (sfc, props) => {
681
681
  }
682
682
  return target;
683
683
  };
684
- const _sfc_main$f = defineComponent({
684
+ const _sfc_main$g = defineComponent({
685
685
  props: {
686
686
  containerCssClass: String
687
687
  }
688
688
  });
689
689
  const _hoisted_1$e = { class: "modal-header" };
690
- const _hoisted_2$b = /* @__PURE__ */ createTextVNode(" default header ");
690
+ const _hoisted_2$c = /* @__PURE__ */ createTextVNode(" default header ");
691
691
  const _hoisted_3$7 = /* @__PURE__ */ createElementVNode("hr", { class: "solid" }, null, -1);
692
692
  const _hoisted_4$6 = { class: "modal-body" };
693
693
  const _hoisted_5$6 = /* @__PURE__ */ createTextVNode(" default body ");
@@ -709,7 +709,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
709
709
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
710
710
  }, "X"),
711
711
  renderSlot(_ctx.$slots, "header", {}, () => [
712
- _hoisted_2$b
712
+ _hoisted_2$c
713
713
  ]),
714
714
  _hoisted_3$7
715
715
  ]),
@@ -727,7 +727,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
727
727
  _: 3
728
728
  });
729
729
  }
730
- var Modal = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$d]]);
730
+ var Modal = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$d]]);
731
731
  function isArray(value) {
732
732
  return !Array.isArray ? getTag(value) === "[object Array]" : Array.isArray(value);
733
733
  }
@@ -37242,12 +37242,15 @@ const useQuests = defineStore("quests", {
37242
37242
  });
37243
37243
  const useScreens = defineStore("screens", {
37244
37244
  state: () => ({
37245
- currentScreen: "default",
37245
+ layers: ["default"],
37246
37246
  buttons: {}
37247
37247
  }),
37248
37248
  actions: {
37249
- setScreen(screen) {
37250
- this.currentScreen = screen;
37249
+ setScreen(screen, layer) {
37250
+ this.layers[layer || 0] = screen;
37251
+ },
37252
+ emptyLayer(layer) {
37253
+ delete this.layers[layer];
37251
37254
  },
37252
37255
  setButtons(config2) {
37253
37256
  const { buttons: buttonsConfig, screens: screensConfig, images } = config2;
@@ -37280,12 +37283,12 @@ const useScreens = defineStore("screens", {
37280
37283
  },
37281
37284
  generateSaveData() {
37282
37285
  return {
37283
- currentScreen: this.currentScreen,
37286
+ layers: this.layers,
37284
37287
  buttons: this.buttons
37285
37288
  };
37286
37289
  },
37287
37290
  loadSaveData(data) {
37288
- this.currentScreen = data.currentScreen;
37291
+ this.layers = data.layers;
37289
37292
  this.buttons = cjs(this.buttons, data.buttons);
37290
37293
  }
37291
37294
  }
@@ -38558,7 +38561,7 @@ const useSkills = defineStore("skills", {
38558
38561
  });
38559
38562
  var debugMenu_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".debug-menu{z-index:9999}.debug-button{position:fixed;bottom:10px;right:10px;padding:5px}.error-message{color:#ff4500;margin-top:10px;margin-bottom:10px}.error-filename{color:gray;text-decoration:underline}.debug-menu-container{width:100%}.search-result{border:1px solid var(--text-color);padding:10px;font-weight:700;font-size:20px;width:100}.jump-menu-container{width:80%}.debug-info{position:fixed;background-color:#0009;border:1px dotted var(--text-color);top:0;left:0;padding:5px}.variables-viewer{height:100%}\n")();
38560
38563
  let fuse;
38561
- const _sfc_main$e = defineComponent({
38564
+ const _sfc_main$f = defineComponent({
38562
38565
  components: {
38563
38566
  Modal
38564
38567
  },
@@ -38788,7 +38791,7 @@ const _sfc_main$e = defineComponent({
38788
38791
  }
38789
38792
  });
38790
38793
  const _hoisted_1$d = { class: "debug-menu" };
38791
- const _hoisted_2$a = {
38794
+ const _hoisted_2$b = {
38792
38795
  key: 0,
38793
38796
  class: "debug-info"
38794
38797
  };
@@ -38855,7 +38858,7 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
38855
38858
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.open && _ctx.open(...args)),
38856
38859
  class: "button debug-button"
38857
38860
  }, "Debug Menu"),
38858
- !_ctx.playing && _ctx.flowState === "menu" ? (openBlock(), createElementBlock("div", _hoisted_2$a, _hoisted_5$5)) : createCommentVNode("", true),
38861
+ !_ctx.playing && _ctx.flowState === "menu" ? (openBlock(), createElementBlock("div", _hoisted_2$b, _hoisted_5$5)) : createCommentVNode("", true),
38859
38862
  _ctx.jumping ? (openBlock(), createBlock(_component_modal, {
38860
38863
  key: 1,
38861
38864
  onClose: _ctx.finishJumping,
@@ -38968,9 +38971,9 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
38968
38971
  }, 8, ["onClose"])) : createCommentVNode("", true)
38969
38972
  ]);
38970
38973
  }
38971
- var DebugMenu = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$c]]);
38974
+ var DebugMenu = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$c]]);
38972
38975
  var volumeControls_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".volume-label{margin-right:10px;font-size:20px;font-weight:700}.volume-controls{font-size:25px;display:flex;align-items:center;justify-content:center;margin:0 20px}.volume-slider{width:200px;background-color:#00f}\n")();
38973
- const _sfc_main$d = defineComponent({
38976
+ const _sfc_main$e = defineComponent({
38974
38977
  data() {
38975
38978
  return {
38976
38979
  muted: false
@@ -38997,13 +39000,13 @@ const _sfc_main$d = defineComponent({
38997
39000
  }
38998
39001
  });
38999
39002
  const _hoisted_1$c = { class: "volume-controls" };
39000
- const _hoisted_2$9 = /* @__PURE__ */ createElementVNode("label", {
39003
+ const _hoisted_2$a = /* @__PURE__ */ createElementVNode("label", {
39001
39004
  for: "volume",
39002
39005
  class: "volume-label"
39003
39006
  }, "Volume", -1);
39004
39007
  function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
39005
39008
  return openBlock(), createElementBlock("div", _hoisted_1$c, [
39006
- _hoisted_2$9,
39009
+ _hoisted_2$a,
39007
39010
  createElementVNode("input", {
39008
39011
  ref: "slider",
39009
39012
  class: "volume-slider",
@@ -39018,9 +39021,9 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
39018
39021
  }, null, 544)
39019
39022
  ]);
39020
39023
  }
39021
- var VolumeControls = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$b]]);
39024
+ var VolumeControls = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$b]]);
39022
39025
  var hud_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".hud{position:absolute;right:0;top:0;display:flex;flex-direction:row-reverse;z-index:3}.hud-stat{border:1px dotted white;background-color:var(--hud-background);color:var(--hud-text-color);padding:5px}.hud-icon{display:inline-block;height:1em}.hud-text{margin-left:5px}\n")();
39023
- const _sfc_main$c = defineComponent({
39026
+ const _sfc_main$d = defineComponent({
39024
39027
  components: {
39025
39028
  VolumeControls
39026
39029
  },
@@ -39049,7 +39052,7 @@ const _sfc_main$c = defineComponent({
39049
39052
  }
39050
39053
  });
39051
39054
  const _hoisted_1$b = ["src"];
39052
- const _hoisted_2$8 = { class: "bold hud-text" };
39055
+ const _hoisted_2$9 = { class: "bold hud-text" };
39053
39056
  const _hoisted_3$5 = /* @__PURE__ */ createTextVNode(": ");
39054
39057
  function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
39055
39058
  return openBlock(), createElementBlock("div", {
@@ -39065,16 +39068,16 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
39065
39068
  class: "hud-icon",
39066
39069
  src: _ctx.statsConfig[key].icon
39067
39070
  }, null, 8, _hoisted_1$b),
39068
- createElementVNode("span", _hoisted_2$8, toDisplayString(_ctx.statsConfig[key].name), 1),
39071
+ createElementVNode("span", _hoisted_2$9, toDisplayString(_ctx.statsConfig[key].name), 1),
39069
39072
  _hoisted_3$5,
39070
39073
  createElementVNode("span", null, toDisplayString(Math.floor(stat.value * 100) / 100), 1)
39071
39074
  ]);
39072
39075
  }), 128))
39073
39076
  ], 4);
39074
39077
  }
39075
- var Hud = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$a]]);
39078
+ var Hud = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$a]]);
39076
39079
  var loadingBar_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => "#loading-bar{position:relative;width:40vw;height:100px;border-radius:50px;background:black}#inner-loading-bar{height:100%;border-radius:50px 0 0 50px;background:var(--light-background)}#loading-text{z-index:99999;display:flex;align-items:center;justify-content:space-around;position:absolute;width:100%;height:100%;top:0}\n")();
39077
- const _sfc_main$b = defineComponent({
39080
+ const _sfc_main$c = defineComponent({
39078
39081
  props: {
39079
39082
  percentage: Number,
39080
39083
  step: String
@@ -39091,21 +39094,21 @@ const _sfc_main$b = defineComponent({
39091
39094
  computed: {}
39092
39095
  });
39093
39096
  const _hoisted_1$a = { id: "loading-bar" };
39094
- const _hoisted_2$7 = { id: "loading-text" };
39097
+ const _hoisted_2$8 = { id: "loading-text" };
39095
39098
  function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
39096
39099
  return openBlock(), createElementBlock("div", _hoisted_1$a, [
39097
39100
  createElementVNode("div", {
39098
39101
  id: "inner-loading-bar",
39099
39102
  style: normalizeStyle(_ctx.loadingStyle())
39100
39103
  }, null, 4),
39101
- createElementVNode("div", _hoisted_2$7, [
39104
+ createElementVNode("div", _hoisted_2$8, [
39102
39105
  createElementVNode("h3", null, "Loading " + toDisplayString(Math.floor(_ctx.percentage * 100)) + "% - " + toDisplayString(_ctx.step), 1)
39103
39106
  ])
39104
39107
  ]);
39105
39108
  }
39106
- var LoadingBar = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$9]]);
39109
+ var LoadingBar = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$9]]);
39107
39110
  var notificationToast_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".notifications-holder{position:fixed;top:0;right:0;padding:10px;display:flex;flex-direction:column-reverse;align-items:center;pointer-events:none}.notification{margin-top:10px;margin-bottom:10px;border-radius:10px;padding:15px;background:var(--notifications-bg);width:40vh;text-align:center}\n")();
39108
- const _sfc_main$a = defineComponent({
39111
+ const _sfc_main$b = defineComponent({
39109
39112
  data() {
39110
39113
  },
39111
39114
  methods: {},
@@ -39132,7 +39135,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
39132
39135
  _: 1
39133
39136
  });
39134
39137
  }
39135
- var NotificationToast = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$8]]);
39138
+ var NotificationToast = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$8]]);
39136
39139
  let config;
39137
39140
  function setCharactersConfig(data) {
39138
39141
  config = data;
@@ -39243,7 +39246,7 @@ function debounce(func, waitMilliseconds = 50, options = {}) {
39243
39246
  return debouncedFunction;
39244
39247
  }
39245
39248
  var MainMenu_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".quit-button{margin:20px;text-align:center}\n")();
39246
- const _sfc_main$9 = defineComponent({
39249
+ const _sfc_main$a = defineComponent({
39247
39250
  components: {
39248
39251
  Modal,
39249
39252
  VolumeControls
@@ -39274,7 +39277,7 @@ const _sfc_main$9 = defineComponent({
39274
39277
  }
39275
39278
  });
39276
39279
  const _hoisted_1$9 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Menu", -1);
39277
- const _hoisted_2$6 = { class: "menu-content" };
39280
+ const _hoisted_2$7 = { class: "menu-content" };
39278
39281
  function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
39279
39282
  const _component_VolumeControls = resolveComponent("VolumeControls");
39280
39283
  const _component_modal = resolveComponent("modal");
@@ -39287,7 +39290,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
39287
39290
  _hoisted_1$9
39288
39291
  ]),
39289
39292
  body: withCtx(() => [
39290
- createElementVNode("div", _hoisted_2$6, [
39293
+ createElementVNode("div", _hoisted_2$7, [
39291
39294
  createElementVNode("h3", null, "Play time: " + toDisplayString(_ctx.getPlayTimeString()), 1),
39292
39295
  createVNode(_component_VolumeControls),
39293
39296
  createElementVNode("button", {
@@ -39303,9 +39306,9 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
39303
39306
  _: 1
39304
39307
  });
39305
39308
  }
39306
- var MainMenu = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$7]]);
39309
+ var MainMenu = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$7]]);
39307
39310
  var Skills_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".skills-modal{width:800px}.skills-container{display:grid;grid-auto-rows:auto;grid-template-columns:repeat(3,1fr);grid-gap:20px 20px}.skill-display{width:200px;height:300px;position:relative;background-size:cover}.skill-title{position:absolute;bottom:0px;text-align:center;width:100%;color:var(--skills-text-color);background:var(--skills-text-background)}.skill-level{position:absolute;top:0;right:0;font-weight:700;font-size:25px;color:var(--skills-level-color);width:var(--skills-xp-bar-height);height:var(--skills-xp-bar-height);background-color:var(--skills-level-background)}.skill-description-container{justify-content:space-between;align-items:stretch}.skill-left{flex-direction:column;border:1px dashed white;padding:10px;justify-content:center}.skill-right{border:1px dashed white;flex-direction:column;flex-grow:2;align-items:baseline}.skill-xp-container{position:absolute;top:0;left:0;height:var(--skills-xp-bar-height);width:calc(100% - var(--skills-xp-bar-height));background-color:#00000080}.skill-xp-bar{position:absolute;top:0;left:0;width:50%;height:100%;background-color:#0000fa80}.skill-xp-text{z-index:2}\n")();
39308
- const _sfc_main$8 = defineComponent({
39311
+ const _sfc_main$9 = defineComponent({
39309
39312
  setup() {
39310
39313
  const store = useSkills();
39311
39314
  const skills = computed(() => store.skills);
@@ -39363,7 +39366,7 @@ const _sfc_main$8 = defineComponent({
39363
39366
  }
39364
39367
  });
39365
39368
  const _hoisted_1$8 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Skills", -1);
39366
- const _hoisted_2$5 = {
39369
+ const _hoisted_2$6 = {
39367
39370
  key: 0,
39368
39371
  class: "skills-container"
39369
39372
  };
@@ -39388,7 +39391,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
39388
39391
  _hoisted_1$8
39389
39392
  ]),
39390
39393
  body: withCtx(() => [
39391
- !_ctx.chosenSkill ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
39394
+ !_ctx.chosenSkill ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
39392
39395
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.skillsToDisplay, (skill) => {
39393
39396
  return openBlock(), createElementBlock("button", {
39394
39397
  onClick: () => _ctx.clickSkill(skill.id),
@@ -39431,9 +39434,9 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
39431
39434
  _: 1
39432
39435
  });
39433
39436
  }
39434
- var Skills = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$6]]);
39437
+ var Skills = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$6]]);
39435
39438
  var inventoryUi_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".inventory-modal{width:800px;min-height:50%}.inventory-container{display:grid;grid-auto-rows:auto;grid-template-columns:repeat(3,1fr);grid-gap:20px 20px}.item-display{width:200px;height:300px;position:relative;background-repeat:no-repeat;background-size:contain}.item-title{position:absolute;bottom:0px;text-align:center;width:100%;color:var(--inventory-text-color);background:var(--inventory-text-background)}.item-amount{position:absolute;top:0;right:0;font-weight:700;font-size:25px;color:var(--inventory-amount-color);width:40px;height:40px;background-color:var(--inventory-amount-background)}.item-description-container{justify-content:space-between;align-items:stretch}.item-left{border:1px dashed white;flex-direction:column;padding:10px;justify-content:center}.item-right{border:1px dashed white;flex-direction:column;flex-grow:2;align-items:baseline;padding:10px}\n")();
39436
- const _sfc_main$7 = defineComponent({
39439
+ const _sfc_main$8 = defineComponent({
39437
39440
  setup() {
39438
39441
  const store = useInventory();
39439
39442
  const dialogStore = useDialogStore();
@@ -39524,7 +39527,7 @@ const _sfc_main$7 = defineComponent({
39524
39527
  }
39525
39528
  });
39526
39529
  const _hoisted_1$7 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Inventory", -1);
39527
- const _hoisted_2$4 = {
39530
+ const _hoisted_2$5 = {
39528
39531
  key: 0,
39529
39532
  class: "inventory-container"
39530
39533
  };
@@ -39552,7 +39555,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
39552
39555
  _hoisted_1$7
39553
39556
  ]),
39554
39557
  body: withCtx(() => [
39555
- !_ctx.chosenItem && Object.keys(_ctx.itemsToDisplay).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
39558
+ !_ctx.chosenItem && Object.keys(_ctx.itemsToDisplay).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
39556
39559
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.itemsToDisplay, (item) => {
39557
39560
  return openBlock(), createElementBlock("button", {
39558
39561
  onClick: () => _ctx.clickItem(item.id),
@@ -39592,9 +39595,9 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
39592
39595
  _: 1
39593
39596
  }, 8, ["onClose"]);
39594
39597
  }
39595
- var InventoryUi = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$5]]);
39598
+ var InventoryUi = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$5]]);
39596
39599
  var dialogPicture_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".dialog-picture{position:absolute;width:80px;height:80px;border:2px solid white;border-radius:10px;background-color:gray;z-index:99}.dialog-picture img{width:100%;height:100%}\n")();
39597
- const _sfc_main$6 = defineComponent({
39600
+ const _sfc_main$7 = defineComponent({
39598
39601
  props: {
39599
39602
  pictureUrl: String
39600
39603
  },
@@ -39632,9 +39635,9 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
39632
39635
  }, null, 8, _hoisted_1$6)
39633
39636
  ], 4);
39634
39637
  }
39635
- var DialogPicture = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$4]]);
39638
+ var DialogPicture = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$4]]);
39636
39639
  var dialogBox_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".dialog-title{font-size:20px;font-weight:700}.dialog-text{font-size:16px}.dialog-box{color:var(--text-color);padding:10px 10px 10px 2em;margin-bottom:10px}.dialog-choice{color:var(--dialog-choice-color)}.dialog-choice:hover{color:var(--dialog-choice-hover-color);cursor:pointer}.buttons-container{width:100%;padding:10px;display:flex;justify-content:space-evenly;align-items:stretch;box-sizing:border-box}.interact-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;height:50px;color:var(--text-color);border:1px solid black;font-weight:700;font-size:24px;text-align:center;flex-grow:2;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.interact-button:not(:last-child){margin-right:10px}\n")();
39637
- const _sfc_main$5 = defineComponent({
39640
+ const _sfc_main$6 = defineComponent({
39638
39641
  data() {
39639
39642
  return {
39640
39643
  playerText: "",
@@ -39777,7 +39780,7 @@ const _sfc_main$5 = defineComponent({
39777
39780
  }
39778
39781
  });
39779
39782
  const _hoisted_1$5 = { class: "dialog-content" };
39780
- const _hoisted_2$3 = ["innerHTML"];
39783
+ const _hoisted_2$4 = ["innerHTML"];
39781
39784
  const _hoisted_3$2 = ["innerHTML"];
39782
39785
  const _hoisted_4$2 = ["innerHTML"];
39783
39786
  const _hoisted_5$2 = {
@@ -39801,7 +39804,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
39801
39804
  class: "dialog-title override",
39802
39805
  style: normalizeStyle(_ctx.titleStyle),
39803
39806
  innerHTML: _ctx.options.title
39804
- }, null, 12, _hoisted_2$3)) : createCommentVNode("", true),
39807
+ }, null, 12, _hoisted_2$4)) : createCommentVNode("", true),
39805
39808
  createElementVNode("span", {
39806
39809
  class: "dialog-text dialog-separator override",
39807
39810
  style: normalizeStyle(_ctx.textStyle),
@@ -39846,10 +39849,10 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
39846
39849
  ])
39847
39850
  ], 4);
39848
39851
  }
39849
- var DialogBox = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$3]]);
39852
+ var DialogBox = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$3]]);
39850
39853
  var gameDialog_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".dialog-container{flex-shrink:2;min-height:100%;width:100%;background-color:(var(--bg-color));box-sizing:border-box;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;overflow-x:hidden}.dialog{overflow-y:auto;overflow-x:hidden;position:relative;-ms-overflow-style:none;scrollbar-width:none}.dialog::-webkit-scrollbar{display:none}.dialog *{overflow-anchor:none}.anchor{overflow-anchor:auto;height:1px}\n")();
39851
39854
  const _hoisted_1$4 = /* @__PURE__ */ createElementVNode("div", { class: "anchor" }, null, -1);
39852
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
39855
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
39853
39856
  __name: "game-dialog",
39854
39857
  props: {
39855
39858
  layoutMode: String,
@@ -39984,7 +39987,7 @@ const filterObject = (object, predicate) => {
39984
39987
  return result;
39985
39988
  };
39986
39989
  var questsUi_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".quests-modal{width:100%;min-height:50%}.quest-header{display:flex;flex-direction:row;align-items:center}.quest-title{font-size:1.5rem;font-weight:700;margin-bottom:.5rem}.quest-completed{color:var(--completed-quest-title-color)}.quest-in-progress{color:var(--quest-title-color)}.quest-state{font-size:1.25rem;font-weight:700;margin-bottom:.5rem}.quest-description{font-size:1.1rem;text-align:justify;font-style:italic;margin-bottom:.5rem}.quest-objectives-container{margin-left:10px}.quest-objective-completed{color:var(--objective-completed-color);text-decoration:line-through}.quest-objective-in-progress{color:var(--objective-in-progress-color)}.quest-objective-description{font-size:1rem;margin-bottom:.5rem}\n")();
39987
- const _sfc_main$3 = defineComponent({
39990
+ const _sfc_main$4 = defineComponent({
39988
39991
  setup() {
39989
39992
  const questsStore = useQuests();
39990
39993
  const quests = computed(() => questsStore.quests);
@@ -40034,7 +40037,7 @@ const _sfc_main$3 = defineComponent({
40034
40037
  }
40035
40038
  });
40036
40039
  const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Quests", -1);
40037
- const _hoisted_2$2 = {
40040
+ const _hoisted_2$3 = {
40038
40041
  key: 0,
40039
40042
  class: "quests-container"
40040
40043
  };
@@ -40063,7 +40066,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
40063
40066
  _hoisted_1$3
40064
40067
  ]),
40065
40068
  body: withCtx(() => [
40066
- Object.keys(_ctx.questsToDisplay).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
40069
+ Object.keys(_ctx.questsToDisplay).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
40067
40070
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.questsToDisplay, (quest) => {
40068
40071
  return openBlock(), createElementBlock("div", {
40069
40072
  class: "quest-display",
@@ -40100,9 +40103,9 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
40100
40103
  _: 1
40101
40104
  }, 8, ["onClose"]);
40102
40105
  }
40103
- var QuestsUi = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2]]);
40106
+ var QuestsUi = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$2]]);
40104
40107
  var menuButtons_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".menu-content{text-align:center}.menu-toggle-button{margin:0;padding:2px;border-radius:5px}.menu-toggle-button:not(:last-child){margin-right:10px}.menu-modal{width:500px}\n")();
40105
- const _sfc_main$2 = defineComponent({
40108
+ const _sfc_main$3 = defineComponent({
40106
40109
  data() {
40107
40110
  return {
40108
40111
  buttons: [
@@ -40209,7 +40212,7 @@ const _sfc_main$2 = defineComponent({
40209
40212
  }
40210
40213
  });
40211
40214
  const _hoisted_1$2 = { class: "menu-container" };
40212
- const _hoisted_2$1 = ["onClick", "id"];
40215
+ const _hoisted_2$2 = ["onClick", "id"];
40213
40216
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
40214
40217
  return openBlock(), createElementBlock("div", _hoisted_1$2, [
40215
40218
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.buttonsToShow, (buttonConf) => {
@@ -40218,22 +40221,26 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
40218
40221
  onClick: ($event) => _ctx.buttonClick(buttonConf),
40219
40222
  id: buttonConf.cssId,
40220
40223
  class: "button menu-toggle-button"
40221
- }, toDisplayString(buttonConf.text), 9, _hoisted_2$1);
40224
+ }, toDisplayString(buttonConf.text), 9, _hoisted_2$2);
40222
40225
  }), 128))
40223
40226
  ]);
40224
40227
  }
40225
- var MenuButtons = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1]]);
40226
- var screens_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".viewport{position:relative}\n")();
40227
- const _hoisted_1$1 = ["onClick"];
40228
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
40229
- __name: "screens",
40228
+ var MenuButtons = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$1]]);
40229
+ var screenLayer_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".viewport{position:relative}.viewport-layer{background-size:cover;background-repeat:no-repeat;background-position:center;position:absolute;left:0;top:0;width:100%;height:100%}.viewport-button{position:absolute}\n")();
40230
+ const _hoisted_1$1 = ["id"];
40231
+ const _hoisted_2$1 = ["id", "onClick"];
40232
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
40233
+ __name: "screen-layer",
40234
+ props: {
40235
+ layer: String
40236
+ },
40230
40237
  setup(__props) {
40238
+ const props = __props;
40231
40239
  const vmStore = useVM();
40232
- const rendering = useRenderingStore();
40233
40240
  const main2 = useMain();
40234
40241
  const screensStore = useScreens();
40235
40242
  const currentScreen = computed(() => {
40236
- return screensStore.currentScreen;
40243
+ return props.layer;
40237
40244
  });
40238
40245
  const buttonsState = computed(() => {
40239
40246
  return screensStore.buttons;
@@ -40248,15 +40255,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
40248
40255
  const screenButtons = computed(() => {
40249
40256
  return screenConfig.value.buttons || [];
40250
40257
  });
40251
- const layoutMode = computed(() => {
40252
- return rendering.layoutMode;
40253
- });
40254
- const layoutWidth = computed(() => {
40255
- return getConfig().layout.backgrounds.width;
40256
- });
40257
- const layoutHeight = computed(() => {
40258
- return getConfig().layout.backgrounds.height;
40259
- });
40260
40258
  const inGame = computed(() => {
40261
40259
  return main2.isInGame;
40262
40260
  });
@@ -40288,7 +40286,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
40288
40286
  }
40289
40287
  return {
40290
40288
  ...style,
40291
- position: "absolute",
40292
40289
  left: `${config2.position.left}px`,
40293
40290
  top: `${config2.position.top}px`
40294
40291
  };
@@ -40307,7 +40304,54 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
40307
40304
  vmStore.runLine();
40308
40305
  }
40309
40306
  }
40310
- const backgroundStyle = computed(() => {
40307
+ const layerStyle = computed(() => {
40308
+ return {
40309
+ backgroundImage: `url(${getImageUrl(screenConfig.value.background)})`
40310
+ };
40311
+ });
40312
+ return (_ctx, _cache) => {
40313
+ return unref(inGame) ? (openBlock(), createElementBlock("div", {
40314
+ key: 0,
40315
+ class: "viewport-layer",
40316
+ id: `viewport-layer-${unref(currentScreen)}`,
40317
+ style: normalizeStyle(unref(layerStyle))
40318
+ }, [
40319
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(screenButtons), (button, index) => {
40320
+ return openBlock(), createElementBlock("button", {
40321
+ key: index,
40322
+ class: "viewport-button",
40323
+ id: `viewport-button-${button}`,
40324
+ onClick: ($event) => clickOnButton(button),
40325
+ style: normalizeStyle(getButtonStyle(button))
40326
+ }, toDisplayString(unref(getButtonConfig)(button).text), 13, _hoisted_2$1);
40327
+ }), 128))
40328
+ ], 12, _hoisted_1$1)) : createCommentVNode("", true);
40329
+ };
40330
+ }
40331
+ });
40332
+ var screens_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".viewport{position:relative}\n")();
40333
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
40334
+ __name: "screens",
40335
+ setup(__props) {
40336
+ const rendering = useRenderingStore();
40337
+ const main2 = useMain();
40338
+ const screensStore = useScreens();
40339
+ const layers = computed(() => {
40340
+ return screensStore.layers.filter((layer) => layer);
40341
+ });
40342
+ const layoutMode = computed(() => {
40343
+ return rendering.layoutMode;
40344
+ });
40345
+ const layoutWidth = computed(() => {
40346
+ return getConfig().layout.backgrounds.width;
40347
+ });
40348
+ const layoutHeight = computed(() => {
40349
+ return getConfig().layout.backgrounds.height;
40350
+ });
40351
+ const inGame = computed(() => {
40352
+ return main2.isInGame;
40353
+ });
40354
+ const viewportStyle = computed(() => {
40311
40355
  const width = `${layoutWidth.value}px`;
40312
40356
  let height = `${layoutHeight.value}px`;
40313
40357
  if (layoutMode.value === "vertical") {
@@ -40315,8 +40359,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
40315
40359
  }
40316
40360
  return {
40317
40361
  height,
40318
- width,
40319
- backgroundImage: `url(${getImageUrl(screenConfig.value.background)})`
40362
+ width
40320
40363
  };
40321
40364
  });
40322
40365
  return (_ctx, _cache) => {
@@ -40324,14 +40367,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
40324
40367
  key: 0,
40325
40368
  class: "viewport",
40326
40369
  id: "narrat-viewport",
40327
- style: normalizeStyle(unref(backgroundStyle))
40370
+ style: normalizeStyle(unref(viewportStyle))
40328
40371
  }, [
40329
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(screenButtons), (button, index) => {
40330
- return openBlock(), createElementBlock("button", {
40372
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(layers), (layer, index) => {
40373
+ return openBlock(), createBlock(_sfc_main$2, {
40331
40374
  key: index,
40332
- onClick: ($event) => clickOnButton(button),
40333
- style: normalizeStyle(getButtonStyle(button))
40334
- }, toDisplayString(unref(getButtonConfig)(button).text), 13, _hoisted_1$1);
40375
+ layer
40376
+ }, null, 8, ["layer"]);
40335
40377
  }), 128))
40336
40378
  ], 4)) : createCommentVNode("", true);
40337
40379
  };
@@ -40362,7 +40404,7 @@ const _sfc_main = defineComponent({
40362
40404
  MainMenu,
40363
40405
  Skills,
40364
40406
  InventoryUi,
40365
- GameDialog: _sfc_main$4,
40407
+ GameDialog: _sfc_main$5,
40366
40408
  QuestsUi,
40367
40409
  MenuButtons,
40368
40410
  Screens: _sfc_main$1
@@ -40882,17 +40924,24 @@ const addPlugin = new CommandPlugin("add", [
40882
40924
  const state = getModifiableDataPinia();
40883
40925
  addDataHelper(state, cmd.options.key, cmd.options.value);
40884
40926
  });
40885
- const setScreenCommand = new CommandPlugin("set_screen", [{ name: "screen", type: "string" }], async (cmd) => {
40927
+ const setScreenCommand = new CommandPlugin("set_screen", [
40928
+ { name: "screen", type: "string" },
40929
+ { name: "layer", type: "number", optional: true }
40930
+ ], async (cmd) => {
40931
+ const screens = useScreens();
40932
+ screens.setScreen(cmd.options.screen, cmd.options.layer);
40933
+ });
40934
+ const emptyLayerCommand = new CommandPlugin("empty_layer", [{ name: "layer", type: "number" }], async (cmd) => {
40886
40935
  const screens = useScreens();
40887
- screens.setScreen(cmd.options.screen);
40936
+ screens.emptyLayer(cmd.options.layer);
40888
40937
  });
40889
40938
  const setButtonCommand = new CommandPlugin("set_button", [
40890
40939
  { name: "buttonId", type: "string" },
40891
- { name: "enabled", type: "boolean" }
40940
+ { name: "state", type: "any" }
40892
40941
  ], async (cmd) => {
40893
- const { buttonId, enabled } = cmd.options;
40942
+ const { buttonId, state } = cmd.options;
40894
40943
  const screens = useScreens();
40895
- screens.changeButton(buttonId, enabled);
40944
+ screens.changeButton(buttonId, state);
40896
40945
  });
40897
40946
  const talkCommand = CommandPlugin.FromOptions({
40898
40947
  keyword: "talk",
@@ -41455,6 +41504,7 @@ function registerBaseCommands(vm2) {
41455
41504
  vm2.addCommand(stopCommand);
41456
41505
  vm2.addCommand(setButtonCommand);
41457
41506
  vm2.addCommand(setScreenCommand);
41507
+ vm2.addCommand(emptyLayerCommand);
41458
41508
  vm2.addCommand(waitCommand);
41459
41509
  vm2.addCommand(equalPlugin);
41460
41510
  vm2.addCommand(greaterThanPlugin);