narrat 2.0.10 → 2.0.11

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 (103) hide show
  1. package/CHANGELOG.md +844 -0
  2. package/LICENSE +21 -21
  3. package/README.md +105 -105
  4. package/dist/.DS_Store +0 -0
  5. package/dist/app.vue.d.ts +96 -96
  6. package/dist/components/MainMenu.vue.d.ts +12 -12
  7. package/dist/components/Skills.vue.d.ts +22 -22
  8. package/dist/components/debug/debug-menu.vue.d.ts +48 -48
  9. package/dist/components/dialog-picture.vue.d.ts +9 -9
  10. package/dist/components/game-dialog.vue.d.ts +65 -65
  11. package/dist/components/hud.vue.d.ts +12 -12
  12. package/dist/components/inventory-ui.vue.d.ts +30 -30
  13. package/dist/components/loading-bar.vue.d.ts +10 -10
  14. package/dist/components/menu-buttons.vue.d.ts +26 -26
  15. package/dist/components/notification-toast.vue.d.ts +6 -6
  16. package/dist/components/quests-ui.vue.d.ts +20 -20
  17. package/dist/components/screens.vue.d.ts +46 -0
  18. package/dist/components/utils/modal.vue.d.ts +6 -6
  19. package/dist/components/volume-controls.vue.d.ts +7 -7
  20. package/dist/config.d.ts +158 -151
  21. package/dist/constants.d.ts +1 -1
  22. package/dist/data/characters.json +62 -62
  23. package/dist/data/config.json +184 -182
  24. package/dist/data/example.rpy +367 -367
  25. package/dist/data/refactor.rpy +30 -30
  26. package/dist/defaultConfig.d.ts +2 -2
  27. package/dist/demo/demo.d.ts +1 -1
  28. package/dist/dialog-box.vue.d.ts +37 -37
  29. package/dist/exports/config.d.ts +1 -1
  30. package/dist/exports/display.d.ts +2 -2
  31. package/dist/exports/plugins.d.ts +20 -20
  32. package/dist/fonts/OpenDyslexic.ttf.svg +2326 -2326
  33. package/dist/img/.DS_Store +0 -0
  34. package/dist/lib/lib.d.ts +15 -15
  35. package/dist/lib.css +1 -1
  36. package/dist/main.d.ts +5 -5
  37. package/dist/music/.DS_Store +0 -0
  38. package/dist/narrat.es.js +320 -283
  39. package/dist/narrat.es.js.map +1 -1
  40. package/dist/narrat.umd.js +90 -89
  41. package/dist/narrat.umd.js.map +1 -1
  42. package/dist/plugins/NarratPlugin.d.ts +11 -11
  43. package/dist/sounds/.DS_Store +0 -0
  44. package/dist/stores/audio-store.d.ts +12 -12
  45. package/dist/stores/dialog-store.d.ts +31 -31
  46. package/dist/stores/hud-stats-store.d.ts +22 -22
  47. package/dist/stores/inventory-store.d.ts +37 -37
  48. package/dist/stores/main-store.d.ts +338 -283
  49. package/dist/stores/notification-store.d.ts +12 -12
  50. package/dist/stores/quest-log.d.ts +39 -39
  51. package/dist/stores/rendering-store.d.ts +13 -13
  52. package/dist/stores/screens-store.d.ts +22 -23
  53. package/dist/stores/skills.d.ts +36 -36
  54. package/dist/stores/vm-store.d.ts +155 -155
  55. package/dist/types/app-types.d.ts +4 -4
  56. package/dist/types/character-types.d.ts +27 -27
  57. package/dist/types/dialog-box-types.d.ts +10 -10
  58. package/dist/types/game-save.d.ts +21 -21
  59. package/dist/types/parser.d.ts +93 -93
  60. package/dist/types/state.d.ts +3 -3
  61. package/dist/utils/ajax.d.ts +1 -1
  62. package/dist/utils/audio-loader.d.ts +13 -13
  63. package/dist/utils/characters.d.ts +5 -5
  64. package/dist/utils/data-helpers.d.ts +19 -19
  65. package/dist/utils/debounce.d.ts +14 -14
  66. package/dist/utils/error-handling.d.ts +3 -3
  67. package/dist/utils/helpers.d.ts +6 -6
  68. package/dist/utils/images-loader.d.ts +6 -6
  69. package/dist/utils/logger.d.ts +11 -11
  70. package/dist/utils/object-iterators.d.ts +8 -8
  71. package/dist/utils/promises.d.ts +1 -1
  72. package/dist/utils/randomId.d.ts +1 -1
  73. package/dist/utils/save-helpers.d.ts +3 -3
  74. package/dist/utils/skillchecks.d.ts +17 -17
  75. package/dist/utils/string-helpers.d.ts +3 -3
  76. package/dist/utils/time-helpers.d.ts +2 -2
  77. package/dist/vm/commands/arithmetic-commands.d.ts +17 -17
  78. package/dist/vm/commands/audio-commands.d.ts +8 -8
  79. package/dist/vm/commands/choice.d.ts +37 -37
  80. package/dist/vm/commands/clear_dialog.d.ts +2 -2
  81. package/dist/vm/commands/command-helpers.d.ts +2 -2
  82. package/dist/vm/commands/command-plugin.d.ts +43 -43
  83. package/dist/vm/commands/flow-commands.d.ts +14 -14
  84. package/dist/vm/commands/if.d.ts +10 -10
  85. package/dist/vm/commands/index.d.ts +2 -2
  86. package/dist/vm/commands/inventory-commands.d.ts +15 -15
  87. package/dist/vm/commands/logic-command.d.ts +42 -42
  88. package/dist/vm/commands/notify.d.ts +4 -4
  89. package/dist/vm/commands/quest-commands.d.ts +30 -30
  90. package/dist/vm/commands/screen-commands.d.ts +8 -8
  91. package/dist/vm/commands/set.d.ts +6 -6
  92. package/dist/vm/commands/skill-commands.d.ts +33 -33
  93. package/dist/vm/commands/stats-commands.d.ts +12 -12
  94. package/dist/vm/commands/string-commands.d.ts +9 -9
  95. package/dist/vm/commands/text-field.d.ts +7 -7
  96. package/dist/vm/commands/text.d.ts +13 -13
  97. package/dist/vm/commands/wait.d.ts +4 -4
  98. package/dist/vm/vm-helpers.d.ts +16 -16
  99. package/dist/vm/vm-parser.d.ts +19 -19
  100. package/dist/vm/vm-parser.test.d.ts +1 -1
  101. package/dist/vm/vm.d.ts +19 -19
  102. package/package.json +79 -79
  103. package/dist/gameloop.d.ts +0 -3
package/dist/narrat.es.js CHANGED
@@ -537,7 +537,7 @@ var es6Promise = { exports: {} };
537
537
  });
538
538
  })(es6Promise);
539
539
  es6Promise.exports.polyfill();
540
- var main = /* @__PURE__ */ (() => '/*! @import *//*! tailwindcss v3.1.4 | MIT License | https://tailwindcss.com */*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::-webkit-backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.w-full{width:100%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.table-auto{table-layout:auto}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.list-disc{list-style-type:disc}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.gap-4{gap:1rem}.border{border-width:1px}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.italic{font-style:italic}.underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}.line-through{-webkit-text-decoration-line:line-through;text-decoration-line:line-through}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{--font-family: "Helvetica", sans-serif, "Arial", "sans-serif";--bg-color: #131720;--text-color: #d9e1f2;--primary: hsl(255, 30%, 55%);--focus: hsl(210, 90%, 50%);--secondary: #42b983;--border-color: hsla(0, 0%, 100%, .2);--light-1: hsl(210, 30%, 40%);--light-2: hsl(255, 30%, 50%);--light-background: linear-gradient(to right, var(--light-1), var(--light-2));--shadow-1: hsla(236, 50%, 50%, .3);--shadow-2: hsla(236, 50%, 50%, .4);--hud-background: rgba(0, 0, 0, .4);--hud-text-color: var(--text-color);--notifications-bg: darkslateblue;--skills-text-background: rgba(0, 0, 0, .5);--skills-text-color: var(--text-color);--skills-level-background: rgba(0, 0, 0, .5);--skills-level-color: orange;--skills-xp-bar-height: 40px;--skill-check-name-color: orange;--skill-check-difficulty: orange;--skill-check-success: green;--skill-check-failed: red;--skill-check-color: orange;--dialog-choice-color: orange;--dialog-choice-hover-color: var(--text-color);--inventory-text-background: rgba(0, 0, 0, .5);--inventory-text-color: var(--text-color);--inventory-amount-background: rgba(0, 0, 0, .5);--inventory-amount-color: orange;--quest-title-color: yellow;--completed-quest-title-color: grey;--objective-in-progress-color: white;--objective-completed-color: grey}body,*{font-family:var(--font-family)}.list-item{display:inline-block;margin-right:10px}.list-enter-active,.list-leave-active{transition:all .3s ease}#app{background-size:cover}.list-enter-from,.list-leave-to{opacity:0;transform:translate(300px)}.notification-item{display:inline-block;margin-right:10px}.notification-enter-active,.notification-leave-active{transition:all .3s ease}.notification-enter-from,.notification-leave-to{opacity:0;transform:translateY(-300px)}.fade-enter-active,.fade-leave-active{transition:opacity .3s ease}.fade-enter-from,.fade-leave-to{opacity:0}.fade-in-enter-active{transition:opacity .1s ease}.fade-in-enter-from{opacity:0}body{padding:0;margin:0;font-family:Arial,sans-serif;background-color:#000}.select{background:var(--light-background);padding:10px}.option{background-color:var(--light-2);padding:5px;color:var(--text-color)}.button{background:var(--light-background);color:var(--text-color);box-shadow:.4rem .5rem 2.4rem .2rem var(--shadow-1),inset -2px -4px #0006,inset 2px 2px #fff7;border-radius:10px;padding:10px;font-weight:800;font-size:16px;margin:10px;transition:.2s;box-shadow:inset -2px -4px #0006,inset 2px 2px #fff7}.button.large{border-radius:20px}.menu-button{border-radius:5px}.button.main-menu-button{border-radius:20px}.button:focus,.button:hover{transform:translateY(-.2rem);box-shadow:0 0 1rem .2rem var(--shadow-2),inset -2px -4px #0006,inset 2px 2px #fff7}.disabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.button.disabled{box-shadow:unset;color:gray;background:var(--border-color)}.input{background:var(--light-background);color:var(--text-color);box-shadow:.4rem .4rem 2.4rem .2rem var(--shadow-1);border-radius:100px;padding:10px;font-weight:800;font-size:16px;margin:10px;transition:.2s}.input:focus,.input:hover{transform:translateY(-.2rem);box-shadow:0 0 2.4rem .2rem var(--shadow-2)}a{color:pink;text-decoration:underline}th,td{padding:4px;border:1px solid var(--text-color);text-align:center}#game-holder{width:100vw;height:100vh;padding:0;margin:0;top:0;left:0;background-color:#000;display:flex;align-items:center;justify-content:center;min-height:-webkit-fill-available}.title{font-size:30px;font-weight:700;text-align:center}.container{padding:20px}h1,h2,h3,h4{font-weight:700}h1{font-size:30px}h2{font-size:26px}h3{font-size:24px}hr.solid{border:1px solid var(--text-color);margin-top:30px;margin-bottom:30px}.card-1{box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d;transition:all .3s cubic-bezier(.25,.8,.25,1)}.card-1:hover{box-shadow:0 14px 28px #00000040,0 10px 10px #00000038}.card-2{box-shadow:0 3px 6px #00000029,0 3px 6px #0000003b}.card-3{box-shadow:0 10px 20px #00000030,0 6px 6px #0000003b}.card-4{box-shadow:0 14px 28px #00000040,0 10px 10px #00000038}.card-5{box-shadow:0 19px 38px #0000004d,0 15px 12px #00000038}.dialog-choice{transition:.2s}.dialog-choice:hover{transform:scale(1.05);transform-origin:center}.dialog-choice:not(:hover)>.skill-check-name,.passive-skill-check>.skill-check-name{color:var(--skill-check-name-color)}.dialog-choice:not(:hover)>.skill-check-difficulty,.passive-skill-check>.skill-check-difficulty{color:var(--skill-check-difficulty)}.skill-check-difficulty{font-weight:700}.dialog-choice:not(:hover)>.skill-check-success,.passive-skill-check>.skill-check-success{color:var(--skill-check-success)}.dialog-choice:not(:hover)>.skill-check-failed,.passive-skill-check>.skill-check-failed{color:var(--skill-check-failed)}.dialog-choice:not(:hover)>.skill-check,.passive-skill-check.skill-check{color:var(--skill-check-color)}.narrat-canvas{position:absolute;height:100%;top:0;left:0}#touchTrigger{pointer-events:none}\n')();
540
+ var main = /* @__PURE__ */ (() => '/*! @import *//*! tailwindcss v3.1.4 | MIT License | https://tailwindcss.com */*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::-webkit-backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.w-full{width:100%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.table-auto{table-layout:auto}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.list-disc{list-style-type:disc}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.gap-4{gap:1rem}.border{border-width:1px}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.italic{font-style:italic}.underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}.line-through{-webkit-text-decoration-line:line-through;text-decoration-line:line-through}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{--font-family: "Helvetica", sans-serif, "Arial", "sans-serif";--bg-color: #131720;--text-color: #d9e1f2;--primary: hsl(255, 30%, 55%);--focus: hsl(210, 90%, 50%);--secondary: #42b983;--border-color: hsla(0, 0%, 100%, .2);--light-1: hsl(210, 30%, 40%);--light-2: hsl(255, 30%, 50%);--light-background: linear-gradient(to right, var(--light-1), var(--light-2));--shadow-1: hsla(236, 50%, 50%, .3);--shadow-2: hsla(236, 50%, 50%, .4);--hud-background: rgba(0, 0, 0, .4);--hud-text-color: var(--text-color);--notifications-bg: darkslateblue;--skills-text-background: rgba(0, 0, 0, .5);--skills-text-color: var(--text-color);--skills-level-background: rgba(0, 0, 0, .5);--skills-level-color: orange;--skills-xp-bar-height: 40px;--skill-check-name-color: orange;--skill-check-difficulty: orange;--skill-check-success: green;--skill-check-failed: red;--skill-check-color: orange;--dialog-choice-color: orange;--dialog-choice-hover-color: var(--text-color);--inventory-text-background: rgba(0, 0, 0, .5);--inventory-text-color: var(--text-color);--inventory-amount-background: rgba(0, 0, 0, .5);--inventory-amount-color: orange;--quest-title-color: yellow;--completed-quest-title-color: grey;--objective-in-progress-color: white;--objective-completed-color: grey}body,*{font-family:var(--font-family)}.list-item{display:inline-block;margin-right:10px}.list-enter-active,.list-leave-active{transition:all .3s ease}#app{background-size:cover}.list-enter-from,.list-leave-to{opacity:0;transform:translate(300px)}.notification-item{display:inline-block;margin-right:10px}.notification-enter-active,.notification-leave-active{transition:all .3s ease}.notification-enter-from,.notification-leave-to{opacity:0;transform:translateY(-300px)}.fade-enter-active,.fade-leave-active{transition:opacity .3s ease}.fade-enter-from,.fade-leave-to{opacity:0}.fade-in-enter-active{transition:opacity .1s ease}.fade-in-enter-from{opacity:0}body{padding:0;margin:0;font-family:Arial,sans-serif;background-color:#000}.select{background:var(--light-background);padding:10px}.option{background-color:var(--light-2);padding:5px;color:var(--text-color)}.button{background:var(--light-background);color:var(--text-color);box-shadow:.4rem .5rem 2.4rem .2rem var(--shadow-1),inset -2px -4px #0006,inset 2px 2px #fff7;border-radius:10px;padding:10px;font-weight:800;font-size:16px;margin:10px;transition:.2s;box-shadow:inset -2px -4px #0006,inset 2px 2px #fff7}.button.large{border-radius:20px}.menu-button{border-radius:5px}.button.main-menu-button{border-radius:20px}.button:focus,.button:hover{transform:translateY(-.2rem);box-shadow:0 0 1rem .2rem var(--shadow-2),inset -2px -4px #0006,inset 2px 2px #fff7}.disabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.button.disabled{box-shadow:unset;color:gray;background:var(--border-color)}.input{background:var(--light-background);color:var(--text-color);box-shadow:.4rem .4rem 2.4rem .2rem var(--shadow-1);border-radius:100px;padding:10px;font-weight:800;font-size:16px;margin:10px;transition:.2s}.input:focus,.input:hover{transform:translateY(-.2rem);box-shadow:0 0 2.4rem .2rem var(--shadow-2)}a{color:pink;text-decoration:underline}th,td{padding:4px;border:1px solid var(--text-color);text-align:center}#game-holder{width:100vw;height:100vh;padding:0;margin:0;top:0;left:0;background-color:#000;display:flex;align-items:center;justify-content:center;min-height:-webkit-fill-available}.title{font-size:30px;font-weight:700;text-align:center}.container{padding:20px}h1,h2,h3,h4{font-weight:700}h1{font-size:30px}h2{font-size:26px}h3{font-size:24px}hr.solid{border:1px solid var(--text-color);margin-top:30px;margin-bottom:30px}.card-1{box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d;transition:all .3s cubic-bezier(.25,.8,.25,1)}.card-1:hover{box-shadow:0 14px 28px #00000040,0 10px 10px #00000038}.card-2{box-shadow:0 3px 6px #00000029,0 3px 6px #0000003b}.card-3{box-shadow:0 10px 20px #00000030,0 6px 6px #0000003b}.card-4{box-shadow:0 14px 28px #00000040,0 10px 10px #00000038}.card-5{box-shadow:0 19px 38px #0000004d,0 15px 12px #00000038}.dialog-choice{transition:.2s}.dialog-choice:hover{transform:scale(1.05);transform-origin:center}.dialog-choice:not(:hover)>.skill-check-name,.passive-skill-check>.skill-check-name{color:var(--skill-check-name-color)}.dialog-choice:not(:hover)>.skill-check-difficulty,.passive-skill-check>.skill-check-difficulty{color:var(--skill-check-difficulty)}.skill-check-difficulty{font-weight:700}.dialog-choice:not(:hover)>.skill-check-success,.passive-skill-check>.skill-check-success{color:var(--skill-check-success)}.dialog-choice:not(:hover)>.skill-check-failed,.passive-skill-check>.skill-check-failed{color:var(--skill-check-failed)}.dialog-choice:not(:hover)>.skill-check,.passive-skill-check.skill-check{color:var(--skill-check-color)}.narrat-canvas{position:absolute;height:100%;top:0;left:0}#touchTrigger{pointer-events:none}\n')();
541
541
  const f$1 = ref([]), v$1 = ref(null), m$1 = ref(null), g$1 = ref(null), h$1 = reactive({ current: "" }), y$1 = [], b$1 = ref(false), k$1 = readonly(f$1), w$1 = readonly(v$1), M$1 = readonly(m$1), q$1 = readonly(g$1), x$1 = readonly(h$1), $$1 = (e20 = w$1.value) => {
542
542
  h$1.current = e20;
543
543
  const t2 = k$1.value.findIndex((t3) => t3.name === e20), n2 = k$1.value.map((e21) => e21.name);
@@ -681,12 +681,12 @@ var _export_sfc = (sfc, props) => {
681
681
  }
682
682
  return target;
683
683
  };
684
- const _sfc_main$e = defineComponent({
684
+ const _sfc_main$f = defineComponent({
685
685
  props: {
686
686
  containerCssClass: String
687
687
  }
688
688
  });
689
- const _hoisted_1$d = { class: "modal-header" };
689
+ const _hoisted_1$e = { class: "modal-header" };
690
690
  const _hoisted_2$b = /* @__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" };
@@ -703,7 +703,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
703
703
  class: normalizeClass(["modal-container bg-gray-800 card-4", _ctx.containerCssClass]),
704
704
  onClick: _cache[1] || (_cache[1] = (e20) => e20.stopPropagation())
705
705
  }, [
706
- createElementVNode("div", _hoisted_1$d, [
706
+ createElementVNode("div", _hoisted_1$e, [
707
707
  createElementVNode("button", {
708
708
  class: "close-button",
709
709
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
@@ -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$e, [["render", _sfc_render$d]]);
730
+ var Modal = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$d]]);
731
731
  function isArray(value) {
732
732
  return !Array.isArray ? getTag(value) === "[object Array]" : Array.isArray(value);
733
733
  }
@@ -34375,6 +34375,16 @@ function getSkillConfig(id2) {
34375
34375
  }
34376
34376
  return skill;
34377
34377
  }
34378
+ function getImageUrl(imageKeyOrUrl) {
34379
+ if (config$1.images[imageKeyOrUrl]) {
34380
+ return config$1.images[imageKeyOrUrl];
34381
+ } else {
34382
+ return imageKeyOrUrl;
34383
+ }
34384
+ }
34385
+ function getButtonConfig(button) {
34386
+ return config$1.buttons[button];
34387
+ }
34378
34388
  function getItemConfig(id2) {
34379
34389
  const item = config$1.items[id2];
34380
34390
  if (!item) {
@@ -37239,15 +37249,34 @@ const useScreens = defineStore("screens", {
37239
37249
  setScreen(screen) {
37240
37250
  this.currentScreen = screen;
37241
37251
  },
37242
- setButtons(buttons) {
37243
- for (const i2 in buttons) {
37244
- this.buttons[i2] = {
37245
- enabled: buttons[i2].enabled
37252
+ setButtons(config2) {
37253
+ const { buttons: buttonsConfig, screens: screensConfig, images } = config2;
37254
+ for (const key in buttonsConfig) {
37255
+ this.buttons[key] = {
37256
+ state: buttonsConfig[key].enabled
37246
37257
  };
37247
37258
  }
37259
+ for (const key in screensConfig) {
37260
+ if (screensConfig[key].buttons) {
37261
+ const screen = screensConfig[key];
37262
+ if (screen.background && images[screen.background]) {
37263
+ screen.background = images[screen.background];
37264
+ }
37265
+ for (const index in screen.buttons) {
37266
+ const button = screen.buttons[index];
37267
+ if (typeof button === "object") {
37268
+ buttonsConfig[button.id] = button;
37269
+ screen.buttons[index] = button.id;
37270
+ this.buttons[button.id] = {
37271
+ state: button.enabled
37272
+ };
37273
+ }
37274
+ }
37275
+ }
37276
+ }
37248
37277
  },
37249
37278
  changeButton(button, newValue) {
37250
- this.buttons[button].enabled = newValue;
37279
+ this.buttons[button].state = newValue;
37251
37280
  },
37252
37281
  generateSaveData() {
37253
37282
  return {
@@ -37343,41 +37372,41 @@ const loggerManager = new LogManager();
37343
37372
  loggerManager.setupDebugger(false);
37344
37373
  const logger = loggerManager.logger;
37345
37374
  function parseScript(errorHandler, code, fileName) {
37346
- const ctx2 = {
37375
+ const ctx = {
37347
37376
  fileName,
37348
37377
  currentLine: 0,
37349
- error: (line, text) => errorHandler(ctx2, line, text),
37378
+ error: (line, text) => errorHandler(ctx, line, text),
37350
37379
  processCommandsFunction: processCommands,
37351
37380
  indentSize: 0
37352
37381
  };
37353
- ctx2.indentSize = detectIndentation(ctx2, code);
37354
- const lines = findLines(ctx2, code);
37355
- ctx2.currentLine = 0;
37382
+ ctx.indentSize = detectIndentation(ctx, code);
37383
+ const lines = findLines(ctx, code);
37384
+ ctx.currentLine = 0;
37356
37385
  logger.log(lines);
37357
37386
  const script = {};
37358
37387
  for (const line of lines) {
37359
37388
  if (line.code.search(":") === -1) {
37360
- ctx2.error(line.line, `First indentation level should only be used to specify labels`);
37389
+ ctx.error(line.line, `First indentation level should only be used to specify labels`);
37361
37390
  }
37362
37391
  const labelString = line.code.replace(":", "");
37363
37392
  const labelWords = labelString.split(/ +/g);
37364
37393
  const labelName = labelWords[0];
37365
37394
  const labelArgs = labelWords.slice(1);
37366
37395
  if (!line.branch) {
37367
- ctx2.error(line.line, `This line should have a branch but doesn't`);
37396
+ ctx.error(line.line, `This line should have a branch but doesn't`);
37368
37397
  }
37369
37398
  script[labelName] = {
37370
- branch: processCommands(ctx2, line.branch, void 0),
37399
+ branch: processCommands(ctx, line.branch, void 0),
37371
37400
  args: labelArgs
37372
37401
  };
37373
37402
  }
37374
37403
  return script;
37375
37404
  }
37376
- function processCommands(ctx2, lines, parentLine) {
37377
- const startLine = ctx2.currentLine;
37405
+ function processCommands(ctx, lines, parentLine) {
37406
+ const startLine = ctx.currentLine;
37378
37407
  const branchContext = {
37379
37408
  processCommandsFunction: processCommands,
37380
- parserContext: ctx2,
37409
+ parserContext: ctx,
37381
37410
  lines,
37382
37411
  currentLine: 0,
37383
37412
  line: lines[0]
@@ -37388,13 +37417,13 @@ function processCommands(ctx2, lines, parentLine) {
37388
37417
  if (parentLine) {
37389
37418
  lineNumber = parentLine.line;
37390
37419
  }
37391
- ctx2.error(lineNumber, `Processing of command failed because the current branch has no lines inside`);
37420
+ ctx.error(lineNumber, `Processing of command failed because the current branch has no lines inside`);
37392
37421
  return [];
37393
37422
  }
37394
37423
  while (branchContext.currentLine < lines.length) {
37395
37424
  const line = lines[branchContext.currentLine];
37396
37425
  branchContext.line = line;
37397
- const parsed = parseExpression(ctx2, line, line.expression);
37426
+ const parsed = parseExpression(ctx, line, line.expression);
37398
37427
  const commandPlugin = vm.commands[parsed.command.operator];
37399
37428
  let parseFunction = commandPlugin == null ? void 0 : commandPlugin.parser;
37400
37429
  if (!parseFunction) {
@@ -37403,25 +37432,25 @@ function processCommands(ctx2, lines, parentLine) {
37403
37432
  logger.log(vm.commands.text);
37404
37433
  const { newLine } = parseFunction(branchContext, parsed);
37405
37434
  branchContext.currentLine = newLine;
37406
- ctx2.currentLine = startLine + newLine;
37435
+ ctx.currentLine = startLine + newLine;
37407
37436
  branch.push(parsed);
37408
37437
  }
37409
37438
  return branch;
37410
37439
  }
37411
- function parseExpression(ctx2, line, expression) {
37440
+ function parseExpression(ctx, line, expression) {
37412
37441
  logger.log(expression);
37413
37442
  if (typeof expression[0] !== "string") {
37414
- ctx2.error(line.line, `Expression operator should be a string`);
37443
+ ctx.error(line.line, `Expression operator should be a string`);
37415
37444
  }
37416
37445
  const parsed = {
37417
37446
  code: line.code,
37418
- fileName: ctx2.fileName,
37447
+ fileName: ctx.fileName,
37419
37448
  line: line.line,
37420
37449
  command: {
37421
37450
  staticOptions: {},
37422
37451
  commandType: expression[0],
37423
37452
  operator: expression[0],
37424
- args: expression.slice(1).map((arg) => parseArgument(ctx2, line, arg)),
37453
+ args: expression.slice(1).map((arg) => parseArgument(ctx, line, arg)),
37425
37454
  options: {}
37426
37455
  }
37427
37456
  };
@@ -37430,14 +37459,14 @@ function parseExpression(ctx2, line, expression) {
37430
37459
  if (!command) {
37431
37460
  const otherKeywords = ["else", "success", "failure"];
37432
37461
  if (!isParsedTokenString(firstElement) && !otherKeywords.includes(firstElement)) {
37433
- ctx2.error(line.line, `Unknown command ${firstElement}`);
37462
+ ctx.error(line.line, `Unknown command ${firstElement}`);
37434
37463
  }
37435
37464
  }
37436
37465
  return parsed;
37437
37466
  }
37438
- function parseArgument(ctx2, line, argument) {
37467
+ function parseArgument(ctx, line, argument) {
37439
37468
  if (Array.isArray(argument)) {
37440
- return parseExpression(ctx2, line, argument);
37469
+ return parseExpression(ctx, line, argument);
37441
37470
  } else {
37442
37471
  return argument;
37443
37472
  }
@@ -37452,12 +37481,12 @@ function parseTokenToPrimitive(value) {
37452
37481
  }
37453
37482
  return value;
37454
37483
  }
37455
- function parseCodeLine(ctx2, codeToProcess) {
37484
+ function parseCodeLine(ctx, codeToProcess) {
37456
37485
  if (codeToProcess.charAt(codeToProcess.length - 1) === ":") {
37457
37486
  codeToProcess = codeToProcess.substr(0, codeToProcess.length - 1);
37458
37487
  }
37459
37488
  const tokens = parseCodeLineIntoTokens(codeToProcess);
37460
- const [expression] = tokensToExpression(ctx2, tokens);
37489
+ const [expression] = tokensToExpression(ctx, tokens);
37461
37490
  return expression;
37462
37491
  }
37463
37492
  function parseCodeLineIntoTokens(code) {
@@ -37490,7 +37519,7 @@ function splitIntoTokens(code) {
37490
37519
  result = result.reduce((total, curr) => [...total, ...curr.split(/(\(|\))/g)].filter((el2) => el2 && el2), []);
37491
37520
  return result.map((token) => parseTokenToPrimitive(token));
37492
37521
  }
37493
- function tokensToExpression(ctx2, tokens) {
37522
+ function tokensToExpression(ctx, tokens) {
37494
37523
  logger.log("===============");
37495
37524
  let expression = [];
37496
37525
  let cursor = 0;
@@ -37503,7 +37532,7 @@ function tokensToExpression(ctx2, tokens) {
37503
37532
  const subExpressionString = tokens.slice(parenthesisIndex + 1);
37504
37533
  logger.log(`Found a sub expression. Before: ${expression} - After: ${subExpressionString}`);
37505
37534
  cursor = parenthesisIndex;
37506
- const [subExpression, subExpressionLength] = tokensToExpression(ctx2, subExpressionString);
37535
+ const [subExpression, subExpressionLength] = tokensToExpression(ctx, subExpressionString);
37507
37536
  const subExpressionEndIndex = cursor + subExpressionLength;
37508
37537
  expression.push(subExpression);
37509
37538
  cursor = subExpressionEndIndex + 1;
@@ -37523,19 +37552,19 @@ function tokensToExpression(ctx2, tokens) {
37523
37552
  }
37524
37553
  const endIndex = findExpressionEnd(tokens.slice(cursor)) + cursor;
37525
37554
  if (endIndex === -1) {
37526
- ctx2.error(ctx2.currentLine, `Expression is not closed (missing ")" closing parenthesis)`);
37555
+ ctx.error(ctx.currentLine, `Expression is not closed (missing ")" closing parenthesis)`);
37527
37556
  return [expression, endIndex];
37528
37557
  }
37529
37558
  const restOfString = tokens.slice(cursor, endIndex);
37530
37559
  logger.log(`End of expression: ${endIndex} - ${restOfString}`);
37531
37560
  logger.log("===================");
37532
37561
  expression = [...expression, ...restOfString];
37533
- validateExpression(ctx2, expression);
37562
+ validateExpression(ctx, expression);
37534
37563
  return [expression, endIndex + 1];
37535
37564
  }
37536
- function validateExpression(ctx2, expression) {
37565
+ function validateExpression(ctx, expression) {
37537
37566
  if (expression.length < 1) {
37538
- ctx2.error(ctx2.currentLine, `Expression is empty`);
37567
+ ctx.error(ctx.currentLine, `Expression is empty`);
37539
37568
  }
37540
37569
  }
37541
37570
  function findExpressionStart(tokens) {
@@ -37544,7 +37573,7 @@ function findExpressionStart(tokens) {
37544
37573
  function findExpressionEnd(tokens) {
37545
37574
  return tokens.findIndex((token) => token === ")");
37546
37575
  }
37547
- function findLines(ctx2, data) {
37576
+ function findLines(ctx, data) {
37548
37577
  const code = data.split(/\r?\n|$/).map((line) => {
37549
37578
  const commentIndex = line.search(/ *\/\//g);
37550
37579
  if (commentIndex !== -1) {
@@ -37552,10 +37581,10 @@ function findLines(ctx2, data) {
37552
37581
  }
37553
37582
  return line;
37554
37583
  });
37555
- const lines = findBranches(ctx2, code, 0, 0);
37584
+ const lines = findBranches(ctx, code, 0, 0);
37556
37585
  return lines.lines;
37557
37586
  }
37558
- function findBranches(ctx2, code, startLine, indentLevel) {
37587
+ function findBranches(ctx, code, startLine, indentLevel) {
37559
37588
  let stillInBranch = true;
37560
37589
  let currentLine = startLine;
37561
37590
  const lines = [];
@@ -37567,20 +37596,20 @@ function findBranches(ctx2, code, startLine, indentLevel) {
37567
37596
  if (lineText.search(/^\s*$/) !== -1) {
37568
37597
  currentLine++;
37569
37598
  } else {
37570
- const lineIndent = getIndentLevel(ctx2, lineText);
37571
- lineText = lineText.substring(lineIndent * ctx2.indentSize);
37572
- validateIndent(ctx2, lineIndent, currentLine);
37599
+ const lineIndent = getIndentLevel(ctx, lineText);
37600
+ lineText = lineText.substring(lineIndent * ctx.indentSize);
37601
+ validateIndent(ctx, lineIndent, currentLine);
37573
37602
  if (lineIndent < indentLevel) {
37574
37603
  stillInBranch = false;
37575
37604
  } else if (lineIndent > indentLevel) {
37576
37605
  if (lines.length === 0 || lineIndent - indentLevel !== 1) {
37577
- ctx2.error(currentLine, `Wrong double indentation`);
37606
+ ctx.error(currentLine, `Wrong double indentation`);
37578
37607
  }
37579
- const branchLines = findBranches(ctx2, code, currentLine, lineIndent);
37608
+ const branchLines = findBranches(ctx, code, currentLine, lineIndent);
37580
37609
  lines[lines.length - 1].branch = branchLines.lines;
37581
37610
  currentLine = branchLines.endLine;
37582
37611
  } else {
37583
- const expression = parseCodeLine(ctx2, lineText);
37612
+ const expression = parseCodeLine(ctx, lineText);
37584
37613
  const line = {
37585
37614
  code: lineText,
37586
37615
  indentation: lineIndent,
@@ -37589,7 +37618,7 @@ function findBranches(ctx2, code, startLine, indentLevel) {
37589
37618
  };
37590
37619
  lines.push(line);
37591
37620
  currentLine++;
37592
- ctx2.currentLine = currentLine;
37621
+ ctx.currentLine = currentLine;
37593
37622
  }
37594
37623
  }
37595
37624
  }
@@ -37598,19 +37627,19 @@ function findBranches(ctx2, code, startLine, indentLevel) {
37598
37627
  endLine: currentLine
37599
37628
  };
37600
37629
  }
37601
- function validateIndent(ctx2, indentLevel, currentIndex) {
37630
+ function validateIndent(ctx, indentLevel, currentIndex) {
37602
37631
  if (indentLevel % 1 !== 0) {
37603
- ctx2.error(currentIndex, `Indentation level of ${indentLevel} incorrect. Expected indentation of ${ctx2.indentSize} spaces for this file.`);
37632
+ ctx.error(currentIndex, `Indentation level of ${indentLevel} incorrect. Expected indentation of ${ctx.indentSize} spaces for this file.`);
37604
37633
  }
37605
37634
  }
37606
- function getIndentLevel(ctx2, line) {
37607
- return line.search(/[^ ]/) / ctx2.indentSize;
37635
+ function getIndentLevel(ctx, line) {
37636
+ return line.search(/[^ ]/) / ctx.indentSize;
37608
37637
  }
37609
- function detectIndentation(ctx2, script) {
37638
+ function detectIndentation(ctx, script) {
37610
37639
  const regex = /\n( *)/;
37611
37640
  const result = script.match(regex);
37612
37641
  if (!result || result.length < 2) {
37613
- ctx2.error(0, `Can't detect indentation level. Make sure you indent with at least 2 spaces and consistently`);
37642
+ ctx.error(0, `Can't detect indentation level. Make sure you indent with at least 2 spaces and consistently`);
37614
37643
  return 0;
37615
37644
  }
37616
37645
  logger.log(result);
@@ -37676,7 +37705,7 @@ const useVM = defineStore("vm", {
37676
37705
  const file = files[index];
37677
37706
  scripts = {
37678
37707
  ...scripts,
37679
- ...parseScript((ctx2, line, error2) => parserError(ctx2, line, error2), file, scriptPaths[index])
37708
+ ...parseScript((ctx, line, error2) => parserError(ctx, line, error2), file, scriptPaths[index])
37680
37709
  };
37681
37710
  }
37682
37711
  const end = Date.now();
@@ -38262,7 +38291,7 @@ const useMain = defineStore("main", {
38262
38291
  }
38263
38292
  await useVM().loadScripts(scriptPaths);
38264
38293
  const screens = useScreens();
38265
- screens.setButtons(config2.buttons);
38294
+ screens.setButtons(config2);
38266
38295
  const skillsStore = useSkills();
38267
38296
  skillsStore.setupSkills(config2.skills);
38268
38297
  const hudStore = useHud();
@@ -38429,11 +38458,16 @@ const useMain = defineStore("main", {
38429
38458
  Object.assign(states[key], stateOverride);
38430
38459
  }
38431
38460
  }
38461
+ },
38462
+ getters: {
38463
+ isInGame(state) {
38464
+ return state.flowState === "playing";
38465
+ }
38432
38466
  }
38433
38467
  });
38434
- function parserError(ctx2, line, text) {
38435
- console.error(`Parser error: ${ctx2.fileName}:${ctx2.currentLine}`, text);
38436
- const errorText = `[Parser Error] in <span class="error-filename">${ctx2.fileName}:${line + 1}</span> - <b>${text}</b>`;
38468
+ function parserError(ctx, line, text) {
38469
+ console.error(`Parser error: ${ctx.fileName}:${ctx.currentLine}`, text);
38470
+ const errorText = `[Parser Error] in <span class="error-filename">${ctx.fileName}:${line + 1}</span> - <b>${text}</b>`;
38437
38471
  error(errorText);
38438
38472
  }
38439
38473
  function error(text) {
@@ -38524,7 +38558,7 @@ const useSkills = defineStore("skills", {
38524
38558
  });
38525
38559
  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")();
38526
38560
  let fuse;
38527
- const _sfc_main$d = defineComponent({
38561
+ const _sfc_main$e = defineComponent({
38528
38562
  components: {
38529
38563
  Modal
38530
38564
  },
@@ -38753,7 +38787,7 @@ const _sfc_main$d = defineComponent({
38753
38787
  }
38754
38788
  }
38755
38789
  });
38756
- const _hoisted_1$c = { class: "debug-menu" };
38790
+ const _hoisted_1$d = { class: "debug-menu" };
38757
38791
  const _hoisted_2$a = {
38758
38792
  key: 0,
38759
38793
  class: "debug-info"
@@ -38778,7 +38812,7 @@ const _hoisted_5$5 = [
38778
38812
  _hoisted_4$5
38779
38813
  ];
38780
38814
  const _hoisted_6$5 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Jump to label", -1);
38781
- const _hoisted_7$5 = {
38815
+ const _hoisted_7$4 = {
38782
38816
  key: 0,
38783
38817
  class: "search-results"
38784
38818
  };
@@ -38816,7 +38850,7 @@ const _hoisted_26 = /* @__PURE__ */ createElementVNode("h3", { style: { "color":
38816
38850
  const _hoisted_27 = { ref: "stateViewer" };
38817
38851
  function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
38818
38852
  const _component_modal = resolveComponent("modal");
38819
- return openBlock(), createElementBlock("div", _hoisted_1$c, [
38853
+ return openBlock(), createElementBlock("div", _hoisted_1$d, [
38820
38854
  createElementVNode("button", {
38821
38855
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.open && _ctx.open(...args)),
38822
38856
  class: "button debug-button"
@@ -38840,7 +38874,7 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
38840
38874
  }, null, 544), [
38841
38875
  [vModelText, _ctx.searchString]
38842
38876
  ]),
38843
- _ctx.matches.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$5, [
38877
+ _ctx.matches.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$4, [
38844
38878
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.matches, (match, index) => {
38845
38879
  return openBlock(), createElementBlock("div", {
38846
38880
  class: "search-result",
@@ -38934,9 +38968,9 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
38934
38968
  }, 8, ["onClose"])) : createCommentVNode("", true)
38935
38969
  ]);
38936
38970
  }
38937
- var DebugMenu = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$c]]);
38971
+ var DebugMenu = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$c]]);
38938
38972
  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")();
38939
- const _sfc_main$c = defineComponent({
38973
+ const _sfc_main$d = defineComponent({
38940
38974
  data() {
38941
38975
  return {
38942
38976
  muted: false
@@ -38962,13 +38996,13 @@ const _sfc_main$c = defineComponent({
38962
38996
  }
38963
38997
  }
38964
38998
  });
38965
- const _hoisted_1$b = { class: "volume-controls" };
38999
+ const _hoisted_1$c = { class: "volume-controls" };
38966
39000
  const _hoisted_2$9 = /* @__PURE__ */ createElementVNode("label", {
38967
39001
  for: "volume",
38968
39002
  class: "volume-label"
38969
39003
  }, "Volume", -1);
38970
39004
  function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
38971
- return openBlock(), createElementBlock("div", _hoisted_1$b, [
39005
+ return openBlock(), createElementBlock("div", _hoisted_1$c, [
38972
39006
  _hoisted_2$9,
38973
39007
  createElementVNode("input", {
38974
39008
  ref: "slider",
@@ -38984,9 +39018,9 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
38984
39018
  }, null, 544)
38985
39019
  ]);
38986
39020
  }
38987
- var VolumeControls = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$b]]);
39021
+ var VolumeControls = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$b]]);
38988
39022
  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")();
38989
- const _sfc_main$b = defineComponent({
39023
+ const _sfc_main$c = defineComponent({
38990
39024
  components: {
38991
39025
  VolumeControls
38992
39026
  },
@@ -39014,7 +39048,7 @@ const _sfc_main$b = defineComponent({
39014
39048
  }
39015
39049
  }
39016
39050
  });
39017
- const _hoisted_1$a = ["src"];
39051
+ const _hoisted_1$b = ["src"];
39018
39052
  const _hoisted_2$8 = { class: "bold hud-text" };
39019
39053
  const _hoisted_3$5 = /* @__PURE__ */ createTextVNode(": ");
39020
39054
  function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
@@ -39030,7 +39064,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
39030
39064
  createElementVNode("img", {
39031
39065
  class: "hud-icon",
39032
39066
  src: _ctx.statsConfig[key].icon
39033
- }, null, 8, _hoisted_1$a),
39067
+ }, null, 8, _hoisted_1$b),
39034
39068
  createElementVNode("span", _hoisted_2$8, toDisplayString(_ctx.statsConfig[key].name), 1),
39035
39069
  _hoisted_3$5,
39036
39070
  createElementVNode("span", null, toDisplayString(Math.floor(stat.value * 100) / 100), 1)
@@ -39038,9 +39072,9 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
39038
39072
  }), 128))
39039
39073
  ], 4);
39040
39074
  }
39041
- var Hud = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$a]]);
39075
+ var Hud = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$a]]);
39042
39076
  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")();
39043
- const _sfc_main$a = defineComponent({
39077
+ const _sfc_main$b = defineComponent({
39044
39078
  props: {
39045
39079
  percentage: Number,
39046
39080
  step: String
@@ -39056,10 +39090,10 @@ const _sfc_main$a = defineComponent({
39056
39090
  },
39057
39091
  computed: {}
39058
39092
  });
39059
- const _hoisted_1$9 = { id: "loading-bar" };
39093
+ const _hoisted_1$a = { id: "loading-bar" };
39060
39094
  const _hoisted_2$7 = { id: "loading-text" };
39061
39095
  function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
39062
- return openBlock(), createElementBlock("div", _hoisted_1$9, [
39096
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
39063
39097
  createElementVNode("div", {
39064
39098
  id: "inner-loading-bar",
39065
39099
  style: normalizeStyle(_ctx.loadingStyle())
@@ -39069,9 +39103,9 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
39069
39103
  ])
39070
39104
  ]);
39071
39105
  }
39072
- var LoadingBar = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$9]]);
39106
+ var LoadingBar = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$9]]);
39073
39107
  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")();
39074
- const _sfc_main$9 = defineComponent({
39108
+ const _sfc_main$a = defineComponent({
39075
39109
  data() {
39076
39110
  },
39077
39111
  methods: {},
@@ -39098,7 +39132,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
39098
39132
  _: 1
39099
39133
  });
39100
39134
  }
39101
- var NotificationToast = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$8]]);
39135
+ var NotificationToast = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$8]]);
39102
39136
  let config;
39103
39137
  function setCharactersConfig(data) {
39104
39138
  config = data;
@@ -39127,22 +39161,6 @@ function aspectRatioFit(screenWidth, screenHeight, gameWidth, gameHeight) {
39127
39161
  const bestRatio = Math.min(widthRatio, heightRatio);
39128
39162
  return bestRatio;
39129
39163
  }
39130
- function screenToCanvas(x2, y2, element) {
39131
- const rect = element.getBoundingClientRect();
39132
- const ratio = element.width / rect.width;
39133
- const canvasX = x2 - rect.x;
39134
- const canvasY = y2 - rect.y;
39135
- const scaledX = canvasX * ratio;
39136
- const scaledY = canvasY * ratio;
39137
- return {
39138
- x: scaledX,
39139
- y: scaledY
39140
- };
39141
- }
39142
- function aabb(ax2, ay2, aw2, ah2, bx2, by2, bw2, bh2) {
39143
- return !(ax2 + aw2 < bx2 || ay2 + ah2 < by2 || ax2 > bx2 + bw2 || ay2 > by2 + bh2);
39144
- }
39145
- const images = {};
39146
39164
  let imagesToLoad = 0;
39147
39165
  let imagesLoaded = 0;
39148
39166
  function loadImages(config2) {
@@ -39160,7 +39178,6 @@ function loadImage(key, path, resolver, rejecter) {
39160
39178
  const image = new Image();
39161
39179
  image.onload = () => {
39162
39180
  imagesLoaded += 1;
39163
- images[key] = image;
39164
39181
  logger$1.log(`Loaded image ${key} successfully`);
39165
39182
  if (imagesLoaded >= imagesToLoad) {
39166
39183
  logger$1.log(`All images loaded`);
@@ -39226,7 +39243,7 @@ function debounce(func, waitMilliseconds = 50, options = {}) {
39226
39243
  return debouncedFunction;
39227
39244
  }
39228
39245
  var MainMenu_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".quit-button{margin:20px;text-align:center}\n")();
39229
- const _sfc_main$8 = defineComponent({
39246
+ const _sfc_main$9 = defineComponent({
39230
39247
  components: {
39231
39248
  Modal,
39232
39249
  VolumeControls
@@ -39256,7 +39273,7 @@ const _sfc_main$8 = defineComponent({
39256
39273
  ...mapState(useMain, ["playTime"])
39257
39274
  }
39258
39275
  });
39259
- const _hoisted_1$8 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Menu", -1);
39276
+ const _hoisted_1$9 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Menu", -1);
39260
39277
  const _hoisted_2$6 = { class: "menu-content" };
39261
39278
  function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
39262
39279
  const _component_VolumeControls = resolveComponent("VolumeControls");
@@ -39267,7 +39284,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
39267
39284
  containerCssClass: "menu-modal"
39268
39285
  }, {
39269
39286
  header: withCtx(() => [
39270
- _hoisted_1$8
39287
+ _hoisted_1$9
39271
39288
  ]),
39272
39289
  body: withCtx(() => [
39273
39290
  createElementVNode("div", _hoisted_2$6, [
@@ -39286,9 +39303,9 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
39286
39303
  _: 1
39287
39304
  });
39288
39305
  }
39289
- var MainMenu = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7]]);
39306
+ var MainMenu = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$7]]);
39290
39307
  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")();
39291
- const _sfc_main$7 = defineComponent({
39308
+ const _sfc_main$8 = defineComponent({
39292
39309
  setup() {
39293
39310
  const store = useSkills();
39294
39311
  const skills = computed(() => store.skills);
@@ -39345,7 +39362,7 @@ const _sfc_main$7 = defineComponent({
39345
39362
  }
39346
39363
  }
39347
39364
  });
39348
- const _hoisted_1$7 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Skills", -1);
39365
+ const _hoisted_1$8 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Skills", -1);
39349
39366
  const _hoisted_2$5 = {
39350
39367
  key: 0,
39351
39368
  class: "skills-container"
@@ -39354,7 +39371,7 @@ const _hoisted_3$4 = ["onClick"];
39354
39371
  const _hoisted_4$4 = { class: "skill-title" };
39355
39372
  const _hoisted_5$4 = { class: "skill-xp-container" };
39356
39373
  const _hoisted_6$4 = { class: "skill-xp-text" };
39357
- const _hoisted_7$4 = { class: "skill-level" };
39374
+ const _hoisted_7$3 = { class: "skill-level" };
39358
39375
  const _hoisted_8$3 = { key: 1 };
39359
39376
  const _hoisted_9$1 = { class: "flex flex-row skill-description-container" };
39360
39377
  const _hoisted_10$1 = { class: "flex skill-left" };
@@ -39368,7 +39385,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
39368
39385
  containerCssClass: "skills-modal"
39369
39386
  }, {
39370
39387
  header: withCtx(() => [
39371
- _hoisted_1$7
39388
+ _hoisted_1$8
39372
39389
  ]),
39373
39390
  body: withCtx(() => [
39374
39391
  !_ctx.chosenSkill ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
@@ -39387,7 +39404,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
39387
39404
  }, null, 4),
39388
39405
  createElementVNode("h3", _hoisted_6$4, toDisplayString(skill.xp) + " / " + toDisplayString(_ctx.xpPerLevel) + " XP", 1)
39389
39406
  ]),
39390
- createElementVNode("h3", _hoisted_7$4, toDisplayString(skill.level), 1)
39407
+ createElementVNode("h3", _hoisted_7$3, toDisplayString(skill.level), 1)
39391
39408
  ], 12, _hoisted_3$4);
39392
39409
  }), 128))
39393
39410
  ])) : typeof _ctx.chosenSkill === "string" ? (openBlock(), createElementBlock("div", _hoisted_8$3, [
@@ -39414,9 +39431,9 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
39414
39431
  _: 1
39415
39432
  });
39416
39433
  }
39417
- var Skills = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6]]);
39434
+ var Skills = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$6]]);
39418
39435
  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")();
39419
- const _sfc_main$6 = defineComponent({
39436
+ const _sfc_main$7 = defineComponent({
39420
39437
  setup() {
39421
39438
  const store = useInventory();
39422
39439
  const dialogStore = useDialogStore();
@@ -39506,7 +39523,7 @@ const _sfc_main$6 = defineComponent({
39506
39523
  }
39507
39524
  }
39508
39525
  });
39509
- const _hoisted_1$6 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Inventory", -1);
39526
+ const _hoisted_1$7 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Inventory", -1);
39510
39527
  const _hoisted_2$4 = {
39511
39528
  key: 0,
39512
39529
  class: "inventory-container"
@@ -39515,7 +39532,7 @@ const _hoisted_3$3 = ["onClick"];
39515
39532
  const _hoisted_4$3 = { class: "item-title" };
39516
39533
  const _hoisted_5$3 = { class: "item-amount" };
39517
39534
  const _hoisted_6$3 = { key: 1 };
39518
- const _hoisted_7$3 = { class: "flex flex-row item-description-container" };
39535
+ const _hoisted_7$2 = { class: "flex flex-row item-description-container" };
39519
39536
  const _hoisted_8$2 = { class: "flex item-left" };
39520
39537
  const _hoisted_9 = { class: "flex item-right" };
39521
39538
  const _hoisted_10 = /* @__PURE__ */ createElementVNode("hr", { class: "hr-solid" }, null, -1);
@@ -39532,7 +39549,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
39532
39549
  containerCssClass: "inventory-modal"
39533
39550
  }, {
39534
39551
  header: withCtx(() => [
39535
- _hoisted_1$6
39552
+ _hoisted_1$7
39536
39553
  ]),
39537
39554
  body: withCtx(() => [
39538
39555
  !_ctx.chosenItem && Object.keys(_ctx.itemsToDisplay).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
@@ -39548,7 +39565,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
39548
39565
  ], 12, _hoisted_3$3);
39549
39566
  }), 128))
39550
39567
  ])) : typeof _ctx.chosenId === "string" ? (openBlock(), createElementBlock("div", _hoisted_6$3, [
39551
- createElementVNode("div", _hoisted_7$3, [
39568
+ createElementVNode("div", _hoisted_7$2, [
39552
39569
  createElementVNode("div", _hoisted_8$2, [
39553
39570
  createElementVNode("div", {
39554
39571
  class: "item-display",
@@ -39575,9 +39592,9 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
39575
39592
  _: 1
39576
39593
  }, 8, ["onClose"]);
39577
39594
  }
39578
- var InventoryUi = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5]]);
39595
+ var InventoryUi = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$5]]);
39579
39596
  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")();
39580
- const _sfc_main$5 = defineComponent({
39597
+ const _sfc_main$6 = defineComponent({
39581
39598
  props: {
39582
39599
  pictureUrl: String
39583
39600
  },
@@ -39603,7 +39620,7 @@ const _sfc_main$5 = defineComponent({
39603
39620
  }
39604
39621
  }
39605
39622
  });
39606
- const _hoisted_1$5 = ["src"];
39623
+ const _hoisted_1$6 = ["src"];
39607
39624
  function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
39608
39625
  return openBlock(), createElementBlock("div", {
39609
39626
  class: "dialog-picture override",
@@ -39612,12 +39629,12 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
39612
39629
  createElementVNode("img", {
39613
39630
  src: _ctx.pictureUrl,
39614
39631
  class: "picture override"
39615
- }, null, 8, _hoisted_1$5)
39632
+ }, null, 8, _hoisted_1$6)
39616
39633
  ], 4);
39617
39634
  }
39618
- var DialogPicture = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4]]);
39635
+ var DialogPicture = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$4]]);
39619
39636
  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")();
39620
- const _sfc_main$4 = defineComponent({
39637
+ const _sfc_main$5 = defineComponent({
39621
39638
  data() {
39622
39639
  return {
39623
39640
  playerText: "",
@@ -39759,7 +39776,7 @@ const _sfc_main$4 = defineComponent({
39759
39776
  }
39760
39777
  }
39761
39778
  });
39762
- const _hoisted_1$4 = { class: "dialog-content" };
39779
+ const _hoisted_1$5 = { class: "dialog-content" };
39763
39780
  const _hoisted_2$3 = ["innerHTML"];
39764
39781
  const _hoisted_3$2 = ["innerHTML"];
39765
39782
  const _hoisted_4$2 = ["innerHTML"];
@@ -39768,7 +39785,7 @@ const _hoisted_5$2 = {
39768
39785
  class: "dialog-choices"
39769
39786
  };
39770
39787
  const _hoisted_6$2 = ["onClick", "innerHTML"];
39771
- const _hoisted_7$2 = { key: 2 };
39788
+ const _hoisted_7$1 = { key: 2 };
39772
39789
  const _hoisted_8$1 = {
39773
39790
  key: 3,
39774
39791
  class: "buttons-container"
@@ -39778,7 +39795,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
39778
39795
  class: "dialog-box w-full override",
39779
39796
  style: normalizeStyle(_ctx.dialogBoxStyle)
39780
39797
  }, [
39781
- createElementVNode("div", _hoisted_1$4, [
39798
+ createElementVNode("div", _hoisted_1$5, [
39782
39799
  _ctx.options.title ? (openBlock(), createElementBlock("span", {
39783
39800
  key: 0,
39784
39801
  class: "dialog-title override",
@@ -39805,7 +39822,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
39805
39822
  innerHTML: `${index + 1}. \u2013\xA0 ${choice.choice}`
39806
39823
  }, null, 14, _hoisted_6$2);
39807
39824
  }), 128))
39808
- ])) : _ctx.canInteract && _ctx.options.textField ? (openBlock(), createElementBlock("div", _hoisted_7$2, [
39825
+ ])) : _ctx.canInteract && _ctx.options.textField ? (openBlock(), createElementBlock("div", _hoisted_7$1, [
39809
39826
  withDirectives(createElementVNode("input", {
39810
39827
  type: "text",
39811
39828
  class: "label-input input",
@@ -39829,10 +39846,10 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
39829
39846
  ])
39830
39847
  ], 4);
39831
39848
  }
39832
- var DialogBox = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3]]);
39849
+ var DialogBox = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$3]]);
39833
39850
  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")();
39834
- const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("div", { class: "anchor" }, null, -1);
39835
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
39851
+ const _hoisted_1$4 = /* @__PURE__ */ createElementVNode("div", { class: "anchor" }, null, -1);
39852
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
39836
39853
  __name: "game-dialog",
39837
39854
  props: {
39838
39855
  layoutMode: String,
@@ -39951,7 +39968,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
39951
39968
  ]),
39952
39969
  _: 1
39953
39970
  }, 8, ["style"]),
39954
- _hoisted_1$3
39971
+ _hoisted_1$4
39955
39972
  ], 4)) : createCommentVNode("", true)
39956
39973
  ], 64);
39957
39974
  };
@@ -39967,7 +39984,7 @@ const filterObject = (object, predicate) => {
39967
39984
  return result;
39968
39985
  };
39969
39986
  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")();
39970
- const _sfc_main$2 = defineComponent({
39987
+ const _sfc_main$3 = defineComponent({
39971
39988
  setup() {
39972
39989
  const questsStore = useQuests();
39973
39990
  const quests = computed(() => questsStore.quests);
@@ -40016,7 +40033,7 @@ const _sfc_main$2 = defineComponent({
40016
40033
  Modal
40017
40034
  }
40018
40035
  });
40019
- const _hoisted_1$2 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Quests", -1);
40036
+ const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Quests", -1);
40020
40037
  const _hoisted_2$2 = {
40021
40038
  key: 0,
40022
40039
  class: "quests-container"
@@ -40031,9 +40048,9 @@ const _hoisted_6$1 = {
40031
40048
  key: 1,
40032
40049
  class: "menu-container"
40033
40050
  };
40034
- const _hoisted_7$1 = /* @__PURE__ */ createElementVNode("h2", { class: "title" }, "There are no quests!", -1);
40051
+ const _hoisted_7 = /* @__PURE__ */ createElementVNode("h2", { class: "title" }, "There are no quests!", -1);
40035
40052
  const _hoisted_8 = [
40036
- _hoisted_7$1
40053
+ _hoisted_7
40037
40054
  ];
40038
40055
  function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
40039
40056
  const _component_modal = resolveComponent("modal");
@@ -40043,7 +40060,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
40043
40060
  containerCssClass: "quests-modal"
40044
40061
  }, {
40045
40062
  header: withCtx(() => [
40046
- _hoisted_1$2
40063
+ _hoisted_1$3
40047
40064
  ]),
40048
40065
  body: withCtx(() => [
40049
40066
  Object.keys(_ctx.questsToDisplay).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
@@ -40083,9 +40100,9 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
40083
40100
  _: 1
40084
40101
  }, 8, ["onClose"]);
40085
40102
  }
40086
- var QuestsUi = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
40103
+ var QuestsUi = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2]]);
40087
40104
  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")();
40088
- const _sfc_main$1 = defineComponent({
40105
+ const _sfc_main$2 = defineComponent({
40089
40106
  data() {
40090
40107
  return {
40091
40108
  buttons: [
@@ -40191,10 +40208,10 @@ const _sfc_main$1 = defineComponent({
40191
40208
  }
40192
40209
  }
40193
40210
  });
40194
- const _hoisted_1$1 = { class: "menu-container" };
40211
+ const _hoisted_1$2 = { class: "menu-container" };
40195
40212
  const _hoisted_2$1 = ["onClick", "id"];
40196
40213
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
40197
- return openBlock(), createElementBlock("div", _hoisted_1$1, [
40214
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
40198
40215
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.buttonsToShow, (buttonConf) => {
40199
40216
  return openBlock(), createElementBlock("button", {
40200
40217
  key: buttonConf.id,
@@ -40205,7 +40222,121 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
40205
40222
  }), 128))
40206
40223
  ]);
40207
40224
  }
40208
- var MenuButtons = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
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",
40230
+ setup(__props) {
40231
+ const vmStore = useVM();
40232
+ const rendering = useRenderingStore();
40233
+ const main2 = useMain();
40234
+ const screensStore = useScreens();
40235
+ const currentScreen = computed(() => {
40236
+ return screensStore.currentScreen;
40237
+ });
40238
+ const buttonsState = computed(() => {
40239
+ return screensStore.buttons;
40240
+ });
40241
+ const screenConfig = computed(() => {
40242
+ const conf = getConfig().screens[currentScreen.value];
40243
+ if (!conf) {
40244
+ throw new Error(`Screen ${currentScreen.value} doesn't have a config`);
40245
+ }
40246
+ return conf;
40247
+ });
40248
+ const screenButtons = computed(() => {
40249
+ return screenConfig.value.buttons || [];
40250
+ });
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
+ const inGame = computed(() => {
40261
+ return main2.isInGame;
40262
+ });
40263
+ function getButtonImageUrl(button) {
40264
+ const config2 = getButtonConfig(button);
40265
+ const background = config2.background;
40266
+ if (!background) {
40267
+ return void 0;
40268
+ }
40269
+ return getImageUrl(background);
40270
+ }
40271
+ function getButtonStyle(button) {
40272
+ const config2 = getButtonConfig(button);
40273
+ const style = {};
40274
+ if (config2.position.width) {
40275
+ style.width = `${config2.position.width}px`;
40276
+ }
40277
+ if (config2.position.height) {
40278
+ style.height = `${config2.position.height}px`;
40279
+ }
40280
+ if (config2.background) {
40281
+ style.backgroundImage = `url(${getButtonImageUrl(button)})`;
40282
+ }
40283
+ if (buttonsState.value[button].state === false) {
40284
+ style.opacity = 0.3;
40285
+ style.pointerEvents = "none";
40286
+ } else if (buttonsState.value[button].state === "hidden") {
40287
+ style.display = "none";
40288
+ }
40289
+ return {
40290
+ ...style,
40291
+ position: "absolute",
40292
+ left: `${config2.position.left}px`,
40293
+ top: `${config2.position.top}px`
40294
+ };
40295
+ }
40296
+ function clickOnButton(button) {
40297
+ const config2 = getButtonConfig(button);
40298
+ const state = buttonsState.value[button];
40299
+ if (state.state === true) {
40300
+ const scriptToRun = config2.action;
40301
+ const newStack = {
40302
+ branchData: vmStore.script[scriptToRun],
40303
+ currentIndex: 0,
40304
+ label: scriptToRun
40305
+ };
40306
+ vmStore.setStack(newStack);
40307
+ vmStore.runLine();
40308
+ }
40309
+ }
40310
+ const backgroundStyle = computed(() => {
40311
+ const width = `${layoutWidth.value}px`;
40312
+ let height = `${layoutHeight.value}px`;
40313
+ if (layoutMode.value === "vertical") {
40314
+ height = `${100 - getConfig().layout.mobileDialogHeightPercentage}%`;
40315
+ }
40316
+ return {
40317
+ height,
40318
+ width,
40319
+ backgroundImage: `url(${getImageUrl(screenConfig.value.background)})`
40320
+ };
40321
+ });
40322
+ return (_ctx, _cache) => {
40323
+ return unref(inGame) ? (openBlock(), createElementBlock("div", {
40324
+ key: 0,
40325
+ class: "viewport",
40326
+ id: "narrat-viewport",
40327
+ style: normalizeStyle(unref(backgroundStyle))
40328
+ }, [
40329
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(screenButtons), (button, index) => {
40330
+ return openBlock(), createElementBlock("button", {
40331
+ key: index,
40332
+ onClick: ($event) => clickOnButton(button),
40333
+ style: normalizeStyle(getButtonStyle(button))
40334
+ }, toDisplayString(unref(getButtonConfig)(button).text), 13, _hoisted_1$1);
40335
+ }), 128))
40336
+ ], 4)) : createCommentVNode("", true);
40337
+ };
40338
+ }
40339
+ });
40209
40340
  var app_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => "#app{background-color:var(--bg-color);width:100%;height:100%;position:absolute;display:flex;flex-direction:row;align-items:center;justify-content:center;color:var(--text-color);box-sizing:border-box;overflow:hidden;transform-origin:center center}.game{background-color:var(--bg-color);position:relative;display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;height:100%;box-sizing:border-box;overflow:hidden}.interact-button{height:50px;border:1px solid black;font-weight:700;font-size:20px;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}.background{margin:0}#background-canvas{height:100%}.menu-toggle{position:fixed;bottom:0px;right:15%;z-index:2}#game-title-container{margin-bottom:50px}#game-title-text{text-align:center;font-size:50px}.menu-button{font-size:25px}#game-header{position:relative;top:100px}\n")();
40210
40341
  const _sfc_main = defineComponent({
40211
40342
  setup() {
@@ -40231,9 +40362,10 @@ const _sfc_main = defineComponent({
40231
40362
  MainMenu,
40232
40363
  Skills,
40233
40364
  InventoryUi,
40234
- GameDialog: _sfc_main$3,
40365
+ GameDialog: _sfc_main$4,
40235
40366
  QuestsUi,
40236
- MenuButtons
40367
+ MenuButtons,
40368
+ Screens: _sfc_main$1
40237
40369
  },
40238
40370
  data() {
40239
40371
  return {
@@ -40395,17 +40527,16 @@ const _sfc_main = defineComponent({
40395
40527
  }
40396
40528
  }
40397
40529
  });
40398
- const _hoisted_1 = ["width", "height"];
40399
- const _hoisted_2 = {
40530
+ const _hoisted_1 = {
40400
40531
  key: 2,
40401
40532
  id: "game-menu",
40402
40533
  style: { "height": "100%", "padding": "20px" }
40403
40534
  };
40404
- const _hoisted_3 = { id: "game-header" };
40405
- const _hoisted_4 = { id: "game-title-container" };
40406
- const _hoisted_5 = { id: "game-title-text" };
40407
- const _hoisted_6 = { class: "flex flex-col" };
40408
- const _hoisted_7 = { key: 3 };
40535
+ const _hoisted_2 = { id: "game-header" };
40536
+ const _hoisted_3 = { id: "game-title-container" };
40537
+ const _hoisted_4 = { id: "game-title-text" };
40538
+ const _hoisted_5 = { class: "flex flex-col" };
40539
+ const _hoisted_6 = { key: 3 };
40409
40540
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
40410
40541
  const _component_Hud = resolveComponent("Hud");
40411
40542
  const _component_MenuButtons = resolveComponent("MenuButtons");
@@ -40413,6 +40544,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
40413
40544
  const _component_InventoryUi = resolveComponent("InventoryUi");
40414
40545
  const _component_QuestsUi = resolveComponent("QuestsUi");
40415
40546
  const _component_MainMenu = resolveComponent("MainMenu");
40547
+ const _component_Screens = resolveComponent("Screens");
40416
40548
  const _component_GameDialog = resolveComponent("GameDialog");
40417
40549
  const _component_LoadingBar = resolveComponent("LoadingBar");
40418
40550
  const _component_DebugMenu = resolveComponent("DebugMenu");
@@ -40444,28 +40576,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
40444
40576
  key: 3,
40445
40577
  onClose: _ctx.closeModal
40446
40578
  }, null, 8, ["onClose"])) : createCommentVNode("", true),
40447
- _ctx.inGame ? (openBlock(), createElementBlock("div", {
40448
- key: 4,
40449
- class: "background",
40450
- style: normalizeStyle(_ctx.backgroundStyle)
40451
- }, [
40452
- createElementVNode("canvas", {
40453
- width: _ctx.layoutWidth,
40454
- height: _ctx.layoutHeight,
40455
- id: "background-canvas",
40456
- class: "narrat-canvas"
40457
- }, null, 8, _hoisted_1)
40458
- ], 4)) : createCommentVNode("", true),
40579
+ createVNode(_component_Screens),
40459
40580
  createVNode(_component_GameDialog, {
40460
40581
  inGame: _ctx.inGame,
40461
40582
  layoutMode: _ctx.layoutMode
40462
40583
  }, null, 8, ["inGame", "layoutMode"])
40463
- ], 4)) : _ctx.gameLoaded ? (openBlock(), createElementBlock("div", _hoisted_2, [
40464
- createElementVNode("div", _hoisted_3, [
40465
- createElementVNode("div", _hoisted_4, [
40466
- createElementVNode("h1", _hoisted_5, toDisplayString(_ctx.gameTitle), 1)
40584
+ ], 4)) : _ctx.gameLoaded ? (openBlock(), createElementBlock("div", _hoisted_1, [
40585
+ createElementVNode("div", _hoisted_2, [
40586
+ createElementVNode("div", _hoisted_3, [
40587
+ createElementVNode("h1", _hoisted_4, toDisplayString(_ctx.gameTitle), 1)
40467
40588
  ]),
40468
- createElementVNode("div", _hoisted_6, [
40589
+ createElementVNode("div", _hoisted_5, [
40469
40590
  createElementVNode("button", {
40470
40591
  class: "button menu-button main-menu-button larg start-button override",
40471
40592
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.startGame && _ctx.startGame(...args))
@@ -40477,7 +40598,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
40477
40598
  }, " Continue Game ")) : createCommentVNode("", true)
40478
40599
  ])
40479
40600
  ])
40480
- ])) : (openBlock(), createElementBlock("div", _hoisted_7, [
40601
+ ])) : (openBlock(), createElementBlock("div", _hoisted_6, [
40481
40602
  createVNode(_component_LoadingBar, {
40482
40603
  percentage: _ctx.loadingPercentage,
40483
40604
  step: _ctx.loadingStep
@@ -40488,93 +40609,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
40488
40609
  ], 4);
40489
40610
  }
40490
40611
  var GameApp = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
40491
- let canvas;
40492
- let ctx;
40493
- const mousePos = {
40494
- x: 0,
40495
- y: 0
40496
- };
40497
- function startGameLoop() {
40498
- document.addEventListener("mousemove", (e20) => {
40499
- mousePos.x = e20.clientX;
40500
- mousePos.y = e20.clientY;
40501
- });
40502
- document.addEventListener("click", debounce(mouseclick, 100, { maxWait: 200 }));
40503
- gameLoop();
40504
- }
40505
- function gameLoop() {
40506
- const screens = useScreens();
40507
- const mainStore = useMain();
40508
- if (mainStore.playing) {
40509
- if (!canvas) {
40510
- canvas = document.querySelector("#background-canvas");
40511
- if (canvas && !ctx) {
40512
- ctx = canvas.getContext("2d");
40513
- }
40514
- } else if (canvas && ctx) {
40515
- ctx.fillStyle = "white";
40516
- ctx.fillRect(0, 0, canvas.width, canvas.height);
40517
- const currentScreen = screens.currentScreen;
40518
- const screen = getConfig().screens[currentScreen];
40519
- const bg2 = screen.background;
40520
- ctx.drawImage(images[bg2], 0, 0);
40521
- let foundCollision = false;
40522
- const scaledMousePos = screenToCanvas(mousePos.x, mousePos.y, canvas);
40523
- if (screen.buttons) {
40524
- for (const buttonName of screen.buttons) {
40525
- if (screens.buttons[buttonName].enabled) {
40526
- const button = getConfig().buttons[buttonName];
40527
- const image = images[button.background];
40528
- ctx.drawImage(image, button.position.left, button.position.top);
40529
- if (aabb(scaledMousePos.x, scaledMousePos.y, 1, 1, button.position.left, button.position.top, button.position.width, button.position.height)) {
40530
- foundCollision = true;
40531
- }
40532
- }
40533
- }
40534
- }
40535
- if (foundCollision) {
40536
- document.body.style.cursor = "pointer";
40537
- } else {
40538
- document.body.style.cursor = "default";
40539
- }
40540
- ctx.fillStyle = "black";
40541
- ctx.textAlign = "left";
40542
- }
40543
- } else {
40544
- canvas = void 0;
40545
- ctx = void 0;
40546
- }
40547
- window.requestAnimationFrame(gameLoop);
40548
- }
40549
- function mouseclick(e20) {
40550
- const screens = useScreens();
40551
- const vmStore = useVM();
40552
- if (!canvas) {
40553
- return;
40554
- }
40555
- mousePos.x = e20.clientX;
40556
- mousePos.y = e20.clientY;
40557
- const scaledMousePos = screenToCanvas(mousePos.x, mousePos.y, canvas);
40558
- const currentScreen = screens.currentScreen;
40559
- const screen = getConfig().screens[currentScreen];
40560
- if (screen.buttons) {
40561
- for (const buttonName of screen.buttons) {
40562
- if (screens.buttons[buttonName].enabled) {
40563
- const button = getConfig().buttons[buttonName];
40564
- if (aabb(scaledMousePos.x, scaledMousePos.y, 1, 1, button.position.left, button.position.top, button.position.width, button.position.height)) {
40565
- const scriptToRun = button.action;
40566
- const newStack = {
40567
- branchData: vmStore.script[scriptToRun],
40568
- currentIndex: 0,
40569
- label: scriptToRun
40570
- };
40571
- vmStore.setStack(newStack);
40572
- vmStore.runLine();
40573
- }
40574
- }
40575
- }
40576
- }
40577
- }
40578
40612
  function commandRuntimeError(cmd, errorText) {
40579
40613
  console.error(`Runtime error =========================`);
40580
40614
  console.error("Args: ", cmd.args);
@@ -40642,9 +40676,9 @@ function generateParser(keyword, argTypes) {
40642
40676
  expectedArgCount.push(argTypes.length - 1);
40643
40677
  }
40644
40678
  }
40645
- return (ctx2, parsed) => {
40679
+ return (ctx, parsed) => {
40646
40680
  const returnValue = {
40647
- newLine: ctx2.currentLine + 1
40681
+ newLine: ctx.currentLine + 1
40648
40682
  };
40649
40683
  const args = parsed.command.args;
40650
40684
  if (argTypes !== "any") {
@@ -40652,7 +40686,7 @@ function generateParser(keyword, argTypes) {
40652
40686
  console.log("Error details");
40653
40687
  console.log(parsed.command);
40654
40688
  console.log(args);
40655
- ctx2.parserContext.error(ctx2.line.line, `Command ${keyword}: Expected ${expectedArgCount.join(" or ")} arguments but got ${args.length}`);
40689
+ ctx.parserContext.error(ctx.line.line, `Command ${keyword}: Expected ${expectedArgCount.join(" or ")} arguments but got ${args.length}`);
40656
40690
  return returnValue;
40657
40691
  }
40658
40692
  }
@@ -40663,13 +40697,13 @@ function generateParser(keyword, argTypes) {
40663
40697
  if (!isExpression(arg)) {
40664
40698
  const isValid = argType.type === "any" || typeof arg === argType.type;
40665
40699
  if (!isValid) {
40666
- ctx2.parserContext.error(ctx2.line.line, `Command ${keyword}: Argument #${index + 1} (${argType.name}) should be a ${argType.type}, but got type ${typeof arg}: ${JSON.stringify(arg)}`);
40700
+ ctx.parserContext.error(ctx.line.line, `Command ${keyword}: Argument #${index + 1} (${argType.name}) should be a ${argType.type}, but got type ${typeof arg}: ${JSON.stringify(arg)}`);
40667
40701
  }
40668
40702
  }
40669
40703
  });
40670
40704
  }
40671
40705
  return {
40672
- newLine: ctx2.currentLine + 1
40706
+ newLine: ctx.currentLine + 1
40673
40707
  };
40674
40708
  };
40675
40709
  }
@@ -40889,8 +40923,8 @@ const talkCommand = CommandPlugin.FromOptions({
40889
40923
  });
40890
40924
  const textParser = () => {
40891
40925
  const parser = generateParser("text", []);
40892
- return (ctx2, parsed) => {
40893
- const result = parser(ctx2, parsed);
40926
+ return (ctx, parsed) => {
40927
+ const result = parser(ctx, parsed);
40894
40928
  parsed.command.staticOptions = {
40895
40929
  text: parsed.code
40896
40930
  };
@@ -41011,8 +41045,12 @@ const objectiveStartedPlugin = new CommandPlugin("objective_started?", [
41011
41045
  const quests = useQuests();
41012
41046
  return quests.isObjectiveStarted(questId, objectiveId);
41013
41047
  });
41014
- const waitCommand = new CommandPlugin("wait", [{ name: "duration", type: "number" }], async (cmd) => {
41015
- await timeout(cmd.options.duration);
41048
+ const waitCommand = CommandPlugin.FromOptions({
41049
+ keyword: "wait",
41050
+ argTypes: [{ name: "duration", type: "number" }],
41051
+ runner: async (cmd) => {
41052
+ await timeout(cmd.options.duration);
41053
+ }
41016
41054
  });
41017
41055
  const notifyPlugin = new CommandPlugin("notify", [{ name: "text", type: "string" }], async (cmd) => {
41018
41056
  const { text } = cmd.options;
@@ -41033,22 +41071,22 @@ const ifCommand = new CommandPlugin("if", [{ name: "condition", type: "boolean"
41033
41071
  };
41034
41072
  return vmStore.addAndRunFrame(newStack);
41035
41073
  }
41036
- }, (ctx2, parsed) => {
41037
- let newLine = ctx2.currentLine;
41074
+ }, (ctx, parsed) => {
41075
+ let newLine = ctx.currentLine;
41038
41076
  const parser = generateParser("if", [
41039
41077
  { name: "condition", type: "string" }
41040
41078
  ]);
41041
- parser(ctx2, parsed);
41042
- const { lines, currentLine, line } = ctx2;
41079
+ parser(ctx, parsed);
41080
+ const { lines, currentLine, line } = ctx;
41043
41081
  const command = parsed.command;
41044
41082
  let failure;
41045
41083
  const nextLine = getLine(lines, currentLine + 1);
41046
41084
  if (nextLine && nextLine.code === "else:") {
41047
- failure = ctx2.processCommandsFunction(ctx2.parserContext, nextLine.branch, line);
41085
+ failure = ctx.processCommandsFunction(ctx.parserContext, nextLine.branch, line);
41048
41086
  newLine++;
41049
41087
  }
41050
41088
  command.staticOptions = {
41051
- success: ctx2.processCommandsFunction(ctx2.parserContext, line.branch, line),
41089
+ success: ctx.processCommandsFunction(ctx.parserContext, line.branch, line),
41052
41090
  failure
41053
41091
  };
41054
41092
  newLine++;
@@ -41204,54 +41242,54 @@ const runChoice = async (cmd) => {
41204
41242
  const res = await runCommand(prompt, dialogChoices);
41205
41243
  await onChoicePlayerAnswered(cmd, res);
41206
41244
  };
41207
- function parseChoiceOption(ctx2, choice, index) {
41245
+ function parseChoiceOption(ctx, choice, index) {
41208
41246
  choice.expression;
41209
41247
  if (!choice.branch) {
41210
- ctx2.parserContext.error(choice.line, `Choice option doesn't have any branch to go to (${choice.code} - ${choice.line})`);
41248
+ ctx.parserContext.error(choice.line, `Choice option doesn't have any branch to go to (${choice.code} - ${choice.line})`);
41211
41249
  }
41212
41250
  let skillBranches;
41213
41251
  let mainBranch;
41214
41252
  const branch = choice.branch;
41215
41253
  if (choice.expression[1] === "roll") {
41216
41254
  if (!branch[0].branch || !branch[1].branch) {
41217
- ctx2.parserContext.error(choice.line, `Choice option with a skill roll needs success and failure branches (${choice.code} - ${choice.line})`);
41255
+ ctx.parserContext.error(choice.line, `Choice option with a skill roll needs success and failure branches (${choice.code} - ${choice.line})`);
41218
41256
  }
41219
41257
  skillBranches = {
41220
- success: ctx2.processCommandsFunction(ctx2.parserContext, branch[0].branch, choice),
41221
- failure: ctx2.processCommandsFunction(ctx2.parserContext, branch[1].branch, choice)
41258
+ success: ctx.processCommandsFunction(ctx.parserContext, branch[0].branch, choice),
41259
+ failure: ctx.processCommandsFunction(ctx.parserContext, branch[1].branch, choice)
41222
41260
  };
41223
41261
  } else {
41224
- mainBranch = ctx2.processCommandsFunction(ctx2.parserContext, branch, choice);
41262
+ mainBranch = ctx.processCommandsFunction(ctx.parserContext, branch, choice);
41225
41263
  }
41226
41264
  const choiceInfo = {
41227
- prompt: ctx2.processCommandsFunction(ctx2.parserContext, [choice], choice)[0],
41265
+ prompt: ctx.processCommandsFunction(ctx.parserContext, [choice], choice)[0],
41228
41266
  branch: mainBranch,
41229
41267
  skillBranches
41230
41268
  };
41231
41269
  return choiceInfo;
41232
41270
  }
41233
- const choiceParser = (ctx2, parsed) => {
41234
- let newLine = ctx2.currentLine;
41271
+ const choiceParser = (ctx, parsed) => {
41272
+ let newLine = ctx.currentLine;
41235
41273
  generateParser("choice", []);
41236
- const { line } = ctx2;
41274
+ const { line } = ctx;
41237
41275
  const command = parsed.command;
41238
41276
  if (!line.branch || line.branch.length < 2) {
41239
- ctx2.parserContext.error(line.line, `Choice menu needs to have at least one option`);
41277
+ ctx.parserContext.error(line.line, `Choice menu needs to have at least one option`);
41240
41278
  }
41241
41279
  const prompt = line.branch[0];
41242
41280
  if (!prompt) {
41243
- ctx2.parserContext.error(ctx2.line.line, `Choice prompt is missing `);
41281
+ ctx.parserContext.error(ctx.line.line, `Choice prompt is missing `);
41244
41282
  }
41245
41283
  const choices = line.branch.slice(1);
41246
41284
  const prompts = choices.map((choice, index) => {
41247
41285
  if (!choice.branch) {
41248
- ctx2.parserContext.error(choice.line, `Choice option doesn't have any branch to go to (${choice.code})`);
41286
+ ctx.parserContext.error(choice.line, `Choice option doesn't have any branch to go to (${choice.code})`);
41249
41287
  }
41250
- choice = getChoiceOptionLineFromChoicePrompt(ctx2.parserContext, choice);
41251
- return parseChoiceOption(ctx2, choice);
41288
+ choice = getChoiceOptionLineFromChoicePrompt(ctx.parserContext, choice);
41289
+ return parseChoiceOption(ctx, choice);
41252
41290
  });
41253
41291
  command.staticOptions = {
41254
- prompt: ctx2.processCommandsFunction(ctx2.parserContext, [prompt], line)[0],
41292
+ prompt: ctx.processCommandsFunction(ctx.parserContext, [prompt], line)[0],
41255
41293
  choices: prompts
41256
41294
  };
41257
41295
  newLine++;
@@ -41307,7 +41345,7 @@ const onChoicePlayerAnswered = async (command, playerChoice) => {
41307
41345
  await vmStore.addAndRunFrame(newStack);
41308
41346
  }
41309
41347
  };
41310
- function getChoiceOptionLineFromChoicePrompt(ctx2, choice) {
41348
+ function getChoiceOptionLineFromChoicePrompt(ctx, choice) {
41311
41349
  const generatedCode = `choicePrompt ${choice.code}`;
41312
41350
  const newLine = {
41313
41351
  code: generatedCode,
@@ -41494,7 +41532,6 @@ async function startApp(config2, options) {
41494
41532
  };
41495
41533
  window.narrat = narrat;
41496
41534
  }
41497
- startGameLoop();
41498
41535
  }
41499
41536
  class NarratPlugin {
41500
41537
  onPageLoaded() {