@moku-labs/game 0.4.2 → 0.4.4
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/{commands-DYO22lzi.d.mts → commands-C83eQ5B9.d.mts} +8 -1
- package/dist/control.d.mts +1 -1
- package/dist/control.mjs +2 -2
- package/dist/{dev-B5p9_3fz.mjs → dev-wKLgOw7c.mjs} +8 -5
- package/dist/index.d.mts +9 -9
- package/dist/index.mjs +2 -1
- package/dist/inspect.d.mts +5 -2
- package/dist/inspect.mjs +1 -1
- package/dist/{run-C7O77UQR.mjs → run-D_R0oJ6g.mjs} +36 -1
- package/dist/{sources-CTGuY3Fe.mjs → sources-DVWJ8nfr.mjs} +26 -3
- package/dist/testing.d.mts +2 -2
- package/dist/testing.mjs +2 -2
- package/dist/{types-CVUHPvMB.d.mts → types-C-4f2jD_.d.mts} +669 -18
- package/dist/types-w646dMeA.d.mts +648 -0
- package/llms.txt +3 -3
- package/package.json +13 -11
- package/dist/types-BnWH-75b.d.mts +0 -1284
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as Captured, Et as Bookmark, T as DebugSwitches, Vt as Time, an as Api, k as Api$2, kt as FlowState, m as Api$1 } from "./types-Dy1xB68L.mjs";
|
|
2
2
|
import { d as HeadlessApp, n as Command, r as ControlApp } from "./types-DtmFVCHf.mjs";
|
|
3
3
|
import { H as InputApi } from "./types-VErbiEXy.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { G as UiApi, g as AnimApi, t as AudioApi } from "./types-C-4f2jD_.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/flow/doors/commands.d.ts
|
|
7
7
|
/**
|
|
@@ -104,6 +104,13 @@ declare const commands: Readonly<{
|
|
|
104
104
|
timeScale: Command<{
|
|
105
105
|
scale: "number";
|
|
106
106
|
}, Readonly<Time>, ControlApp>;
|
|
107
|
+
mute: Command<{
|
|
108
|
+
muted: "boolean";
|
|
109
|
+
}, boolean, HeadlessApp & {
|
|
110
|
+
readonly log: import("@moku-labs/common/browser").LogApi;
|
|
111
|
+
} & {
|
|
112
|
+
readonly audio?: AudioApi;
|
|
113
|
+
}>;
|
|
107
114
|
trace: Command<{
|
|
108
115
|
path: "json";
|
|
109
116
|
}, boolean, HeadlessApp & {
|
package/dist/control.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as HeadlessApp, i as InputArguments, n as Command, o as InputSchema, s as Ran } from "./types-DtmFVCHf.mjs";
|
|
2
|
-
import { t as commands } from "./commands-
|
|
2
|
+
import { t as commands } from "./commands-C83eQ5B9.mjs";
|
|
3
3
|
import { t as defineCommand } from "./define-BKWjWgyQ.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/flow/doors/dev.d.ts
|
package/dist/control.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as controlRefused } from "./dev-
|
|
2
|
-
import { n as commands, t as run } from "./run-
|
|
1
|
+
import { t as controlRefused } from "./dev-wKLgOw7c.mjs";
|
|
2
|
+
import { n as commands, t as run } from "./run-D_R0oJ6g.mjs";
|
|
3
3
|
import { s as defineCommand } from "./input-CK4nxBO1.mjs";
|
|
4
4
|
export { commands, controlRefused, defineCommand, run };
|
|
@@ -27,18 +27,21 @@ function controlRefused() {
|
|
|
27
27
|
return /* @__PURE__ */ new Error("[game] Control commands run in dev builds only.\n Define __MOKU_GAME_DEV__ as true in the dev build.");
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* Builds the error a door source throws when the opt-in plugin it
|
|
30
|
+
* Builds the error a door source or command throws when the opt-in plugin it uses is not
|
|
31
|
+
* installed.
|
|
31
32
|
*
|
|
32
|
-
* @param id - The id of the source.
|
|
33
|
-
* @param plugin - The export name of the plugin it
|
|
33
|
+
* @param id - The id of the source or the command.
|
|
34
|
+
* @param plugin - The export name of the plugin it uses.
|
|
35
|
+
* @param kind - What the door descriptor is. A source by default.
|
|
34
36
|
* @returns The error, ready to throw.
|
|
35
37
|
* @example
|
|
36
38
|
* ```ts
|
|
37
39
|
* notInstalled("game.sounds", "audioPlugin").message; // "[game] The source game.sounds needs audioPlugin.\n Add audioPlugin to createApp({ plugins })."
|
|
40
|
+
* notInstalled("game.mute", "audioPlugin", "command").message; // "[game] The command game.mute needs audioPlugin.\n Add audioPlugin to createApp({ plugins })."
|
|
38
41
|
* ```
|
|
39
42
|
*/
|
|
40
|
-
function notInstalled(id, plugin) {
|
|
41
|
-
return /* @__PURE__ */ new Error(`[game] The
|
|
43
|
+
function notInstalled(id, plugin, kind = "source") {
|
|
44
|
+
return /* @__PURE__ */ new Error(`[game] The ${kind} ${id} needs ${plugin}.\n Add ${plugin} to createApp({ plugins }).`);
|
|
42
45
|
}
|
|
43
46
|
//#endregion
|
|
44
47
|
export { isDev as n, notInstalled as r, controlRefused as t };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $ as Ease, A as Config$8, B as ComponentValue, Bt as State$7, Ct as to, Dt as DefineNode, Ft as GuideOptions, G as Narrowed, Ht as types_d_exports$14, It as Hint, J as ResourceType, Jt as State$5, Kt as Json, L as ComponentHandle, M as State$8, Mt as SceneIdOf, N as types_d_exports$16, O as ViewportSize, Pt as Descriptor, Q as DescriptionNode, Rt as Api$5, S as types_d_exports$11, St as slot, Tt as FeatureDescription, W as Mut, Wt as Config$5, X as TagType, Xt as Patch, Y as SystemDefinition, Yt as types_d_exports$9, _n as Events$1, _t as State$3, a as DefineBundles, an as Api$3, at as ProjectionMotion, b as State$6, bt as defineFlow, c as LoadReason, cn as PauseReason, d as Tier, dn as Api$1, dt as BundlesOf, en as SaveUnreadableError, fn as Config$2, ft as Config$3, gn as Config$9, h as Config$6, hn as types_d_exports$3, ht as GameTypes, i as Config$1, it as NumericFields, k as Api$6, ln as State$4, m as Api$4, mn as State$2, mt as FeaturePlugin, n as BundleMap, nn as StoreApi, on as Config$4, ot as ProjectionSpec, p as types_d_exports$1, pt as EmitterIdOf, q as QueryTerm, qt as Root, r as BundleSpec, rn as RngApi, s as LoadBundles, sn as Events, t as Api, u as State$1, un as types_d_exports$8, ut as Api$2, vn as Require, vt as TextStylesOf, wt as type, xt as exit, yt as types_d_exports$5, z as ComponentType, zt as Config$7 } from "./types-Dy1xB68L.mjs";
|
|
2
2
|
import { $ as SpriteValue, A as TextStyleInput, B as types_d_exports$6, C as Config$12, D as TextApi, E as State$11, F as Config$10, G as Display, H as InputApi, I as I18nApi, J as Parent, K as NineSlice, L as Message, M as TextValue, N as types_d_exports$13, O as TextBind, P as Argument, Q as SpriteOptions, R as State$9, S as BindOptions, T as Point, U as State$10, V as Config$11, W as types_d_exports$7, X as ShapeValue, Y as Shape, Z as Sprite, _ as Style, b as defineComponent, d as popup, et as Transform, f as defineTokens, g as ResolvedStyle, h as IsFlags, j as TextStyles, k as TextFormat, l as Box, nt as sprite, p as IntrinsicElementsFor, q as NineSliceValue, s as PopupComponent, tt as TransformValue, u as LocalWrite, w as CountdownValue, x as BindField, y as WhenFlags, z as TypedTr } from "./types-VErbiEXy.mjs";
|
|
3
|
-
import { A as
|
|
4
|
-
import {
|
|
3
|
+
import { A as haptic, B as tween, C as HapticKind, D as defineAnimation, E as HAPTIC_KINDS, F as set, G as UiApi, H as wait, I as sfx, K as types_d_exports$15, L as spawn, M as parallel, N as play, O as external, P as sequence, R as spawned, S as types_d_exports, T as Step, U as Config$15, V as use, W as State$15, _ as Config$13, b as State$12, c as AnySceneProjection, d as SceneDefinition, f as SceneSpec, g as AnimApi, h as types_d_exports$12, i as MusicOptions, j as mark, k as frames, l as DefineScene, m as State$14, n as Config$14, o as State$13, p as ScenesApi, r as MusicDescriptor, s as types_d_exports$2, t as AudioApi, u as LayerMap, v as FramesValue, w as SfxDescriptor, x as Target, y as MotionKeyframe, z as stagger } from "./types-C-4f2jD_.mjs";
|
|
4
|
+
import { _ as NoiseValue, a as types_d_exports$4, c as EmitterValue, d as ColorMatrixValue, f as DisplacementValue, g as GlowValue, h as FilterValueOf, i as State$16, l as AlphaValue, m as FilterSpec, n as EffectsApi, o as EmitterConfig, p as FilterComponent, s as EmitterDefinition, t as Config$16, u as BlurValue, v as OutlineValue, y as UniformDeclaration } from "./types-w646dMeA.mjs";
|
|
5
5
|
import { Log } from "@moku-labs/common/browser";
|
|
6
6
|
import { PluginCtx } from "@moku-labs/core";
|
|
7
7
|
|
|
@@ -212,7 +212,7 @@ declare const assetsPlugin: import("@moku-labs/core").PluginInstance<"assets", C
|
|
|
212
212
|
* });
|
|
213
213
|
* ```
|
|
214
214
|
*/
|
|
215
|
-
declare const audioPlugin: import("@moku-labs/core").PluginInstance<"audio", Config$
|
|
215
|
+
declare const audioPlugin: import("@moku-labs/core").PluginInstance<"audio", Config$14, State$13, AudioApi, {}> & Record<never, never>;
|
|
216
216
|
//#endregion
|
|
217
217
|
//#region src/plugins/clock/index.d.ts
|
|
218
218
|
/**
|
|
@@ -244,7 +244,7 @@ declare const clockPlugin: import("@moku-labs/core").PluginInstance<"clock", Con
|
|
|
244
244
|
* app.effects.stats(); // { particles: 0, emitters: 0, filters: 0, renderPasses: 0 }: nothing runs before start
|
|
245
245
|
* ```
|
|
246
246
|
*/
|
|
247
|
-
declare const effectsPlugin: import("@moku-labs/core").PluginInstance<"effects", Config$16, State$
|
|
247
|
+
declare const effectsPlugin: import("@moku-labs/core").PluginInstance<"effects", Config$16, State$16, EffectsApi, {}> & Record<never, never>;
|
|
248
248
|
//#endregion
|
|
249
249
|
//#region src/plugins/flow/index.d.ts
|
|
250
250
|
/**
|
|
@@ -552,7 +552,7 @@ declare const rendererPlugin: import("@moku-labs/core").PluginInstance<"renderer
|
|
|
552
552
|
* export const awaitIntent = defineNode({ scene: "board", rest: true, outcomes: { merge: type() } });
|
|
553
553
|
* ```
|
|
554
554
|
*/
|
|
555
|
-
declare const scenesPlugin: import("@moku-labs/core").PluginInstance<"scenes", Record<string, never>, State$
|
|
555
|
+
declare const scenesPlugin: import("@moku-labs/core").PluginInstance<"scenes", Record<string, never>, State$14, ScenesApi, {
|
|
556
556
|
"scenes:changed": {
|
|
557
557
|
from: string | undefined;
|
|
558
558
|
to: string;
|
|
@@ -609,7 +609,7 @@ declare const timePlugin: import("@moku-labs/core").PluginInstance<"time", Confi
|
|
|
609
609
|
* app.input.tap(app.ui.find("claim") ?? 0);
|
|
610
610
|
* ```
|
|
611
611
|
*/
|
|
612
|
-
declare const uiPlugin: import("@moku-labs/core").PluginInstance<"ui", Config$
|
|
612
|
+
declare const uiPlugin: import("@moku-labs/core").PluginInstance<"ui", Config$15, State$15, UiApi, {}> & Record<never, never>;
|
|
613
613
|
//#endregion
|
|
614
614
|
//#region src/plugins/world/index.d.ts
|
|
615
615
|
/**
|
|
@@ -1396,7 +1396,7 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
|
|
|
1396
1396
|
rolledBackTo: string;
|
|
1397
1397
|
retry: boolean;
|
|
1398
1398
|
};
|
|
1399
|
-
}> & Record<never, never>) | ExtraPlugins[number], [...ExtraPlugins], import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common/browser").LogConfig, import("@moku-labs/common/browser").LogState, import("@moku-labs/common/browser").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common/browser").EnvConfig, import("@moku-labs/common/browser").EnvState, import("@moku-labs/common/browser").EnvApi>]>> | undefined) => import("@moku-labs/core").App<Config$9, Events$1, (import("@moku-labs/core").PluginInstance<"time", Config$7, State$7, Api$5, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"lifecycle", Config$4, State$4, Api$3, {
|
|
1399
|
+
}> & Record<never, never>) | ExtraPlugins[number], [...ExtraPlugins], import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common/browser").LogConfig, import("@moku-labs/common/browser").LogState, import("@moku-labs/common/browser").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common/browser").EnvConfig, import("@moku-labs/common/browser").EnvState, import("@moku-labs/common/browser").EnvApi>]>, import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common/browser").LogConfig, import("@moku-labs/common/browser").LogState, import("@moku-labs/common/browser").LogApi> | import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common/browser").EnvConfig, import("@moku-labs/common/browser").EnvState, import("@moku-labs/common/browser").EnvApi>> | undefined) => import("@moku-labs/core").App<Config$9, Events$1, (import("@moku-labs/core").PluginInstance<"time", Config$7, State$7, Api$5, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"lifecycle", Config$4, State$4, Api$3, {
|
|
1400
1400
|
"lifecycle:changed": {
|
|
1401
1401
|
reason: PauseReason;
|
|
1402
1402
|
action: "push" | "pop";
|
|
@@ -1573,7 +1573,7 @@ declare const screen: readonly [import("@moku-labs/core").PluginInstance<"world"
|
|
|
1573
1573
|
reason: "budget" | "request";
|
|
1574
1574
|
keys: readonly string[];
|
|
1575
1575
|
};
|
|
1576
|
-
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"scenes", Record<string, never>, State$
|
|
1576
|
+
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"scenes", Record<string, never>, State$14, ScenesApi, {
|
|
1577
1577
|
"scenes:changed": {
|
|
1578
1578
|
from: string | undefined;
|
|
1579
1579
|
to: string;
|
|
@@ -1591,6 +1591,6 @@ declare const screen: readonly [import("@moku-labs/core").PluginInstance<"world"
|
|
|
1591
1591
|
"i18n:locale-changed": {
|
|
1592
1592
|
locale: string;
|
|
1593
1593
|
};
|
|
1594
|
-
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"text", Config$12, State$11, TextApi, {}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"ui", Config$
|
|
1594
|
+
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"text", Config$12, State$11, TextApi, {}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"ui", Config$15, State$15, UiApi, {}> & Record<never, never>];
|
|
1595
1595
|
//#endregion
|
|
1596
1596
|
export { Alpha, types_d_exports as Anim, Animation, types_d_exports$1 as Assets, types_d_exports$2 as Audio, type BackResult, type BindOptions, Blur, Box, types_d_exports$3 as Clock, ColorMatrix, Countdown, type CountdownValue, type DescriptionNode, Displacement, Display, Draggable, DropTarget, types_d_exports$4 as Effects, Emitter, Exiting, types_d_exports$5 as Flow, Frames, Glow, HAPTIC_KINDS, type HapticKind, Held, Hovered, types_d_exports$6 as I18n, types_d_exports$7 as Input, Layer, types_d_exports$8 as Lifecycle, LocalWrite, types_d_exports$9 as Model, NineSlice, Noise, Order, Outline, Parent, types_d_exports$10 as Platform, type PlatformProvider, Pointer, PointerOver, Pressable, Pressed, types_d_exports$11 as Renderer, SaveUnreadableError, types_d_exports$12 as Scenes, Shape, Sprite, Swipeable, Tappable, Text, type TextFormat, types_d_exports$13 as TextTypes, types_d_exports$14 as Time, Touchable, Traceable, Traced, Transform, Tree, types_d_exports$15 as Ui, types_d_exports$16 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, createApp, createPlugin, defineAnimation, defineBundles, defineComponent, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, defineTextStyles, defineTokens, effectsPlugin, exit, external, flowPlugin, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
|
2
2
|
import { a as enableDraftPatches, i as dropDrafts, o as finishDrafts, r as deepFreeze, s as openDrafts, t as memory } from "./memory-CvgdnsQO.mjs";
|
|
3
3
|
import { c as findNode, d as slotNames, f as compact, i as servePaused, l as framePath, n as captureFrame, o as collectFlows, p as pushEntry, r as serveCaptures, s as describeGraph, t as cancelCaptures, u as graphHash } from "./capture-fpd83Mi5.mjs";
|
|
4
4
|
import { A as system, C as Exiting, D as component, E as Tree, O as mut, S as sprite, T as Order, _ as Parent, a as visualOf$1, b as Transform, c as Text, d as defineTextStyles, f as label, g as NineSlice, h as Display, j as tag, k as resource, l as bind, m as textFor, n as fitScaleOf, o as visualRectOf, p as readStyle, r as samePose, s as Countdown, t as CONTENT, u as builtInStyles, v as Shape, w as Layer, x as componentsFor, y as Sprite } from "./visual-DUvvPPCt.mjs";
|
|
5
|
-
import { n as isDev } from "./dev-
|
|
5
|
+
import { n as isDev } from "./dev-wKLgOw7c.mjs";
|
|
6
6
|
import { n as flatten, r as defineComponent } from "./flatten-BkXuscAV.mjs";
|
|
7
7
|
import { envPlugin, logPlugin } from "@moku-labs/common/browser";
|
|
8
8
|
import { createCoreConfig } from "@moku-labs/core";
|
|
@@ -17033,6 +17033,7 @@ function createAudioApi(ctx) {
|
|
|
17033
17033
|
state.buses[checked].muted = on;
|
|
17034
17034
|
applyGain(state, checked);
|
|
17035
17035
|
},
|
|
17036
|
+
muted: (bus) => state.buses[busOf(state, bus)].muted,
|
|
17036
17037
|
unlocked: () => state.unlocked,
|
|
17037
17038
|
journal: () => state.journal
|
|
17038
17039
|
};
|
package/dist/inspect.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { At as JournalEntry, H as EntitySnapshot, Ot as FlowGraph, R as ComponentSchema, U as FrameDiff, Ut as Api, f as Usage, gt as Position, j as Explained, k as Api$1, m as Api$2, t as Api$3, tn as Snapshot, w as RenderStats, x as Under } from "./types-Dy1xB68L.mjs";
|
|
2
2
|
import { a as InputOf, c as Source, d as HeadlessApp, i as InputArguments, l as WatchApp, o as InputSchema, t as CheatEntry, u as WatchInput } from "./types-DtmFVCHf.mjs";
|
|
3
3
|
import { c as UiNode } from "./types-VErbiEXy.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { G as UiApi, a as SoundEntry, t as AudioApi } from "./types-C-4f2jD_.mjs";
|
|
5
5
|
import { n as defineSource } from "./define-BKWjWgyQ.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { n as EffectsApi, r as EffectsStats } from "./types-w646dMeA.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/plugins/flow/doors/read.d.ts
|
|
9
9
|
/**
|
|
@@ -97,6 +97,9 @@ declare const sources: Readonly<{
|
|
|
97
97
|
}, readonly SoundEntry[], HeadlessApp & {
|
|
98
98
|
readonly audio?: AudioApi;
|
|
99
99
|
}>;
|
|
100
|
+
audioMuted: Source<{}, boolean, HeadlessApp & {
|
|
101
|
+
readonly audio?: AudioApi;
|
|
102
|
+
}>;
|
|
100
103
|
effects: Source<{}, EffectsStats, HeadlessApp & {
|
|
101
104
|
readonly effects?: EffectsApi;
|
|
102
105
|
}>;
|
package/dist/inspect.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as sheetAlone, u as graphHash } from "./capture-fpd83Mi5.mjs";
|
|
2
|
-
import { n as isDev, t as controlRefused } from "./dev-
|
|
2
|
+
import { n as isDev, r as notInstalled, t as controlRefused } from "./dev-wKLgOw7c.mjs";
|
|
3
3
|
import { a as isProjectionTarget, i as recordCheat, o as readTarget, r as isTainted, s as defineCommand, t as inputOrEmpty } from "./input-CK4nxBO1.mjs";
|
|
4
4
|
//#region src/plugins/flow/headless.ts
|
|
5
5
|
const noPayload = null;
|
|
@@ -217,6 +217,40 @@ const reducedMotionCommand = defineCommand({
|
|
|
217
217
|
}
|
|
218
218
|
});
|
|
219
219
|
//#endregion
|
|
220
|
+
//#region src/plugins/audio/control.ts
|
|
221
|
+
/**
|
|
222
|
+
* @file audio plugin — the audio command of the `/control` door: mute the whole game. Dev builds
|
|
223
|
+
* only: the body starts with the inline dev guard, so a bundler `define` of `false` drops it, and
|
|
224
|
+
* logs the `moku:dev` marker.
|
|
225
|
+
*/
|
|
226
|
+
/**
|
|
227
|
+
* Mutes or unmutes the `master` bus, so music and sfx both go silent; the stored volumes stay.
|
|
228
|
+
* Answers the flag as it is afterwards.
|
|
229
|
+
*
|
|
230
|
+
* @throws {Error} `[game] The command game.mute needs audioPlugin.` when the app has no `audioPlugin`.
|
|
231
|
+
* @example
|
|
232
|
+
* ```ts
|
|
233
|
+
* // The editor's Sound switch silences the game while a level is checked.
|
|
234
|
+
* (await run(app, commands.mute, { muted: true })).value; // true
|
|
235
|
+
* ```
|
|
236
|
+
*/
|
|
237
|
+
const muteCommand = defineCommand({
|
|
238
|
+
id: "game.mute",
|
|
239
|
+
title: "Mute",
|
|
240
|
+
input: { muted: "boolean" },
|
|
241
|
+
effect: "cosmetic",
|
|
242
|
+
run: (app, { muted }) => {
|
|
243
|
+
if (typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) throw controlRefused();
|
|
244
|
+
if (app.audio === void 0) throw notInstalled("game.mute", "audioPlugin", "command");
|
|
245
|
+
app.log.debug("moku:dev", {
|
|
246
|
+
command: "game.mute",
|
|
247
|
+
muted
|
|
248
|
+
});
|
|
249
|
+
app.audio.mute("master", muted);
|
|
250
|
+
return app.audio.muted("master");
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
//#endregion
|
|
220
254
|
//#region src/plugins/input/control.ts
|
|
221
255
|
/**
|
|
222
256
|
* @file input plugin — the input commands of the `/control` door: a drag from one view onto
|
|
@@ -1173,6 +1207,7 @@ const commands = Object.freeze({
|
|
|
1173
1207
|
reducedMotion: reducedMotionCommand,
|
|
1174
1208
|
fill: fillCommand,
|
|
1175
1209
|
timeScale: timeScaleCommand,
|
|
1210
|
+
mute: muteCommand,
|
|
1176
1211
|
trace: traceCommand
|
|
1177
1212
|
});
|
|
1178
1213
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as scaleByFits, w as Layer } from "./visual-DUvvPPCt.mjs";
|
|
2
|
-
import { r as notInstalled } from "./dev-
|
|
2
|
+
import { r as notInstalled } from "./dev-wKLgOw7c.mjs";
|
|
3
3
|
import { c as defineSource, n as cheatsOf, o as readTarget, r as isTainted, t as inputOrEmpty } from "./input-CK4nxBO1.mjs";
|
|
4
4
|
//#region src/plugins/flow/doors/read.ts
|
|
5
5
|
/**
|
|
@@ -99,8 +99,8 @@ const assetsSource = defineSource({
|
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region src/plugins/audio/inspect.ts
|
|
101
101
|
/**
|
|
102
|
-
* @file audio plugin — the audio
|
|
103
|
-
* Production-safe:
|
|
102
|
+
* @file audio plugin — the audio sources of the `/inspect` door: the journal of started sounds
|
|
103
|
+
* and the mute flag of the master bus. Production-safe: they only read.
|
|
104
104
|
*/
|
|
105
105
|
/**
|
|
106
106
|
* The sounds that started, oldest first: every sfx played and every music track begun, all of
|
|
@@ -125,6 +125,28 @@ const soundsSource = defineSource({
|
|
|
125
125
|
return last === void 0 ? entries : entries.slice(Math.max(0, entries.length - last));
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
|
+
/**
|
|
129
|
+
* Whether the whole game is muted: the mute flag of the `master` bus. The `game.mute` command
|
|
130
|
+
* writes it.
|
|
131
|
+
*
|
|
132
|
+
* @throws {Error} `[game] The source game.audioMuted needs audioPlugin.` when the app has no `audioPlugin`.
|
|
133
|
+
* @example
|
|
134
|
+
* ```ts
|
|
135
|
+
* // The editor muted the game, and an e2e script checks the switch took.
|
|
136
|
+
* await run(app, commands.mute, { muted: true });
|
|
137
|
+
* read(app, sources.audioMuted); // true
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
const audioMutedSource = defineSource({
|
|
141
|
+
id: "game.audioMuted",
|
|
142
|
+
title: "Audio muted",
|
|
143
|
+
input: {},
|
|
144
|
+
changes: "frame",
|
|
145
|
+
read: (app) => {
|
|
146
|
+
if (app.audio === void 0) throw notInstalled("game.audioMuted", "audioPlugin");
|
|
147
|
+
return app.audio.muted("master");
|
|
148
|
+
}
|
|
149
|
+
});
|
|
128
150
|
//#endregion
|
|
129
151
|
//#region src/plugins/effects/inspect.ts
|
|
130
152
|
/**
|
|
@@ -717,6 +739,7 @@ const sources = Object.freeze({
|
|
|
717
739
|
locate: locateSource,
|
|
718
740
|
render: renderSource,
|
|
719
741
|
sounds: soundsSource,
|
|
742
|
+
audioMuted: audioMutedSource,
|
|
720
743
|
effects: effectsSource,
|
|
721
744
|
assets: assetsSource,
|
|
722
745
|
log: logSource,
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { $t as SaveDoc, Kt as Json, Qt as ProviderCall, Ut as Api$2, Zt as PlayerStateProvider, an as Api$3, k as Api$1, m as Api, pn as FakeClock } from "./types-Dy1xB68L.mjs";
|
|
2
2
|
import { _ as stepFrames, a as InputOf, d as HeadlessApp, f as HeadlessGame, g as runRepro, h as createHeadless, m as ReproResult, p as Repro, r as ControlApp } from "./types-DtmFVCHf.mjs";
|
|
3
3
|
import { H as InputApi } from "./types-VErbiEXy.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { t as commands } from "./commands-
|
|
4
|
+
import { G as UiApi, g as AnimApi } from "./types-C-4f2jD_.mjs";
|
|
5
|
+
import { t as commands } from "./commands-C83eQ5B9.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/clock/fake.d.ts
|
|
8
8
|
/**
|
package/dist/testing.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as saveOf, t as memory } from "./memory-CvgdnsQO.mjs";
|
|
2
|
-
import { a as stepFrames, i as runRepro, n as commands, r as createHeadless, t as run } from "./run-
|
|
3
|
-
import { n as read, t as sources } from "./sources-
|
|
2
|
+
import { a as stepFrames, i as runRepro, n as commands, r as createHeadless, t as run } from "./run-D_R0oJ6g.mjs";
|
|
3
|
+
import { n as read, t as sources } from "./sources-DVWJ8nfr.mjs";
|
|
4
4
|
import { createBrandConsole } from "@moku-labs/common/cli";
|
|
5
5
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|