@moku-labs/game 0.15.45 → 0.15.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/page.d.mts +1 -1
- package/dist/app/system.d.mts +3 -3
- package/dist/app.d.mts +3 -3
- package/dist/app.mjs +1 -1
- package/dist/assets.d.mts +1 -1
- package/dist/{commands-BaXRIOPU.d.mts → commands-C2-V2uKy.d.mts} +5 -5
- package/dist/control.d.mts +4 -4
- package/dist/{define-uySGnVPX.d.mts → define-NGQXu7Qj.d.mts} +2 -2
- package/dist/{headless-DrlyL0pm.d.mts → headless-DcJCzBkz.d.mts} +1 -1
- package/dist/{index-CRihYJbm.d.mts → index-DTsi9hds.d.mts} +3 -3
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/inspect.d.mts +6 -6
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/{runtime-CIt0aVFZ.d.mts → runtime--I74mwMY.d.mts} +1 -1
- package/dist/{src-tF21Z_H9.mjs → src-CI77RUzT.mjs} +1044 -157
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-B2KkIW4i.d.mts → types-Bc_re3rB.d.mts} +156 -42
- package/dist/{types-CIHizn2J.d.mts → types-CiSVMR89.d.mts} +15 -5
- package/dist/{types-DabD5pC9.d.mts → types-D4Q5MH_l.d.mts} +2 -2
- package/dist/{types-Bf2e_BIs.d.mts → types-RX1bYaqD.d.mts} +2 -2
- package/dist/{types-BAS9CfKx.d.mts → types-dF8Qmn7P.d.mts} +4 -4
- package/dist/{visual-D71Z28Yl.d.mts → visual-wSjsCu_W.d.mts} +6 -6
- package/dist/visual.d.mts +1 -1
- package/llms.txt +1 -1
- package/package.json +1 -1
package/dist/testing.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Or as Json, Sr as FakeClock, _r as NodeFx, br as ClockSource, cr as NodeTable, er as FeaturePlugin, fr as Descriptor, gr as Hint, nr as AnyFlow } from "./types-
|
|
2
|
-
import { t as createApp } from "./index-
|
|
3
|
-
import { b as saveOf, v as WithGameState, y as memory } from "./types-
|
|
4
|
-
import { a as createHeadless, i as ReproResult, n as HeadlessGame, o as runRepro, r as Repro, s as stepFrames, t as HeadlessApp } from "./headless-
|
|
1
|
+
import { Or as Json, Sr as FakeClock, _r as NodeFx, br as ClockSource, cr as NodeTable, er as FeaturePlugin, fr as Descriptor, gr as Hint, nr as AnyFlow } from "./types-Bc_re3rB.mjs";
|
|
2
|
+
import { t as createApp } from "./index-DTsi9hds.mjs";
|
|
3
|
+
import { b as saveOf, v as WithGameState, y as memory } from "./types-dF8Qmn7P.mjs";
|
|
4
|
+
import { a as createHeadless, i as ReproResult, n as HeadlessGame, o as runRepro, r as Repro, s as stepFrames, t as HeadlessApp } from "./headless-DcJCzBkz.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/clock/fake.d.ts
|
package/dist/testing.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { an as type, en as refuseStart, m as flattenFeatures, nn as exit, t as createApp } from "./src-
|
|
1
|
+
import { an as type, en as refuseStart, m as flattenFeatures, nn as exit, t as createApp } from "./src-CI77RUzT.mjs";
|
|
2
2
|
import { n as saveOf, t as memory } from "./memory-CWlqhS7l.mjs";
|
|
3
3
|
import { n as fakeClock } from "./fake-hnJcJeYf.mjs";
|
|
4
4
|
import { i as stepFrames, r as runRepro, t as createHeadless } from "./headless-CCiUwvlp.mjs";
|
|
@@ -3245,7 +3245,7 @@ type RunnerApi = {
|
|
|
3245
3245
|
* // The scenes plugin, at the tap on "board" over the ward: the veil goes up at `begin`, without
|
|
3246
3246
|
* // waiting, while the `load` stage still downloads the board; the switch runs at `scene`.
|
|
3247
3247
|
* const flow = ctx.require(flowPlugin);
|
|
3248
|
-
* const veil = { cover: { color: 0x000000, alpha: 0.45, inMs:
|
|
3248
|
+
* const veil = { cover: { color: 0x000000, alpha: 0.45, inMs: 50, outMs: 150 } };
|
|
3249
3249
|
* const offBegin = flow.onEnter("begin", (node, { mode }) => {
|
|
3250
3250
|
* if (mode === "live" && node.scene === "board") ctx.require(rendererPlugin).sync.leave.show(veil);
|
|
3251
3251
|
* });
|
|
@@ -4475,6 +4475,40 @@ type ProjectionSpec<Item, LayerName extends string, LiftName extends string, Pla
|
|
|
4475
4475
|
* ```
|
|
4476
4476
|
*/
|
|
4477
4477
|
readonly initialOnly?: InitialOnly<Values>;
|
|
4478
|
+
/**
|
|
4479
|
+
* The item a closed window of this projection is kept built for, so it opens in the frame after the tap. While
|
|
4480
|
+
* `from` does not show its key (`key(item)`, or the name of the projection without `key`), the engine builds its
|
|
4481
|
+
* view aside in the idle time of frames, one step a frame, and holds it hidden: never drawn, never hit, `entityOf`
|
|
4482
|
+
* does not answer for it. After a commit it reads `warm` again: the same content changes nothing, the same key
|
|
4483
|
+
* writes the difference into the held view, another key builds it again. When `from` shows that key the held view
|
|
4484
|
+
* is shown at once: the same entity, only what differs from the warm item is written (no `change` hook), and the
|
|
4485
|
+
* `enter` and `loop` hooks play as for a new view. A close plays the exit as before; the view is then built again
|
|
4486
|
+
* in idle frames. Only on a drawing renderer and a live world (a pause or a fast walk drops the view in work, to be
|
|
4487
|
+
* built again after it), and not in the frames of a motion that owns its fields (a loop and a motion that repeats
|
|
4488
|
+
* forever do not count); a `warm` or a `view` that throws is logged as `world:projection-failed` and nothing is held
|
|
4489
|
+
* until the next commit. The cost is the memory of the held view.
|
|
4490
|
+
* Left out, nothing is warmed.
|
|
4491
|
+
*
|
|
4492
|
+
* @param player - The `player` root of the committed state.
|
|
4493
|
+
* @param session - The `session` root of the committed state.
|
|
4494
|
+
* @returns One item of the type `from` gives; `undefined` holds nothing.
|
|
4495
|
+
* @example
|
|
4496
|
+
* ```ts
|
|
4497
|
+
* // The settings sheet of a game: its main page is built while the board shows.
|
|
4498
|
+
* export const settingsSheet = projection({
|
|
4499
|
+
* name: "settings.sheet",
|
|
4500
|
+
* layer: "ui",
|
|
4501
|
+
* from: (player: Player, session: Session) =>
|
|
4502
|
+
* session.sheet?.kind === "settings" ? [settingsModel(player, session, tables)] : [],
|
|
4503
|
+
* key: sheet => sheet.id,
|
|
4504
|
+
* view: sheet => settingsView(sheet),
|
|
4505
|
+
* warm: (player, session) => settingsModel(player, { ...session, sheet: { kind: "settings", page: "main" } }, tables)
|
|
4506
|
+
* });
|
|
4507
|
+
* // The tap commits session.sheet = { kind: "settings", page: "main" }: the next frame shows the held sheet,
|
|
4508
|
+
* // nothing is built and its Tree is not written again.
|
|
4509
|
+
* ```
|
|
4510
|
+
*/
|
|
4511
|
+
warm?(player: Player, session: Session): NoInfer<Item>;
|
|
4478
4512
|
};
|
|
4479
4513
|
/**
|
|
4480
4514
|
* A projection spec with its item and layer types erased, as the world stores it.
|
|
@@ -4498,7 +4532,8 @@ type AnyProjectionSpec = {
|
|
|
4498
4532
|
key?(item: unknown): string;
|
|
4499
4533
|
view(item: unknown): ViewOutput;
|
|
4500
4534
|
readonly motion?: AnyProjectionMotion; /** The `initialOnly` pairs, their field names no longer tied to the component. */
|
|
4501
|
-
readonly initialOnly?: readonly (readonly [ComponentHandle<object>, readonly string[]])[];
|
|
4535
|
+
readonly initialOnly?: readonly (readonly [ComponentHandle<object>, readonly string[]])[]; /** The item a closed window is kept built for, its type erased as `from`'s. */
|
|
4536
|
+
warm?(player: Json, session: Json): unknown;
|
|
4502
4537
|
};
|
|
4503
4538
|
/**
|
|
4504
4539
|
* Why a reconcile runs. Merged over the frame; the cause table decides play or direct. A
|
|
@@ -4588,6 +4623,11 @@ type Track = {
|
|
|
4588
4623
|
* additive track drives no component: a settle may bring the component home under it.
|
|
4589
4624
|
*/
|
|
4590
4625
|
additive: boolean;
|
|
4626
|
+
/**
|
|
4627
|
+
* Whether the track repeats forever (`repeat: "forever"`): it never ends, so the warm step does not wait for it to
|
|
4628
|
+
* end, as for a loop.
|
|
4629
|
+
*/
|
|
4630
|
+
forever: boolean;
|
|
4591
4631
|
};
|
|
4592
4632
|
/**
|
|
4593
4633
|
* The rest pose of one entity, by component name: the last output of `view(item)` for a view, or
|
|
@@ -4687,6 +4727,52 @@ type ProjectionState = {
|
|
|
4687
4727
|
sweptDespawns: number; /** The running build of the next scene; absent when none runs, never written as `undefined`. */
|
|
4688
4728
|
building?: Building; /** The `onBuild` checks: every one answers true before `built()` does. Kept across builds. */
|
|
4689
4729
|
buildChecks: Array<() => boolean>;
|
|
4730
|
+
/**
|
|
4731
|
+
* The game clock at the start of this frame (world's `input` phase), or at the start of a scene build in its own
|
|
4732
|
+
* frame: what `left()` counts from, for a scene build and a warm window alike.
|
|
4733
|
+
*/
|
|
4734
|
+
frameStart: number; /** The warm record of every mounted projection that declares `warm`, by projection name. */
|
|
4735
|
+
warm: Map<string, WarmRecord>; /** The same records in mounted order: the order the warm step takes them in. */
|
|
4736
|
+
warmList: WarmRecord[];
|
|
4737
|
+
/**
|
|
4738
|
+
* Every entity a warm record holds hidden: its view, the entities `adopt` marked for it, and the elements a plugin
|
|
4739
|
+
* registered a key for under its projection while it is closed. One lookup in `isBuilding`. An entity that is gone
|
|
4740
|
+
* leaves it in the sweep after its despawn.
|
|
4741
|
+
*/
|
|
4742
|
+
warmHeld: Set<Entity>; /** The record whose held view is being built now; absent when none is, never written as `undefined`. */
|
|
4743
|
+
warmActive?: WarmRecord;
|
|
4744
|
+
/**
|
|
4745
|
+
* The warm step may find work: a record went cold, or a commit came since the step last found none. A frame at rest
|
|
4746
|
+
* reads it and `warmActive` and returns.
|
|
4747
|
+
*/
|
|
4748
|
+
warmStale: boolean; /** Milliseconds per frame the building of a warm view may take, read from the frame rate when the work starts. */
|
|
4749
|
+
warmBudgetMs: number;
|
|
4750
|
+
};
|
|
4751
|
+
/**
|
|
4752
|
+
* Where a warm record stands: nothing held (`"cold"`), its view held and still built by ui and the renderer
|
|
4753
|
+
* (`"building"`), held and done (`"ready"`), or shown by `from` (`"shown"`), when the view lives in `mounted`.
|
|
4754
|
+
*/
|
|
4755
|
+
type WarmPhase = "cold" | "building" | "ready" | "shown";
|
|
4756
|
+
/**
|
|
4757
|
+
* The warm window of one mounted projection: the item `warm` gave, and the view of it held hidden until `from` shows
|
|
4758
|
+
* its key. A record lives while its projection is mounted; its view is spawned, patched and dropped in place.
|
|
4759
|
+
*/
|
|
4760
|
+
type WarmRecord = {
|
|
4761
|
+
/** The projection. */name: string; /** The key of the held item; absent while nothing is held. */
|
|
4762
|
+
key?: string; /** The item the held view was built or last patched for; absent while nothing is held. */
|
|
4763
|
+
item?: unknown; /** The held view: never in `mounted.live` until `from` shows its key; absent while nothing is held. */
|
|
4764
|
+
view?: View$1;
|
|
4765
|
+
/**
|
|
4766
|
+
* The held view's entity, the entities `adopt` marked for it and the elements registered under its projection while
|
|
4767
|
+
* it is closed; emptied when the view is shown or dropped. An entity that is gone leaves it in the sweep.
|
|
4768
|
+
*/
|
|
4769
|
+
entities: Set<Entity>;
|
|
4770
|
+
phase: WarmPhase;
|
|
4771
|
+
/**
|
|
4772
|
+
* The state `warm` was last read against: the step reads it again only after a commit. Kept when `warm` or `view`
|
|
4773
|
+
* threw, so a throw is logged once per commit and not every frame.
|
|
4774
|
+
*/
|
|
4775
|
+
seen?: Snapshot;
|
|
4690
4776
|
};
|
|
4691
4777
|
/**
|
|
4692
4778
|
* The build of the next scene aside (spec 31): its projections mounted into a table of their own, so a name never has
|
|
@@ -4698,8 +4784,7 @@ type Building = {
|
|
|
4698
4784
|
layers: ReadonlyArray<LayerSpec>; /** Who owns the entities of the projections the build mounts. */
|
|
4699
4785
|
owner: Owner; /** The projections only the coming list names, mounted aside until the commit moves them into `mounted`. */
|
|
4700
4786
|
mounted: Map<string, Mounted>; /** Every entity of the build: the views it spawned and the entities `adopt` marked. */
|
|
4701
|
-
entities: Set<Entity>; /**
|
|
4702
|
-
frameStart: number; /** Milliseconds per frame the building work may take. */
|
|
4787
|
+
entities: Set<Entity>; /** Milliseconds per frame the building work may take. */
|
|
4703
4788
|
budgetMs: number;
|
|
4704
4789
|
/**
|
|
4705
4790
|
* Whether a reconcile passed over a mounted projection the coming list drops, which keeps what it showed when the
|
|
@@ -4874,9 +4959,10 @@ type ProjectionApi = {
|
|
|
4874
4959
|
*/
|
|
4875
4960
|
lift(entity: Entity, on: boolean): void;
|
|
4876
4961
|
/**
|
|
4877
|
-
* The projection and key of an entity. Also answers for a view in the despawn queue
|
|
4878
|
-
* element registered with `registerKey`. A view answers the
|
|
4879
|
-
* same frozen object every call, so asking every frame
|
|
4962
|
+
* The projection and key of an entity. Also answers for a view in the despawn queue, for the view
|
|
4963
|
+
* a warm window holds hidden and for an element registered with `registerKey`. A view answers the
|
|
4964
|
+
* address it keeps for its life, the same frozen object every call, so asking every frame
|
|
4965
|
+
* allocates nothing.
|
|
4880
4966
|
*
|
|
4881
4967
|
* @param entity - The entity to ask about.
|
|
4882
4968
|
* @returns The projection name and the key, or `undefined`.
|
|
@@ -4954,8 +5040,8 @@ type ProjectionApi = {
|
|
|
4954
5040
|
*/
|
|
4955
5041
|
restOf<Value extends object>(entity: Entity, component: ComponentType<Value>): Value | undefined;
|
|
4956
5042
|
/**
|
|
4957
|
-
* The entity of one key of one projection: a live view, never the despawn queue
|
|
4958
|
-
* a plugin above registered under that key.
|
|
5043
|
+
* The entity of one key of one projection: a live view, never the despawn queue and never the
|
|
5044
|
+
* view a warm window holds hidden, or an element a plugin above registered under that key.
|
|
4959
5045
|
*
|
|
4960
5046
|
* @param projection - Name of the projection.
|
|
4961
5047
|
* @param key - The model key.
|
|
@@ -4971,7 +5057,8 @@ type ProjectionApi = {
|
|
|
4971
5057
|
entityOf(projection: string, key: string): Entity | undefined;
|
|
4972
5058
|
/**
|
|
4973
5059
|
* The live view entities of a mounted projection, in the order of its model keys. A view that
|
|
4974
|
-
* plays its exit is left out, and so
|
|
5060
|
+
* plays its exit is left out, and so are the view a warm window holds hidden and an element
|
|
5061
|
+
* registered with `registerKey`. A projection
|
|
4975
5062
|
* the running build mounts answers its building views (`isBuilding` tells them apart), so a host
|
|
4976
5063
|
* of the coming scene can take them before the swap. Every call hands out a new array.
|
|
4977
5064
|
*
|
|
@@ -5044,7 +5131,10 @@ type ProjectionApi = {
|
|
|
5044
5131
|
* Gives an entity a projection and key of its own, so `entityOf` and `keyOf` answer for it next
|
|
5045
5132
|
* to the live views. That is how an element becomes a target for `anim`, `input` and `guide`.
|
|
5046
5133
|
* A key whose entity is gone is dropped in the next live frame, also when the remover was never
|
|
5047
|
-
* called.
|
|
5134
|
+
* called. An element registered while the projection's warm window is held and the projection
|
|
5135
|
+
* shows no live view belongs to the held root (a row its list ranged in after it was built): it
|
|
5136
|
+
* is held with the window, `isBuilding` answers true and `entityOf` nothing until the open. A
|
|
5137
|
+
* projection that shows other keys live while it warms one is not covered: its elements answer.
|
|
5048
5138
|
*
|
|
5049
5139
|
* @param projection - Name the element is addressed under.
|
|
5050
5140
|
* @param key - Key the element is addressed under.
|
|
@@ -5059,6 +5149,10 @@ type ProjectionApi = {
|
|
|
5059
5149
|
*
|
|
5060
5150
|
* world.projection.entityOf("hud", "coins"); // the entity of the counter
|
|
5061
5151
|
* drop(); // the element left the screen
|
|
5152
|
+
*
|
|
5153
|
+
* // A row the shop's list ranges in while the shop is closed and held warm.
|
|
5154
|
+
* world.projection.registerKey("shop.sheet", "w15", row);
|
|
5155
|
+
* world.projection.entityOf("shop.sheet", "w15"); // undefined until the shop opens
|
|
5062
5156
|
* ```
|
|
5063
5157
|
*/
|
|
5064
5158
|
registerKey(projection: string, key: string, entity: Entity): () => void;
|
|
@@ -5187,9 +5281,12 @@ type ProjectionApi = {
|
|
|
5187
5281
|
*/
|
|
5188
5282
|
discard(): void;
|
|
5189
5283
|
/**
|
|
5190
|
-
* Milliseconds of building budget left in this frame
|
|
5191
|
-
* frame started (read at the start of world's `input` phase). The
|
|
5192
|
-
*
|
|
5284
|
+
* Milliseconds of building budget left in this frame, for what is built aside or held warm: the budget minus the
|
|
5285
|
+
* game clock time since the frame started (read at the start of world's `input` phase). The budget is the scene
|
|
5286
|
+
* build's `budgetMs`, or while a warm window is built two thirds of the frame interval the loop runs at,
|
|
5287
|
+
* `(1000 / fps) * 2 / 3`. The clock counts whole milliseconds. Negative once the frame spent more; `Infinity` while
|
|
5288
|
+
* nothing is built, also while warm windows rest built, and in a world that is not live: a pause or a fast walk drops
|
|
5289
|
+
* the warm window in work. Allocates nothing.
|
|
5193
5290
|
*
|
|
5194
5291
|
* @returns The milliseconds left, or `Infinity`.
|
|
5195
5292
|
* @example
|
|
@@ -5198,22 +5295,25 @@ type ProjectionApi = {
|
|
|
5198
5295
|
* const projection = ctx.require(worldPlugin).projection;
|
|
5199
5296
|
* projection.left(); // 3: 1 ms of the 4 ms budget is spent
|
|
5200
5297
|
* projection.left(); // -1 after 4 ms more of views: the rest waits for the next frame
|
|
5298
|
+
* projection.left(); // ≈ 9.1 at 60 fps, 2 ms into a frame that builds the warm settings sheet
|
|
5201
5299
|
* ```
|
|
5202
5300
|
*/
|
|
5203
5301
|
left(): number;
|
|
5204
5302
|
/**
|
|
5205
|
-
* Whether an entity
|
|
5206
|
-
*
|
|
5207
|
-
*
|
|
5303
|
+
* Whether an entity is built aside or held warm: a view the running build spawned, the view a warm window holds
|
|
5304
|
+
* hidden (`warm` of a projection), an entity `adopt` marked for either, or an element registered with `registerKey`
|
|
5305
|
+
* for a closed warm window. Such an entity is not drawn, not hit and not found until it is shown. A view is flagged before the `onAdded` hooks of its components, so a hook can ask.
|
|
5306
|
+
* Two set lookups; false after the commit of the build and once `from` shows the warm view. Allocates nothing.
|
|
5208
5307
|
*
|
|
5209
5308
|
* @param entity - The entity to ask about.
|
|
5210
|
-
* @returns True for an entity
|
|
5309
|
+
* @returns True for an entity built aside or held warm.
|
|
5211
5310
|
* @example
|
|
5212
5311
|
* ```ts
|
|
5213
5312
|
* // The renderer pass sorts the views of the coming scene out of its live work.
|
|
5214
5313
|
* const projection = ctx.require(worldPlugin).projection;
|
|
5215
5314
|
* projection.isBuilding(1_048_600); // true: a board item the build spawned
|
|
5216
5315
|
* projection.isBuilding(1_048_576); // false: a ward bed on screen
|
|
5316
|
+
* projection.isBuilding(1_048_640); // true: the settings sheet, held warm while closed
|
|
5217
5317
|
*
|
|
5218
5318
|
* // A game plugin keeps one board root: the root of the board built aside is not a second one.
|
|
5219
5319
|
* ctx.require(worldPlugin).ecs.onAdded(Tree, entity => {
|
|
@@ -5224,7 +5324,8 @@ type ProjectionApi = {
|
|
|
5224
5324
|
isBuilding(entity: Entity): boolean;
|
|
5225
5325
|
/**
|
|
5226
5326
|
* Registers one part of the build that has to be done before the swap: `built()` answers true only when every
|
|
5227
|
-
* registered check does. A registration stays across builds.
|
|
5327
|
+
* registered check does. A registration stays across builds. The same checks tell when a warm window's held view is
|
|
5328
|
+
* built, and a world with no check (no drawing plugin) warms nothing.
|
|
5228
5329
|
*
|
|
5229
5330
|
* @param check - Answers true when the caller's part of the running build is done.
|
|
5230
5331
|
* @returns The remover; calling it twice is safe.
|
|
@@ -5238,9 +5339,10 @@ type ProjectionApi = {
|
|
|
5238
5339
|
*/
|
|
5239
5340
|
onBuild(check: () => boolean): () => void;
|
|
5240
5341
|
/**
|
|
5241
|
-
* Marks an entity another plugin spawned for a
|
|
5242
|
-
* tree and
|
|
5243
|
-
*
|
|
5342
|
+
* Marks an entity another plugin spawned for a root built aside or held warm, so `isBuilding` answers for the whole
|
|
5343
|
+
* tree and a discard despawns it with the rest. It joins the running scene build, else the warm window being built
|
|
5344
|
+
* now; does nothing when neither runs. The commit of the build, and the open of the window, clear the mark with
|
|
5345
|
+
* every other.
|
|
5244
5346
|
*
|
|
5245
5347
|
* @param entity - The entity to mark.
|
|
5246
5348
|
* @example
|
|
@@ -5249,7 +5351,7 @@ type ProjectionApi = {
|
|
|
5249
5351
|
* const world = ctx.require(worldPlugin);
|
|
5250
5352
|
* const button = world.ecs.spawn({ kind: "plugin", name: "ui" }, []);
|
|
5251
5353
|
* world.projection.adopt(button);
|
|
5252
|
-
* world.projection.isBuilding(button); // true until the commit
|
|
5354
|
+
* world.projection.isBuilding(button); // true until the commit, or until the warm sheet it belongs to opens
|
|
5253
5355
|
* ```
|
|
5254
5356
|
*/
|
|
5255
5357
|
adopt(entity: Entity): void;
|
|
@@ -5271,11 +5373,18 @@ type ProjectionInternal = {
|
|
|
5271
5373
|
reconcileIfDirty(): void;
|
|
5272
5374
|
/**
|
|
5273
5375
|
* Records the moment a frame starts, for the budget `left()` counts down. Runs first in `time`
|
|
5274
|
-
* phase `input`, with the moment `Now` gets;
|
|
5376
|
+
* phase `input`, with the moment `Now` gets; one number written.
|
|
5275
5377
|
*
|
|
5276
5378
|
* @param now - The game clock at the start of the frame.
|
|
5277
5379
|
*/
|
|
5278
5380
|
startFrame(now: number): void;
|
|
5381
|
+
/**
|
|
5382
|
+
* One step of the warm windows, in `time` phase `input` after the reconcile: the checks of the
|
|
5383
|
+
* record being built are polled, or the next record is built, patched or dropped. Only in a
|
|
5384
|
+
* live world with no scene build, a drawing plugin and no motion that owns its fields; at rest
|
|
5385
|
+
* it reads two fields and returns.
|
|
5386
|
+
*/
|
|
5387
|
+
stepWarm(): void;
|
|
5279
5388
|
/**
|
|
5280
5389
|
* Empties the hint buffer. Runs once per frame, reconcile or not.
|
|
5281
5390
|
*/
|
|
@@ -10439,9 +10548,9 @@ type View = {
|
|
|
10439
10548
|
hiddenTop: number; /** The HUD factor an overlay fades this view with (a `HudPart`), 1 for every other view (spec 22 O7). */
|
|
10440
10549
|
hud: number;
|
|
10441
10550
|
/**
|
|
10442
|
-
* A held top of a scene build (spec 31): a view of the next scene
|
|
10443
|
-
*
|
|
10444
|
-
* in the pass after the commit.
|
|
10551
|
+
* A held top of a scene build (spec 31) or of a warm window (spec 33, slice B+D): a view of the next scene, or of a
|
|
10552
|
+
* closed window, with no parent or with a live parent, built while the current scene stays drawn. It hangs nowhere
|
|
10553
|
+
* in the stage, is listed in `SyncState.heldViews`, and is attached in the pass after the commit or the open.
|
|
10445
10554
|
*/
|
|
10446
10555
|
held: boolean;
|
|
10447
10556
|
};
|
|
@@ -11009,8 +11118,8 @@ type DebugApi = {
|
|
|
11009
11118
|
*
|
|
11010
11119
|
* @example
|
|
11011
11120
|
* ```ts
|
|
11012
|
-
* // A game that writes nothing: black at 45 %,
|
|
11013
|
-
* const cover: LeaveCover = { color: 0x000000, alpha: 0.45, inMs:
|
|
11121
|
+
* // A game that writes nothing: black at 45 %, 50 ms in, 150 ms out.
|
|
11122
|
+
* const cover: LeaveCover = { color: 0x000000, alpha: 0.45, inMs: 50, outMs: 150 };
|
|
11014
11123
|
* ```
|
|
11015
11124
|
*/
|
|
11016
11125
|
type LeaveCover = {
|
|
@@ -11052,7 +11161,7 @@ type LeaveLoader = {
|
|
|
11052
11161
|
* @example
|
|
11053
11162
|
* ```ts
|
|
11054
11163
|
* // The default of `scenes`: the veil from the start, the engine's ring once the switch took 400 ms.
|
|
11055
|
-
* const look: LeaveLook = { cover: { color: 0x000000, alpha: 0.45, inMs:
|
|
11164
|
+
* const look: LeaveLook = { cover: { color: 0x000000, alpha: 0.45, inMs: 50, outMs: 150 }, loader: { afterMs: 400 } };
|
|
11056
11165
|
* ```
|
|
11057
11166
|
*/
|
|
11058
11167
|
type LeaveLook = {
|
|
@@ -11069,7 +11178,7 @@ type LeaveLook = {
|
|
|
11069
11178
|
* ```ts
|
|
11070
11179
|
* // `scenes`, at the start of a switch from the ward, whose bundles are still loading.
|
|
11071
11180
|
* const renderer = ctx.require(rendererPlugin);
|
|
11072
|
-
* renderer.sync.leave.show({ cover: { color: 0x000000, alpha: 0.45, inMs:
|
|
11181
|
+
* renderer.sync.leave.show({ cover: { color: 0x000000, alpha: 0.45, inMs: 50, outMs: 150 }, loader: { afterMs: 400 } });
|
|
11073
11182
|
* renderer.sync.leave.land(); // the board stands: the veil fades out over 150 ms, the ring is gone
|
|
11074
11183
|
* ```
|
|
11075
11184
|
*/
|
|
@@ -11084,7 +11193,7 @@ type LeaveApi = {
|
|
|
11084
11193
|
* ```ts
|
|
11085
11194
|
* // `scenes` leaves a scene whose `leave` names a turning texture: the veil from the next frame, the texture at 400 ms.
|
|
11086
11195
|
* ctx.require(rendererPlugin).sync.leave.show({
|
|
11087
|
-
* cover: { color: 0x0b1020, alpha: 0.6, inMs:
|
|
11196
|
+
* cover: { color: 0x0b1020, alpha: 0.6, inMs: 50, outMs: 150 },
|
|
11088
11197
|
* loader: { afterMs: 400, texture: "ui.loader.ring" }
|
|
11089
11198
|
* });
|
|
11090
11199
|
* ```
|
|
@@ -11296,7 +11405,7 @@ type SyncApi = {
|
|
|
11296
11405
|
* ```ts
|
|
11297
11406
|
* // `scenes`, at the start of a switch from the ward, and at the swap to the board.
|
|
11298
11407
|
* const renderer = ctx.require(rendererPlugin);
|
|
11299
|
-
* renderer.sync.leave.show({ cover: { color: 0x000000, alpha: 0.45, inMs:
|
|
11408
|
+
* renderer.sync.leave.show({ cover: { color: 0x000000, alpha: 0.45, inMs: 50, outMs: 150 }, loader: { afterMs: 400 } });
|
|
11300
11409
|
* renderer.sync.leave.land(); // the veil fades out over the board in 150 ms
|
|
11301
11410
|
* ```
|
|
11302
11411
|
*/
|
|
@@ -11766,13 +11875,18 @@ type AsideQueue = {
|
|
|
11766
11875
|
made: number;
|
|
11767
11876
|
};
|
|
11768
11877
|
/**
|
|
11769
|
-
* The held tops of a scene build, in the order they were made (spec 31
|
|
11770
|
-
* went, or that hangs under a building parent by now, is stale and
|
|
11771
|
-
* loops. Private to `sync`.
|
|
11878
|
+
* The held tops of a scene build and of warm windows, in the order they were made (spec 31, spec 33 slice B+D):
|
|
11879
|
+
* dense, from 0 to `count`. A slot whose view went, or that hangs under a building parent by now, is stale and dropped
|
|
11880
|
+
* at the next scan. Not `held`, the unseen cache of the loops. Private to `sync`.
|
|
11772
11881
|
*/
|
|
11773
11882
|
type HeldViews = {
|
|
11774
11883
|
entities: Entity[];
|
|
11775
|
-
count: number;
|
|
11884
|
+
count: number;
|
|
11885
|
+
/**
|
|
11886
|
+
* `world.projection.membershipVersion()` at the last scan of the list, or at the first top of an empty one. Every
|
|
11887
|
+
* end of a build moves it: the list is looked at again only after a move.
|
|
11888
|
+
*/
|
|
11889
|
+
version: number; /** The dev check named a building view under the stage in this build: named once. */
|
|
11776
11890
|
reported: boolean;
|
|
11777
11891
|
};
|
|
11778
11892
|
/**
|
|
@@ -11859,7 +11973,7 @@ type SyncState = {
|
|
|
11859
11973
|
passesVersion: number; /** The filtered views' passes of `renderPassesOf`, counted at `passesVersion` `at` under `root`. */
|
|
11860
11974
|
passes: PassCount; /** The name of the scene's HUD layer (`above: "overlays"`), kept with the layers; `undefined` without one. */
|
|
11861
11975
|
hudLayer: string | undefined; /** The building entities waiting for their view (spec 31). */
|
|
11862
|
-
aside: AsideQueue; /** The held tops of the scene build, attached in the pass after
|
|
11976
|
+
aside: AsideQueue; /** The held tops of the scene build and of warm windows, attached in the pass after their commit or open (spec 31, 33). */
|
|
11863
11977
|
heldViews: HeldViews; /** The picture of a scene being left: the running look and the engine's objects (spec 33, slice A2). */
|
|
11864
11978
|
leave: LeaveState;
|
|
11865
11979
|
cleanups: Array<() => void>;
|
|
@@ -12004,13 +12118,13 @@ type CheckedProjections<Layer extends string, List> = { readonly [Index in keyof
|
|
|
12004
12118
|
*
|
|
12005
12119
|
* @example
|
|
12006
12120
|
* ```ts
|
|
12007
|
-
* // A navy veil at 60 %, the engine's
|
|
12121
|
+
* // A navy veil at 60 %, the engine's 50 ms in and 150 ms out.
|
|
12008
12122
|
* const cover: SceneCover = { color: 0x0b1020, alpha: 0.6 };
|
|
12009
12123
|
* ```
|
|
12010
12124
|
*/
|
|
12011
12125
|
type SceneCover = {
|
|
12012
12126
|
/** Colour of the veil, `0xRRGGBB`. Default `0x000000`. */color?: number; /** The alpha it fades in to, 0 to 1. Default 0.45. */
|
|
12013
|
-
alpha?: number; /** Milliseconds from 0 to `alpha`, from the switch start. Default
|
|
12127
|
+
alpha?: number; /** Milliseconds from 0 to `alpha`, from the switch start. Default 50. */
|
|
12014
12128
|
inMs?: number; /** Milliseconds back to 0 after the swap. Default 150. */
|
|
12015
12129
|
outMs?: number;
|
|
12016
12130
|
};
|
|
@@ -12038,7 +12152,7 @@ type SceneLoader<Asset extends string = string> = {
|
|
|
12038
12152
|
/**
|
|
12039
12153
|
* What a live switch shows over the scene being left: the veil and the loader. The scene being left decides: its
|
|
12040
12154
|
* `leave` is merged field by field over `config.leave`, which is merged over the engine's default (`{ cover: { color:
|
|
12041
|
-
* 0x000000, alpha: 0.45, inMs:
|
|
12155
|
+
* 0x000000, alpha: 0.45, inMs: 50, outMs: 150 }, loader: { afterMs: 400 } }`). `false` turns a part or the whole off;
|
|
12042
12156
|
* a part written over `false` starts from the engine's default. Fast mode, a headless app and the first scene of a run
|
|
12043
12157
|
* show nothing.
|
|
12044
12158
|
*
|
|
@@ -12176,7 +12290,7 @@ type Config$1 = {
|
|
|
12176
12290
|
buildMs: number | "auto";
|
|
12177
12291
|
/**
|
|
12178
12292
|
* What a live switch shows over the scene being left, for every scene; a scene's own `leave` is merged over it field
|
|
12179
|
-
* by field. A field left out keeps the engine's default, `{ cover: { color: 0x000000, alpha: 0.45, inMs:
|
|
12293
|
+
* by field. A field left out keeps the engine's default, `{ cover: { color: 0x000000, alpha: 0.45, inMs: 50,
|
|
12180
12294
|
* outMs: 150 }, loader: { afterMs: 400 } }`; `false` turns a part or the whole off.
|
|
12181
12295
|
*
|
|
12182
12296
|
* @example
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { An as NumericFields, Cn as TagType, Dn as Motion, En as Ease, In as ViewHandle, Jr as Api, K as TransformValue, Ln as Api$1, Nn as ReducedMotion, On as MotionCause, Or as Json, Y as Api$3, cn as AnyComponentType, dt as ViewportSize, fn as ComponentType, fr as Descriptor, gr as Hint, ii as Require, jn as ProjectionMotion, kn as MotionHandle, ln as AnyComponentValue, mn as Entity, nn as Api$2, s as Events$1, sn as AnyComponent, t as Api$4, vr as Answer, wn as ChangeHook, yr as Api$5 } from "./types-
|
|
1
|
+
import { An as NumericFields, Cn as TagType, Dn as Motion, En as Ease, In as ViewHandle, Jr as Api, K as TransformValue, Ln as Api$1, Nn as ReducedMotion, On as MotionCause, Or as Json, Y as Api$3, cn as AnyComponentType, dt as ViewportSize, fn as ComponentType, fr as Descriptor, gr as Hint, ii as Require, jn as ProjectionMotion, kn as MotionHandle, ln as AnyComponentValue, mn as Entity, nn as Api$2, s as Events$1, sn as AnyComponent, t as Api$4, vr as Answer, wn as ChangeHook, yr as Api$5 } from "./types-Bc_re3rB.mjs";
|
|
2
2
|
import { Log } from "@moku-labs/common/browser";
|
|
3
3
|
import { PluginCtx } from "@moku-labs/core";
|
|
4
4
|
import { Node, Yoga } from "yoga-layout/load";
|
|
@@ -2830,9 +2830,9 @@ type Root = {
|
|
|
2830
2830
|
} | undefined;
|
|
2831
2831
|
pending?: boolean;
|
|
2832
2832
|
/**
|
|
2833
|
-
* Present from the reconcile that found the root in the scene `world` builds aside (spec 31)
|
|
2834
|
-
* until the reconcile that finds it committed, which gives the
|
|
2835
|
-
* other root.
|
|
2833
|
+
* Present from the reconcile that found the root in the scene `world` builds aside (spec 31), or
|
|
2834
|
+
* held warm (spec 33 B+D), until the reconcile that finds it committed or shown, which gives the
|
|
2835
|
+
* slots out again and registers its element keys with `world`. Absent on every other root.
|
|
2836
2836
|
*/
|
|
2837
2837
|
aside?: true;
|
|
2838
2838
|
/**
|
|
@@ -2841,6 +2841,12 @@ type Root = {
|
|
|
2841
2841
|
*/
|
|
2842
2842
|
parked?: Parked[]; /** The application of a root built aside in parts, while it is open; absent otherwise. */
|
|
2843
2843
|
applying?: ApplyCursor;
|
|
2844
|
+
/**
|
|
2845
|
+
* Present from the release of a root whose parts still waited (a warm window opened while it was
|
|
2846
|
+
* built) until the solve that lays it out whole: its elements take their rects with no motion,
|
|
2847
|
+
* as their enters play next. Absent on every other root.
|
|
2848
|
+
*/
|
|
2849
|
+
still?: true;
|
|
2844
2850
|
};
|
|
2845
2851
|
/**
|
|
2846
2852
|
* Where the focus ring was last drawn: the layer and order of its root, the rect grown by the
|
|
@@ -3021,7 +3027,11 @@ type JsxState = {
|
|
|
3021
3027
|
written: number; /** The wall times of the last taps on a `DebugTrigger` view, five at the most. */
|
|
3022
3028
|
debugTaps: number[]; /** Whether `ui:debug-trigger-no-agent` was logged: once per app. */
|
|
3023
3029
|
debugWarned: boolean; /** Elements that carry `Overlay`, from their enter to their despawn (spec 22 O4.5). */
|
|
3024
|
-
overlays: Set<Entity>;
|
|
3030
|
+
overlays: Set<Entity>;
|
|
3031
|
+
/**
|
|
3032
|
+
* How many roots carry `aside`, as the last reconcile counted them: 0 while no scene is built
|
|
3033
|
+
* aside and no window is held warm.
|
|
3034
|
+
*/
|
|
3025
3035
|
asideRoots: number;
|
|
3026
3036
|
};
|
|
3027
3037
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as PixiModule, A as SyncApi, An as NumericFields, Dr as Events$3, En as Ease, Fn as TrackSegment, Jr as Api$1, Ln as Api$2, Nn as ReducedMotion, O as FilterSlot, Or as Json, Pn as TrackOptions, Q as PixiFilter, Tr as Api$6, Wr as Events$5, Y as Api$4, b as Events$4, dr as TypeTag, et as PixiSprite, fn as ComponentType, fr as Descriptor, ft as FilterCache, ii as Require, k as FilterSlotInputs, kn as MotionHandle, ln as AnyComponentValue, mn as Entity, nn as Api$3, ri as Events$2, s as Events$1, sn as AnyComponent, t as Api$5, tt as PixiTexture, un as ComponentHandle, ut as Point } from "./types-
|
|
2
|
-
import { N as InputApi, R as I18nApi, X as StylesState, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, w as TextApi } from "./types-
|
|
1
|
+
import { $ as PixiModule, A as SyncApi, An as NumericFields, Dr as Events$3, En as Ease, Fn as TrackSegment, Jr as Api$1, Ln as Api$2, Nn as ReducedMotion, O as FilterSlot, Or as Json, Pn as TrackOptions, Q as PixiFilter, Tr as Api$6, Wr as Events$5, Y as Api$4, b as Events$4, dr as TypeTag, et as PixiSprite, fn as ComponentType, fr as Descriptor, ft as FilterCache, ii as Require, k as FilterSlotInputs, kn as MotionHandle, ln as AnyComponentValue, mn as Entity, nn as Api$3, ri as Events$2, s as Events$1, sn as AnyComponent, t as Api$5, tt as PixiTexture, un as ComponentHandle, ut as Point } from "./types-Bc_re3rB.mjs";
|
|
2
|
+
import { N as InputApi, R as I18nApi, X as StylesState, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, w as TextApi } from "./types-CiSVMR89.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
import { PluginCtx } from "@moku-labs/core";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Lr as Snapshot, Or as Json } from "./types-
|
|
2
|
-
import { t as HeadlessApp } from "./headless-
|
|
1
|
+
import { Lr as Snapshot, Or as Json } from "./types-Bc_re3rB.mjs";
|
|
2
|
+
import { t as HeadlessApp } from "./headless-DcJCzBkz.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/flow/doors/types.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as PixiModule, Er as Config, Fr as SaveDoc, Nr as PlayerStateProvider, Or as Json, Pr as ProviderCall, Rr as SnapshotOf, Sr as FakeClock, X as Config$2, a as Config$3, br as ClockSource, d as Manifest, dr as TypeTag, er as FeaturePlugin, lt as Orientation, n as AssetsIo, nr as AnyFlow, zn as Config$1 } from "./types-
|
|
2
|
-
import { o as AudioContextLike, s as Config$4 } from "./types-
|
|
3
|
-
import { R as I18nApi, U as StringTable, W as TextKey } from "./types-
|
|
4
|
-
import { St as effectsPlugin, Tt as audioPlugin, ht as PlatformProvider, i as screen, pt as platformPlugin, t as createApp } from "./index-
|
|
1
|
+
import { $ as PixiModule, Er as Config, Fr as SaveDoc, Nr as PlayerStateProvider, Or as Json, Pr as ProviderCall, Rr as SnapshotOf, Sr as FakeClock, X as Config$2, a as Config$3, br as ClockSource, d as Manifest, dr as TypeTag, er as FeaturePlugin, lt as Orientation, n as AssetsIo, nr as AnyFlow, zn as Config$1 } from "./types-Bc_re3rB.mjs";
|
|
2
|
+
import { o as AudioContextLike, s as Config$4 } from "./types-D4Q5MH_l.mjs";
|
|
3
|
+
import { R as I18nApi, U as StringTable, W as TextKey } from "./types-CiSVMR89.mjs";
|
|
4
|
+
import { St as effectsPlugin, Tt as audioPlugin, ht as PlatformProvider, i as screen, pt as platformPlugin, t as createApp } from "./index-DTsi9hds.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/model/store/providers/memory.d.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Hr as Api$3, Tr as Api$2, Y as Api, nn as Api$1, yr as Api$4 } from "./types-
|
|
2
|
-
import { P as AnimApi, r as UiApi } from "./types-
|
|
3
|
-
import { N as InputApi } from "./types-
|
|
4
|
-
import { r as Repro } from "./headless-
|
|
5
|
-
import { a as InputOf, r as ControlApp } from "./types-
|
|
6
|
-
import { t as commands } from "./commands-
|
|
1
|
+
import { Hr as Api$3, Tr as Api$2, Y as Api, nn as Api$1, yr as Api$4 } from "./types-Bc_re3rB.mjs";
|
|
2
|
+
import { P as AnimApi, r as UiApi } from "./types-D4Q5MH_l.mjs";
|
|
3
|
+
import { N as InputApi } from "./types-CiSVMR89.mjs";
|
|
4
|
+
import { r as Repro } from "./headless-DcJCzBkz.mjs";
|
|
5
|
+
import { a as InputOf, r as ControlApp } from "./types-RX1bYaqD.mjs";
|
|
6
|
+
import { t as commands } from "./commands-C2-V2uKy.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/visual/types.d.ts
|
|
9
9
|
/** The base commands of the `/control` door, keyed by their short names. */
|
package/dist/visual.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as VisualApp, c as VisualRenderer, d as VisualStart, f as VisualStep, h as VisualTolerance, i as CheckpointResult, l as VisualReport, m as VisualTestResult, n as runVisualTests, o as VisualOptions, p as VisualTest, r as defineVisualTest, s as VisualPage, t as parseVisualArgv, u as VisualSetup } from "./visual-
|
|
1
|
+
import { a as VisualApp, c as VisualRenderer, d as VisualStart, f as VisualStep, h as VisualTolerance, i as CheckpointResult, l as VisualReport, m as VisualTestResult, n as runVisualTests, o as VisualOptions, p as VisualTest, r as defineVisualTest, s as VisualPage, t as parseVisualArgv, u as VisualSetup } from "./visual-wSjsCu_W.mjs";
|
|
2
2
|
export { type CheckpointResult, type VisualApp, type VisualOptions, type VisualPage, type VisualRenderer, type VisualReport, type VisualSetup, type VisualStart, type VisualStep, type VisualTest, type VisualTestResult, type VisualTolerance, defineVisualTest, parseVisualArgv, runVisualTests };
|
package/llms.txt
CHANGED
|
@@ -534,7 +534,7 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
|
|
|
534
534
|
- Overlays: `Overlay({ dim, dimColor, cover, hud, fade, hold })` on the root of an overlay (in `components`) keeps everything drawn before it as one picture, retaken in the frame anything in it changes, and with `cover: "opaque"` draws none of it once landed at alpha 1; `hold: true` (default `false`) holds the endless loops under it while it stands, as under a cover or a blurred picture (their phase follows time), so a dimmed sheet over a sharp scene draws no frame at rest; the engine draws the dim (`dim × level`, right under the root); the level follows the root's own enter and exit motion, `fade` (250 ms) only when it has none; level and landing are read through `app.renderer.sync.debug.overlays()`. A `backdrop: true` filter inside the kept range runs no pass while the picture stands (its look is in the picture) and is drawn again in the frame the overlay is gone. Types: `OverlayValue` (the component's value) and `HudPartValue` (a part of the HUD an overlay keeps shown or lets fade).
|
|
535
535
|
- HUD: a scene layer `{ above: "overlays" }` is the HUD layer, drawn above every overlay and never in a picture; a scene with a HUD layer and no `ui` gets `ui` right under it. Its roots never take the keyboard: Escape and the Back press reach the top sheet under it. `HudPart({ key })` tags a HUD view; an overlay's `hud` (`"all"`, `"none"` or keys) names the parts that stay shown, the others fade with its level and take no tap. Keys are typed by `defineGame<{ …, hud: "energy" | "gems" }>()`.
|
|
536
536
|
- Endless loops of views under an opaque or blurred overlay write nothing (`renderer.sync.loopsHeld(entity)`, the seam anim asks before an endless loop writes); their phase follows time.
|
|
537
|
-
- Scene switch look: from the start of a live switch (before its bundles and textures are awaited) the renderer draws a veil over the scene being left, above every layer, and, when the switch is not done `afterMs` after its start, a loader above it until the swap; then the veil fades out over the new scene. Config `scenes.leave` (default `{ cover: { color: 0x000000, alpha: 0.45, inMs:
|
|
537
|
+
- Scene switch look: from the start of a live switch (before its bundles and textures are awaited) the renderer draws a veil over the scene being left, above every layer, and, when the switch is not done `afterMs` after its start, a loader above it until the swap; then the veil fades out over the new scene. Config `scenes.leave` (default `{ cover: { color: 0x000000, alpha: 0.45, inMs: 50, outMs: 150 }, loader: { afterMs: 400 } }`) and a scene's `leave` (`defineScene("ward", { ..., leave: false })`) are merged field by field (the scene being left decides; `false` turns a part or the whole off); the loader is the engine's white ring, `loader: { texture: "ui.loader.ring" }` a game texture turning, or `loader: { projection: "loading" }` a projection mounted only once the loader is due, in a layer of its own the scene declares (no other projection of the scene may draw there); an abort or a throw drops both at once; fast walks, a world that is not live, headless apps and the first scene show nothing; types `SceneLeave`, `SceneCover`, `SceneLoader` (`Scenes`).
|
|
538
538
|
- A scene names bundles on top of its `bundle` from the committed state: `defineScene("ward", { bundle: "episodes-kit", bundles: ({ session }) => [session.episode], layers: {}, projections: [wardRoom] })`. `bundles` is read each time a node enters the scene, and every way in (a live entry, a restore, the `safeNode` recovery) waits for all of them before the scene is mounted and the node's gate opens. The keys are `BundleKey`s of `generated/assets.ts`.
|
|
539
539
|
- `app.assets`: `load(bundle)`, `warm(bundle)` (loads it if needed, then puts its textures and atlas pages on the GPU through `renderer.sync.textures.upload`, `renderer.uploads` a drawn frame; joins a running or finished warm; an unload forgets it; resolves also when the renderer could not upload; headless at once), `unload(bundle)`, `isLoaded(bundle)`, `has(bundle)` (the manifest carries it, loaded or not), `texture(key)`, `font(key)`, `audio(key)`, `usage()`. Per bundle in a feature's `assets.ts`: `defineBundles({ ep01: { tier: "feature", release: "leave", mipmaps: ["items/**"] } })`. `release: "leave"` also unloads the bundle, with reason `"leave"`, at the next rest once nothing holds it: not pinned by the node entered, not named by the mounted scene, no node of its feature on the stack; a bundle the outgoing scene named leaves one rest later. The default `"budget"` leaves only under the texture budget. `mipmaps` (`true` or globs relative to `assets/`) uploads the textures with their full chain; such a texture stays loose in a pack. A sub-feature with resources gets its own bundles, named like its folder, with `dir` and `parent` in the manifest; a code-only one has none. The effect `ready(bundle | bundles)` (root export, also from `defineGame`) lets a node rest on a load and stay answerable: its handler (fast mode too) answers `true` headless, throws for an unknown bundle, answers `true` when every bundle is loaded and warmed or its last warm failed (`ctx.log.warn("assets:ready-failed", { bundle, error })`, cleared by a later successful load), otherwise starts `warm` for what is missing, answers `false` and posts `{ type: "ready" }` into `flow.inbox` once all of it settled. Recipe: a rest node `inbox: ["elapsed", "ready"]` with outcomes `ready` and `back`, and a transit node `if ((await fx(ready(list))) === false) return out.wait();`. `companions.add({ load(bundle), unload(bundle) })` adds what loads and unloads with every bundle; `i18n` adds the strings of a sub-feature that way, only when `assets` is composed. Events `assets:bundle-loaded`, `assets:bundle-progress`, `assets:bundle-unloaded` (`reason: "budget" | "request" | "leave"`), `assets:replaced` (dev). Config: `manifest`, `textureBudgetMb: 192`, `preloadDepth: 2`, `baseUrl`, `io`.
|
|
540
540
|
- `resource(name, defaults)` clones plain JSON defaults into every world. `resource(name, () => value)` calls the factory once per world on first read, so the value may hold a `Map` or a function: `const Looks = resource("boardLooks", () => ({ shown: new Map<World.Entity, { look: string }>() }))`. A system keeps its own state there; `snapshot()` leaves a value that is not JSON out.
|