narrat 0.11.4 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +336 -0
  2. package/LICENSE +21 -21
  3. package/README.md +30 -30
  4. package/lib/app.vue.d.ts +83 -17
  5. package/lib/components/MainMenu.vue.d.ts +8 -49
  6. package/lib/components/Skills.vue.d.ts +6 -7
  7. package/lib/components/debug/debug-menu.vue.d.ts +18 -8
  8. package/lib/components/dialog-picture.vue.d.ts +4 -5
  9. package/lib/components/hud.vue.d.ts +4 -2
  10. package/lib/components/inventory.vue.d.ts +30 -0
  11. package/lib/components/loading-bar.vue.d.ts +4 -7
  12. package/lib/components/menu.vue.d.ts +4 -48
  13. package/lib/components/notification-toast.vue.d.ts +3 -4
  14. package/lib/components/utils/modal.vue.d.ts +3 -5
  15. package/lib/components/volume-controls.vue.d.ts +1 -1
  16. package/lib/config.d.ts +10 -2
  17. package/lib/dialog-box.vue.d.ts +9 -8
  18. package/lib/exports/plugins.d.ts +0 -3
  19. package/lib/gameloop.d.ts +1 -3
  20. package/lib/index.d.ts +1 -4
  21. package/lib/index.esm.js +7643 -7219
  22. package/lib/index.js +7642 -7217
  23. package/lib/plugins/NarratPlugin.d.ts +1 -1
  24. package/lib/store.d.ts +1 -1
  25. package/lib/stores/audio-store.d.ts +11 -0
  26. package/lib/stores/dialog-store.d.ts +27 -0
  27. package/lib/stores/hud-stats-store.d.ts +20 -0
  28. package/lib/stores/inventory-store.d.ts +23 -0
  29. package/lib/stores/main-store.d.ts +268 -0
  30. package/lib/stores/notification-store.d.ts +12 -0
  31. package/lib/stores/rendering-store.d.ts +13 -0
  32. package/lib/stores/screens-store.d.ts +23 -0
  33. package/lib/stores/skills.d.ts +32 -0
  34. package/lib/stores/vm-store.d.ts +151 -0
  35. package/lib/types/dialog-box-types.d.ts +1 -1
  36. package/lib/types/game-save.d.ts +19 -17
  37. package/lib/types/state.d.ts +0 -96
  38. package/lib/utils/audio-loader.d.ts +4 -6
  39. package/lib/utils/data-helpers.d.ts +7 -5
  40. package/lib/utils/error-handling.d.ts +2 -3
  41. package/lib/utils/skillchecks.d.ts +6 -9
  42. package/lib/utils/string-helpers.d.ts +1 -3
  43. package/lib/vm/commands/add_item.d.ts +2 -0
  44. package/lib/vm/commands/choice.d.ts +1 -3
  45. package/lib/vm/commands/command-plugin.d.ts +3 -5
  46. package/lib/vm/commands/remove_item.d.ts +2 -0
  47. package/lib/vm/vm-helpers.d.ts +7 -9
  48. package/lib/vm/vm-parser.d.ts +1 -1
  49. package/lib/vm/vm.d.ts +4 -8
  50. package/package.json +85 -85
  51. package/lib/demo/bitsy/bitsy.d.ts +0 -27
  52. package/lib/display.d.ts +0 -2
  53. package/lib/plugins.d.ts +0 -22
package/CHANGELOG.md ADDED
@@ -0,0 +1,336 @@
1
+ # Narrat changelog
2
+
3
+ ## 1.1.0
4
+
5
+ ### Inventory system
6
+
7
+ There is a new inventory system.
8
+
9
+ Possible items can be defined in the config:
10
+
11
+ ```json
12
+ "items": {
13
+ "bread": {
14
+ "name": "Bread",
15
+ "description": "A bread in the game.",
16
+ "icon": "img/items/bread.png"
17
+ }
18
+ }
19
+ ```
20
+
21
+ Then items can be added/removed in scripts:
22
+
23
+ ```
24
+ main:
25
+ add_item bread 15
26
+ remove_item bread 10
27
+ $if this.items.bread.amount > 0:
28
+ talk helper idle "You have %{items.bread.amount} bread"
29
+ else:
30
+ talk helper idle "You have no bread"
31
+ ```
32
+ ## 1.0.0
33
+
34
+ ### State management rewrite
35
+
36
+ Rewrote the state management of the engine using [pinia](https://pinia.vuejs.org/) instead of Vuex for state management.
37
+
38
+ This allows the state to be more modular, easy to use and better compatible with Vue.js devtools for development of the engine, as pinia is now the official vue state management library.
39
+
40
+ The version has been bumped to 1.0.0 as it's a major rewrite. No bugs have been found when testing though.
41
+
42
+ ### Save files breaking change
43
+
44
+ The save file format has changed, so saved games from previous versions would break. As no one is using this engine in production for now, this isn't an issue.
45
+
46
+ A new `version` string has been added to save files, so that in the future it will be possible to add migrations from older save files to newer ones if needed
47
+
48
+ ## Updated Vue version
49
+
50
+ The Vue dependency version has been updated to the current latest (3.2.37)
51
+
52
+ ## Vuex peer dependency deleted
53
+
54
+ Vuex is no longer a peer dependency, and has been replaced with pinia.
55
+
56
+ ## 0.11.1
57
+
58
+ Fixed an error in how the narrat packaged is exported
59
+
60
+ ## 0.11.0
61
+
62
+ ### New Plugin system!
63
+
64
+ There is now a plugin system developers can use to add new functionality to narrat (more documentation soon). See the [narrat-bitsy](https://github.com/liana-pigeot/narrat-bitsy) plugin for an example.
65
+
66
+ ## 0.10.0
67
+
68
+ ### New XP System
69
+
70
+ - XP can be accumulated to level
71
+ - config option: `skillOptions.xpPerLevel`
72
+ - Use `add_xp` in script tso add xp, just like adding levels
73
+ - XP now displayed in skills menu
74
+
75
+ ### Other improvements
76
+
77
+ - Improvements in skill checks display and difficulty
78
+ - Bug fixes to skill check edge cases
79
+ - Fixed a bug when not having a default title screen music
80
+ - Added a new `hideAfterRoll` option to skill checks to hide their choice after they've happened once
81
+ - Refactored skill check code for internal consistency between the different ways they're run
82
+ - New CSS variables and classes to customise the look of skill check prompts
83
+
84
+ ## 0.9.4
85
+
86
+ - Fixed a bug when going back to the main menu and reloading the save without refreshing the page
87
+ - New `defaultMusic` option in audio options for title screen music
88
+
89
+ ## 0.9.3
90
+
91
+ - Fixed a bug when loading a saved game
92
+
93
+ ## 0.9.2
94
+
95
+ - Added new CSS variables and id/classes to make it easier to theme games
96
+
97
+ Current CSS variables list (Look at [main.css](https://github.com/liana-pigeot/narrat/blob/main/src/sass/main.css) in the narrat repo for up to date version):
98
+
99
+ ```css
100
+ :root {
101
+ --bg-color: #131720;
102
+ --text-color: #d9e1f2;
103
+ --primary: hsl(255, 30%, 55%);
104
+ --focus: hsl(210, 90%, 50%);
105
+ --secondary: #42b983;
106
+ --border-color: hsla(0, 0%, 100%, 0.2);
107
+ --light-1: hsl(210, 30%, 40%);
108
+ --light-2: hsl(255, 30%, 50%);
109
+ --light-background: linear-gradient(to right, var(--light-1), var(--light-2));
110
+ --shadow-1: hsla(236, 50%, 50%, 0.3);
111
+ --shadow-2: hsla(236, 50%, 50%, 0.4);
112
+ --hud-background: rgba(0, 0, 0, 0.4);
113
+ --hud-text-color: var(--text-color);
114
+ --notifications-bg: darkslateblue;
115
+
116
+ --skills-text-background: rgba(0, 0, 0, 0.5);
117
+ --skills-text-color: var(--text-color);
118
+ --skills-level-background: rgba(0, 0, 0, 0.5);
119
+ --skills-level-color: orange;
120
+ }
121
+ ```
122
+
123
+ Can be edited in a game's CSS file by overriding those variables in a more specific selector. For example:
124
+
125
+ ```css
126
+ #app {
127
+ --bg-color: white;
128
+ --text-color: black;
129
+ }
130
+ ```
131
+
132
+ would override the background and text colors of the game
133
+
134
+ ## 0.9.1
135
+
136
+ - Fixed a file capitalisation error in 0.9.0
137
+
138
+ ## 0.9.0
139
+
140
+ ### Breaking Changes
141
+
142
+ New config options for skills:
143
+
144
+ - `icon`: Path to the image to use for the skill's icon (currently the skill widget is 200x300, but you can override the CSS if needed)
145
+ - `hidden`: Optional boolean to make the skill hidden until it is "obtained". A skill that is configured to be hidden will only start appearing in the skills menu once it's above level 0
146
+
147
+ Example skills config:
148
+
149
+ ```json
150
+ "skills": {
151
+ "agility": {
152
+ "name": "Agility",
153
+ "description": "How good you are at moving around.",
154
+ "startingLevel": 0,
155
+ "icon": "img/skills/agility.jpg",
156
+ "hidden": true
157
+ },
158
+ "logic": {
159
+ "name": "Logic",
160
+ "description": "How good you are at solving problems",
161
+ "icon": "img/skills/logic.jpg",
162
+ "startingLevel": 0
163
+ }
164
+ },
165
+ ```
166
+
167
+ ### Bug Fixes
168
+
169
+ - Music could play multiple times at once when replaying the same music
170
+
171
+ ### New Features and improvements
172
+
173
+ #### Development and debug
174
+
175
+ - Improved debug menu with a **variable editor** to view and edit values in the `data` object.
176
+ - Also added a separate editor for the entire engine/app state. Can be useful for debugging complex bugs by exploring the state of the app.
177
+ - New **Quick label jump** feature to easily jump to specific labels for testing. Press **J** to open and type the name of a label then select a result with up/down arrows and press Enter
178
+ - New keyboard shortcut to open debug menu (**d**)
179
+ - Added a debug info panel on the main starting screen of the game with info on the shortcuts
180
+
181
+ #### Engine improvements
182
+
183
+ - Menu modal improved to be more compact with a cleaner design
184
+ - Added fade in and fade outs when changing music (configurable in config)
185
+ - **Improved the default UI** to be more pleasing to look at
186
+ - Added a **return to Main Menu** button to the main menu for resetting the game
187
+ - New **Skills Menu** allowing players to view their skills:
188
+ - It only appears if the game has skills configured
189
+ - It shows skill icons, name and current level on a grid
190
+ - Clicking on a skill opens a skill page with more detailed info and the skill description
191
+ - The skill menu button is next to the usual menu button
192
+
193
+ ## 0.8.5
194
+
195
+ - Fixed a bug with `clear_dialog` that was disabling all interaction upon use
196
+
197
+ ## 0.8.4
198
+
199
+ - Fixed many issues with save being broken (it didn't properly save the name of the last label the player was on, effectively restarting the game from scratch every time)
200
+ - Added new things to the save function so their state gets reloaded properly on game launch:
201
+ - Current music now gets saved and restarts when reloading the game, if any is active
202
+ - Stats (the ones in the HUD) now get saved
203
+ - Current screen is also saved
204
+ - Removed many useless spammy `console.log` and added a `Logger` in the code so that most logs (outside of errors/important logs) will only appear in debug mode.
205
+
206
+ ## 0.8.3
207
+
208
+ - Fixed bug where menu button would move up as more text gets added to the game
209
+
210
+ ## 0.8.2
211
+
212
+ - Added css to hide scrollbars in the game UI
213
+ - Added a new Menu button with the options to quit and change volume
214
+ - Removed volume slider from the HUD and moved it to the new menu
215
+
216
+ ## 0.8.1
217
+
218
+ - Fixed a bug in accessing values inside conditions caused by changed in 0.7.2
219
+
220
+ ## 0.8.0
221
+
222
+ - Changed the `set` method to access things without caps (`data`, `skills`, `buttons` instead of `DATA`, `SKILLS`, `BUTTONS`) for consistency.
223
+ - Changed string interpolation to have more accessible objects, now values in `data` need to be accessed with `%{data.something}` instead of just `%{something}`
224
+ - Now possible to access skill levels in string interpolation with `%{skills.someSkill.level}`
225
+ - Improvements to how skill checks are printed to be less awkward
226
+
227
+ ## 0.7.1
228
+
229
+ - Added `stop` and `pause` functions which work similarly to play for stopping or pausing audio.
230
+
231
+ ## 0.6.5
232
+
233
+ - Audio and music options from the config now get passed to howler
234
+ - Renamed `path` to `src` in audio config (to be consistent with howler)
235
+
236
+ ## 0.6.0
237
+
238
+ Added stats feature for tracking numbers and displaying them in the hud
239
+
240
+ Example config:
241
+
242
+ ```
243
+ "hudStats": {
244
+ "money": {
245
+ "icon": "img/ui/money.png",
246
+ "name": "Money",
247
+ "startingValue": 0,
248
+ "minValue": 0
249
+ },
250
+ "energy": {
251
+ "icon": "img/ui/energy.png",
252
+ "name": "Energy",
253
+ "startingValue": 10,
254
+ "minValue": 0,
255
+ "maxValue": 10
256
+ }
257
+ }
258
+ ```
259
+
260
+ ## 0.5.4
261
+
262
+ - Improved responsive layout and fixed some issues in it
263
+
264
+ New config keys required in the layout part of the config (to be documented):
265
+
266
+ ```
267
+ "layout": {
268
+ "backgrounds": {
269
+ "width": 880,
270
+ "height": 720
271
+ },
272
+ "dialogBottomPadding": 70,
273
+ "minTextWidth": 475,
274
+ "mobileDialogHeightPercentage": 60,
275
+ "verticalLayoutThreshold": 1000,
276
+ "portraits": {
277
+ "width": 100,
278
+ "height": 100
279
+ }
280
+ },
281
+ ```
282
+
283
+ ## 0.4.0
284
+
285
+ Added responsive layout for mobile and small screens. Still in progress, but functionnal enough to be better than before so I'm releasing it.
286
+
287
+ ## 0.3.4
288
+
289
+ - Improved string templating to work with deep nesting and also inside choice text
290
+
291
+ ## 0.3.3
292
+
293
+ - Now detects indentation size and can support any indentation size
294
+
295
+ ## 0.3.2
296
+
297
+ - Added a new `add_level` function for increasing the level of a skill. Example: `add_level someSkill 1` will increase the player's level in `someSkill` by 1
298
+ - Added a new `notify` function for displaying a notification toast that disappears after a few seconds (duration configurable in `config.json`). Example: `notify "Hello, this is a notification"`.
299
+
300
+ ## 0.3.1
301
+
302
+ Added new config options for controlling how skill rolls are done and the display of their difficulty
303
+
304
+ ## 0.3.0
305
+
306
+ Breaking changes around renaming data access from scripts
307
+
308
+ ### New Add Command
309
+
310
+ New `add` command, works the same way as `set` but increments the value based on the existing value, ie. `set SKILLS.someSkill.level 2` will increment `someSkill.level` by 2.
311
+
312
+ ### Skills
313
+
314
+ - Now possible to set the starting value of a skill (in the config)
315
+ - Now possible to edit a skill's value with `set SKILLS.someSkill.level 2` for example
316
+ - Skillcheck command renamed to roll (`if this.roll("someSkillCheck", "testSkill", 40);`)
317
+
318
+ ### General
319
+
320
+ The `set` and `$if` command now refer to data in caps and have access to more data:
321
+
322
+ - `set SKILLS.someSkill.level [value]` Sets the value of a skill
323
+ - `set DATA.someData [value]` Sets a value in the data object (data is for any game-created variables)
324
+ - `$if this.SKILLCHECKS.someSkillCheck.passed` now available for checking if a skillcheck has already been passed
325
+
326
+ ## 0.0.14
327
+
328
+ - Added the changelog (manually made for now)
329
+
330
+ ## 0.0.13
331
+
332
+ - Added debug menu for jumping to labels (currently doesn't support production builds disabling it)
333
+ - Added saving and loading of the game (works by storing data, skills, skillchecks etc. When the game is reloaded, it is brought back at the last label visited)
334
+ - Fixed a bug where conditional choices would play the wrong result if a choice is removed due to a condition
335
+ - Made script loading and compilation happen during the initial loading, so everything is ready to play when pressing start game
336
+ - Skill checks now also save and load their data, so a failed check becomes impossible to choose, and a succeeded skill check can be skipped if shown again
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 Liana Pigeot
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Liana Pigeot
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,30 +1,30 @@
1
- # 🚀 Narrat
2
-
3
- ![example workflow](https://github.com/nialna/narrat/actions/workflows/main.yml/badge.svg)
4
-
5
- A narrative game engine for text-based games. Inspired by renpy syntax, but built to be customisable, extendable and web-focused. See the [website](https://get-narrat.com)
6
-
7
- ![Narrat banner image](https://gblobscdn.gitbook.com/assets%2F-Mh95QNKFZeeRV90-ZSq%2F-MiI7tyjjriQTQI80bhM%2F-MiI83Ys6ED75AlZ_dVT%2Fnarrat-banner.jpg?alt=media&token=9d72e03f-c2ba-4fcb-8579-491b0f8940d8)
8
-
9
- You can [try a little demo](https://get-narrat.com/demo/). It contains a built version of the [narrat demo repo](https://github.com/nialna/narrat-demo).
10
-
11
- Game dialogue info is written in files with a similar syntax to Renpy (.rpy files). Those files get loaded by the game engine which plays through them. This allows us to use [renpy syntax highlighting](https://marketplace.visualstudio.com/items?itemName=LuqueDaniel.languague-renpy) in vs code easily. It is **not renpy** though, just inspired from it. Eventually narrat might have its own language and file extension support.
12
-
13
- ## Usage
14
-
15
- See the [Documentation](https://docs.get-narrat.com/) for more info, or jump directly in the [Getting Started Guide](https://docs.get-narrat.com/getting-started)
16
-
17
- ## Features
18
-
19
- * Flexible dialog writing with branching and conditions
20
- * Multiple script files support with labels and jumps to organise script writing
21
- * Multiple speaking characters support with icons and poses
22
- * Custom variables in scripts to create flags or other data the game needs to track
23
- * Seamless saving and reloading
24
- * UI with buttons that can be used for example to create world maps with clickable locations (the buttons can be controlled in scripts)
25
- * Sound and music support
26
- * Delays between script lines
27
- * Electron build to turn the game into a pc/mac/linux app (template to be updated with example soon)
28
- * Skill checks (Feature still early, needs a UI for viewing skills and creating characters)
29
-
30
-
1
+ # 🚀 Narrat
2
+
3
+ ![example workflow](https://github.com/nialna/narrat/actions/workflows/main.yml/badge.svg)
4
+
5
+ A narrative game engine for text-based games. Inspired by renpy syntax, but built to be customisable, extendable and web-focused. See the [website](https://get-narrat.com)
6
+
7
+ ![Narrat banner image](https://gblobscdn.gitbook.com/assets%2F-Mh95QNKFZeeRV90-ZSq%2F-MiI7tyjjriQTQI80bhM%2F-MiI83Ys6ED75AlZ_dVT%2Fnarrat-banner.jpg?alt=media&token=9d72e03f-c2ba-4fcb-8579-491b0f8940d8)
8
+
9
+ You can [try a little demo](https://get-narrat.com/demo/). It contains a built version of the [narrat demo repo](https://github.com/nialna/narrat-demo).
10
+
11
+ Game dialogue info is written in files with a similar syntax to Renpy (.rpy files). Those files get loaded by the game engine which plays through them. This allows us to use [renpy syntax highlighting](https://marketplace.visualstudio.com/items?itemName=LuqueDaniel.languague-renpy) in vs code easily. It is **not renpy** though, just inspired from it. Eventually narrat might have its own language and file extension support.
12
+
13
+ ## Usage
14
+
15
+ See the [Documentation](https://docs.get-narrat.com/) for more info, or jump directly in the [Getting Started Guide](https://docs.get-narrat.com/getting-started)
16
+
17
+ ## Features
18
+
19
+ * Flexible dialog writing with branching and conditions
20
+ * Multiple script files support with labels and jumps to organise script writing
21
+ * Multiple speaking characters support with icons and poses
22
+ * Custom variables in scripts to create flags or other data the game needs to track
23
+ * Seamless saving and reloading
24
+ * UI with buttons that can be used for example to create world maps with clickable locations (the buttons can be controlled in scripts)
25
+ * Sound and music support
26
+ * Delays between script lines
27
+ * Electron build to turn the game into a pc/mac/linux app (template to be updated with example soon)
28
+ * Skill checks (Feature still early, needs a UI for viewing skills and creating characters)
29
+
30
+
package/lib/app.vue.d.ts CHANGED
@@ -1,13 +1,81 @@
1
1
  import { PropType } from 'vue';
2
- import { DialogKey } from './types/state';
3
2
  import { DialogBoxParameters } from './types/dialog-box-types';
4
3
  import { GameConfig } from './types/app-types';
5
4
  import { AppOptions } from '.';
6
5
  import { Parser } from './types/parser';
6
+ import { DialogKey } from './stores/dialog-store';
7
7
  declare const _default: import("vue").DefineComponent<{
8
8
  config: PropType<GameConfig>;
9
9
  options: PropType<AppOptions>;
10
- }, unknown, {
10
+ }, {
11
+ dialog: import("vue").ComputedRef<{
12
+ speaker: string;
13
+ text: string;
14
+ pose?: string;
15
+ choices?: {
16
+ choice: string;
17
+ originalIndex: number;
18
+ allowed: boolean;
19
+ }[];
20
+ interactive: boolean;
21
+ id: string;
22
+ }[]>;
23
+ stack: import("vue").ComputedRef<{
24
+ currentIndex: number;
25
+ branch: {
26
+ code: string;
27
+ args: string[];
28
+ operator: string;
29
+ commandType: string;
30
+ options: Parser.EmptyOptions | {
31
+ condition: string;
32
+ success: any[];
33
+ failure?: any[];
34
+ } | {
35
+ label: string;
36
+ } | {
37
+ text: string;
38
+ } | {
39
+ prompt: any;
40
+ choices: {
41
+ choice: string;
42
+ branch: any[];
43
+ condition?: string;
44
+ skillCheck?: {
45
+ id: string;
46
+ skill: string;
47
+ value: number;
48
+ hideAfterRoll: boolean;
49
+ success: {
50
+ text: string;
51
+ branch: any[];
52
+ };
53
+ failure: {
54
+ text: string;
55
+ branch?: any[];
56
+ };
57
+ };
58
+ index: number;
59
+ }[];
60
+ } | {
61
+ screen: string;
62
+ } | {
63
+ mode: "sound" | "music";
64
+ audio: string;
65
+ } | {
66
+ mode: "sound" | "music";
67
+ audio?: string;
68
+ } | {
69
+ duration: number;
70
+ };
71
+ fileName: string;
72
+ line: number;
73
+ }[];
74
+ label: string;
75
+ }[]>;
76
+ modal: import("vue").ComputedRef<string | false>;
77
+ flowState: import("vue").ComputedRef<"menu" | "playing">;
78
+ }, {
11
79
  lineTitle: string;
12
80
  lineText: string;
13
81
  gameLoaded: boolean;
@@ -15,8 +83,6 @@ declare const _default: import("vue").DefineComponent<{
15
83
  loadingPercentage: number;
16
84
  hasSave: boolean;
17
85
  }, {
18
- dialog(): DialogKey[];
19
- openModal(): string | false;
20
86
  dialogLength(): number;
21
87
  lastDialog(): DialogKey | undefined;
22
88
  command(): Parser.Command;
@@ -24,18 +90,14 @@ declare const _default: import("vue").DefineComponent<{
24
90
  backgroundStyle(): any;
25
91
  layoutWidth(): number;
26
92
  gameTitle(): string;
27
- flowState(): string;
28
93
  inGame(): boolean;
29
94
  layoutHeight(): number;
30
- screenWidth(): number;
31
- screenHeight(): number;
32
95
  backgroundSize(): {
33
96
  width: number;
34
97
  height: number;
35
98
  left: number;
36
99
  top: number;
37
100
  };
38
- layoutMode(): string;
39
101
  dialogWidth(): number;
40
102
  dialogStyle(): any;
41
103
  gameWidth(): number;
@@ -44,22 +106,26 @@ declare const _default: import("vue").DefineComponent<{
44
106
  gameStyle(): any;
45
107
  screenRatio(): number;
46
108
  dialogContainerStyle(): any;
109
+ currentLine: () => Parser.Command;
110
+ screenWidth: () => number;
111
+ screenHeight: () => number;
112
+ canvasWidth: () => number;
113
+ canvasHeight: () => number;
114
+ topOffset: () => number;
115
+ leftOffset: () => number;
116
+ layoutMode: () => "horizontal" | "vertical";
47
117
  }, {
48
- setupMachine(): Promise<any>;
118
+ setupMachine(): Promise<void>;
49
119
  getSaveFile(): string | null;
50
120
  startGame(): Promise<void>;
51
121
  loadGame(): Promise<void>;
52
122
  isDialogActive(i: number): boolean;
53
123
  nextLine(): void;
54
- choosePrompt(index: number): void;
55
124
  updateScreenSize(): void;
56
125
  closeModal(): void;
57
126
  getDialogBoxOptions(dialogKey: DialogKey, index: number): DialogBoxParameters;
58
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
59
- config?: unknown;
60
- options?: unknown;
61
- } & {} & {
62
- config?: GameConfig;
63
- options?: AppOptions;
64
- }> & {}, {}>;
127
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
128
+ config: PropType<GameConfig>;
129
+ options: PropType<AppOptions>;
130
+ }>>, {}>;
65
131
  export default _default;
@@ -1,59 +1,18 @@
1
1
  declare const _default: import("vue").DefineComponent<Readonly<import("vue").ComponentPropsOptions<{
2
2
  [x: string]: unknown;
3
- }>>, unknown, void, {}, {
3
+ }>>, unknown, void, {
4
+ playTime: () => {
5
+ start: number;
6
+ previousPlaytime: number;
7
+ };
8
+ }, {
4
9
  quit(): void;
5
10
  close(): void;
6
11
  mainMenu(): void;
7
12
  getPlayTimeString(): string;
8
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<(readonly unknown[] & {
9
- [x: number]: string;
10
- } & {
11
- [Symbol.iterator]?: IterableIterator<string>;
12
- length?: number;
13
- toString?: string;
14
- toLocaleString?: string;
15
- concat?: string[];
16
- join?: string;
17
- slice?: string[];
18
- indexOf?: (searchElement: string, fromIndex?: number) => number;
19
- lastIndexOf?: (searchElement: string, fromIndex?: number) => number;
20
- every?: {
21
- <S extends string>(predicate: (value: string, index: number, array: readonly string[]) => value is S, thisArg?: any): this is readonly S[];
22
- (predicate: (value: string, index: number, array: readonly string[]) => unknown, thisArg?: any): boolean;
23
- };
24
- some?: (predicate: (value: string, index: number, array: readonly string[]) => unknown, thisArg?: any) => boolean;
25
- forEach?: (callbackfn: (value: string, index: number, array: readonly string[]) => void, thisArg?: any) => void;
26
- map?: <U>(callbackfn: (value: string, index: number, array: readonly string[]) => U, thisArg?: any) => U[];
27
- filter?: {
28
- <S_1 extends string>(predicate: (value: string, index: number, array: readonly string[]) => value is S_1, thisArg?: any): S_1[];
29
- (predicate: (value: string, index: number, array: readonly string[]) => unknown, thisArg?: any): string[];
30
- };
31
- reduce?: {
32
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: readonly string[]) => string): string;
33
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: readonly string[]) => string, initialValue: string): string;
34
- <U_1>(callbackfn: (previousValue: U_1, currentValue: string, currentIndex: number, array: readonly string[]) => U_1, initialValue: U_1): U_1;
35
- };
36
- reduceRight?: {
37
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: readonly string[]) => string): string;
38
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: readonly string[]) => string, initialValue: string): string;
39
- <U_2>(callbackfn: (previousValue: U_2, currentValue: string, currentIndex: number, array: readonly string[]) => U_2, initialValue: U_2): U_2;
40
- };
41
- find?: {
42
- <S_2 extends string>(predicate: (this: void, value: string, index: number, obj: readonly string[]) => value is S_2, thisArg?: any): S_2;
43
- (predicate: (value: string, index: number, obj: readonly string[]) => unknown, thisArg?: any): string;
44
- };
45
- findIndex?: (predicate: (value: string, index: number, obj: readonly string[]) => unknown, thisArg?: any) => number;
46
- entries?: IterableIterator<[number, string]>;
47
- keys?: IterableIterator<number>;
48
- values?: IterableIterator<string>;
49
- includes?: (searchElement: string, fromIndex?: number) => boolean;
50
- flatMap?: <U_3, This = undefined>(callback: (this: This, value: string, index: number, array: string[]) => U_3 | readonly U_3[], thisArg?: This) => U_3[];
51
- flat?: unknown[];
52
- }) | ({
53
- [x: string]: unknown;
54
- } & {} & {
13
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, readonly string[] | Readonly<import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
55
14
  [x: string]: unknown;
56
- })> & {}, {
15
+ }>>>>, {
57
16
  [x: number]: string;
58
17
  } | {}>;
59
18
  export default _default;