@vnejs/docs 0.2.79 → 0.2.81
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 +17 -17
- package/architecture/backends.md +7 -7
- package/architecture/bridge.md +22 -0
- package/architecture/build.md +8 -7
- package/architecture/bundles.md +5 -5
- package/architecture/cli.md +7 -7
- package/architecture/configs.md +9 -9
- package/architecture/contracts.md +12 -12
- package/architecture/dependencies.md +37 -35
- package/architecture/editor.md +4 -4
- package/architecture/games.md +7 -7
- package/architecture/helpers.md +5 -5
- package/architecture/model.md +14 -14
- package/architecture/modules.md +35 -35
- package/architecture/packages.md +16 -16
- package/architecture/plugins.md +15 -15
- package/architecture/shared.md +16 -15
- package/architecture/uis.md +8 -8
- package/changelog/0.2.80.md +3 -0
- package/changelog/0.2.81.md +3 -0
- package/changelog/README.md +2 -0
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/plugins/controls/cursor.md +1 -1
- package/plugins/controls/gamepad.md +2 -2
- package/plugins/scenario/choose.md +14 -14
- package/plugins/scenario/fastforward.md +1 -1
- package/plugins/scenario/history.md +7 -7
- package/plugins/scenario/point_and_click.md +5 -5
- package/plugins/scenario/qte.md +6 -6
- package/plugins/text/smooth.md +4 -4
- package/plugins/text/text.md +10 -10
- package/plugins/views.scenario/choose.md +1 -1
- package/plugins/views.scenario/interface.md +8 -8
- package/plugins/views.scenario/point_and_click.md +4 -4
- package/plugins/views.scenario/qte.md +5 -5
- package/scenario.guide/choose.md +1 -1
- package/scenario.guide/qte-random.md +1 -1
- package/architecture/compatibility.md +0 -22
package/architecture/modules.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# modules_extensions/
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Base-class hierarchy** for modules inside `plugins/`.
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Class hierarchy
|
|
6
6
|
|
|
7
7
|
```mermaid
|
|
8
8
|
flowchart TD
|
|
@@ -11,7 +11,7 @@ flowchart TD
|
|
|
11
11
|
MR["@vnejs/module.replace<br/>ModuleReplace"]
|
|
12
12
|
MRE["@vnejs/module.replace.exec<br/>ModuleReplaceExec"]
|
|
13
13
|
MCO["@vnejs/module.components<br/>ModuleController, ModuleView"]
|
|
14
|
-
ML["@vnejs/module.layer<br/>canvas
|
|
14
|
+
ML["@vnejs/module.layer<br/>canvas layers"]
|
|
15
15
|
MA["@vnejs/module.audio"]
|
|
16
16
|
MCA["@vnejs/module.controller.audio"]
|
|
17
17
|
MCT["@vnejs/module.controller.tabs"]
|
|
@@ -50,38 +50,38 @@ flowchart TD
|
|
|
50
50
|
MCO --> ML
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
|
|
|
54
|
-
| ------------------------------------------------ |
|
|
55
|
-
| **`@vnejs/module`** | **`Module`**: `VNE`, `on`/`emit`, `inject`, state, shared, media, lifecycle
|
|
56
|
-
| **`@vnejs/module.core`** | **`ModuleCore`** —
|
|
57
|
-
| **`@vnejs/module.replace`** | **`ModuleReplace`** —
|
|
58
|
-
| **`@vnejs/module.replace.exec`** | **`ModuleReplaceExec`** —
|
|
59
|
-
| **`@vnejs/module.components`** | **`ModuleView`**, **`ModuleController`** — React
|
|
60
|
-
| **`@vnejs/module.layer`** | Canvas layers: controller, image, sprite, text, video, props, view
|
|
61
|
-
| **`@vnejs/module.audio`** |
|
|
62
|
-
| **`@vnejs/module.controller.audio`** | Overlay
|
|
63
|
-
| **`@vnejs/module.controller.tabs`** |
|
|
64
|
-
| **`@vnejs/module.controller.preload`** |
|
|
65
|
-
| **`@vnejs/module.controller.backgrounds`** |
|
|
66
|
-
| **`@vnejs/module.controller.bg`** |
|
|
67
|
-
| **`@vnejs/module.controller.accept`** | ACCEPT / INTERACT →
|
|
68
|
-
| **`@vnejs/module.controller.interact`** | `BUTTONS.ANY` → `INTERACT.EMIT
|
|
69
|
-
| **`@vnejs/module.controller.arrows.vertical`** | ARROW_UP / ARROW_BOTTOM
|
|
70
|
-
| **`@vnejs/module.controller.arrows.horizontal`** | ARROW_LEFT / ARROW_RIGHT
|
|
71
|
-
| **`@vnejs/module.controller.arrows.grid`** |
|
|
72
|
-
| **`@vnejs/module.controller.pages`** |
|
|
73
|
-
| **`@vnejs/module.controller.hide.on.state`** | STATE.SET / STATE.CLEAR → emit HIDE
|
|
74
|
-
| **`@vnejs/module.controller.hide.on.controls`** | BACK / MENU / GAMEMENU → emit HIDE
|
|
75
|
-
| **`@vnejs/module.scales.common`** |
|
|
53
|
+
| Package | Role |
|
|
54
|
+
| ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
55
|
+
| **`@vnejs/module`** | **`Module`**: `VNE`, `on`/`emit`, `inject`, state, shared, media, lifecycle |
|
|
56
|
+
| **`@vnejs/module.core`** | **`ModuleCore`** — typed access to **core contracts** |
|
|
57
|
+
| **`@vnejs/module.replace`** | **`ModuleReplace`** — replace a payload field in order through `REPLACE_KEY` and a handler chain |
|
|
58
|
+
| **`@vnejs/module.replace.exec`** | **`ModuleReplaceExec`** — a registry of exec handlers by module name (`EXEC_REG` / `EXEC_GET`) |
|
|
59
|
+
| **`@vnejs/module.components`** | **`ModuleView`**, **`ModuleController`** — React view, zustand, media, controls. `SHOW`: `GATE` `-200`, `BEFORE` `-100`, `MAIN` `0`, `CONTROLS` `100`, `AFTER` `200`, `CLEANUP` `300`. `HIDE`: `GATE` `-300`, `CONTROLS` `-200`, `BEFORE` `-100`, `MAIN` `0`, `AFTER` `100`, `CLEANUP` `200`. `setShow` emits `UPDATE_STATE` `{ isShow }`, then `updateView(isForce, false)`. `UPDATE_FAST`, `EXTERNAL_UPDATE` (`isShow` → `updateViewFast`) |
|
|
60
|
+
| **`@vnejs/module.layer`** | Canvas layers: controller, image, sprite, text, video, props, view |
|
|
61
|
+
| **`@vnejs/module.audio`** | Base for audio plugins of scenario layers (`music` / `sound` / …) |
|
|
62
|
+
| **`@vnejs/module.controller.audio`** | Overlay BGM for view screens: pause global / play `view` / resume on `SHOW.AFTER` / `HIDE.AFTER` / PRELOAD |
|
|
63
|
+
| **`@vnejs/module.controller.tabs`** | Tab navigation: TAB_PREV/TAB_NEXT → `TAB_SET`; guard + `applyTab` (`UPDATE_STATE` `{ tab }`) + abstract `onTabSet`. The tab is set on `SHOW.BEFORE`. PUSH/POP on `CONTROLS` |
|
|
64
|
+
| **`@vnejs/module.controller.preload`** | Preload labels and events on `SHOW.BEFORE` (emits PRELOAD) and on PRELOAD. `isShow` comes from `UPDATE_STATE`. `MEMORY.CLEARED` runs only when `isShow`. The plugin sets the events (`EVENT_SHOW` / `EVENT_HIDE` / `EVENT_PRELOAD` / `EVENT_UPDATE_STATE`) |
|
|
65
|
+
| **`@vnejs/module.controller.backgrounds`** | Rotate a background list on `SHOW.AFTER`, on a timer, and on `MEMORY.CLEARED` when `isShow` comes from `UPDATE_STATE`. The timer is always cleared on `HIDE.AFTER`. The plugin sets the events and the list |
|
|
66
|
+
| **`@vnejs/module.controller.bg`** | A static screen background. `SHOW.BEFORE` writes `bgSrc` through `UPDATE_STATE`. `isShow` comes from `UPDATE_STATE`. Optional PRELOAD / start / STATE.CLEAR. On `MEMORY.CLEARED`, preload and/or refresh when `isShow` |
|
|
67
|
+
| **`@vnejs/module.controller.accept`** | ACCEPT / INTERACT → the plugin ACCEPT event. PUSH/POP controls on `SHOW.CONTROLS` / `HIDE.CONTROLS` |
|
|
68
|
+
| **`@vnejs/module.controller.interact`** | `BUTTONS.ANY` → `INTERACT.EMIT`. After show, `INTERACT.PUSH` (`onInteract`). Before hide, `INTERACT.POP`. PUSH/POP controls on `SHOW.CONTROLS` / `HIDE.CONTROLS` |
|
|
69
|
+
| **`@vnejs/module.controller.arrows.vertical`** | ARROW_UP / ARROW_BOTTOM over visible items. PUSH/POP controls on `SHOW.CONTROLS` / `HIDE.CONTROLS`. The index goes through `UPDATE_STATE`. On `HIDE.CLEANUP`, `currentArrowVerticalItem` becomes `undefined` through `UPDATE_STATE`, then `UPDATE_FAST` |
|
|
70
|
+
| **`@vnejs/module.controller.arrows.horizontal`** | ARROW_LEFT / ARROW_RIGHT over items. PUSH/POP controls on `SHOW.CONTROLS` / `HIDE.CONTROLS`. The index goes through `UPDATE_STATE`. On `HIDE.CLEANUP`, `currentArrowHorizontalItem` becomes `undefined` through `UPDATE_STATE`, then `UPDATE_FAST` |
|
|
71
|
+
| **`@vnejs/module.controller.arrows.grid`** | Four arrows on a grid. `GRID_NEXT` / `GRID_PREV` at the edge. PUSH/POP on `SHOW.CONTROLS` / `HIDE.CONTROLS`. `GRID_UPDATE_ITEMS` has no payload. Meta goes through `UPDATE_STATE`. On `HIDE.CLEANUP`, `gridRow` / `gridColumn` become `undefined` through `UPDATE_STATE`, then `UPDATE_FAST` |
|
|
72
|
+
| **`@vnejs/module.controller.pages`** | Pagination: `PAGE_SET` / `PAGE_NEXT` / `PAGE_PREV` → `setPage` → `UPDATE_STATE` (`pageIndex`) + abstract `applyPage` + `UPDATE_FAST` |
|
|
73
|
+
| **`@vnejs/module.controller.hide.on.state`** | STATE.SET / STATE.CLEAR → emit the plugin HIDE (`isForce` is set by the subclass) |
|
|
74
|
+
| **`@vnejs/module.controller.hide.on.controls`** | BACK / MENU / GAMEMENU → emit the plugin HIDE. PUSH/POP controls on `SHOW.CONTROLS` / `HIDE.CONTROLS` |
|
|
75
|
+
| **`@vnejs/module.scales.common`** | Base for scales / RPG modules |
|
|
76
76
|
|
|
77
|
-
###
|
|
77
|
+
### Principles
|
|
78
78
|
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
- **`ModuleCore`**
|
|
79
|
+
- A plugin takes the base it needs (`ModuleCore`, `ModuleView`, `ModuleLayerController`, …). It does not extend `Module` directly.
|
|
80
|
+
- Bases pull **contracts** from `contracts/`. That is how `EVENTS` / `CONST` are typed.
|
|
81
|
+
- **`ModuleCore`** is for `plugins/core/` and `bridge/`. **`ModuleView` / `ModuleLayer*`** are for view and canvas, plus **`@vnejs/uis.react`**.
|
|
82
82
|
|
|
83
|
-
| | `packages/`
|
|
84
|
-
| ----------------- |
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
83
|
+
| | `packages/` | `modules_extensions/` |
|
|
84
|
+
| ----------------- | -------------------------- | ---------------------------- |
|
|
85
|
+
| Role | Runtime and infrastructure | Templates for plugin modules |
|
|
86
|
+
| Registered in VNE | yes (`registry`, `core`) | no |
|
|
87
|
+
| Inheritance | — | `plugins/` extend the bases |
|
package/architecture/packages.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# packages/
|
|
2
2
|
|
|
3
|
-
**Runtime
|
|
3
|
+
**Runtime base of the engine.** Published npm packages `@vnejs/*`. `plugins/`, `bundles/`, and `VneCore` stand on them.
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Contents and dependencies
|
|
6
6
|
|
|
7
7
|
```mermaid
|
|
8
8
|
flowchart BT
|
|
@@ -25,19 +25,19 @@ flowchart BT
|
|
|
25
25
|
SH --> ME
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
|
|
|
29
|
-
| ------------------------ |
|
|
30
|
-
| **`@vnejs/registry`** |
|
|
31
|
-
| **`@vnejs/observer`** | **`Observer`** — pub/sub: `subscribe` / `emit`
|
|
32
|
-
| **`@vnejs/core`** | **`VneCore`**:
|
|
33
|
-
| **`@vnejs/constants`** |
|
|
34
|
-
| **`@vnejs/sources-set`** | **`SourcesSet`** —
|
|
35
|
-
| **`@vnejs/semaphore`** | **`Semaphore`** —
|
|
36
|
-
| **`@vnejs/test-utils`** | Harness
|
|
28
|
+
| Package | Role |
|
|
29
|
+
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
30
|
+
| **`@vnejs/registry`** | Registry **`VNE`**, array **`VNE_MODULES`**, **`regPlugin`** / **`regModule`**, types for module augmentation |
|
|
31
|
+
| **`@vnejs/observer`** | **`Observer`** — pub/sub: `subscribe` / `emit` with `priority` (groups in ascending order), `emitOne`, `emitReal`, `emitReals` |
|
|
32
|
+
| **`@vnejs/core`** | **`VneCore`**: modules from `VNE_MODULES`, lifecycle, load `mods.json` / `media_info/`, `reset` |
|
|
33
|
+
| **`@vnejs/constants`** | Shared stub constants (`EMPTY_OBJECT`, `EMPTY_ARRAY`) |
|
|
34
|
+
| **`@vnejs/sources-set`** | **`SourcesSet`** — manage a set of sources (text and related logic) |
|
|
35
|
+
| **`@vnejs/semaphore`** | **`Semaphore`** — a task queue with weights and a concurrency limit |
|
|
36
|
+
| **`@vnejs/test-utils`** | Harness for module tests: observer stubs, `createTestModule`, spies, DOM mocks |
|
|
37
37
|
|
|
38
|
-
###
|
|
38
|
+
### Principles
|
|
39
39
|
|
|
40
|
-
- **`registry` + `observer`**
|
|
41
|
-
- **`core`**
|
|
42
|
-
- **`test-utils`**
|
|
43
|
-
-
|
|
40
|
+
- **`registry` + `observer`** are the base. Almost every plugin and module depends on them.
|
|
41
|
+
- **`core`** is the runtime assembly point. `games/` create `new VneCore()` after they import `bundles/`.
|
|
42
|
+
- **`test-utils`** is only for tests of workspace packages. It is not part of the game runtime.
|
|
43
|
+
- Packages hold no game logic. They are not tied to one `bundles/` package.
|
package/architecture/plugins.md
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
# plugins/
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A **plugin** is the behavior described in `contracts/`.
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Registration
|
|
6
6
|
|
|
7
|
-
1.
|
|
7
|
+
1. Import the contract from `contracts/`.
|
|
8
8
|
2. `regPlugin(PLUGIN_NAME, { constants, events, params, settings }, [ModuleClasses])`.
|
|
9
|
-
3.
|
|
9
|
+
3. Classes land in `VNE_MODULES` through `regModule`.
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### Modules and lifecycle
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
A plugin is a **set of modules**, each with a unique `name`. After `new VneCore()`:
|
|
14
14
|
|
|
15
|
-
1. **`inject`** — observer, global state, shared, media.
|
|
16
|
-
2. **`subscribe`** —
|
|
17
|
-
3. **`setup`** —
|
|
18
|
-
4. **`init`** —
|
|
19
|
-
5. **`start`** —
|
|
15
|
+
1. **`inject`** — observer, global state, shared, media. At the end, if the method exists, `postinject` runs.
|
|
16
|
+
2. **`subscribe`** — event subscriptions.
|
|
17
|
+
3. **`setup`** — prepare before `init` (every `setup` finishes before any `init`).
|
|
18
|
+
4. **`init`** — async initialization.
|
|
19
|
+
5. **`start`** — after every `init` (every `init` finishes before any `start`).
|
|
20
20
|
|
|
21
21
|
```mermaid
|
|
22
22
|
sequenceDiagram
|
|
23
|
-
participant A as
|
|
23
|
+
participant A as Module plugins/ A
|
|
24
24
|
participant OBS as Observer
|
|
25
|
-
participant B as
|
|
25
|
+
participant B as Module plugins/ B
|
|
26
26
|
|
|
27
27
|
A->>OBS: emit(EVENT_A.DONE, payload)
|
|
28
28
|
OBS->>B: handler
|
|
29
29
|
B->>OBS: emit(EVENT_B.START)
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Packages in `plugins/` **do not import** code from a neighbor plugin. They import the contract and `VNE`.
|
|
33
33
|
|
|
34
|
-
###
|
|
34
|
+
### Dependencies
|
|
35
35
|
|
|
36
36
|
- `contracts/`, **`@vnejs/module.*`**, **`@vnejs/helpers`**, **`@vnejs/uis.*`** (view).
|
package/architecture/shared.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# shared/
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Plugin setup presets.** Functions the game uses to build parameters. Not a plugin, not a contract, and not behavior on the bus.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Name: `shared/views.screens/gamemenu/` → **`@vnejs/shared.views.screens.gamemenu`**. Do not use a bare **`@vnejs/shared`**. That name used to mean the registry. The registry is now **`@vnejs/registry`**.
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Contents
|
|
8
8
|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
| **`@vnejs/shared.views.screens.gamemenu`** |
|
|
12
|
-
| **`@vnejs/shared.views.screens.mainmenu`** |
|
|
13
|
-
| **`@vnejs/shared.views.settings`**
|
|
9
|
+
| Package | Role |
|
|
10
|
+
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| **`@vnejs/shared.views.screens.gamemenu`** | Functions for game-menu items. Each one returns `GameMenuItemFactory`. `locKey` is required. Optional `cbBefore` and `cbAfter` run around the click. |
|
|
12
|
+
| **`@vnejs/shared.views.screens.mainmenu`** | Functions for main-menu items. Each one returns `MainMenuItemFactory`. `locKey` is required. Optional `cbBefore` and `cbAfter` run around the click. |
|
|
13
|
+
| **`@vnejs/shared.views.settings`** | Functions for settings actions and fields. A confirm action takes `locKey`, `locKeyAccept`, and `locKeyDecline`. An action without confirm takes no arguments. `createFieldToggle` takes `locKey` and `settingKey` and returns a `toggle` field. `createFieldRangeX` and `createFieldRangeS` take `locKey`, `settingKey`, `min`, `max`, `step`, and an optional `valueMap`. They return a `range` field with suffix `x` or `s`. `createFieldVolume` takes `locKey` and `settingKey` and returns a `range` field from 0 to 100, step 1, suffix `%`. `createFieldQuality` takes `locKey`, a flag for each key of `CONST.LAYER.QUALITIES`, and an optional `optionsWidthModifier`. `createFieldFilter` takes `locKey`, `optionsWidthModifier`, and an array of values. The first item is an empty value with key `locKey.off`. `createFieldLang` takes `locKey` and an array of values. An item key is `locKey`, a dot, and the value. `createFieldActions` takes `locKey` and an array of values. An item key is `locKey`, a dot, and the value. `action` equals that value. |
|
|
14
14
|
|
|
15
15
|
```mermaid
|
|
16
16
|
flowchart TD
|
|
@@ -23,15 +23,16 @@ flowchart TD
|
|
|
23
23
|
G --> B
|
|
24
24
|
G --> SH
|
|
25
25
|
B --> P
|
|
26
|
+
B --> SH
|
|
26
27
|
P --> CT
|
|
27
28
|
SH --> CT
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
###
|
|
31
|
+
### Principles
|
|
31
32
|
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
- **`plugins/`**
|
|
33
|
+
- The package imports **`@vnejs/registry`** and the **`contracts/`** it needs. It does not import implementations from **`plugins/`**.
|
|
34
|
+
- One package may depend on several contracts. A menu-item click ties events from different plugins.
|
|
35
|
+
- A function returns a factory `(module) => item`. It does not write to `VNE.PARAMS`.
|
|
36
|
+
- A bundle that depends on a plugin lists the matching `@vnejs/shared.*` in `dependencies`. Bundle source does not import or re-export the factories.
|
|
37
|
+
- The game imports `@vnejs/shared.*` in a script and builds `PARAMS.ITEMS` itself. The game `package.json` does not list that dependency.
|
|
38
|
+
- **`plugins/`** do not import **`shared/`** packages.
|
package/architecture/uis.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# uis/
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Presentation layer** for view plugins. Not a plugin. Not in `VNE`.
|
|
4
4
|
|
|
5
|
-
|
|
|
5
|
+
| Part | Role |
|
|
6
6
|
| --------------------------- | ----------------------------- |
|
|
7
7
|
| **`uis/utils/`** | `cn`, `injectStyles`, `sel` |
|
|
8
|
-
| **`uis/react/primitives/`** |
|
|
9
|
-
| **`uis/react/composites/`** |
|
|
10
|
-
| **`uis/react/complex/`** |
|
|
11
|
-
| **`uis/react/hooks/`** | React
|
|
8
|
+
| **`uis/react/primitives/`** | Atoms (button, text, icon, …) |
|
|
9
|
+
| **`uis/react/composites/`** | Composite components |
|
|
10
|
+
| **`uis/react/complex/`** | Large UI blocks |
|
|
11
|
+
| **`uis/react/hooks/`** | React hooks |
|
|
12
12
|
| **`uis/react/base/`** | Barrel **`@vnejs/uis.react`** |
|
|
13
13
|
|
|
14
|
-
View
|
|
14
|
+
View plugins in `plugins/` use **`ModuleView`** and render with components from `uis/`.
|
|
15
15
|
|
|
16
16
|
```mermaid
|
|
17
17
|
flowchart TD
|
|
@@ -19,5 +19,5 @@ flowchart TD
|
|
|
19
19
|
VP --> UIR["@vnejs/uis.react"]
|
|
20
20
|
VP --> UU["@vnejs/uis.utils"]
|
|
21
21
|
VP --> OBS[Observer]
|
|
22
|
-
UIR -.->|"
|
|
22
|
+
UIR -.->|"does not use"| VNE
|
|
23
23
|
```
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# 0.2.80
|
|
2
|
+
|
|
3
|
+
- `bundles/vn.base` — depends on `@vnejs/shared.views.screens.gamemenu`, `@vnejs/shared.views.screens.mainmenu`, and `@vnejs/shared.views.settings`. The bundle does not import or re-export the factories. A game script still imports those packages. The game `package.json` still omits them.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# 0.2.81
|
|
2
|
+
|
|
3
|
+
- `bridge/` — replaces `compatibility/`. A package is `@vnejs/bridge.plugins.<one>.plugins.<two>`. `regPlugin` uses namespace `BRIDGE_PLUGIN_<PLUGIN_NAME_1>_PLUGIN_<PLUGIN_NAME_2>` and an empty shape. There is no bridge contract. The module class lives in `src/modules/`. Six pairs follow the plugins the module actually uses: `plugins.text` + `plugins.canvas.child.sprite.speak`, `plugins.text` + `plugins.canvas.child.bg.speak`, `plugins.text.smooth` + `plugins.scenario.fastforward`, `plugins.settings.potato` + `plugins.text.smooth`, `plugins.canvas.child.bg` + `plugins.views.screens.gallery`, `plugins.scenario.autoread` + `plugins.audio.voice`.
|
package/changelog/README.md
CHANGED
package/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -71,4 +71,4 @@ None.
|
|
|
71
71
|
### Other
|
|
72
72
|
|
|
73
73
|
- [controls.md](./controls.md) — `CONTROLS`: EVENTS.DEVICE_SET (mousemove → keyboard)
|
|
74
|
-
- [gamepad.md](./gamepad.md) — sticks via `
|
|
74
|
+
- [gamepad.md](./gamepad.md) — sticks via `bridge/plugins.controls.gamepad/plugins.controls.cursor`: left → `SHIFT`, right → `SCROLL`; device type (xbox|ps) — `controls.gamepad.device`
|
|
@@ -42,7 +42,7 @@ After the poll yields logical name `button_N`, `controls.gamepad.buttons` emits
|
|
|
42
42
|
| `button_4` | LB / L1 | `TAB_PREV` |
|
|
43
43
|
| `button_5` | RB / R1 | `TAB_NEXT` |
|
|
44
44
|
| `button_6` | LT / L2 | `FASTFORWARD_START` / `FASTFORWARD_FINISH` |
|
|
45
|
-
| `button_7` | RT / R2 | (cursor click via
|
|
45
|
+
| `button_7` | RT / R2 | (cursor click via bridge) |
|
|
46
46
|
| `button_8` | View / Select | `GAMEMENU` |
|
|
47
47
|
| `button_9` | Menu / Start | `MENU` |
|
|
48
48
|
| `button_12`…`15` | D-pad | `ARROW_*` |
|
|
@@ -101,4 +101,4 @@ All mappings — object `CUSTOM_BUTTON_MAPPING` in `plugins/controls/gamepad/src
|
|
|
101
101
|
### Other
|
|
102
102
|
|
|
103
103
|
- [controls.md](./controls.md) — `CONTROLS`: EVENTS.EMIT, EVENTS.DEVICE_SET (via `controls.gamepad.device` → xbox|playstation), CONST.BUTTONS, CONST.DEVICES
|
|
104
|
-
- [cursor.md](./cursor.md) — via `
|
|
104
|
+
- [cursor.md](./cursor.md) — via `bridge/plugins.controls.gamepad/plugins.controls.cursor`: left stick (axes 0–1) → `CURSOR.SHIFT`, right stick (axes 2–3) → `CURSOR.SCROLL`; RT → `CURSOR.CLICK`
|
|
@@ -84,29 +84,29 @@ None.
|
|
|
84
84
|
| `choose.scenario.option` | Register `% choose.option`: skip unchosen branches. |
|
|
85
85
|
| `choose.scenario.module` | Register `$ choose`: action `repeat`. |
|
|
86
86
|
|
|
87
|
-
##
|
|
87
|
+
## Bridge
|
|
88
88
|
|
|
89
|
-
### `
|
|
89
|
+
### `bridge/plugins.scenario.choose/plugins.scenario.fastforward/`
|
|
90
90
|
|
|
91
|
-
Package: `@vnejs/
|
|
91
|
+
Package: `@vnejs/bridge.plugins.scenario.choose.plugins.scenario.fastforward`
|
|
92
92
|
|
|
93
93
|
In `subscribe` listens to `OPTION` at `OPTION_PRIORITY.BEFORE`: on option pick emits `FASTFORWARD.CHECK` (before `HIDE` / `OPTION_REPLACE`).
|
|
94
94
|
|
|
95
|
-
### `
|
|
95
|
+
### `bridge/plugins.scenario.choose/plugins.scenario.history/`
|
|
96
96
|
|
|
97
|
-
Package: `@vnejs/
|
|
97
|
+
Package: `@vnejs/bridge.plugins.scenario.choose.plugins.scenario.history`
|
|
98
98
|
|
|
99
99
|
In `subscribe` listens to `OPTION` at `OPTION_PRIORITY.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`.
|
|
100
100
|
|
|
101
|
-
### `
|
|
101
|
+
### `bridge/plugins.scenario.choose/plugins.scenario.qte/`
|
|
102
102
|
|
|
103
|
-
Package: `@vnejs/
|
|
103
|
+
Package: `@vnejs/bridge.plugins.scenario.choose.plugins.scenario.qte`
|
|
104
104
|
|
|
105
|
-
On `OPTION_REPLACE` runs QTE when the option has `qte: <id>` (see [qte.md](./qte.md#
|
|
105
|
+
On `OPTION_REPLACE` runs QTE when the option has `qte: <id>` (see [qte.md](./qte.md#bridge)). 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`.
|
|
106
106
|
|
|
107
|
-
### `
|
|
107
|
+
### `bridge/plugins.scenario.choose/plugins.text/`
|
|
108
108
|
|
|
109
|
-
Package: `@vnejs/
|
|
109
|
+
Package: `@vnejs/bridge.plugins.scenario.choose.plugins.text`
|
|
110
110
|
|
|
111
111
|
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`.
|
|
112
112
|
|
|
@@ -120,9 +120,9 @@ In `init` registers an `OPTION_TEXT` handler that returns `TEXT.REPLACE`. `text.
|
|
|
120
120
|
|
|
121
121
|
### Other
|
|
122
122
|
|
|
123
|
-
- [text.md](../text/text.md) — `TEXT`: `OPTION_TEXT` → `REPLACE` (
|
|
124
|
-
- [qte.md](./qte.md) — `QTE`: link via `OPTION_REPLACE` (
|
|
125
|
-
- [fastforward.md](./fastforward.md) — `FASTFORWARD`: link via `OPTION` at `OPTION_PRIORITY.BEFORE` (
|
|
126
|
-
- [history.md](./history.md) — `HISTORY`: link via `OPTION` at `OPTION_PRIORITY.BEFORE` → `ADD` with `locKey` (
|
|
123
|
+
- [text.md](../text/text.md) — `TEXT`: `OPTION_TEXT` → `REPLACE` (bridge above)
|
|
124
|
+
- [qte.md](./qte.md) — `QTE`: link via `OPTION_REPLACE` (bridge above)
|
|
125
|
+
- [fastforward.md](./fastforward.md) — `FASTFORWARD`: link via `OPTION` at `OPTION_PRIORITY.BEFORE` (bridge above)
|
|
126
|
+
- [history.md](./history.md) — `HISTORY`: link via `OPTION` at `OPTION_PRIORITY.BEFORE` → `ADD` with `locKey` (bridge above)
|
|
127
127
|
- [views.scenario/choose.md](../views.scenario/choose.md) — `CHOOSE_VIEW`: choice UI (listens SHOW / HIDE)
|
|
128
128
|
- [scenario/point_and_click.md](./point_and_click.md) — same `repeat` / `SKIP` / `SHOW` / `HIDE` / `STATE_UPDATE` pattern
|
|
@@ -71,4 +71,4 @@ Handler payloads and results are typed through module augmentation of the contra
|
|
|
71
71
|
|
|
72
72
|
### Other
|
|
73
73
|
|
|
74
|
-
- [choose.md](./choose.md) — `CHOOSE`: linked via `
|
|
74
|
+
- [choose.md](./choose.md) — `CHOOSE`: linked via `bridge/plugins.scenario.choose/plugins.scenario.fastforward` (`OPTION` at `OPTION_PRIORITY.BEFORE` → `FASTFORWARD.CHECK`)
|
|
@@ -47,17 +47,17 @@ None.
|
|
|
47
47
|
|
|
48
48
|
Log state belongs to module `history` (`globalState.history`). Snapshots in `MEMORY` use module name `history.memory`.
|
|
49
49
|
|
|
50
|
-
##
|
|
50
|
+
## Bridge
|
|
51
51
|
|
|
52
|
-
### `
|
|
52
|
+
### `bridge/plugins.text/plugins.scenario.history/`
|
|
53
53
|
|
|
54
|
-
Package: `@vnejs/
|
|
54
|
+
Package: `@vnejs/bridge.plugins.text.plugins.scenario.history`
|
|
55
55
|
|
|
56
56
|
On `TEXT.EMIT_NEXT` emits `HISTORY.ADD` with `{ label, text, args, speaker, speakerInfo }`. `text` — scenario line as-is, including `{…}` markers: that is the localization key. Wired in `bundles/vn.skeleton`.
|
|
57
57
|
|
|
58
|
-
### `
|
|
58
|
+
### `bridge/plugins.scenario.choose/plugins.scenario.history/`
|
|
59
59
|
|
|
60
|
-
Package: `@vnejs/
|
|
60
|
+
Package: `@vnejs/bridge.plugins.scenario.choose.plugins.scenario.history`
|
|
61
61
|
|
|
62
62
|
On `CHOOSE.OPTION` at `CONST.CHOOSE.OPTION_PRIORITY.BEFORE` emits `HISTORY.ADD` with `{ locKey: "choice" }`. Line translation — key `choice` in the screen `history.json`. Wired in `bundles/vn.skeleton`.
|
|
63
63
|
|
|
@@ -72,6 +72,6 @@ On `CHOOSE.OPTION` at `CONST.CHOOSE.OPTION_PRIORITY.BEFORE` emits `HISTORY.ADD`
|
|
|
72
72
|
|
|
73
73
|
### Other
|
|
74
74
|
|
|
75
|
-
- [text.md](../text/text.md) — `TEXT`: `EMIT_NEXT` → `ADD` (
|
|
76
|
-
- [choose.md](./choose.md) — `CHOOSE`: `OPTION` at `OPTION_PRIORITY.BEFORE` → `ADD` (
|
|
75
|
+
- [text.md](../text/text.md) — `TEXT`: `EMIT_NEXT` → `ADD` (bridge above)
|
|
76
|
+
- [choose.md](./choose.md) — `CHOOSE`: `OPTION` at `OPTION_PRIORITY.BEFORE` → `ADD` (bridge above)
|
|
77
77
|
- [views.screens/history.md](../views.screens/history.md) — `HISTORY_VIEW`: log screen (`SHOW` / `HIDE`); reads `GET` / `KEYS` / `LOAD`
|
|
@@ -70,17 +70,17 @@ None.
|
|
|
70
70
|
| `point_and_click.scenario.option` | Register `% point-and-click.option`: skip unchosen branches. |
|
|
71
71
|
| `point_and_click.scenario.module` | Register `$ point-and-click`: action `repeat`. |
|
|
72
72
|
|
|
73
|
-
##
|
|
73
|
+
## Bridge
|
|
74
74
|
|
|
75
|
-
### `
|
|
75
|
+
### `bridge/plugins.scenario.point_and_click/plugins.vars.flags/`
|
|
76
76
|
|
|
77
|
-
Package: `@vnejs/
|
|
77
|
+
Package: `@vnejs/bridge.plugins.scenario.point_and_click.plugins.vars.flags`
|
|
78
78
|
|
|
79
79
|
In `init` registers handler on `EXEC_REG` for flags module → `VARS_FLAGS.EXEC_CHECK`.
|
|
80
80
|
|
|
81
|
-
### `
|
|
81
|
+
### `bridge/plugins.scenario.point_and_click/plugins.vars.counters/`
|
|
82
82
|
|
|
83
|
-
Package: `@vnejs/
|
|
83
|
+
Package: `@vnejs/bridge.plugins.scenario.point_and_click.plugins.vars.counters`
|
|
84
84
|
|
|
85
85
|
In `init` registers handler on `EXEC_REG` for counters module → `VARS_COUNTERS.EXEC_CHECK`.
|
|
86
86
|
|
package/plugins/scenario/qte.md
CHANGED
|
@@ -21,7 +21,7 @@ Handler payloads and results are typed through module augmentation of the contra
|
|
|
21
21
|
|
|
22
22
|
| Key | Meaning |
|
|
23
23
|
| ---------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
24
|
-
| `LINE_KEYWORDS.QTE_FALLBACK` | `"qte-fallback"`: keyword on `% choose.option` for QTE fail branch (via choose↔qte
|
|
24
|
+
| `LINE_KEYWORDS.QTE_FALLBACK` | `"qte-fallback"`: keyword on `% choose.option` for QTE fail branch (via choose↔qte bridge). |
|
|
25
25
|
| `LOGS_ACTIONS` | Log labels: `EMIT` (`emit`), `RESULT` (`result`), `MISSING` (`missing`). |
|
|
26
26
|
|
|
27
27
|
## Parameters
|
|
@@ -68,13 +68,13 @@ None.
|
|
|
68
68
|
|
|
69
69
|
## Embedded (`skipScenario`)
|
|
70
70
|
|
|
71
|
-
On `EMIT` with `skipScenario: true` sets `shared.qteScenarioSkip`; on `RESULT` module `qte.result` does **not** change `curLine` and does **not** call `emit SCENARIO.NEXT` — only `CLOSED`. Used by choose↔qte
|
|
71
|
+
On `EMIT` with `skipScenario: true` sets `shared.qteScenarioSkip`; on `RESULT` module `qte.result` does **not** change `curLine` and does **not** call `emit SCENARIO.NEXT` — only `CLOSED`. Used by choose↔qte bridge so branching stays with choose. In `qte` module `postinject` the flag is `false`.
|
|
72
72
|
|
|
73
|
-
##
|
|
73
|
+
## Bridge
|
|
74
74
|
|
|
75
|
-
### `
|
|
75
|
+
### `bridge/plugins.scenario.choose/plugins.scenario.qte/`
|
|
76
76
|
|
|
77
|
-
Package: `@vnejs/
|
|
77
|
+
Package: `@vnejs/bridge.plugins.scenario.choose.plugins.scenario.qte`
|
|
78
78
|
|
|
79
79
|
On `CHOOSE.OPTION_REPLACE`: when the option has `qte: <id>`, runs QTE with `skipScenario: true`. Success — same option index; fail — index of the option whose `keywords` include `LINE_KEYWORDS.QTE_FALLBACK` (`qte-fallback`; if none — original index + `EVENTS.LOGS.EMIT`).
|
|
80
80
|
|
|
@@ -101,4 +101,4 @@ Wired in `bundles/vn.base`.
|
|
|
101
101
|
### Other
|
|
102
102
|
|
|
103
103
|
- [views.scenario/qte.md](../views.scenario/qte.md) — `QTE_VIEW`: round UI (listens OPENED / CLOSED)
|
|
104
|
-
- [choose.md](./choose.md) — `CHOOSE`: OPTION_REPLACE; link via
|
|
104
|
+
- [choose.md](./choose.md) — `CHOOSE`: OPTION_REPLACE; link via bridge above
|
package/plugins/text/smooth.md
CHANGED
|
@@ -41,11 +41,11 @@ None.
|
|
|
41
41
|
| `text.smooth.cycle` | Handles SMOOTH, PROCESS_CANCEL, EMIT_END, CLEAR. |
|
|
42
42
|
| `text.smooth.emit.end` | Handles EMIT_END, RECALC_DONE. |
|
|
43
43
|
|
|
44
|
-
##
|
|
44
|
+
## Bridge
|
|
45
45
|
|
|
46
|
-
### `
|
|
46
|
+
### `bridge/plugins.views.scenario.interface/plugins.text.smooth/`
|
|
47
47
|
|
|
48
|
-
Package: `@vnejs/
|
|
48
|
+
Package: `@vnejs/bridge.plugins.views.scenario.interface.plugins.text.smooth`
|
|
49
49
|
|
|
50
50
|
Link to [interface.md](../views.scenario/interface.md): `CHANGED` → `INTERFACE.TEXT_CHANGED` (`tokens` from `globalState.text`, `tokensVisible`, `uid`). `start` resets `shared.interfaceTextShowAllTokensOnChange`.
|
|
51
51
|
|
|
@@ -59,4 +59,4 @@ Link to [interface.md](../views.scenario/interface.md): `CHANGED` → `INTERFACE
|
|
|
59
59
|
### Other
|
|
60
60
|
|
|
61
61
|
- [text.md](./text.md) — `TEXT`: EVENTS.PROCESS_CANCEL, EVENTS.EMIT_END, EVENTS.RECALC_DONE, EVENTS.EMIT_PROCESS
|
|
62
|
-
- [interface.md](../views.scenario/interface.md) — `INTERFACE`: link via
|
|
62
|
+
- [interface.md](../views.scenario/interface.md) — `INTERFACE`: link via bridge above
|