narrat 2.0.9 → 2.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,13 +681,13 @@ var _export_sfc = (sfc, props) => {
681
681
  }
682
682
  return target;
683
683
  };
684
- const _sfc_main$e = defineComponent({
684
+ const _sfc_main$g = defineComponent({
685
685
  props: {
686
686
  containerCssClass: String
687
687
  }
688
688
  });
689
- const _hoisted_1$d = { class: "modal-header" };
690
- const _hoisted_2$b = /* @__PURE__ */ createTextVNode(" default header ");
689
+ const _hoisted_1$e = { class: "modal-header" };
690
+ const _hoisted_2$c = /* @__PURE__ */ createTextVNode(" default header ");
691
691
  const _hoisted_3$7 = /* @__PURE__ */ createElementVNode("hr", { class: "solid" }, null, -1);
692
692
  const _hoisted_4$6 = { class: "modal-body" };
693
693
  const _hoisted_5$6 = /* @__PURE__ */ createTextVNode(" default body ");
@@ -703,13 +703,13 @@ 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"))
710
710
  }, "X"),
711
711
  renderSlot(_ctx.$slots, "header", {}, () => [
712
- _hoisted_2$b
712
+ _hoisted_2$c
713
713
  ]),
714
714
  _hoisted_3$7
715
715
  ]),
@@ -727,7 +727,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
727
727
  _: 3
728
728
  });
729
729
  }
730
- var Modal = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$d]]);
730
+ var Modal = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$d]]);
731
731
  function isArray(value) {
732
732
  return !Array.isArray ? getTag(value) === "[object Array]" : Array.isArray(value);
733
733
  }
@@ -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) {
@@ -37106,23 +37116,6 @@ const useInventory = defineStore("inventory", {
37106
37116
  }
37107
37117
  }
37108
37118
  });
37109
- const everyObject = (object, predicate) => {
37110
- for (const key in object) {
37111
- if (!predicate(object[key])) {
37112
- return false;
37113
- }
37114
- }
37115
- return true;
37116
- };
37117
- const filterObject = (object, predicate) => {
37118
- const result = {};
37119
- for (const key in object) {
37120
- if (predicate(object[key])) {
37121
- result[key] = object[key];
37122
- }
37123
- }
37124
- return result;
37125
- };
37126
37119
  const useQuests = defineStore("quests", {
37127
37120
  state: () => ({
37128
37121
  quests: {}
@@ -37212,7 +37205,7 @@ const useQuests = defineStore("quests", {
37212
37205
  if (!quest) {
37213
37206
  return false;
37214
37207
  }
37215
- return everyObject(quest.objectives, (objective) => objective.state === "completed");
37208
+ return quest.state === "completed";
37216
37209
  },
37217
37210
  isObjectiveCompleted(questId, objectiveId) {
37218
37211
  const objective = this.getObjective(questId, objectiveId);
@@ -37249,31 +37242,53 @@ const useQuests = defineStore("quests", {
37249
37242
  });
37250
37243
  const useScreens = defineStore("screens", {
37251
37244
  state: () => ({
37252
- currentScreen: "default",
37245
+ layers: ["default"],
37253
37246
  buttons: {}
37254
37247
  }),
37255
37248
  actions: {
37256
- setScreen(screen) {
37257
- this.currentScreen = screen;
37249
+ setScreen(screen, layer) {
37250
+ this.layers[layer || 0] = screen;
37251
+ },
37252
+ emptyLayer(layer) {
37253
+ delete this.layers[layer];
37258
37254
  },
37259
- setButtons(buttons) {
37260
- for (const i2 in buttons) {
37261
- this.buttons[i2] = {
37262
- enabled: buttons[i2].enabled
37255
+ setButtons(config2) {
37256
+ const { buttons: buttonsConfig, screens: screensConfig, images } = config2;
37257
+ for (const key in buttonsConfig) {
37258
+ this.buttons[key] = {
37259
+ state: buttonsConfig[key].enabled
37263
37260
  };
37264
37261
  }
37262
+ for (const key in screensConfig) {
37263
+ if (screensConfig[key].buttons) {
37264
+ const screen = screensConfig[key];
37265
+ if (screen.background && images[screen.background]) {
37266
+ screen.background = images[screen.background];
37267
+ }
37268
+ for (const index in screen.buttons) {
37269
+ const button = screen.buttons[index];
37270
+ if (typeof button === "object") {
37271
+ buttonsConfig[button.id] = button;
37272
+ screen.buttons[index] = button.id;
37273
+ this.buttons[button.id] = {
37274
+ state: button.enabled
37275
+ };
37276
+ }
37277
+ }
37278
+ }
37279
+ }
37265
37280
  },
37266
37281
  changeButton(button, newValue) {
37267
- this.buttons[button].enabled = newValue;
37282
+ this.buttons[button].state = newValue;
37268
37283
  },
37269
37284
  generateSaveData() {
37270
37285
  return {
37271
- currentScreen: this.currentScreen,
37286
+ layers: this.layers,
37272
37287
  buttons: this.buttons
37273
37288
  };
37274
37289
  },
37275
37290
  loadSaveData(data) {
37276
- this.currentScreen = data.currentScreen;
37291
+ this.layers = data.layers;
37277
37292
  this.buttons = cjs(this.buttons, data.buttons);
37278
37293
  }
37279
37294
  }
@@ -37360,41 +37375,41 @@ const loggerManager = new LogManager();
37360
37375
  loggerManager.setupDebugger(false);
37361
37376
  const logger = loggerManager.logger;
37362
37377
  function parseScript(errorHandler, code, fileName) {
37363
- const ctx2 = {
37378
+ const ctx = {
37364
37379
  fileName,
37365
37380
  currentLine: 0,
37366
- error: (line, text) => errorHandler(ctx2, line, text),
37381
+ error: (line, text) => errorHandler(ctx, line, text),
37367
37382
  processCommandsFunction: processCommands,
37368
37383
  indentSize: 0
37369
37384
  };
37370
- ctx2.indentSize = detectIndentation(ctx2, code);
37371
- const lines = findLines(ctx2, code);
37372
- ctx2.currentLine = 0;
37385
+ ctx.indentSize = detectIndentation(ctx, code);
37386
+ const lines = findLines(ctx, code);
37387
+ ctx.currentLine = 0;
37373
37388
  logger.log(lines);
37374
37389
  const script = {};
37375
37390
  for (const line of lines) {
37376
37391
  if (line.code.search(":") === -1) {
37377
- ctx2.error(line.line, `First indentation level should only be used to specify labels`);
37392
+ ctx.error(line.line, `First indentation level should only be used to specify labels`);
37378
37393
  }
37379
37394
  const labelString = line.code.replace(":", "");
37380
37395
  const labelWords = labelString.split(/ +/g);
37381
37396
  const labelName = labelWords[0];
37382
37397
  const labelArgs = labelWords.slice(1);
37383
37398
  if (!line.branch) {
37384
- ctx2.error(line.line, `This line should have a branch but doesn't`);
37399
+ ctx.error(line.line, `This line should have a branch but doesn't`);
37385
37400
  }
37386
37401
  script[labelName] = {
37387
- branch: processCommands(ctx2, line.branch, void 0),
37402
+ branch: processCommands(ctx, line.branch, void 0),
37388
37403
  args: labelArgs
37389
37404
  };
37390
37405
  }
37391
37406
  return script;
37392
37407
  }
37393
- function processCommands(ctx2, lines, parentLine) {
37394
- const startLine = ctx2.currentLine;
37408
+ function processCommands(ctx, lines, parentLine) {
37409
+ const startLine = ctx.currentLine;
37395
37410
  const branchContext = {
37396
37411
  processCommandsFunction: processCommands,
37397
- parserContext: ctx2,
37412
+ parserContext: ctx,
37398
37413
  lines,
37399
37414
  currentLine: 0,
37400
37415
  line: lines[0]
@@ -37405,13 +37420,13 @@ function processCommands(ctx2, lines, parentLine) {
37405
37420
  if (parentLine) {
37406
37421
  lineNumber = parentLine.line;
37407
37422
  }
37408
- ctx2.error(lineNumber, `Processing of command failed because the current branch has no lines inside`);
37423
+ ctx.error(lineNumber, `Processing of command failed because the current branch has no lines inside`);
37409
37424
  return [];
37410
37425
  }
37411
37426
  while (branchContext.currentLine < lines.length) {
37412
37427
  const line = lines[branchContext.currentLine];
37413
37428
  branchContext.line = line;
37414
- const parsed = parseExpression(ctx2, line, line.expression);
37429
+ const parsed = parseExpression(ctx, line, line.expression);
37415
37430
  const commandPlugin = vm.commands[parsed.command.operator];
37416
37431
  let parseFunction = commandPlugin == null ? void 0 : commandPlugin.parser;
37417
37432
  if (!parseFunction) {
@@ -37420,25 +37435,25 @@ function processCommands(ctx2, lines, parentLine) {
37420
37435
  logger.log(vm.commands.text);
37421
37436
  const { newLine } = parseFunction(branchContext, parsed);
37422
37437
  branchContext.currentLine = newLine;
37423
- ctx2.currentLine = startLine + newLine;
37438
+ ctx.currentLine = startLine + newLine;
37424
37439
  branch.push(parsed);
37425
37440
  }
37426
37441
  return branch;
37427
37442
  }
37428
- function parseExpression(ctx2, line, expression) {
37443
+ function parseExpression(ctx, line, expression) {
37429
37444
  logger.log(expression);
37430
37445
  if (typeof expression[0] !== "string") {
37431
- ctx2.error(line.line, `Expression operator should be a string`);
37446
+ ctx.error(line.line, `Expression operator should be a string`);
37432
37447
  }
37433
37448
  const parsed = {
37434
37449
  code: line.code,
37435
- fileName: ctx2.fileName,
37450
+ fileName: ctx.fileName,
37436
37451
  line: line.line,
37437
37452
  command: {
37438
37453
  staticOptions: {},
37439
37454
  commandType: expression[0],
37440
37455
  operator: expression[0],
37441
- args: expression.slice(1).map((arg) => parseArgument(ctx2, line, arg)),
37456
+ args: expression.slice(1).map((arg) => parseArgument(ctx, line, arg)),
37442
37457
  options: {}
37443
37458
  }
37444
37459
  };
@@ -37447,14 +37462,14 @@ function parseExpression(ctx2, line, expression) {
37447
37462
  if (!command) {
37448
37463
  const otherKeywords = ["else", "success", "failure"];
37449
37464
  if (!isParsedTokenString(firstElement) && !otherKeywords.includes(firstElement)) {
37450
- ctx2.error(line.line, `Unknown command ${firstElement}`);
37465
+ ctx.error(line.line, `Unknown command ${firstElement}`);
37451
37466
  }
37452
37467
  }
37453
37468
  return parsed;
37454
37469
  }
37455
- function parseArgument(ctx2, line, argument) {
37470
+ function parseArgument(ctx, line, argument) {
37456
37471
  if (Array.isArray(argument)) {
37457
- return parseExpression(ctx2, line, argument);
37472
+ return parseExpression(ctx, line, argument);
37458
37473
  } else {
37459
37474
  return argument;
37460
37475
  }
@@ -37469,12 +37484,12 @@ function parseTokenToPrimitive(value) {
37469
37484
  }
37470
37485
  return value;
37471
37486
  }
37472
- function parseCodeLine(ctx2, codeToProcess) {
37487
+ function parseCodeLine(ctx, codeToProcess) {
37473
37488
  if (codeToProcess.charAt(codeToProcess.length - 1) === ":") {
37474
37489
  codeToProcess = codeToProcess.substr(0, codeToProcess.length - 1);
37475
37490
  }
37476
37491
  const tokens = parseCodeLineIntoTokens(codeToProcess);
37477
- const [expression] = tokensToExpression(ctx2, tokens);
37492
+ const [expression] = tokensToExpression(ctx, tokens);
37478
37493
  return expression;
37479
37494
  }
37480
37495
  function parseCodeLineIntoTokens(code) {
@@ -37507,7 +37522,7 @@ function splitIntoTokens(code) {
37507
37522
  result = result.reduce((total, curr) => [...total, ...curr.split(/(\(|\))/g)].filter((el2) => el2 && el2), []);
37508
37523
  return result.map((token) => parseTokenToPrimitive(token));
37509
37524
  }
37510
- function tokensToExpression(ctx2, tokens) {
37525
+ function tokensToExpression(ctx, tokens) {
37511
37526
  logger.log("===============");
37512
37527
  let expression = [];
37513
37528
  let cursor = 0;
@@ -37520,7 +37535,7 @@ function tokensToExpression(ctx2, tokens) {
37520
37535
  const subExpressionString = tokens.slice(parenthesisIndex + 1);
37521
37536
  logger.log(`Found a sub expression. Before: ${expression} - After: ${subExpressionString}`);
37522
37537
  cursor = parenthesisIndex;
37523
- const [subExpression, subExpressionLength] = tokensToExpression(ctx2, subExpressionString);
37538
+ const [subExpression, subExpressionLength] = tokensToExpression(ctx, subExpressionString);
37524
37539
  const subExpressionEndIndex = cursor + subExpressionLength;
37525
37540
  expression.push(subExpression);
37526
37541
  cursor = subExpressionEndIndex + 1;
@@ -37540,19 +37555,19 @@ function tokensToExpression(ctx2, tokens) {
37540
37555
  }
37541
37556
  const endIndex = findExpressionEnd(tokens.slice(cursor)) + cursor;
37542
37557
  if (endIndex === -1) {
37543
- ctx2.error(ctx2.currentLine, `Expression is not closed (missing ")" closing parenthesis)`);
37558
+ ctx.error(ctx.currentLine, `Expression is not closed (missing ")" closing parenthesis)`);
37544
37559
  return [expression, endIndex];
37545
37560
  }
37546
37561
  const restOfString = tokens.slice(cursor, endIndex);
37547
37562
  logger.log(`End of expression: ${endIndex} - ${restOfString}`);
37548
37563
  logger.log("===================");
37549
37564
  expression = [...expression, ...restOfString];
37550
- validateExpression(ctx2, expression);
37565
+ validateExpression(ctx, expression);
37551
37566
  return [expression, endIndex + 1];
37552
37567
  }
37553
- function validateExpression(ctx2, expression) {
37568
+ function validateExpression(ctx, expression) {
37554
37569
  if (expression.length < 1) {
37555
- ctx2.error(ctx2.currentLine, `Expression is empty`);
37570
+ ctx.error(ctx.currentLine, `Expression is empty`);
37556
37571
  }
37557
37572
  }
37558
37573
  function findExpressionStart(tokens) {
@@ -37561,7 +37576,7 @@ function findExpressionStart(tokens) {
37561
37576
  function findExpressionEnd(tokens) {
37562
37577
  return tokens.findIndex((token) => token === ")");
37563
37578
  }
37564
- function findLines(ctx2, data) {
37579
+ function findLines(ctx, data) {
37565
37580
  const code = data.split(/\r?\n|$/).map((line) => {
37566
37581
  const commentIndex = line.search(/ *\/\//g);
37567
37582
  if (commentIndex !== -1) {
@@ -37569,10 +37584,10 @@ function findLines(ctx2, data) {
37569
37584
  }
37570
37585
  return line;
37571
37586
  });
37572
- const lines = findBranches(ctx2, code, 0, 0);
37587
+ const lines = findBranches(ctx, code, 0, 0);
37573
37588
  return lines.lines;
37574
37589
  }
37575
- function findBranches(ctx2, code, startLine, indentLevel) {
37590
+ function findBranches(ctx, code, startLine, indentLevel) {
37576
37591
  let stillInBranch = true;
37577
37592
  let currentLine = startLine;
37578
37593
  const lines = [];
@@ -37584,20 +37599,20 @@ function findBranches(ctx2, code, startLine, indentLevel) {
37584
37599
  if (lineText.search(/^\s*$/) !== -1) {
37585
37600
  currentLine++;
37586
37601
  } else {
37587
- const lineIndent = getIndentLevel(ctx2, lineText);
37588
- lineText = lineText.substring(lineIndent * ctx2.indentSize);
37589
- validateIndent(ctx2, lineIndent, currentLine);
37602
+ const lineIndent = getIndentLevel(ctx, lineText);
37603
+ lineText = lineText.substring(lineIndent * ctx.indentSize);
37604
+ validateIndent(ctx, lineIndent, currentLine);
37590
37605
  if (lineIndent < indentLevel) {
37591
37606
  stillInBranch = false;
37592
37607
  } else if (lineIndent > indentLevel) {
37593
37608
  if (lines.length === 0 || lineIndent - indentLevel !== 1) {
37594
- ctx2.error(currentLine, `Wrong double indentation`);
37609
+ ctx.error(currentLine, `Wrong double indentation`);
37595
37610
  }
37596
- const branchLines = findBranches(ctx2, code, currentLine, lineIndent);
37611
+ const branchLines = findBranches(ctx, code, currentLine, lineIndent);
37597
37612
  lines[lines.length - 1].branch = branchLines.lines;
37598
37613
  currentLine = branchLines.endLine;
37599
37614
  } else {
37600
- const expression = parseCodeLine(ctx2, lineText);
37615
+ const expression = parseCodeLine(ctx, lineText);
37601
37616
  const line = {
37602
37617
  code: lineText,
37603
37618
  indentation: lineIndent,
@@ -37606,7 +37621,7 @@ function findBranches(ctx2, code, startLine, indentLevel) {
37606
37621
  };
37607
37622
  lines.push(line);
37608
37623
  currentLine++;
37609
- ctx2.currentLine = currentLine;
37624
+ ctx.currentLine = currentLine;
37610
37625
  }
37611
37626
  }
37612
37627
  }
@@ -37615,19 +37630,19 @@ function findBranches(ctx2, code, startLine, indentLevel) {
37615
37630
  endLine: currentLine
37616
37631
  };
37617
37632
  }
37618
- function validateIndent(ctx2, indentLevel, currentIndex) {
37633
+ function validateIndent(ctx, indentLevel, currentIndex) {
37619
37634
  if (indentLevel % 1 !== 0) {
37620
- ctx2.error(currentIndex, `Indentation level of ${indentLevel} incorrect. Expected indentation of ${ctx2.indentSize} spaces for this file.`);
37635
+ ctx.error(currentIndex, `Indentation level of ${indentLevel} incorrect. Expected indentation of ${ctx.indentSize} spaces for this file.`);
37621
37636
  }
37622
37637
  }
37623
- function getIndentLevel(ctx2, line) {
37624
- return line.search(/[^ ]/) / ctx2.indentSize;
37638
+ function getIndentLevel(ctx, line) {
37639
+ return line.search(/[^ ]/) / ctx.indentSize;
37625
37640
  }
37626
- function detectIndentation(ctx2, script) {
37641
+ function detectIndentation(ctx, script) {
37627
37642
  const regex = /\n( *)/;
37628
37643
  const result = script.match(regex);
37629
37644
  if (!result || result.length < 2) {
37630
- ctx2.error(0, `Can't detect indentation level. Make sure you indent with at least 2 spaces and consistently`);
37645
+ ctx.error(0, `Can't detect indentation level. Make sure you indent with at least 2 spaces and consistently`);
37631
37646
  return 0;
37632
37647
  }
37633
37648
  logger.log(result);
@@ -37693,7 +37708,7 @@ const useVM = defineStore("vm", {
37693
37708
  const file = files[index];
37694
37709
  scripts = {
37695
37710
  ...scripts,
37696
- ...parseScript((ctx2, line, error2) => parserError(ctx2, line, error2), file, scriptPaths[index])
37711
+ ...parseScript((ctx, line, error2) => parserError(ctx, line, error2), file, scriptPaths[index])
37697
37712
  };
37698
37713
  }
37699
37714
  const end = Date.now();
@@ -38279,7 +38294,7 @@ const useMain = defineStore("main", {
38279
38294
  }
38280
38295
  await useVM().loadScripts(scriptPaths);
38281
38296
  const screens = useScreens();
38282
- screens.setButtons(config2.buttons);
38297
+ screens.setButtons(config2);
38283
38298
  const skillsStore = useSkills();
38284
38299
  skillsStore.setupSkills(config2.skills);
38285
38300
  const hudStore = useHud();
@@ -38446,11 +38461,16 @@ const useMain = defineStore("main", {
38446
38461
  Object.assign(states[key], stateOverride);
38447
38462
  }
38448
38463
  }
38464
+ },
38465
+ getters: {
38466
+ isInGame(state) {
38467
+ return state.flowState === "playing";
38468
+ }
38449
38469
  }
38450
38470
  });
38451
- function parserError(ctx2, line, text) {
38452
- console.error(`Parser error: ${ctx2.fileName}:${ctx2.currentLine}`, text);
38453
- const errorText = `[Parser Error] in <span class="error-filename">${ctx2.fileName}:${line + 1}</span> - <b>${text}</b>`;
38471
+ function parserError(ctx, line, text) {
38472
+ console.error(`Parser error: ${ctx.fileName}:${ctx.currentLine}`, text);
38473
+ const errorText = `[Parser Error] in <span class="error-filename">${ctx.fileName}:${line + 1}</span> - <b>${text}</b>`;
38454
38474
  error(errorText);
38455
38475
  }
38456
38476
  function error(text) {
@@ -38541,7 +38561,7 @@ const useSkills = defineStore("skills", {
38541
38561
  });
38542
38562
  var debugMenu_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".debug-menu{z-index:9999}.debug-button{position:fixed;bottom:10px;right:10px;padding:5px}.error-message{color:#ff4500;margin-top:10px;margin-bottom:10px}.error-filename{color:gray;text-decoration:underline}.debug-menu-container{width:100%}.search-result{border:1px solid var(--text-color);padding:10px;font-weight:700;font-size:20px;width:100}.jump-menu-container{width:80%}.debug-info{position:fixed;background-color:#0009;border:1px dotted var(--text-color);top:0;left:0;padding:5px}.variables-viewer{height:100%}\n")();
38543
38563
  let fuse;
38544
- const _sfc_main$d = defineComponent({
38564
+ const _sfc_main$f = defineComponent({
38545
38565
  components: {
38546
38566
  Modal
38547
38567
  },
@@ -38770,8 +38790,8 @@ const _sfc_main$d = defineComponent({
38770
38790
  }
38771
38791
  }
38772
38792
  });
38773
- const _hoisted_1$c = { class: "debug-menu" };
38774
- const _hoisted_2$a = {
38793
+ const _hoisted_1$d = { class: "debug-menu" };
38794
+ const _hoisted_2$b = {
38775
38795
  key: 0,
38776
38796
  class: "debug-info"
38777
38797
  };
@@ -38795,7 +38815,7 @@ const _hoisted_5$5 = [
38795
38815
  _hoisted_4$5
38796
38816
  ];
38797
38817
  const _hoisted_6$5 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Jump to label", -1);
38798
- const _hoisted_7$5 = {
38818
+ const _hoisted_7$4 = {
38799
38819
  key: 0,
38800
38820
  class: "search-results"
38801
38821
  };
@@ -38833,12 +38853,12 @@ const _hoisted_26 = /* @__PURE__ */ createElementVNode("h3", { style: { "color":
38833
38853
  const _hoisted_27 = { ref: "stateViewer" };
38834
38854
  function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
38835
38855
  const _component_modal = resolveComponent("modal");
38836
- return openBlock(), createElementBlock("div", _hoisted_1$c, [
38856
+ return openBlock(), createElementBlock("div", _hoisted_1$d, [
38837
38857
  createElementVNode("button", {
38838
38858
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.open && _ctx.open(...args)),
38839
38859
  class: "button debug-button"
38840
38860
  }, "Debug Menu"),
38841
- !_ctx.playing && _ctx.flowState === "menu" ? (openBlock(), createElementBlock("div", _hoisted_2$a, _hoisted_5$5)) : createCommentVNode("", true),
38861
+ !_ctx.playing && _ctx.flowState === "menu" ? (openBlock(), createElementBlock("div", _hoisted_2$b, _hoisted_5$5)) : createCommentVNode("", true),
38842
38862
  _ctx.jumping ? (openBlock(), createBlock(_component_modal, {
38843
38863
  key: 1,
38844
38864
  onClose: _ctx.finishJumping,
@@ -38857,7 +38877,7 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
38857
38877
  }, null, 544), [
38858
38878
  [vModelText, _ctx.searchString]
38859
38879
  ]),
38860
- _ctx.matches.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$5, [
38880
+ _ctx.matches.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$4, [
38861
38881
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.matches, (match, index) => {
38862
38882
  return openBlock(), createElementBlock("div", {
38863
38883
  class: "search-result",
@@ -38951,9 +38971,9 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
38951
38971
  }, 8, ["onClose"])) : createCommentVNode("", true)
38952
38972
  ]);
38953
38973
  }
38954
- var DebugMenu = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$c]]);
38974
+ var DebugMenu = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$c]]);
38955
38975
  var volumeControls_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".volume-label{margin-right:10px;font-size:20px;font-weight:700}.volume-controls{font-size:25px;display:flex;align-items:center;justify-content:center;margin:0 20px}.volume-slider{width:200px;background-color:#00f}\n")();
38956
- const _sfc_main$c = defineComponent({
38976
+ const _sfc_main$e = defineComponent({
38957
38977
  data() {
38958
38978
  return {
38959
38979
  muted: false
@@ -38979,14 +38999,14 @@ const _sfc_main$c = defineComponent({
38979
38999
  }
38980
39000
  }
38981
39001
  });
38982
- const _hoisted_1$b = { class: "volume-controls" };
38983
- const _hoisted_2$9 = /* @__PURE__ */ createElementVNode("label", {
39002
+ const _hoisted_1$c = { class: "volume-controls" };
39003
+ const _hoisted_2$a = /* @__PURE__ */ createElementVNode("label", {
38984
39004
  for: "volume",
38985
39005
  class: "volume-label"
38986
39006
  }, "Volume", -1);
38987
39007
  function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
38988
- return openBlock(), createElementBlock("div", _hoisted_1$b, [
38989
- _hoisted_2$9,
39008
+ return openBlock(), createElementBlock("div", _hoisted_1$c, [
39009
+ _hoisted_2$a,
38990
39010
  createElementVNode("input", {
38991
39011
  ref: "slider",
38992
39012
  class: "volume-slider",
@@ -39001,9 +39021,9 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
39001
39021
  }, null, 544)
39002
39022
  ]);
39003
39023
  }
39004
- var VolumeControls = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$b]]);
39024
+ var VolumeControls = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$b]]);
39005
39025
  var hud_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".hud{position:absolute;right:0;top:0;display:flex;flex-direction:row-reverse;z-index:3}.hud-stat{border:1px dotted white;background-color:var(--hud-background);color:var(--hud-text-color);padding:5px}.hud-icon{display:inline-block;height:1em}.hud-text{margin-left:5px}\n")();
39006
- const _sfc_main$b = defineComponent({
39026
+ const _sfc_main$d = defineComponent({
39007
39027
  components: {
39008
39028
  VolumeControls
39009
39029
  },
@@ -39031,8 +39051,8 @@ const _sfc_main$b = defineComponent({
39031
39051
  }
39032
39052
  }
39033
39053
  });
39034
- const _hoisted_1$a = ["src"];
39035
- const _hoisted_2$8 = { class: "bold hud-text" };
39054
+ const _hoisted_1$b = ["src"];
39055
+ const _hoisted_2$9 = { class: "bold hud-text" };
39036
39056
  const _hoisted_3$5 = /* @__PURE__ */ createTextVNode(": ");
39037
39057
  function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
39038
39058
  return openBlock(), createElementBlock("div", {
@@ -39047,17 +39067,17 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
39047
39067
  createElementVNode("img", {
39048
39068
  class: "hud-icon",
39049
39069
  src: _ctx.statsConfig[key].icon
39050
- }, null, 8, _hoisted_1$a),
39051
- createElementVNode("span", _hoisted_2$8, toDisplayString(_ctx.statsConfig[key].name), 1),
39070
+ }, null, 8, _hoisted_1$b),
39071
+ createElementVNode("span", _hoisted_2$9, toDisplayString(_ctx.statsConfig[key].name), 1),
39052
39072
  _hoisted_3$5,
39053
39073
  createElementVNode("span", null, toDisplayString(Math.floor(stat.value * 100) / 100), 1)
39054
39074
  ]);
39055
39075
  }), 128))
39056
39076
  ], 4);
39057
39077
  }
39058
- var Hud = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$a]]);
39078
+ var Hud = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$a]]);
39059
39079
  var loadingBar_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => "#loading-bar{position:relative;width:40vw;height:100px;border-radius:50px;background:black}#inner-loading-bar{height:100%;border-radius:50px 0 0 50px;background:var(--light-background)}#loading-text{z-index:99999;display:flex;align-items:center;justify-content:space-around;position:absolute;width:100%;height:100%;top:0}\n")();
39060
- const _sfc_main$a = defineComponent({
39080
+ const _sfc_main$c = defineComponent({
39061
39081
  props: {
39062
39082
  percentage: Number,
39063
39083
  step: String
@@ -39073,22 +39093,22 @@ const _sfc_main$a = defineComponent({
39073
39093
  },
39074
39094
  computed: {}
39075
39095
  });
39076
- const _hoisted_1$9 = { id: "loading-bar" };
39077
- const _hoisted_2$7 = { id: "loading-text" };
39096
+ const _hoisted_1$a = { id: "loading-bar" };
39097
+ const _hoisted_2$8 = { id: "loading-text" };
39078
39098
  function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
39079
- return openBlock(), createElementBlock("div", _hoisted_1$9, [
39099
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
39080
39100
  createElementVNode("div", {
39081
39101
  id: "inner-loading-bar",
39082
39102
  style: normalizeStyle(_ctx.loadingStyle())
39083
39103
  }, null, 4),
39084
- createElementVNode("div", _hoisted_2$7, [
39104
+ createElementVNode("div", _hoisted_2$8, [
39085
39105
  createElementVNode("h3", null, "Loading " + toDisplayString(Math.floor(_ctx.percentage * 100)) + "% - " + toDisplayString(_ctx.step), 1)
39086
39106
  ])
39087
39107
  ]);
39088
39108
  }
39089
- var LoadingBar = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$9]]);
39109
+ var LoadingBar = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$9]]);
39090
39110
  var notificationToast_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".notifications-holder{position:fixed;top:0;right:0;padding:10px;display:flex;flex-direction:column-reverse;align-items:center;pointer-events:none}.notification{margin-top:10px;margin-bottom:10px;border-radius:10px;padding:15px;background:var(--notifications-bg);width:40vh;text-align:center}\n")();
39091
- const _sfc_main$9 = defineComponent({
39111
+ const _sfc_main$b = defineComponent({
39092
39112
  data() {
39093
39113
  },
39094
39114
  methods: {},
@@ -39115,7 +39135,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
39115
39135
  _: 1
39116
39136
  });
39117
39137
  }
39118
- var NotificationToast = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$8]]);
39138
+ var NotificationToast = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$8]]);
39119
39139
  let config;
39120
39140
  function setCharactersConfig(data) {
39121
39141
  config = data;
@@ -39144,22 +39164,6 @@ function aspectRatioFit(screenWidth, screenHeight, gameWidth, gameHeight) {
39144
39164
  const bestRatio = Math.min(widthRatio, heightRatio);
39145
39165
  return bestRatio;
39146
39166
  }
39147
- function screenToCanvas(x2, y2, element) {
39148
- const rect = element.getBoundingClientRect();
39149
- const ratio = element.width / rect.width;
39150
- const canvasX = x2 - rect.x;
39151
- const canvasY = y2 - rect.y;
39152
- const scaledX = canvasX * ratio;
39153
- const scaledY = canvasY * ratio;
39154
- return {
39155
- x: scaledX,
39156
- y: scaledY
39157
- };
39158
- }
39159
- function aabb(ax2, ay2, aw2, ah2, bx2, by2, bw2, bh2) {
39160
- return !(ax2 + aw2 < bx2 || ay2 + ah2 < by2 || ax2 > bx2 + bw2 || ay2 > by2 + bh2);
39161
- }
39162
- const images = {};
39163
39167
  let imagesToLoad = 0;
39164
39168
  let imagesLoaded = 0;
39165
39169
  function loadImages(config2) {
@@ -39177,7 +39181,6 @@ function loadImage(key, path, resolver, rejecter) {
39177
39181
  const image = new Image();
39178
39182
  image.onload = () => {
39179
39183
  imagesLoaded += 1;
39180
- images[key] = image;
39181
39184
  logger$1.log(`Loaded image ${key} successfully`);
39182
39185
  if (imagesLoaded >= imagesToLoad) {
39183
39186
  logger$1.log(`All images loaded`);
@@ -39243,7 +39246,7 @@ function debounce(func, waitMilliseconds = 50, options = {}) {
39243
39246
  return debouncedFunction;
39244
39247
  }
39245
39248
  var MainMenu_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".quit-button{margin:20px;text-align:center}\n")();
39246
- const _sfc_main$8 = defineComponent({
39249
+ const _sfc_main$a = defineComponent({
39247
39250
  components: {
39248
39251
  Modal,
39249
39252
  VolumeControls
@@ -39273,8 +39276,8 @@ const _sfc_main$8 = defineComponent({
39273
39276
  ...mapState(useMain, ["playTime"])
39274
39277
  }
39275
39278
  });
39276
- const _hoisted_1$8 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Menu", -1);
39277
- const _hoisted_2$6 = { class: "menu-content" };
39279
+ const _hoisted_1$9 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Menu", -1);
39280
+ const _hoisted_2$7 = { class: "menu-content" };
39278
39281
  function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
39279
39282
  const _component_VolumeControls = resolveComponent("VolumeControls");
39280
39283
  const _component_modal = resolveComponent("modal");
@@ -39284,10 +39287,10 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
39284
39287
  containerCssClass: "menu-modal"
39285
39288
  }, {
39286
39289
  header: withCtx(() => [
39287
- _hoisted_1$8
39290
+ _hoisted_1$9
39288
39291
  ]),
39289
39292
  body: withCtx(() => [
39290
- createElementVNode("div", _hoisted_2$6, [
39293
+ createElementVNode("div", _hoisted_2$7, [
39291
39294
  createElementVNode("h3", null, "Play time: " + toDisplayString(_ctx.getPlayTimeString()), 1),
39292
39295
  createVNode(_component_VolumeControls),
39293
39296
  createElementVNode("button", {
@@ -39303,9 +39306,9 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
39303
39306
  _: 1
39304
39307
  });
39305
39308
  }
39306
- var MainMenu = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7]]);
39309
+ var MainMenu = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$7]]);
39307
39310
  var Skills_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".skills-modal{width:800px}.skills-container{display:grid;grid-auto-rows:auto;grid-template-columns:repeat(3,1fr);grid-gap:20px 20px}.skill-display{width:200px;height:300px;position:relative;background-size:cover}.skill-title{position:absolute;bottom:0px;text-align:center;width:100%;color:var(--skills-text-color);background:var(--skills-text-background)}.skill-level{position:absolute;top:0;right:0;font-weight:700;font-size:25px;color:var(--skills-level-color);width:var(--skills-xp-bar-height);height:var(--skills-xp-bar-height);background-color:var(--skills-level-background)}.skill-description-container{justify-content:space-between;align-items:stretch}.skill-left{flex-direction:column;border:1px dashed white;padding:10px;justify-content:center}.skill-right{border:1px dashed white;flex-direction:column;flex-grow:2;align-items:baseline}.skill-xp-container{position:absolute;top:0;left:0;height:var(--skills-xp-bar-height);width:calc(100% - var(--skills-xp-bar-height));background-color:#00000080}.skill-xp-bar{position:absolute;top:0;left:0;width:50%;height:100%;background-color:#0000fa80}.skill-xp-text{z-index:2}\n")();
39308
- const _sfc_main$7 = defineComponent({
39311
+ const _sfc_main$9 = defineComponent({
39309
39312
  setup() {
39310
39313
  const store = useSkills();
39311
39314
  const skills = computed(() => store.skills);
@@ -39362,8 +39365,8 @@ const _sfc_main$7 = defineComponent({
39362
39365
  }
39363
39366
  }
39364
39367
  });
39365
- const _hoisted_1$7 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Skills", -1);
39366
- const _hoisted_2$5 = {
39368
+ const _hoisted_1$8 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Skills", -1);
39369
+ const _hoisted_2$6 = {
39367
39370
  key: 0,
39368
39371
  class: "skills-container"
39369
39372
  };
@@ -39371,7 +39374,7 @@ const _hoisted_3$4 = ["onClick"];
39371
39374
  const _hoisted_4$4 = { class: "skill-title" };
39372
39375
  const _hoisted_5$4 = { class: "skill-xp-container" };
39373
39376
  const _hoisted_6$4 = { class: "skill-xp-text" };
39374
- const _hoisted_7$4 = { class: "skill-level" };
39377
+ const _hoisted_7$3 = { class: "skill-level" };
39375
39378
  const _hoisted_8$3 = { key: 1 };
39376
39379
  const _hoisted_9$1 = { class: "flex flex-row skill-description-container" };
39377
39380
  const _hoisted_10$1 = { class: "flex skill-left" };
@@ -39385,10 +39388,10 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
39385
39388
  containerCssClass: "skills-modal"
39386
39389
  }, {
39387
39390
  header: withCtx(() => [
39388
- _hoisted_1$7
39391
+ _hoisted_1$8
39389
39392
  ]),
39390
39393
  body: withCtx(() => [
39391
- !_ctx.chosenSkill ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
39394
+ !_ctx.chosenSkill ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
39392
39395
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.skillsToDisplay, (skill) => {
39393
39396
  return openBlock(), createElementBlock("button", {
39394
39397
  onClick: () => _ctx.clickSkill(skill.id),
@@ -39404,7 +39407,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
39404
39407
  }, null, 4),
39405
39408
  createElementVNode("h3", _hoisted_6$4, toDisplayString(skill.xp) + " / " + toDisplayString(_ctx.xpPerLevel) + " XP", 1)
39406
39409
  ]),
39407
- createElementVNode("h3", _hoisted_7$4, toDisplayString(skill.level), 1)
39410
+ createElementVNode("h3", _hoisted_7$3, toDisplayString(skill.level), 1)
39408
39411
  ], 12, _hoisted_3$4);
39409
39412
  }), 128))
39410
39413
  ])) : typeof _ctx.chosenSkill === "string" ? (openBlock(), createElementBlock("div", _hoisted_8$3, [
@@ -39431,9 +39434,9 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
39431
39434
  _: 1
39432
39435
  });
39433
39436
  }
39434
- var Skills = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6]]);
39437
+ var Skills = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$6]]);
39435
39438
  var inventoryUi_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".inventory-modal{width:800px;min-height:50%}.inventory-container{display:grid;grid-auto-rows:auto;grid-template-columns:repeat(3,1fr);grid-gap:20px 20px}.item-display{width:200px;height:300px;position:relative;background-repeat:no-repeat;background-size:contain}.item-title{position:absolute;bottom:0px;text-align:center;width:100%;color:var(--inventory-text-color);background:var(--inventory-text-background)}.item-amount{position:absolute;top:0;right:0;font-weight:700;font-size:25px;color:var(--inventory-amount-color);width:40px;height:40px;background-color:var(--inventory-amount-background)}.item-description-container{justify-content:space-between;align-items:stretch}.item-left{border:1px dashed white;flex-direction:column;padding:10px;justify-content:center}.item-right{border:1px dashed white;flex-direction:column;flex-grow:2;align-items:baseline;padding:10px}\n")();
39436
- const _sfc_main$6 = defineComponent({
39439
+ const _sfc_main$8 = defineComponent({
39437
39440
  setup() {
39438
39441
  const store = useInventory();
39439
39442
  const dialogStore = useDialogStore();
@@ -39523,8 +39526,8 @@ const _sfc_main$6 = defineComponent({
39523
39526
  }
39524
39527
  }
39525
39528
  });
39526
- const _hoisted_1$6 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Inventory", -1);
39527
- const _hoisted_2$4 = {
39529
+ const _hoisted_1$7 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Inventory", -1);
39530
+ const _hoisted_2$5 = {
39528
39531
  key: 0,
39529
39532
  class: "inventory-container"
39530
39533
  };
@@ -39532,7 +39535,7 @@ const _hoisted_3$3 = ["onClick"];
39532
39535
  const _hoisted_4$3 = { class: "item-title" };
39533
39536
  const _hoisted_5$3 = { class: "item-amount" };
39534
39537
  const _hoisted_6$3 = { key: 1 };
39535
- const _hoisted_7$3 = { class: "flex flex-row item-description-container" };
39538
+ const _hoisted_7$2 = { class: "flex flex-row item-description-container" };
39536
39539
  const _hoisted_8$2 = { class: "flex item-left" };
39537
39540
  const _hoisted_9 = { class: "flex item-right" };
39538
39541
  const _hoisted_10 = /* @__PURE__ */ createElementVNode("hr", { class: "hr-solid" }, null, -1);
@@ -39549,10 +39552,10 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
39549
39552
  containerCssClass: "inventory-modal"
39550
39553
  }, {
39551
39554
  header: withCtx(() => [
39552
- _hoisted_1$6
39555
+ _hoisted_1$7
39553
39556
  ]),
39554
39557
  body: withCtx(() => [
39555
- !_ctx.chosenItem && Object.keys(_ctx.itemsToDisplay).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
39558
+ !_ctx.chosenItem && Object.keys(_ctx.itemsToDisplay).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
39556
39559
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.itemsToDisplay, (item) => {
39557
39560
  return openBlock(), createElementBlock("button", {
39558
39561
  onClick: () => _ctx.clickItem(item.id),
@@ -39565,7 +39568,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
39565
39568
  ], 12, _hoisted_3$3);
39566
39569
  }), 128))
39567
39570
  ])) : typeof _ctx.chosenId === "string" ? (openBlock(), createElementBlock("div", _hoisted_6$3, [
39568
- createElementVNode("div", _hoisted_7$3, [
39571
+ createElementVNode("div", _hoisted_7$2, [
39569
39572
  createElementVNode("div", _hoisted_8$2, [
39570
39573
  createElementVNode("div", {
39571
39574
  class: "item-display",
@@ -39592,9 +39595,9 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
39592
39595
  _: 1
39593
39596
  }, 8, ["onClose"]);
39594
39597
  }
39595
- var InventoryUi = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5]]);
39598
+ var InventoryUi = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$5]]);
39596
39599
  var dialogPicture_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".dialog-picture{position:absolute;width:80px;height:80px;border:2px solid white;border-radius:10px;background-color:gray;z-index:99}.dialog-picture img{width:100%;height:100%}\n")();
39597
- const _sfc_main$5 = defineComponent({
39600
+ const _sfc_main$7 = defineComponent({
39598
39601
  props: {
39599
39602
  pictureUrl: String
39600
39603
  },
@@ -39620,7 +39623,7 @@ const _sfc_main$5 = defineComponent({
39620
39623
  }
39621
39624
  }
39622
39625
  });
39623
- const _hoisted_1$5 = ["src"];
39626
+ const _hoisted_1$6 = ["src"];
39624
39627
  function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
39625
39628
  return openBlock(), createElementBlock("div", {
39626
39629
  class: "dialog-picture override",
@@ -39629,12 +39632,12 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
39629
39632
  createElementVNode("img", {
39630
39633
  src: _ctx.pictureUrl,
39631
39634
  class: "picture override"
39632
- }, null, 8, _hoisted_1$5)
39635
+ }, null, 8, _hoisted_1$6)
39633
39636
  ], 4);
39634
39637
  }
39635
- var DialogPicture = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4]]);
39638
+ var DialogPicture = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$4]]);
39636
39639
  var dialogBox_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".dialog-title{font-size:20px;font-weight:700}.dialog-text{font-size:16px}.dialog-box{color:var(--text-color);padding:10px 10px 10px 2em;margin-bottom:10px}.dialog-choice{color:var(--dialog-choice-color)}.dialog-choice:hover{color:var(--dialog-choice-hover-color);cursor:pointer}.buttons-container{width:100%;padding:10px;display:flex;justify-content:space-evenly;align-items:stretch;box-sizing:border-box}.interact-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;height:50px;color:var(--text-color);border:1px solid black;font-weight:700;font-size:24px;text-align:center;flex-grow:2;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.interact-button:not(:last-child){margin-right:10px}\n")();
39637
- const _sfc_main$4 = defineComponent({
39640
+ const _sfc_main$6 = defineComponent({
39638
39641
  data() {
39639
39642
  return {
39640
39643
  playerText: "",
@@ -39776,8 +39779,8 @@ const _sfc_main$4 = defineComponent({
39776
39779
  }
39777
39780
  }
39778
39781
  });
39779
- const _hoisted_1$4 = { class: "dialog-content" };
39780
- const _hoisted_2$3 = ["innerHTML"];
39782
+ const _hoisted_1$5 = { class: "dialog-content" };
39783
+ const _hoisted_2$4 = ["innerHTML"];
39781
39784
  const _hoisted_3$2 = ["innerHTML"];
39782
39785
  const _hoisted_4$2 = ["innerHTML"];
39783
39786
  const _hoisted_5$2 = {
@@ -39785,7 +39788,7 @@ const _hoisted_5$2 = {
39785
39788
  class: "dialog-choices"
39786
39789
  };
39787
39790
  const _hoisted_6$2 = ["onClick", "innerHTML"];
39788
- const _hoisted_7$2 = { key: 2 };
39791
+ const _hoisted_7$1 = { key: 2 };
39789
39792
  const _hoisted_8$1 = {
39790
39793
  key: 3,
39791
39794
  class: "buttons-container"
@@ -39795,13 +39798,13 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
39795
39798
  class: "dialog-box w-full override",
39796
39799
  style: normalizeStyle(_ctx.dialogBoxStyle)
39797
39800
  }, [
39798
- createElementVNode("div", _hoisted_1$4, [
39801
+ createElementVNode("div", _hoisted_1$5, [
39799
39802
  _ctx.options.title ? (openBlock(), createElementBlock("span", {
39800
39803
  key: 0,
39801
39804
  class: "dialog-title override",
39802
39805
  style: normalizeStyle(_ctx.titleStyle),
39803
39806
  innerHTML: _ctx.options.title
39804
- }, null, 12, _hoisted_2$3)) : createCommentVNode("", true),
39807
+ }, null, 12, _hoisted_2$4)) : createCommentVNode("", true),
39805
39808
  createElementVNode("span", {
39806
39809
  class: "dialog-text dialog-separator override",
39807
39810
  style: normalizeStyle(_ctx.textStyle),
@@ -39822,7 +39825,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
39822
39825
  innerHTML: `${index + 1}. \u2013\xA0 ${choice.choice}`
39823
39826
  }, null, 14, _hoisted_6$2);
39824
39827
  }), 128))
39825
- ])) : _ctx.canInteract && _ctx.options.textField ? (openBlock(), createElementBlock("div", _hoisted_7$2, [
39828
+ ])) : _ctx.canInteract && _ctx.options.textField ? (openBlock(), createElementBlock("div", _hoisted_7$1, [
39826
39829
  withDirectives(createElementVNode("input", {
39827
39830
  type: "text",
39828
39831
  class: "label-input input",
@@ -39846,10 +39849,10 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
39846
39849
  ])
39847
39850
  ], 4);
39848
39851
  }
39849
- var DialogBox = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3]]);
39852
+ var DialogBox = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$3]]);
39850
39853
  var gameDialog_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".dialog-container{flex-shrink:2;min-height:100%;width:100%;background-color:(var(--bg-color));box-sizing:border-box;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;overflow-x:hidden}.dialog{overflow-y:auto;overflow-x:hidden;position:relative;-ms-overflow-style:none;scrollbar-width:none}.dialog::-webkit-scrollbar{display:none}.dialog *{overflow-anchor:none}.anchor{overflow-anchor:auto;height:1px}\n")();
39851
- const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("div", { class: "anchor" }, null, -1);
39852
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
39854
+ const _hoisted_1$4 = /* @__PURE__ */ createElementVNode("div", { class: "anchor" }, null, -1);
39855
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
39853
39856
  __name: "game-dialog",
39854
39857
  props: {
39855
39858
  layoutMode: String,
@@ -39968,14 +39971,23 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
39968
39971
  ]),
39969
39972
  _: 1
39970
39973
  }, 8, ["style"]),
39971
- _hoisted_1$3
39974
+ _hoisted_1$4
39972
39975
  ], 4)) : createCommentVNode("", true)
39973
39976
  ], 64);
39974
39977
  };
39975
39978
  }
39976
39979
  });
39980
+ const filterObject = (object, predicate) => {
39981
+ const result = {};
39982
+ for (const key in object) {
39983
+ if (predicate(object[key])) {
39984
+ result[key] = object[key];
39985
+ }
39986
+ }
39987
+ return result;
39988
+ };
39977
39989
  var questsUi_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".quests-modal{width:100%;min-height:50%}.quest-header{display:flex;flex-direction:row;align-items:center}.quest-title{font-size:1.5rem;font-weight:700;margin-bottom:.5rem}.quest-completed{color:var(--completed-quest-title-color)}.quest-in-progress{color:var(--quest-title-color)}.quest-state{font-size:1.25rem;font-weight:700;margin-bottom:.5rem}.quest-description{font-size:1.1rem;text-align:justify;font-style:italic;margin-bottom:.5rem}.quest-objectives-container{margin-left:10px}.quest-objective-completed{color:var(--objective-completed-color);text-decoration:line-through}.quest-objective-in-progress{color:var(--objective-in-progress-color)}.quest-objective-description{font-size:1rem;margin-bottom:.5rem}\n")();
39978
- const _sfc_main$2 = defineComponent({
39990
+ const _sfc_main$4 = defineComponent({
39979
39991
  setup() {
39980
39992
  const questsStore = useQuests();
39981
39993
  const quests = computed(() => questsStore.quests);
@@ -40024,8 +40036,8 @@ const _sfc_main$2 = defineComponent({
40024
40036
  Modal
40025
40037
  }
40026
40038
  });
40027
- const _hoisted_1$2 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Quests", -1);
40028
- const _hoisted_2$2 = {
40039
+ const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("h3", { class: "title" }, "Quests", -1);
40040
+ const _hoisted_2$3 = {
40029
40041
  key: 0,
40030
40042
  class: "quests-container"
40031
40043
  };
@@ -40039,9 +40051,9 @@ const _hoisted_6$1 = {
40039
40051
  key: 1,
40040
40052
  class: "menu-container"
40041
40053
  };
40042
- const _hoisted_7$1 = /* @__PURE__ */ createElementVNode("h2", { class: "title" }, "There are no quests!", -1);
40054
+ const _hoisted_7 = /* @__PURE__ */ createElementVNode("h2", { class: "title" }, "There are no quests!", -1);
40043
40055
  const _hoisted_8 = [
40044
- _hoisted_7$1
40056
+ _hoisted_7
40045
40057
  ];
40046
40058
  function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
40047
40059
  const _component_modal = resolveComponent("modal");
@@ -40051,10 +40063,10 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
40051
40063
  containerCssClass: "quests-modal"
40052
40064
  }, {
40053
40065
  header: withCtx(() => [
40054
- _hoisted_1$2
40066
+ _hoisted_1$3
40055
40067
  ]),
40056
40068
  body: withCtx(() => [
40057
- Object.keys(_ctx.questsToDisplay).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
40069
+ Object.keys(_ctx.questsToDisplay).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
40058
40070
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.questsToDisplay, (quest) => {
40059
40071
  return openBlock(), createElementBlock("div", {
40060
40072
  class: "quest-display",
@@ -40091,9 +40103,9 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
40091
40103
  _: 1
40092
40104
  }, 8, ["onClose"]);
40093
40105
  }
40094
- var QuestsUi = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
40106
+ var QuestsUi = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$2]]);
40095
40107
  var menuButtons_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".menu-content{text-align:center}.menu-toggle-button{margin:0;padding:2px;border-radius:5px}.menu-toggle-button:not(:last-child){margin-right:10px}.menu-modal{width:500px}\n")();
40096
- const _sfc_main$1 = defineComponent({
40108
+ const _sfc_main$3 = defineComponent({
40097
40109
  data() {
40098
40110
  return {
40099
40111
  buttons: [
@@ -40199,21 +40211,174 @@ const _sfc_main$1 = defineComponent({
40199
40211
  }
40200
40212
  }
40201
40213
  });
40202
- const _hoisted_1$1 = { class: "menu-container" };
40203
- const _hoisted_2$1 = ["onClick", "id"];
40214
+ const _hoisted_1$2 = { class: "menu-container" };
40215
+ const _hoisted_2$2 = ["onClick", "id"];
40204
40216
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
40205
- return openBlock(), createElementBlock("div", _hoisted_1$1, [
40217
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
40206
40218
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.buttonsToShow, (buttonConf) => {
40207
40219
  return openBlock(), createElementBlock("button", {
40208
40220
  key: buttonConf.id,
40209
40221
  onClick: ($event) => _ctx.buttonClick(buttonConf),
40210
40222
  id: buttonConf.cssId,
40211
40223
  class: "button menu-toggle-button"
40212
- }, toDisplayString(buttonConf.text), 9, _hoisted_2$1);
40224
+ }, toDisplayString(buttonConf.text), 9, _hoisted_2$2);
40213
40225
  }), 128))
40214
40226
  ]);
40215
40227
  }
40216
- var MenuButtons = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
40228
+ var MenuButtons = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$1]]);
40229
+ var screenLayer_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".viewport{position:relative}.viewport-layer{background-size:cover;background-repeat:no-repeat;background-position:center;position:absolute;left:0;top:0;width:100%;height:100%}.viewport-button{position:absolute}\n")();
40230
+ const _hoisted_1$1 = ["id"];
40231
+ const _hoisted_2$1 = ["id", "onClick"];
40232
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
40233
+ __name: "screen-layer",
40234
+ props: {
40235
+ layer: String
40236
+ },
40237
+ setup(__props) {
40238
+ const props = __props;
40239
+ const vmStore = useVM();
40240
+ const main2 = useMain();
40241
+ const screensStore = useScreens();
40242
+ const currentScreen = computed(() => {
40243
+ return props.layer;
40244
+ });
40245
+ const buttonsState = computed(() => {
40246
+ return screensStore.buttons;
40247
+ });
40248
+ const screenConfig = computed(() => {
40249
+ const conf = getConfig().screens[currentScreen.value];
40250
+ if (!conf) {
40251
+ throw new Error(`Screen ${currentScreen.value} doesn't have a config`);
40252
+ }
40253
+ return conf;
40254
+ });
40255
+ const screenButtons = computed(() => {
40256
+ return screenConfig.value.buttons || [];
40257
+ });
40258
+ const inGame = computed(() => {
40259
+ return main2.isInGame;
40260
+ });
40261
+ function getButtonImageUrl(button) {
40262
+ const config2 = getButtonConfig(button);
40263
+ const background = config2.background;
40264
+ if (!background) {
40265
+ return void 0;
40266
+ }
40267
+ return getImageUrl(background);
40268
+ }
40269
+ function getButtonStyle(button) {
40270
+ const config2 = getButtonConfig(button);
40271
+ const style = {};
40272
+ if (config2.position.width) {
40273
+ style.width = `${config2.position.width}px`;
40274
+ }
40275
+ if (config2.position.height) {
40276
+ style.height = `${config2.position.height}px`;
40277
+ }
40278
+ if (config2.background) {
40279
+ style.backgroundImage = `url(${getButtonImageUrl(button)})`;
40280
+ }
40281
+ if (buttonsState.value[button].state === false) {
40282
+ style.opacity = 0.3;
40283
+ style.pointerEvents = "none";
40284
+ } else if (buttonsState.value[button].state === "hidden") {
40285
+ style.display = "none";
40286
+ }
40287
+ return {
40288
+ ...style,
40289
+ left: `${config2.position.left}px`,
40290
+ top: `${config2.position.top}px`
40291
+ };
40292
+ }
40293
+ function clickOnButton(button) {
40294
+ const config2 = getButtonConfig(button);
40295
+ const state = buttonsState.value[button];
40296
+ if (state.state === true) {
40297
+ const scriptToRun = config2.action;
40298
+ const newStack = {
40299
+ branchData: vmStore.script[scriptToRun],
40300
+ currentIndex: 0,
40301
+ label: scriptToRun
40302
+ };
40303
+ vmStore.setStack(newStack);
40304
+ vmStore.runLine();
40305
+ }
40306
+ }
40307
+ const layerStyle = computed(() => {
40308
+ return {
40309
+ backgroundImage: `url(${getImageUrl(screenConfig.value.background)})`
40310
+ };
40311
+ });
40312
+ return (_ctx, _cache) => {
40313
+ return unref(inGame) ? (openBlock(), createElementBlock("div", {
40314
+ key: 0,
40315
+ class: "viewport-layer",
40316
+ id: `viewport-layer-${unref(currentScreen)}`,
40317
+ style: normalizeStyle(unref(layerStyle))
40318
+ }, [
40319
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(screenButtons), (button, index) => {
40320
+ return openBlock(), createElementBlock("button", {
40321
+ key: index,
40322
+ class: "viewport-button",
40323
+ id: `viewport-button-${button}`,
40324
+ onClick: ($event) => clickOnButton(button),
40325
+ style: normalizeStyle(getButtonStyle(button))
40326
+ }, toDisplayString(unref(getButtonConfig)(button).text), 13, _hoisted_2$1);
40327
+ }), 128))
40328
+ ], 12, _hoisted_1$1)) : createCommentVNode("", true);
40329
+ };
40330
+ }
40331
+ });
40332
+ var screens_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".viewport{position:relative}\n")();
40333
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
40334
+ __name: "screens",
40335
+ setup(__props) {
40336
+ const rendering = useRenderingStore();
40337
+ const main2 = useMain();
40338
+ const screensStore = useScreens();
40339
+ const layers = computed(() => {
40340
+ return screensStore.layers.filter((layer) => layer);
40341
+ });
40342
+ const layoutMode = computed(() => {
40343
+ return rendering.layoutMode;
40344
+ });
40345
+ const layoutWidth = computed(() => {
40346
+ return getConfig().layout.backgrounds.width;
40347
+ });
40348
+ const layoutHeight = computed(() => {
40349
+ return getConfig().layout.backgrounds.height;
40350
+ });
40351
+ const inGame = computed(() => {
40352
+ return main2.isInGame;
40353
+ });
40354
+ const viewportStyle = computed(() => {
40355
+ const width = `${layoutWidth.value}px`;
40356
+ let height = `${layoutHeight.value}px`;
40357
+ if (layoutMode.value === "vertical") {
40358
+ height = `${100 - getConfig().layout.mobileDialogHeightPercentage}%`;
40359
+ }
40360
+ return {
40361
+ height,
40362
+ width
40363
+ };
40364
+ });
40365
+ return (_ctx, _cache) => {
40366
+ return unref(inGame) ? (openBlock(), createElementBlock("div", {
40367
+ key: 0,
40368
+ class: "viewport",
40369
+ id: "narrat-viewport",
40370
+ style: normalizeStyle(unref(viewportStyle))
40371
+ }, [
40372
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(layers), (layer, index) => {
40373
+ return openBlock(), createBlock(_sfc_main$2, {
40374
+ key: index,
40375
+ layer
40376
+ }, null, 8, ["layer"]);
40377
+ }), 128))
40378
+ ], 4)) : createCommentVNode("", true);
40379
+ };
40380
+ }
40381
+ });
40217
40382
  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")();
40218
40383
  const _sfc_main = defineComponent({
40219
40384
  setup() {
@@ -40239,9 +40404,10 @@ const _sfc_main = defineComponent({
40239
40404
  MainMenu,
40240
40405
  Skills,
40241
40406
  InventoryUi,
40242
- GameDialog: _sfc_main$3,
40407
+ GameDialog: _sfc_main$5,
40243
40408
  QuestsUi,
40244
- MenuButtons
40409
+ MenuButtons,
40410
+ Screens: _sfc_main$1
40245
40411
  },
40246
40412
  data() {
40247
40413
  return {
@@ -40403,17 +40569,16 @@ const _sfc_main = defineComponent({
40403
40569
  }
40404
40570
  }
40405
40571
  });
40406
- const _hoisted_1 = ["width", "height"];
40407
- const _hoisted_2 = {
40572
+ const _hoisted_1 = {
40408
40573
  key: 2,
40409
40574
  id: "game-menu",
40410
40575
  style: { "height": "100%", "padding": "20px" }
40411
40576
  };
40412
- const _hoisted_3 = { id: "game-header" };
40413
- const _hoisted_4 = { id: "game-title-container" };
40414
- const _hoisted_5 = { id: "game-title-text" };
40415
- const _hoisted_6 = { class: "flex flex-col" };
40416
- const _hoisted_7 = { key: 3 };
40577
+ const _hoisted_2 = { id: "game-header" };
40578
+ const _hoisted_3 = { id: "game-title-container" };
40579
+ const _hoisted_4 = { id: "game-title-text" };
40580
+ const _hoisted_5 = { class: "flex flex-col" };
40581
+ const _hoisted_6 = { key: 3 };
40417
40582
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
40418
40583
  const _component_Hud = resolveComponent("Hud");
40419
40584
  const _component_MenuButtons = resolveComponent("MenuButtons");
@@ -40421,6 +40586,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
40421
40586
  const _component_InventoryUi = resolveComponent("InventoryUi");
40422
40587
  const _component_QuestsUi = resolveComponent("QuestsUi");
40423
40588
  const _component_MainMenu = resolveComponent("MainMenu");
40589
+ const _component_Screens = resolveComponent("Screens");
40424
40590
  const _component_GameDialog = resolveComponent("GameDialog");
40425
40591
  const _component_LoadingBar = resolveComponent("LoadingBar");
40426
40592
  const _component_DebugMenu = resolveComponent("DebugMenu");
@@ -40452,28 +40618,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
40452
40618
  key: 3,
40453
40619
  onClose: _ctx.closeModal
40454
40620
  }, null, 8, ["onClose"])) : createCommentVNode("", true),
40455
- _ctx.inGame ? (openBlock(), createElementBlock("div", {
40456
- key: 4,
40457
- class: "background",
40458
- style: normalizeStyle(_ctx.backgroundStyle)
40459
- }, [
40460
- createElementVNode("canvas", {
40461
- width: _ctx.layoutWidth,
40462
- height: _ctx.layoutHeight,
40463
- id: "background-canvas",
40464
- class: "narrat-canvas"
40465
- }, null, 8, _hoisted_1)
40466
- ], 4)) : createCommentVNode("", true),
40621
+ createVNode(_component_Screens),
40467
40622
  createVNode(_component_GameDialog, {
40468
40623
  inGame: _ctx.inGame,
40469
40624
  layoutMode: _ctx.layoutMode
40470
40625
  }, null, 8, ["inGame", "layoutMode"])
40471
- ], 4)) : _ctx.gameLoaded ? (openBlock(), createElementBlock("div", _hoisted_2, [
40472
- createElementVNode("div", _hoisted_3, [
40473
- createElementVNode("div", _hoisted_4, [
40474
- createElementVNode("h1", _hoisted_5, toDisplayString(_ctx.gameTitle), 1)
40626
+ ], 4)) : _ctx.gameLoaded ? (openBlock(), createElementBlock("div", _hoisted_1, [
40627
+ createElementVNode("div", _hoisted_2, [
40628
+ createElementVNode("div", _hoisted_3, [
40629
+ createElementVNode("h1", _hoisted_4, toDisplayString(_ctx.gameTitle), 1)
40475
40630
  ]),
40476
- createElementVNode("div", _hoisted_6, [
40631
+ createElementVNode("div", _hoisted_5, [
40477
40632
  createElementVNode("button", {
40478
40633
  class: "button menu-button main-menu-button larg start-button override",
40479
40634
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.startGame && _ctx.startGame(...args))
@@ -40485,7 +40640,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
40485
40640
  }, " Continue Game ")) : createCommentVNode("", true)
40486
40641
  ])
40487
40642
  ])
40488
- ])) : (openBlock(), createElementBlock("div", _hoisted_7, [
40643
+ ])) : (openBlock(), createElementBlock("div", _hoisted_6, [
40489
40644
  createVNode(_component_LoadingBar, {
40490
40645
  percentage: _ctx.loadingPercentage,
40491
40646
  step: _ctx.loadingStep
@@ -40496,93 +40651,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
40496
40651
  ], 4);
40497
40652
  }
40498
40653
  var GameApp = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
40499
- let canvas;
40500
- let ctx;
40501
- const mousePos = {
40502
- x: 0,
40503
- y: 0
40504
- };
40505
- function startGameLoop() {
40506
- document.addEventListener("mousemove", (e20) => {
40507
- mousePos.x = e20.clientX;
40508
- mousePos.y = e20.clientY;
40509
- });
40510
- document.addEventListener("click", debounce(mouseclick, 100, { maxWait: 200 }));
40511
- gameLoop();
40512
- }
40513
- function gameLoop() {
40514
- const screens = useScreens();
40515
- const mainStore = useMain();
40516
- if (mainStore.playing) {
40517
- if (!canvas) {
40518
- canvas = document.querySelector("#background-canvas");
40519
- if (canvas && !ctx) {
40520
- ctx = canvas.getContext("2d");
40521
- }
40522
- } else if (canvas && ctx) {
40523
- ctx.fillStyle = "white";
40524
- ctx.fillRect(0, 0, canvas.width, canvas.height);
40525
- const currentScreen = screens.currentScreen;
40526
- const screen = getConfig().screens[currentScreen];
40527
- const bg2 = screen.background;
40528
- ctx.drawImage(images[bg2], 0, 0);
40529
- let foundCollision = false;
40530
- const scaledMousePos = screenToCanvas(mousePos.x, mousePos.y, canvas);
40531
- if (screen.buttons) {
40532
- for (const buttonName of screen.buttons) {
40533
- if (screens.buttons[buttonName].enabled) {
40534
- const button = getConfig().buttons[buttonName];
40535
- const image = images[button.background];
40536
- ctx.drawImage(image, button.position.left, button.position.top);
40537
- if (aabb(scaledMousePos.x, scaledMousePos.y, 1, 1, button.position.left, button.position.top, button.position.width, button.position.height)) {
40538
- foundCollision = true;
40539
- }
40540
- }
40541
- }
40542
- }
40543
- if (foundCollision) {
40544
- document.body.style.cursor = "pointer";
40545
- } else {
40546
- document.body.style.cursor = "default";
40547
- }
40548
- ctx.fillStyle = "black";
40549
- ctx.textAlign = "left";
40550
- }
40551
- } else {
40552
- canvas = void 0;
40553
- ctx = void 0;
40554
- }
40555
- window.requestAnimationFrame(gameLoop);
40556
- }
40557
- function mouseclick(e20) {
40558
- const screens = useScreens();
40559
- const vmStore = useVM();
40560
- if (!canvas) {
40561
- return;
40562
- }
40563
- mousePos.x = e20.clientX;
40564
- mousePos.y = e20.clientY;
40565
- const scaledMousePos = screenToCanvas(mousePos.x, mousePos.y, canvas);
40566
- const currentScreen = screens.currentScreen;
40567
- const screen = getConfig().screens[currentScreen];
40568
- if (screen.buttons) {
40569
- for (const buttonName of screen.buttons) {
40570
- if (screens.buttons[buttonName].enabled) {
40571
- const button = getConfig().buttons[buttonName];
40572
- if (aabb(scaledMousePos.x, scaledMousePos.y, 1, 1, button.position.left, button.position.top, button.position.width, button.position.height)) {
40573
- const scriptToRun = button.action;
40574
- const newStack = {
40575
- branchData: vmStore.script[scriptToRun],
40576
- currentIndex: 0,
40577
- label: scriptToRun
40578
- };
40579
- vmStore.setStack(newStack);
40580
- vmStore.runLine();
40581
- }
40582
- }
40583
- }
40584
- }
40585
- }
40586
40654
  function commandRuntimeError(cmd, errorText) {
40587
40655
  console.error(`Runtime error =========================`);
40588
40656
  console.error("Args: ", cmd.args);
@@ -40650,9 +40718,9 @@ function generateParser(keyword, argTypes) {
40650
40718
  expectedArgCount.push(argTypes.length - 1);
40651
40719
  }
40652
40720
  }
40653
- return (ctx2, parsed) => {
40721
+ return (ctx, parsed) => {
40654
40722
  const returnValue = {
40655
- newLine: ctx2.currentLine + 1
40723
+ newLine: ctx.currentLine + 1
40656
40724
  };
40657
40725
  const args = parsed.command.args;
40658
40726
  if (argTypes !== "any") {
@@ -40660,7 +40728,7 @@ function generateParser(keyword, argTypes) {
40660
40728
  console.log("Error details");
40661
40729
  console.log(parsed.command);
40662
40730
  console.log(args);
40663
- ctx2.parserContext.error(ctx2.line.line, `Command ${keyword}: Expected ${expectedArgCount.join(" or ")} arguments but got ${args.length}`);
40731
+ ctx.parserContext.error(ctx.line.line, `Command ${keyword}: Expected ${expectedArgCount.join(" or ")} arguments but got ${args.length}`);
40664
40732
  return returnValue;
40665
40733
  }
40666
40734
  }
@@ -40671,13 +40739,13 @@ function generateParser(keyword, argTypes) {
40671
40739
  if (!isExpression(arg)) {
40672
40740
  const isValid = argType.type === "any" || typeof arg === argType.type;
40673
40741
  if (!isValid) {
40674
- 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)}`);
40742
+ 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)}`);
40675
40743
  }
40676
40744
  }
40677
40745
  });
40678
40746
  }
40679
40747
  return {
40680
- newLine: ctx2.currentLine + 1
40748
+ newLine: ctx.currentLine + 1
40681
40749
  };
40682
40750
  };
40683
40751
  }
@@ -40856,17 +40924,24 @@ const addPlugin = new CommandPlugin("add", [
40856
40924
  const state = getModifiableDataPinia();
40857
40925
  addDataHelper(state, cmd.options.key, cmd.options.value);
40858
40926
  });
40859
- const setScreenCommand = new CommandPlugin("set_screen", [{ name: "screen", type: "string" }], async (cmd) => {
40927
+ const setScreenCommand = new CommandPlugin("set_screen", [
40928
+ { name: "screen", type: "string" },
40929
+ { name: "layer", type: "number", optional: true }
40930
+ ], async (cmd) => {
40931
+ const screens = useScreens();
40932
+ screens.setScreen(cmd.options.screen, cmd.options.layer);
40933
+ });
40934
+ const emptyLayerCommand = new CommandPlugin("empty_layer", [{ name: "layer", type: "number" }], async (cmd) => {
40860
40935
  const screens = useScreens();
40861
- screens.setScreen(cmd.options.screen);
40936
+ screens.emptyLayer(cmd.options.layer);
40862
40937
  });
40863
40938
  const setButtonCommand = new CommandPlugin("set_button", [
40864
40939
  { name: "buttonId", type: "string" },
40865
- { name: "enabled", type: "boolean" }
40940
+ { name: "state", type: "any" }
40866
40941
  ], async (cmd) => {
40867
- const { buttonId, enabled } = cmd.options;
40942
+ const { buttonId, state } = cmd.options;
40868
40943
  const screens = useScreens();
40869
- screens.changeButton(buttonId, enabled);
40944
+ screens.changeButton(buttonId, state);
40870
40945
  });
40871
40946
  const talkCommand = CommandPlugin.FromOptions({
40872
40947
  keyword: "talk",
@@ -40897,8 +40972,8 @@ const talkCommand = CommandPlugin.FromOptions({
40897
40972
  });
40898
40973
  const textParser = () => {
40899
40974
  const parser = generateParser("text", []);
40900
- return (ctx2, parsed) => {
40901
- const result = parser(ctx2, parsed);
40975
+ return (ctx, parsed) => {
40976
+ const result = parser(ctx, parsed);
40902
40977
  parsed.command.staticOptions = {
40903
40978
  text: parsed.code
40904
40979
  };
@@ -41019,8 +41094,12 @@ const objectiveStartedPlugin = new CommandPlugin("objective_started?", [
41019
41094
  const quests = useQuests();
41020
41095
  return quests.isObjectiveStarted(questId, objectiveId);
41021
41096
  });
41022
- const waitCommand = new CommandPlugin("wait", [{ name: "duration", type: "number" }], async (cmd) => {
41023
- await timeout(cmd.options.duration);
41097
+ const waitCommand = CommandPlugin.FromOptions({
41098
+ keyword: "wait",
41099
+ argTypes: [{ name: "duration", type: "number" }],
41100
+ runner: async (cmd) => {
41101
+ await timeout(cmd.options.duration);
41102
+ }
41024
41103
  });
41025
41104
  const notifyPlugin = new CommandPlugin("notify", [{ name: "text", type: "string" }], async (cmd) => {
41026
41105
  const { text } = cmd.options;
@@ -41041,22 +41120,22 @@ const ifCommand = new CommandPlugin("if", [{ name: "condition", type: "boolean"
41041
41120
  };
41042
41121
  return vmStore.addAndRunFrame(newStack);
41043
41122
  }
41044
- }, (ctx2, parsed) => {
41045
- let newLine = ctx2.currentLine;
41123
+ }, (ctx, parsed) => {
41124
+ let newLine = ctx.currentLine;
41046
41125
  const parser = generateParser("if", [
41047
41126
  { name: "condition", type: "string" }
41048
41127
  ]);
41049
- parser(ctx2, parsed);
41050
- const { lines, currentLine, line } = ctx2;
41128
+ parser(ctx, parsed);
41129
+ const { lines, currentLine, line } = ctx;
41051
41130
  const command = parsed.command;
41052
41131
  let failure;
41053
41132
  const nextLine = getLine(lines, currentLine + 1);
41054
41133
  if (nextLine && nextLine.code === "else:") {
41055
- failure = ctx2.processCommandsFunction(ctx2.parserContext, nextLine.branch, line);
41134
+ failure = ctx.processCommandsFunction(ctx.parserContext, nextLine.branch, line);
41056
41135
  newLine++;
41057
41136
  }
41058
41137
  command.staticOptions = {
41059
- success: ctx2.processCommandsFunction(ctx2.parserContext, line.branch, line),
41138
+ success: ctx.processCommandsFunction(ctx.parserContext, line.branch, line),
41060
41139
  failure
41061
41140
  };
41062
41141
  newLine++;
@@ -41212,54 +41291,54 @@ const runChoice = async (cmd) => {
41212
41291
  const res = await runCommand(prompt, dialogChoices);
41213
41292
  await onChoicePlayerAnswered(cmd, res);
41214
41293
  };
41215
- function parseChoiceOption(ctx2, choice, index) {
41294
+ function parseChoiceOption(ctx, choice, index) {
41216
41295
  choice.expression;
41217
41296
  if (!choice.branch) {
41218
- ctx2.parserContext.error(choice.line, `Choice option doesn't have any branch to go to (${choice.code} - ${choice.line})`);
41297
+ ctx.parserContext.error(choice.line, `Choice option doesn't have any branch to go to (${choice.code} - ${choice.line})`);
41219
41298
  }
41220
41299
  let skillBranches;
41221
41300
  let mainBranch;
41222
41301
  const branch = choice.branch;
41223
41302
  if (choice.expression[1] === "roll") {
41224
41303
  if (!branch[0].branch || !branch[1].branch) {
41225
- ctx2.parserContext.error(choice.line, `Choice option with a skill roll needs success and failure branches (${choice.code} - ${choice.line})`);
41304
+ ctx.parserContext.error(choice.line, `Choice option with a skill roll needs success and failure branches (${choice.code} - ${choice.line})`);
41226
41305
  }
41227
41306
  skillBranches = {
41228
- success: ctx2.processCommandsFunction(ctx2.parserContext, branch[0].branch, choice),
41229
- failure: ctx2.processCommandsFunction(ctx2.parserContext, branch[1].branch, choice)
41307
+ success: ctx.processCommandsFunction(ctx.parserContext, branch[0].branch, choice),
41308
+ failure: ctx.processCommandsFunction(ctx.parserContext, branch[1].branch, choice)
41230
41309
  };
41231
41310
  } else {
41232
- mainBranch = ctx2.processCommandsFunction(ctx2.parserContext, branch, choice);
41311
+ mainBranch = ctx.processCommandsFunction(ctx.parserContext, branch, choice);
41233
41312
  }
41234
41313
  const choiceInfo = {
41235
- prompt: ctx2.processCommandsFunction(ctx2.parserContext, [choice], choice)[0],
41314
+ prompt: ctx.processCommandsFunction(ctx.parserContext, [choice], choice)[0],
41236
41315
  branch: mainBranch,
41237
41316
  skillBranches
41238
41317
  };
41239
41318
  return choiceInfo;
41240
41319
  }
41241
- const choiceParser = (ctx2, parsed) => {
41242
- let newLine = ctx2.currentLine;
41320
+ const choiceParser = (ctx, parsed) => {
41321
+ let newLine = ctx.currentLine;
41243
41322
  generateParser("choice", []);
41244
- const { line } = ctx2;
41323
+ const { line } = ctx;
41245
41324
  const command = parsed.command;
41246
41325
  if (!line.branch || line.branch.length < 2) {
41247
- ctx2.parserContext.error(line.line, `Choice menu needs to have at least one option`);
41326
+ ctx.parserContext.error(line.line, `Choice menu needs to have at least one option`);
41248
41327
  }
41249
41328
  const prompt = line.branch[0];
41250
41329
  if (!prompt) {
41251
- ctx2.parserContext.error(ctx2.line.line, `Choice prompt is missing `);
41330
+ ctx.parserContext.error(ctx.line.line, `Choice prompt is missing `);
41252
41331
  }
41253
41332
  const choices = line.branch.slice(1);
41254
41333
  const prompts = choices.map((choice, index) => {
41255
41334
  if (!choice.branch) {
41256
- ctx2.parserContext.error(choice.line, `Choice option doesn't have any branch to go to (${choice.code})`);
41335
+ ctx.parserContext.error(choice.line, `Choice option doesn't have any branch to go to (${choice.code})`);
41257
41336
  }
41258
- choice = getChoiceOptionLineFromChoicePrompt(ctx2.parserContext, choice);
41259
- return parseChoiceOption(ctx2, choice);
41337
+ choice = getChoiceOptionLineFromChoicePrompt(ctx.parserContext, choice);
41338
+ return parseChoiceOption(ctx, choice);
41260
41339
  });
41261
41340
  command.staticOptions = {
41262
- prompt: ctx2.processCommandsFunction(ctx2.parserContext, [prompt], line)[0],
41341
+ prompt: ctx.processCommandsFunction(ctx.parserContext, [prompt], line)[0],
41263
41342
  choices: prompts
41264
41343
  };
41265
41344
  newLine++;
@@ -41315,7 +41394,7 @@ const onChoicePlayerAnswered = async (command, playerChoice) => {
41315
41394
  await vmStore.addAndRunFrame(newStack);
41316
41395
  }
41317
41396
  };
41318
- function getChoiceOptionLineFromChoicePrompt(ctx2, choice) {
41397
+ function getChoiceOptionLineFromChoicePrompt(ctx, choice) {
41319
41398
  const generatedCode = `choicePrompt ${choice.code}`;
41320
41399
  const newLine = {
41321
41400
  code: generatedCode,
@@ -41425,6 +41504,7 @@ function registerBaseCommands(vm2) {
41425
41504
  vm2.addCommand(stopCommand);
41426
41505
  vm2.addCommand(setButtonCommand);
41427
41506
  vm2.addCommand(setScreenCommand);
41507
+ vm2.addCommand(emptyLayerCommand);
41428
41508
  vm2.addCommand(waitCommand);
41429
41509
  vm2.addCommand(equalPlugin);
41430
41510
  vm2.addCommand(greaterThanPlugin);
@@ -41502,7 +41582,6 @@ async function startApp(config2, options) {
41502
41582
  };
41503
41583
  window.narrat = narrat;
41504
41584
  }
41505
- startGameLoop();
41506
41585
  }
41507
41586
  class NarratPlugin {
41508
41587
  onPageLoaded() {