@vnejs/docs 0.2.65 → 0.2.66
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/README.md +35 -35
- package/architecture/backends.md +18 -0
- package/architecture/build.md +37 -0
- package/architecture/bundles.md +20 -0
- package/architecture/cli.md +25 -0
- package/architecture/compatibility.md +22 -0
- package/architecture/configs.md +19 -0
- package/architecture/contracts.md +30 -0
- package/architecture/dependencies.md +55 -0
- package/architecture/editor.md +7 -0
- package/architecture/games.md +38 -0
- package/architecture/helpers.md +14 -0
- package/architecture/model.md +43 -0
- package/architecture/modules.md +87 -0
- package/architecture/packages.md +43 -0
- package/architecture/plugins.md +36 -0
- package/architecture/uis.md +23 -0
- package/changelog/0.2.18.md +7 -0
- package/changelog/0.2.19.md +14 -0
- package/changelog/0.2.20.md +10 -0
- package/changelog/0.2.21.md +5 -0
- package/changelog/0.2.22.md +11 -0
- package/changelog/0.2.23.md +4 -0
- package/changelog/0.2.25.md +6 -0
- package/changelog/0.2.26.md +12 -0
- package/changelog/0.2.29.md +10 -0
- package/changelog/0.2.31.md +5 -0
- package/changelog/0.2.32.md +3 -0
- package/changelog/0.2.33.md +5 -0
- package/changelog/0.2.34.md +8 -0
- package/changelog/0.2.35.md +33 -0
- package/changelog/0.2.36.md +10 -0
- package/changelog/0.2.38.md +19 -0
- package/changelog/0.2.39.md +16 -0
- package/changelog/0.2.40.md +9 -0
- package/changelog/0.2.42.md +3 -0
- package/changelog/0.2.43.md +10 -0
- package/changelog/0.2.46.md +3 -0
- package/changelog/0.2.47.md +25 -0
- package/changelog/0.2.49.md +3 -0
- package/changelog/0.2.50.md +6 -0
- package/changelog/0.2.51.md +6 -0
- package/changelog/0.2.52.md +5 -0
- package/changelog/0.2.53.md +12 -0
- package/changelog/0.2.55.md +19 -0
- package/changelog/0.2.56.md +11 -0
- package/changelog/0.2.57.md +7 -0
- package/changelog/0.2.58.md +8 -0
- package/changelog/0.2.59.md +6 -0
- package/changelog/0.2.60.md +5 -0
- package/changelog/0.2.61.md +11 -0
- package/changelog/0.2.62.md +8 -0
- package/changelog/0.2.63.md +4 -0
- package/changelog/0.2.64.md +4 -0
- package/changelog/0.2.65.md +3 -0
- package/changelog/0.2.66.md +5 -0
- package/changelog/README.md +43 -0
- package/manifest.json +66 -5
- package/package.json +6 -4
- package/plugins/ai/ai.md +29 -29
- package/plugins/ai/checkers.md +26 -26
- package/plugins/audio/ambient.md +20 -20
- package/plugins/audio/audio.md +40 -40
- package/plugins/audio/music.md +20 -20
- package/plugins/audio/sound.md +20 -20
- package/plugins/audio/voice.md +23 -23
- package/plugins/canvas/bg.md +44 -44
- package/plugins/canvas/bg.speak.md +34 -34
- package/plugins/canvas/fill.md +33 -33
- package/plugins/canvas/layer.md +35 -35
- package/plugins/canvas/sprite.md +46 -46
- package/plugins/canvas/sprite.speak.md +33 -33
- package/plugins/canvas/text.md +37 -37
- package/plugins/canvas/video.md +37 -37
- package/plugins/canvas.layers/bl.md +33 -33
- package/plugins/canvas.layers/fl.md +33 -33
- package/plugins/canvas.layers/ml.md +33 -33
- package/plugins/canvas.layers/ul.md +32 -32
- package/plugins/canvas.props/animation.md +25 -25
- package/plugins/canvas.props/clip.md +22 -22
- package/plugins/canvas.props/filters.md +20 -20
- package/plugins/canvas.props/mask.md +23 -23
- package/plugins/canvas.props/scale.md +20 -20
- package/plugins/common/grid.md +23 -23
- package/plugins/common/turn.md +18 -18
- package/plugins/controls/controls.md +31 -31
- package/plugins/controls/cursor.md +54 -54
- package/plugins/controls/gamepad.md +56 -56
- package/plugins/controls/keyboard.md +17 -17
- package/plugins/core/components.md +28 -28
- package/plugins/core/interact.md +26 -26
- package/plugins/core/logs.md +28 -28
- package/plugins/core/media.md +38 -38
- package/plugins/core/memory.md +28 -28
- package/plugins/core/platforms.md +19 -19
- package/plugins/core/scenario.md +48 -48
- package/plugins/core/settings.md +24 -24
- package/plugins/core/stack.md +39 -39
- package/plugins/core/state.md +30 -30
- package/plugins/core/storage.md +56 -56
- package/plugins/core/system.md +37 -37
- package/plugins/core/vendors.md +19 -19
- package/plugins/entities/entities.md +16 -16
- package/plugins/entities/wallet.md +27 -27
- package/plugins/font/montserrat.md +16 -16
- package/plugins/game/checkers.md +38 -38
- package/plugins/platform/android.md +17 -17
- package/plugins/platform/electron.md +21 -21
- package/plugins/platform/metric.md +23 -23
- package/plugins/rpg/damage.md +22 -22
- package/plugins/rpg/hit.md +24 -24
- package/plugins/rpg/skills.md +26 -26
- package/plugins/save/auto.md +26 -26
- package/plugins/save/continue.md +23 -23
- package/plugins/save/quick.md +24 -24
- package/plugins/save/save.md +37 -37
- package/plugins/scales/health.md +17 -17
- package/plugins/scales/mana.md +17 -17
- package/plugins/scales/scales.md +31 -31
- package/plugins/scenario/autoread.md +36 -36
- package/plugins/scenario/choose.md +74 -65
- package/plugins/scenario/fastforward.md +46 -46
- package/plugins/scenario/history.md +41 -41
- package/plugins/scenario/pause.md +27 -27
- package/plugins/scenario/point_and_click.md +51 -51
- package/plugins/scenario/qte.md +54 -54
- package/plugins/scenario/random.md +17 -17
- package/plugins/settings/filter.md +19 -19
- package/plugins/settings/potato.md +22 -22
- package/plugins/settings/ratio.md +19 -19
- package/plugins/settings/textsize.md +19 -19
- package/plugins/settings/volume.md +21 -21
- package/plugins/text/inject.md +22 -22
- package/plugins/text/locs.md +36 -36
- package/plugins/text/meet.md +19 -19
- package/plugins/text/smooth.md +33 -33
- package/plugins/text/text.md +76 -69
- package/plugins/text/wall.md +20 -20
- package/plugins/time/date.md +22 -22
- package/plugins/time/time.md +23 -23
- package/plugins/vars/counters.md +28 -28
- package/plugins/vars/flags.md +24 -24
- package/plugins/vars/vars.md +29 -29
- package/plugins/views/achievement.md +44 -44
- package/plugins/views/comment.md +31 -31
- package/plugins/views/controls.hints.md +34 -34
- package/plugins/views/cursor.md +19 -19
- package/plugins/views/fps.md +33 -33
- package/plugins/views/gamepad.debug.md +32 -32
- package/plugins/views/settings.md +39 -39
- package/plugins/views/video.md +37 -37
- package/plugins/views.scenario/choose.md +41 -41
- package/plugins/views.scenario/interface.controls.md +31 -31
- package/plugins/views.scenario/interface.fastforward.md +29 -29
- package/plugins/views.scenario/interface.md +74 -74
- package/plugins/views.scenario/point_and_click.md +39 -39
- package/plugins/views.scenario/qte.md +51 -51
- package/plugins/views.screens/checkers.md +35 -35
- package/plugins/views.screens/confirm.md +35 -35
- package/plugins/views.screens/credits.md +31 -31
- package/plugins/views.screens/disclaimer.md +42 -42
- package/plugins/views.screens/eula.md +37 -37
- package/plugins/views.screens/gallery.full.md +41 -41
- package/plugins/views.screens/gallery.md +75 -75
- package/plugins/views.screens/gamemenu.md +41 -41
- package/plugins/views.screens/history.md +39 -39
- package/plugins/views.screens/intro.md +32 -32
- package/plugins/views.screens/loading.md +30 -30
- package/plugins/views.screens/mainmenu.md +49 -49
- package/plugins/views.screens/mainmenu.socials.md +25 -25
- package/plugins/views.screens/save.md +66 -66
- package/plugins/views.screens/settings.defaults.md +37 -37
- package/plugins/views.screens/settings.md +40 -40
- package/scenario.catalog/README.md +13 -13
- package/scenario.catalog/index.md +35 -35
- package/scenario.catalog/stubs/achievement.md +4 -4
- package/scenario.catalog/stubs/audio.ambient.md +4 -4
- package/scenario.catalog/stubs/audio.music.md +4 -4
- package/scenario.catalog/stubs/audio.sound.md +4 -4
- package/scenario.catalog/stubs/audio.voice.md +4 -4
- package/scenario.catalog/stubs/bl.animation.md +5 -5
- package/scenario.catalog/stubs/bl.bg.md +5 -5
- package/scenario.catalog/stubs/bl.clip.md +5 -5
- package/scenario.catalog/stubs/bl.fill.md +5 -5
- package/scenario.catalog/stubs/bl.filter.md +5 -5
- package/scenario.catalog/stubs/bl.mask.md +5 -5
- package/scenario.catalog/stubs/bl.scale.md +5 -5
- package/scenario.catalog/stubs/bl.sprite.md +5 -5
- package/scenario.catalog/stubs/bl.text.md +5 -5
- package/scenario.catalog/stubs/bl.video.md +5 -5
- package/scenario.catalog/stubs/choose.block.md +7 -7
- package/scenario.catalog/stubs/choose.md +4 -4
- package/scenario.catalog/stubs/choose.option.md +7 -7
- package/scenario.catalog/stubs/comment.md +5 -5
- package/scenario.catalog/stubs/counter.md +5 -5
- package/scenario.catalog/stubs/credits.md +4 -4
- package/scenario.catalog/stubs/date.md +4 -4
- package/scenario.catalog/stubs/disclaimer.md +5 -5
- package/scenario.catalog/stubs/fl.animation.md +5 -5
- package/scenario.catalog/stubs/fl.bg.md +5 -5
- package/scenario.catalog/stubs/fl.clip.md +5 -5
- package/scenario.catalog/stubs/fl.fill.md +5 -5
- package/scenario.catalog/stubs/fl.filter.md +5 -5
- package/scenario.catalog/stubs/fl.mask.md +5 -5
- package/scenario.catalog/stubs/fl.scale.md +5 -5
- package/scenario.catalog/stubs/fl.sprite.md +5 -5
- package/scenario.catalog/stubs/fl.text.md +5 -5
- package/scenario.catalog/stubs/fl.video.md +5 -5
- package/scenario.catalog/stubs/flag.md +13 -13
- package/scenario.catalog/stubs/interface.md +4 -4
- package/scenario.catalog/stubs/intro.md +4 -4
- package/scenario.catalog/stubs/mainmenu.md +4 -4
- package/scenario.catalog/stubs/ml.animation.md +5 -5
- package/scenario.catalog/stubs/ml.bg.md +5 -5
- package/scenario.catalog/stubs/ml.clip.md +5 -5
- package/scenario.catalog/stubs/ml.fill.md +5 -5
- package/scenario.catalog/stubs/ml.filter.md +5 -5
- package/scenario.catalog/stubs/ml.mask.md +5 -5
- package/scenario.catalog/stubs/ml.scale.md +5 -5
- package/scenario.catalog/stubs/ml.sprite.md +5 -5
- package/scenario.catalog/stubs/ml.text.md +5 -5
- package/scenario.catalog/stubs/ml.video.md +5 -5
- package/scenario.catalog/stubs/other.md +6 -6
- package/scenario.catalog/stubs/pause.md +5 -5
- package/scenario.catalog/stubs/point-and-click.block.md +4 -4
- package/scenario.catalog/stubs/point-and-click.md +4 -4
- package/scenario.catalog/stubs/point-and-click.option.md +4 -4
- package/scenario.catalog/stubs/qte.md +4 -4
- package/scenario.catalog/stubs/random.md +4 -4
- package/scenario.catalog/stubs/random.option.md +4 -4
- package/scenario.catalog/stubs/save.auto.md +4 -4
- package/scenario.catalog/stubs/save.md +5 -5
- package/scenario.catalog/stubs/scenario.md +4 -4
- package/scenario.catalog/stubs/settings.defaults.md +4 -4
- package/scenario.catalog/stubs/stack.md +4 -4
- package/scenario.catalog/stubs/text.meet.md +4 -4
- package/scenario.catalog/stubs/text.wall.md +4 -4
- package/scenario.catalog/stubs/time.md +4 -4
- package/scenario.catalog/stubs/ul.animation.md +5 -5
- package/scenario.catalog/stubs/ul.bg.md +5 -5
- package/scenario.catalog/stubs/ul.clip.md +5 -5
- package/scenario.catalog/stubs/ul.fill.md +5 -5
- package/scenario.catalog/stubs/ul.filter.md +5 -5
- package/scenario.catalog/stubs/ul.mask.md +5 -5
- package/scenario.catalog/stubs/ul.scale.md +5 -5
- package/scenario.catalog/stubs/ul.sprite.md +5 -5
- package/scenario.catalog/stubs/ul.text.md +5 -5
- package/scenario.catalog/stubs/video.md +4 -4
- package/scenario.catalog/stubs/wallet.md +4 -4
- package/scenario.guide/README.md +38 -38
- package/scenario.guide/audio.md +11 -11
- package/scenario.guide/canvas.md +23 -23
- package/scenario.guide/choose.md +28 -28
- package/scenario.guide/dialogue.md +23 -23
- package/scenario.guide/flow.md +21 -21
- package/scenario.guide/point-and-click.md +12 -12
- package/scenario.guide/qte-random.md +20 -20
- package/scenario.guide/vars.md +19 -19
- package/scenario.guide/views.md +20 -20
- package/CHANGELOG.md +0 -387
- package/architecture.md +0 -566
package/plugins/scales/health.md
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
# plugins/scales/health/
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Package: `@vnejs/plugins.scales.health` · namespace: `SCALE_HEALTH`
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Handles overflow and underflow of the health scale.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Events
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
None.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Constants
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
None.
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Parameters
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
None.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Settings
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
None.
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Modules
|
|
24
24
|
|
|
25
|
-
|
|
|
26
|
-
| -------------- |
|
|
27
|
-
| `scale_health` |
|
|
25
|
+
| Module | Role |
|
|
26
|
+
| -------------- | -------------------------- |
|
|
27
|
+
| `scale_health` | Plugin `health` submodule. |
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Related plugins
|
|
30
30
|
|
|
31
31
|
### plugins/core/
|
|
32
32
|
|
|
33
|
-
—
|
|
33
|
+
— None
|
|
34
34
|
|
|
35
|
-
###
|
|
35
|
+
### Other
|
|
36
36
|
|
|
37
37
|
- [scales.md](./scales.md) — `SCALES`: PARAMS.TYPES
|
package/plugins/scales/mana.md
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
# plugins/scales/mana/
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Package: `@vnejs/plugins.scales.mana` · namespace: `SCALE_MANA`
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Handles overflow and underflow of the mana scale.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Events
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
None.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Constants
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
None.
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Parameters
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
None.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Settings
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
None.
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Modules
|
|
24
24
|
|
|
25
|
-
|
|
|
26
|
-
| ------------ |
|
|
27
|
-
| `scale_mana` |
|
|
25
|
+
| Module | Role |
|
|
26
|
+
| ------------ | ------------------------ |
|
|
27
|
+
| `scale_mana` | Plugin `mana` submodule. |
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Related plugins
|
|
30
30
|
|
|
31
31
|
### plugins/core/
|
|
32
32
|
|
|
33
|
-
—
|
|
33
|
+
— None
|
|
34
34
|
|
|
35
|
-
###
|
|
35
|
+
### Other
|
|
36
36
|
|
|
37
37
|
- [scales.md](./scales.md) — `SCALES`: PARAMS.TYPES
|
package/plugins/scales/scales.md
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
# plugins/scales/scales/
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Package: `@vnejs/plugins.scales.scales` · namespace: `SCALES`
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Manages numeric scales: spawn, change, set, check, and bounds.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Events
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Handler payloads and results are typed through module augmentation of the contract (`VneEventPayloadMap` / `VneEventResultMap`). The types live in `@vnejs/contracts.scales`.
|
|
10
10
|
|
|
11
|
-
|
|
|
12
|
-
| ----------- | ---------------------- |
|
|
13
|
-
| `SPAWN` | `vne:scales:spawn` |
|
|
14
|
-
| `DESTROY` | `vne:scales:destroy` |
|
|
15
|
-
| `SET` | `vne:scales:set` |
|
|
16
|
-
| `RESET` | `vne:scales:reset` |
|
|
17
|
-
| `CHANGE` | `vne:scales:change` |
|
|
18
|
-
| `CHANGED` | `vne:scales:changed` |
|
|
19
|
-
| `CHECK` | `vne:scales:check` |
|
|
20
|
-
| `OVERFLOW` | `vne:scales:overflow` |
|
|
21
|
-
| `UNDERFLOW` | `vne:scales:underflow` |
|
|
11
|
+
| Key | String | Meaning |
|
|
12
|
+
| ----------- | ---------------------- | ----------------------------------- |
|
|
13
|
+
| `SPAWN` | `vne:scales:spawn` | Plugin namespace event `SPAWN`. |
|
|
14
|
+
| `DESTROY` | `vne:scales:destroy` | Plugin namespace event `DESTROY`. |
|
|
15
|
+
| `SET` | `vne:scales:set` | Write or update a value. |
|
|
16
|
+
| `RESET` | `vne:scales:reset` | Plugin namespace event `RESET`. |
|
|
17
|
+
| `CHANGE` | `vne:scales:change` | Plugin namespace event `CHANGE`. |
|
|
18
|
+
| `CHANGED` | `vne:scales:changed` | Record a state change. |
|
|
19
|
+
| `CHECK` | `vne:scales:check` | Check state or resource presence. |
|
|
20
|
+
| `OVERFLOW` | `vne:scales:overflow` | Plugin namespace event `OVERFLOW`. |
|
|
21
|
+
| `UNDERFLOW` | `vne:scales:underflow` | Plugin namespace event `UNDERFLOW`. |
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Constants
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
None.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Parameters
|
|
28
28
|
|
|
29
|
-
|
|
|
30
|
-
| ------- | -------- |
|
|
31
|
-
| `TYPES` | `string` |
|
|
29
|
+
| Key | Type | Meaning |
|
|
30
|
+
| ------- | -------- | --------------------------------------------------------------- |
|
|
31
|
+
| `TYPES` | `string` | Scale kinds (`health`, `mana`, …), extended by child contracts. |
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## Keys
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
The contract exports `getScaleKey(entityId, scaleType)` → `` `${entityId}:${scaleType}` `` (for example `hero:health`). Scales events accept `key` as an opaque string.
|
|
36
36
|
|
|
37
|
-
##
|
|
37
|
+
## Settings
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
None.
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## Modules
|
|
42
42
|
|
|
43
|
-
|
|
|
44
|
-
| -------- |
|
|
45
|
-
| `scales` |
|
|
43
|
+
| Module | Role |
|
|
44
|
+
| -------- | ----------------------------------------- |
|
|
45
|
+
| `scales` | Handles SPAWN, DESTROY, RESET, CHANGE, …. |
|
|
46
46
|
|
|
47
|
-
##
|
|
47
|
+
## Related plugins
|
|
48
48
|
|
|
49
49
|
### plugins/core/
|
|
50
50
|
|
|
51
51
|
- [state.md](../core/state.md) — `STATE`: EVENTS.SET, EVENTS.CLEAR
|
|
52
52
|
|
|
53
|
-
###
|
|
53
|
+
### Other
|
|
54
54
|
|
|
55
55
|
- [health.md](./health.md) — `SCALES.TYPES.HEALTH`
|
|
56
56
|
- [mana.md](./mana.md) — `SCALES.TYPES.MANA`
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
# plugins/scenario/autoread/
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Package: `@vnejs/plugins.scenario.autoread` · namespace: `AUTOREAD`
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Automatically advance the scenario on a timer with configurable delay and temporary block sources.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Events
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Handler payloads and results are typed through module augmentation of the contract (`VneEventPayloadMap` / `VneEventResultMap`). The types live in `@vnejs/contracts.scenario.autoread`.
|
|
10
10
|
|
|
11
|
-
|
|
|
12
|
-
| ---------------- | ----------------------------- |
|
|
13
|
-
| `EMIT` | `vne:autoread:emit` |
|
|
14
|
-
| `PUSH` | `vne:autoread:push` |
|
|
15
|
-
| `POP` | `vne:autoread:pop` |
|
|
16
|
-
| `TIMEOUT_CREATE` | `vne:autoread:timeout_create` |
|
|
17
|
-
| `TIMEOUT_CLEAR` | `vne:autoread:timeout_clear` |
|
|
11
|
+
| Key | String | Meaning |
|
|
12
|
+
| ---------------- | ----------------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| `EMIT` | `vne:autoread:emit` | When autoread is on and not blocked — `INTERACT.EMIT` on `vne-autoread-allow`, else `TIMEOUT_CREATE`. |
|
|
14
|
+
| `PUSH` | `vne:autoread:push` | Add a block source and `TIMEOUT_CLEAR`. Payload: `{ source? }`. |
|
|
15
|
+
| `POP` | `vne:autoread:pop` | Remove a block source; when the queue is empty — `TIMEOUT_CREATE`. Payload: `{ source? }`. |
|
|
16
|
+
| `TIMEOUT_CREATE` | `vne:autoread:timeout_create` | Start a timer for `SETTINGS.AUTOREAD.DELAY`; when it fires, emit `EMIT`. |
|
|
17
|
+
| `TIMEOUT_CLEAR` | `vne:autoread:timeout_clear` | Clear the active timer. |
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Constants
|
|
20
20
|
|
|
21
|
-
|
|
|
22
|
-
| -------------- |
|
|
23
|
-
| `LOGS_ACTIONS` |
|
|
21
|
+
| Key | Meaning |
|
|
22
|
+
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
23
|
+
| `LOGS_ACTIONS` | Log labels: `EMIT` (`emit`), `PUSH` (`push`), `POP` (`pop`), `TIMEOUT_CREATE` (`timeout_create`), `TIMEOUT_CLEAR` (`timeout_clear`). |
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Parameters
|
|
26
26
|
|
|
27
|
-
|
|
|
28
|
-
| ----------------- | --------- |
|
|
29
|
-
| `DEFAULT_DELAY` | `number` |
|
|
30
|
-
| `DEFAULT_ENABLED` | `boolean` |
|
|
27
|
+
| Key | Type | Meaning |
|
|
28
|
+
| ----------------- | --------- | -------------------------------------- |
|
|
29
|
+
| `DEFAULT_DELAY` | `number` | Default: 5000. |
|
|
30
|
+
| `DEFAULT_ENABLED` | `boolean` | Default for whether the feature is on. |
|
|
31
31
|
|
|
32
|
-
##
|
|
32
|
+
## Settings
|
|
33
33
|
|
|
34
|
-
|
|
|
35
|
-
| ---------------------------------- | --------- |
|
|
36
|
-
| `ENABLED` (`vne:autoread:enabled`) | `boolean` |
|
|
37
|
-
| `DELAY` (`vne:autoread:delay`) | `number` |
|
|
34
|
+
| Key | Type | Meaning |
|
|
35
|
+
| ---------------------------------- | --------- | -------------------------------------------------- |
|
|
36
|
+
| `ENABLED` (`vne:autoread:enabled`) | `boolean` | Turn the feature on or off. |
|
|
37
|
+
| `DELAY` (`vne:autoread:delay`) | `number` | Setting `vne:autoread:delay` in `shared.settings`. |
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## Modules
|
|
40
40
|
|
|
41
|
-
|
|
|
42
|
-
| ------------------ |
|
|
43
|
-
| `autoread` | `SETTINGS.INIT`
|
|
44
|
-
| `autoread.logs` |
|
|
45
|
-
| `autoread.sources` |
|
|
46
|
-
| `autoread.emit` | `EMIT`:
|
|
47
|
-
| `autoread.timeout` | `TIMEOUT_CREATE` / `TIMEOUT_CLEAR`.
|
|
41
|
+
| Module | Role |
|
|
42
|
+
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `autoread` | `SETTINGS.INIT` in `setup`. `SETTINGS.CHANGED` for `ENABLED` emits `PUSH` / `POP`. |
|
|
44
|
+
| `autoread.logs` | Log all `AUTOREAD` events via `EVENTS.LOGS.EMIT`. `PUSH` / `POP` log `source`. |
|
|
45
|
+
| `autoread.sources` | In `postinject` — `shared.autoreadDisableSources`. `PUSH` / `POP`. On `STATE.SET` clears the set. |
|
|
46
|
+
| `autoread.emit` | `EMIT`: when on and not blocked — `INTERACT.EMIT` on `vne-autoread-allow`, else `TIMEOUT_CREATE`. |
|
|
47
|
+
| `autoread.timeout` | `TIMEOUT_CREATE` / `TIMEOUT_CLEAR`. Timer on `SETTINGS.AUTOREAD.DELAY`, then `EMIT`. `STATE.CLEAR` → `TIMEOUT_CLEAR`. `STATE.SET` → `TIMEOUT_CLEAR`, then `TIMEOUT_CREATE`. |
|
|
48
48
|
|
|
49
|
-
##
|
|
49
|
+
## Related plugins
|
|
50
50
|
|
|
51
51
|
### plugins/core/
|
|
52
52
|
|
|
@@ -55,6 +55,6 @@ Payloads и результаты хендлеров типизированы ч
|
|
|
55
55
|
- [settings.md](../core/settings.md) — `SETTINGS`: EVENTS.CHANGED, EVENTS.INIT
|
|
56
56
|
- [state.md](../core/state.md) — `STATE`: EVENTS.CLEAR, EVENTS.SET
|
|
57
57
|
|
|
58
|
-
###
|
|
58
|
+
### Other
|
|
59
59
|
|
|
60
|
-
—
|
|
60
|
+
— None
|
|
@@ -1,106 +1,115 @@
|
|
|
1
1
|
# plugins/scenario/choose/
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Package: `@vnejs/plugins.scenario.choose` · namespace: `CHOOSE`
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Handles scenario commands `% choose` / `$ choose`, collects options, stores choice state in `globalState.choose`, and moves the scenario to the picked branch. Does not render UI — see [views.scenario/choose.md](../views.scenario/choose.md).
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Scenario commands
|
|
8
8
|
|
|
9
|
-
|
|
|
10
|
-
| --------------------- |
|
|
11
|
-
| `% choose` |
|
|
12
|
-
| `% choose.option "…"` |
|
|
13
|
-
| `$ choose repeat` |
|
|
9
|
+
| Syntax | Meaning |
|
|
10
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
11
|
+
| `% choose` | Open choice: collect `% choose.option`, emit `EMIT`. When all options are `hided` (or list empty) — `SKIP` and exit the block. |
|
|
12
|
+
| `% choose.option "…"` | Option branch; when passing a non-chosen option — skip body by indent. |
|
|
13
|
+
| `$ choose repeat` | Return to the nearest `% choose` **above** the current line in the same label and `emit SCENARIO.NEXT`. |
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Example “look around → back to menu” loop:
|
|
16
16
|
|
|
17
17
|
```vne
|
|
18
18
|
% choose
|
|
19
|
-
% choose.option "
|
|
19
|
+
% choose.option "Look around"
|
|
20
20
|
hided: $ flag seen
|
|
21
21
|
$ flag seen
|
|
22
22
|
"…"
|
|
23
23
|
$ choose repeat
|
|
24
|
-
#
|
|
24
|
+
# later — when on re-entry all options are hidden
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Events
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Handler payloads and results are typed through module augmentation of the contract (`VneEventPayloadMap` / `VneEventResultMap`). The types live in `@vnejs/contracts.scenario.choose`.
|
|
30
30
|
|
|
31
|
-
|
|
|
32
|
-
| -------------------- | ------------------------------- |
|
|
33
|
-
| `EMIT` | `vne:choose:emit` |
|
|
34
|
-
| `OPTION` | `vne:choose:option` |
|
|
35
|
-
| `OPTION_BEFORE` | `vne:choose:option_before` | Side effects
|
|
36
|
-
| `OPTION_REPLACE` | `vne:choose:option_replace` |
|
|
37
|
-
| `OPTION_REPLACE_REG` | `vne:choose:option_replace_reg` |
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
31
|
+
| Key | String | Meaning |
|
|
32
|
+
| -------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| `EMIT` | `vne:choose:emit` | Accept options and args; when any are visible — `STATE_UPDATE` and `SHOW`; else `SKIP`. |
|
|
34
|
+
| `OPTION` | `vne:choose:option` | Accept UI index: run `OPTION_BEFORE`, then `HIDE`, `OPTION_REPLACE`, set `curLine`, reset state, `emit SCENARIO.NEXT`. |
|
|
35
|
+
| `OPTION_BEFORE` | `vne:choose:option_before` | Side effects before applying choice (Observer subscriptions with `priority`). |
|
|
36
|
+
| `OPTION_REPLACE` | `vne:choose:option_replace` | Replace the accepted option UI index (handler chain before branch jump). |
|
|
37
|
+
| `OPTION_REPLACE_REG` | `vne:choose:option_replace_reg` | Register an `OPTION_REPLACE` handler. |
|
|
38
|
+
| `OPTION_TEXT` | `vne:choose:option_text` | Replace option `text` before it is stored. No handlers — the scenario literal stays. |
|
|
39
|
+
| `OPTION_TEXT_REG` | `vne:choose:option_text_reg` | Register an `OPTION_TEXT` handler. |
|
|
40
|
+
| `SKIP` | `vne:choose:skip` | Skip block: `curLine` to first line after `% choose` indent tree, `emit SCENARIO.NEXT`. |
|
|
41
|
+
| `SHOW` | `vne:choose:show` | Choice active (state ready). View plugin listens. |
|
|
42
|
+
| `HIDE` | `vne:choose:hide` | Choice closed. View plugin listens. |
|
|
43
|
+
| `EXEC_REG` | `vne:choose:exec_reg` | Register exec handler for substitution in options. |
|
|
44
|
+
| `EXEC_GET` | `vne:choose:exec_get` | Get a value via a registered exec handler. |
|
|
45
|
+
| `STATE_UPDATE` | `vne:choose:state_update` | Update accumulated `choose` module state. |
|
|
44
46
|
|
|
45
|
-
##
|
|
47
|
+
## Constants
|
|
46
48
|
|
|
47
|
-
|
|
|
48
|
-
| --------------------- |
|
|
49
|
-
| `EXEC_ACTIONS.REPEAT` |
|
|
50
|
-
| `LOGS_ACTIONS` |
|
|
49
|
+
| Key | Meaning |
|
|
50
|
+
| --------------------- | --------------------------------------------------------------- |
|
|
51
|
+
| `EXEC_ACTIONS.REPEAT` | Literal `repeat` for `$ choose repeat`. |
|
|
52
|
+
| `LOGS_ACTIONS` | Log labels: `EMIT`, `OPTION`, `SKIP`, `SHOW`, `HIDE`, `REPEAT`. |
|
|
51
53
|
|
|
52
|
-
##
|
|
54
|
+
## Parameters
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
None.
|
|
55
57
|
|
|
56
|
-
##
|
|
58
|
+
## Settings
|
|
57
59
|
|
|
58
|
-
|
|
60
|
+
None.
|
|
59
61
|
|
|
60
|
-
##
|
|
62
|
+
## State
|
|
61
63
|
|
|
62
64
|
`globalState.choose`: `options`, `args`, `isShow`, `id`.
|
|
63
65
|
|
|
64
|
-
`id` —
|
|
66
|
+
`id` — open instance id. `crypto.randomUUID()` on `EMIT` (including `$ choose repeat`), `""` after close. Saved in saves and history snapshots with state. Not exposed to scenario.
|
|
65
67
|
|
|
66
|
-
`STATE.SET`
|
|
68
|
+
`STATE.SET` does not change state when `isShow` and `id` match. Another open choice (`isShow: true`, different `id`): write slice, then `HIDE` and `SHOW` with `{ isForce: true }` so the view re-reads options. Visibility change — one `SHOW` or `HIDE` with `{ isForce: true }`. While hidden, another slice only updates state.
|
|
67
69
|
|
|
68
|
-
##
|
|
70
|
+
## Modules
|
|
69
71
|
|
|
70
|
-
|
|
|
71
|
-
| ------------------------ |
|
|
72
|
-
| `choose` | State (`id`, `options`, `args`, `isShow`): `STATE_UPDATE`, `STATE.SET` / `STATE.CLEAR` (→ `SHOW` / `HIDE`;
|
|
73
|
-
| `choose.emit` |
|
|
74
|
-
| `choose.option` |
|
|
75
|
-
| `choose.skip` |
|
|
76
|
-
| `choose.logs` |
|
|
77
|
-
| `choose.replace` |
|
|
78
|
-
| `choose.
|
|
79
|
-
| `choose.
|
|
80
|
-
| `choose.scenario
|
|
81
|
-
| `choose.scenario.
|
|
72
|
+
| Module | Role |
|
|
73
|
+
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
74
|
+
| `choose` | State (`id`, `options`, `args`, `isShow`): `STATE_UPDATE`, `STATE.SET` / `STATE.CLEAR` (→ `SHOW` / `HIDE`; different open choice — `HIDE`, then `SHOW`). |
|
|
75
|
+
| `choose.emit` | Handles `EMIT` (→ `STATE_UPDATE` + `SHOW` or `SKIP`). |
|
|
76
|
+
| `choose.option` | Handles `OPTION`. |
|
|
77
|
+
| `choose.skip` | Handles `SKIP` via `getBlockSkipShift`. |
|
|
78
|
+
| `choose.logs` | Log `EMIT` / `OPTION` / `SKIP` / `SHOW` / `HIDE`. |
|
|
79
|
+
| `choose.replace` | Registry for `OPTION_REPLACE_REG` handlers; extends `@vnejs/module.replace`. |
|
|
80
|
+
| `choose.option.text` | Registry for `OPTION_TEXT_REG` handlers; extends `@vnejs/module.replace`. `EMIT` resolves each option through `OPTION_TEXT`. |
|
|
81
|
+
| `choose.exec` | Registry for EXEC_REG / EXEC_GET handlers. |
|
|
82
|
+
| `choose.scenario` | Register `% choose`: collect option lines via `getBlockOptions`, emit `EMIT`. |
|
|
83
|
+
| `choose.scenario.option` | Register `% choose.option`: skip unchosen branches. |
|
|
84
|
+
| `choose.scenario.module` | Register `$ choose`: action `repeat`. |
|
|
82
85
|
|
|
83
86
|
## Compatibility
|
|
84
87
|
|
|
85
88
|
### `compatibility/scenario.choose/scenario.fastforward/`
|
|
86
89
|
|
|
87
|
-
|
|
90
|
+
Package: `@vnejs/compatibility.scenario.choose-with-scenario.fastforward`
|
|
88
91
|
|
|
89
|
-
|
|
92
|
+
In `subscribe` listens to `OPTION_BEFORE`: on option pick emits `FASTFORWARD.CHECK` (before `HIDE` / `OPTION_REPLACE`).
|
|
90
93
|
|
|
91
94
|
### `compatibility/scenario.choose/scenario.history/`
|
|
92
95
|
|
|
93
|
-
|
|
96
|
+
Package: `@vnejs/compatibility.scenario.choose-with-scenario.history`
|
|
94
97
|
|
|
95
|
-
|
|
98
|
+
In `subscribe` listens to `OPTION_BEFORE`: on option pick emits `HISTORY.ADD` with `{ locKey: "choice" }` (no speaker/text). Line text comes from history screen localization (`history.json`). Wired in `bundles/vn.skeleton`.
|
|
96
99
|
|
|
97
100
|
### `compatibility/scenario.choose/scenario.qte/`
|
|
98
101
|
|
|
99
|
-
|
|
102
|
+
Package: `@vnejs/compatibility.scenario.choose-with-scenario.qte`
|
|
100
103
|
|
|
101
|
-
|
|
104
|
+
On `OPTION_REPLACE` runs QTE when the option has `qte: <id>` (see [qte.md](./qte.md#compatibility)). Field `qte` is added to `ChooseOption` via this package’s module augmentation; `qte-fallback` — keyword on the option line (`% choose.option "…" | qte-fallback`), lands in `ChooseOption.keywords`.
|
|
102
105
|
|
|
103
|
-
|
|
106
|
+
### `compatibility/scenario.choose/text/`
|
|
107
|
+
|
|
108
|
+
Package: `@vnejs/compatibility.scenario.choose-with-text`
|
|
109
|
+
|
|
110
|
+
In `init` registers an `OPTION_TEXT` handler that returns `TEXT.REPLACE`. `text.locs` and `text.inject` stay on that chain. Without this package the option keeps the literal from the scenario line. Wired in `bundles/vn.skeleton`.
|
|
111
|
+
|
|
112
|
+
## Related plugins
|
|
104
113
|
|
|
105
114
|
### plugins/core/
|
|
106
115
|
|
|
@@ -108,11 +117,11 @@ Payloads и результаты хендлеров типизированы ч
|
|
|
108
117
|
- [scenario.md](../core/scenario.md) — `SCENARIO`: EVENTS.NEXT, EVENTS.LINE_EXEC_REG, EVENTS.LINES_GET
|
|
109
118
|
- [state.md](../core/state.md) — `STATE`: EVENTS.SET, EVENTS.CLEAR
|
|
110
119
|
|
|
111
|
-
###
|
|
120
|
+
### Other
|
|
112
121
|
|
|
113
|
-
- [text.md](../text/text.md) — `TEXT`:
|
|
114
|
-
- [qte.md](./qte.md) — `QTE`:
|
|
115
|
-
- [fastforward.md](./fastforward.md) — `FASTFORWARD`:
|
|
116
|
-
- [history.md](./history.md) — `HISTORY`:
|
|
117
|
-
- [views.scenario/choose.md](../views.scenario/choose.md) — `CHOOSE_VIEW`: UI
|
|
118
|
-
- [scenario/point_and_click.md](./point_and_click.md) —
|
|
122
|
+
- [text.md](../text/text.md) — `TEXT`: `OPTION_TEXT` → `REPLACE` (compatibility above)
|
|
123
|
+
- [qte.md](./qte.md) — `QTE`: link via `OPTION_REPLACE` (compatibility above)
|
|
124
|
+
- [fastforward.md](./fastforward.md) — `FASTFORWARD`: link via `OPTION_BEFORE` (compatibility above)
|
|
125
|
+
- [history.md](./history.md) — `HISTORY`: link via `OPTION_BEFORE` → `ADD` with `locKey` (compatibility above)
|
|
126
|
+
- [views.scenario/choose.md](../views.scenario/choose.md) — `CHOOSE_VIEW`: choice UI (listens SHOW / HIDE)
|
|
127
|
+
- [scenario/point_and_click.md](./point_and_click.md) — same `repeat` / `SKIP` / `SHOW` / `HIDE` / `STATE_UPDATE` pattern
|