@open-slot-ui/pixi 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/OpenUIPixi-D4Z7emFO.d.cts +202 -0
- package/dist/OpenUIPixi-D4Z7emFO.d.ts +202 -0
- package/dist/art.cjs +269 -0
- package/dist/art.cjs.map +1 -0
- package/dist/art.d.cts +125 -0
- package/dist/art.d.ts +125 -0
- package/dist/art.js +222 -0
- package/dist/art.js.map +1 -0
- package/dist/chunk-PYXZIGXG.js +3733 -0
- package/dist/chunk-PYXZIGXG.js.map +1 -0
- package/dist/index.cjs +147 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -185
- package/dist/index.d.ts +16 -185
- package/dist/index.js +16 -3621
- package/dist/index.js.map +1 -1
- package/package.json +9 -2
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import * as pixi_js from 'pixi.js';
|
|
2
|
+
import { Container, Ticker, Texture, Application } from 'pixi.js';
|
|
3
|
+
import { Theme, Control, OpenUI, ScreenState, BlockSpec, EventLog } from '@open-slot-ui/core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A skin owns a control's *look* and nothing else. The view drives it with the
|
|
7
|
+
* current state name; the skin swaps art accordingly. This is the seam where a
|
|
8
|
+
* game's design (Graphics, SVG, Spine, …) plugs in without touching control logic.
|
|
9
|
+
*/
|
|
10
|
+
interface SpinSkin {
|
|
11
|
+
/** The display object the view adds into its animated `art` container. */
|
|
12
|
+
readonly view: Container;
|
|
13
|
+
/** React to a state change (swap art, recolor, etc.). */
|
|
14
|
+
update(state: string): void;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
}
|
|
17
|
+
type SpinSkinFactory = (theme: Theme) => SpinSkin;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Base view: a Pixi Container bound to a core Control. Owns layout placement and
|
|
21
|
+
* registers the introspection hook so the core can report bounds/animation state.
|
|
22
|
+
* Subclasses draw and wire input. Dumb on its own (Charter B3).
|
|
23
|
+
*/
|
|
24
|
+
declare abstract class ControlView extends Container {
|
|
25
|
+
protected readonly control: Control;
|
|
26
|
+
protected readonly ui: OpenUI;
|
|
27
|
+
protected animating: boolean;
|
|
28
|
+
protected readonly disposers: Array<() => void>;
|
|
29
|
+
constructor(control: Control, ui: OpenUI);
|
|
30
|
+
/** Position + fit-scale from the control's layout spec against the screen. */
|
|
31
|
+
applyLayout(screen: ScreenState): void;
|
|
32
|
+
private computeRect;
|
|
33
|
+
dispose(): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Per-id view override — swap a control's renderer without forking (Charter P7). */
|
|
37
|
+
type ControlViewFactory = (control: Control, ui: OpenUI, ticker: Ticker) => ControlView;
|
|
38
|
+
interface BlockColumnOptions {
|
|
39
|
+
controlSkins?: Partial<Record<string, ControlViewFactory>>;
|
|
40
|
+
/** Unclipped layer for select dropdowns (so a scroll mask doesn't clip them). */
|
|
41
|
+
dropdownLayer?: Container;
|
|
42
|
+
}
|
|
43
|
+
interface BlockColumn {
|
|
44
|
+
/** Rows laid top→down (first row near y=0); the caller positions/scrolls it. */
|
|
45
|
+
content: Container;
|
|
46
|
+
/** Interactive child views, for disposal. */
|
|
47
|
+
views: ControlView[];
|
|
48
|
+
/** Total column height. */
|
|
49
|
+
height: number;
|
|
50
|
+
/** Inner content width (body width minus padding). */
|
|
51
|
+
innerW: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Render a declarative `BlockSpec[]` into a column of rows — interactive controls
|
|
55
|
+
* (slider/toggle/button/select/value/stepper) and static content (heading/text/
|
|
56
|
+
* callout/stat-grid/steps/paytable/image). All text flows through `ui.t`. This is
|
|
57
|
+
* the single renderer shared by the small panel body AND the scrollable menu, so
|
|
58
|
+
* blocks look identical wherever they appear (Charter B3/B9).
|
|
59
|
+
*/
|
|
60
|
+
declare function buildBlockColumn(blocks: BlockSpec[], controls: Control[], ui: OpenUI, ticker: Ticker, bodyW: number, opts?: BlockColumnOptions): BlockColumn;
|
|
61
|
+
|
|
62
|
+
interface CellRenderer<C extends Container = Container> {
|
|
63
|
+
createCell(digit: number): C;
|
|
64
|
+
setDigit(cell: C, digit: number): void;
|
|
65
|
+
setFiller(cell: C, digit: number): void;
|
|
66
|
+
createSeparator?(char: string): Container;
|
|
67
|
+
destroyCell?(cell: C): void;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Minimal GSAP-compatible API the Counter uses for `fit` animation.
|
|
71
|
+
* Passing the default `gsap` import satisfies this shape — no need for type imports.
|
|
72
|
+
*/
|
|
73
|
+
interface GsapLike {
|
|
74
|
+
to(target: object, vars: Record<string, unknown>): unknown;
|
|
75
|
+
killTweensOf(target: object): void;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface OpenUIIcons {
|
|
79
|
+
settingsIdle?: Texture;
|
|
80
|
+
settingsActive?: Texture;
|
|
81
|
+
close?: Texture;
|
|
82
|
+
rules?: Texture;
|
|
83
|
+
sliderMusic?: Texture;
|
|
84
|
+
sliderSound?: Texture;
|
|
85
|
+
turboOff?: Texture;
|
|
86
|
+
turboOn?: Texture;
|
|
87
|
+
/** One texture per turbo mode (index-aligned) — for 3-mode art. Wins over off/on. */
|
|
88
|
+
turboModes?: Texture[];
|
|
89
|
+
autoIdle?: Texture;
|
|
90
|
+
autoActive?: Texture;
|
|
91
|
+
bonus?: Texture;
|
|
92
|
+
betPlus?: Texture;
|
|
93
|
+
betMinus?: Texture;
|
|
94
|
+
}
|
|
95
|
+
interface OpenUIPixiOptions {
|
|
96
|
+
/** Expose `window.__OPENUI__` for e2e/introspection. Default true. */
|
|
97
|
+
expose?: boolean;
|
|
98
|
+
/** Override the spin control's skin (default = the art-free Graphics placeholder). */
|
|
99
|
+
spinSkin?: SpinSkinFactory;
|
|
100
|
+
/** Real art for the menu/close/slider controls (else neutral placeholders). */
|
|
101
|
+
icons?: OpenUIIcons;
|
|
102
|
+
/**
|
|
103
|
+
* The composed MENU blocks (Settings → Paytable → Rules) the ☰ button opens in a
|
|
104
|
+
* scrollable sheet. Usually built by `mountHud` via `composeMenu(spec.menu, …)`;
|
|
105
|
+
* omitted → a default Settings-only menu (Music/Sound). Pass `false` to skip the
|
|
106
|
+
* built-in Pixi menu entirely (e.g. when supplying your own HTML/DOM menu).
|
|
107
|
+
*/
|
|
108
|
+
menu?: BlockSpec[] | false;
|
|
109
|
+
/** Header title for the menu sheet (localizable). Default 'Menu'. */
|
|
110
|
+
menuTitle?: string;
|
|
111
|
+
/** Per-id view override — swap a control's renderer without forking (Charter P7). */
|
|
112
|
+
controlSkins?: Partial<Record<string, ControlViewFactory>>;
|
|
113
|
+
/**
|
|
114
|
+
* Host `gsap` — enables the value counter's auto-downscale so wide currencies
|
|
115
|
+
* (8-decimal BTC, big SATS counts, long codes) shrink to fit instead of spilling.
|
|
116
|
+
* Kept out of the lib's deps (Charter B5); the host passes its own gsap.
|
|
117
|
+
*/
|
|
118
|
+
gsap?: GsapLike;
|
|
119
|
+
/**
|
|
120
|
+
* Autoplay count-picker presentation. `'drawer'` (default) is a bottom sheet;
|
|
121
|
+
* `'radial'` fans the count chips around the spin button.
|
|
122
|
+
*/
|
|
123
|
+
autoplayPicker?: 'drawer' | 'radial';
|
|
124
|
+
/**
|
|
125
|
+
* Text colour for the top-corner compliance readouts (RTP / net / session). Defaults
|
|
126
|
+
* to the theme text colour; a light-background host can pass a dark colour so the
|
|
127
|
+
* Figma-style `Label: value` block stays legible.
|
|
128
|
+
*/
|
|
129
|
+
readoutColor?: string;
|
|
130
|
+
/**
|
|
131
|
+
* How the interactive HUD appears on mount: `'shown'` (default), `'hidden'` (off
|
|
132
|
+
* screen + non-interactive; reveal later with `showControls()`), or `'slide-in'`
|
|
133
|
+
* (start hidden, then slide in from the edges).
|
|
134
|
+
*/
|
|
135
|
+
intro?: 'shown' | 'hidden' | 'slide-in';
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The controller: mounts ONE root Container onto the host's existing stage,
|
|
139
|
+
* shares the host ticker/renderer, drives resize, and exposes introspection.
|
|
140
|
+
* `unmount()` removes the layer and every listener it created (Charter P2/P12).
|
|
141
|
+
*/
|
|
142
|
+
declare class OpenUIPixi {
|
|
143
|
+
private readonly ui;
|
|
144
|
+
private readonly opts;
|
|
145
|
+
readonly root: Container<pixi_js.ContainerChild>;
|
|
146
|
+
private readonly views;
|
|
147
|
+
/** Full-screen overlays (e.g. the autoplay drawer) that own their own layout. */
|
|
148
|
+
private readonly overlays;
|
|
149
|
+
private readonly disposers;
|
|
150
|
+
private _eventLog?;
|
|
151
|
+
/** Show/hide slide: each interactive view slides toward its anchored edge (bottom
|
|
152
|
+
* controls down, top up — behind the status-bar plaque). Views stay direct children
|
|
153
|
+
* of `root` (introspection bounds unchanged); only their y moves, and the
|
|
154
|
+
* ref-counted input lock makes them non-interactive while moving/hidden. */
|
|
155
|
+
private slideProg;
|
|
156
|
+
private slideTarget;
|
|
157
|
+
private slideHeld;
|
|
158
|
+
private lastScreenH;
|
|
159
|
+
private appTicker?;
|
|
160
|
+
private slideTickFn?;
|
|
161
|
+
private readonly slideBaseY;
|
|
162
|
+
private readonly slideSign;
|
|
163
|
+
/** Buy-feature ⇄ total-win swap: only one shows at a time (see `setupBonusSwap`). */
|
|
164
|
+
private bonusView?;
|
|
165
|
+
private totalWinView?;
|
|
166
|
+
private readonly fadeFns;
|
|
167
|
+
constructor(ui: OpenUI, opts?: OpenUIPixiOptions);
|
|
168
|
+
/** The bus event log backing `window.__OPENUI__.events` (available after mount). */
|
|
169
|
+
get eventLog(): EventLog | undefined;
|
|
170
|
+
mount(app: Application): void;
|
|
171
|
+
/**
|
|
172
|
+
* Wire the buy-feature ⇄ total-win swap. In base play the buy button shows (unless
|
|
173
|
+
* hidden by config/jurisdiction); once the spin button enters free-spins mode
|
|
174
|
+
* (`setFreeSpins(n > 0)` — you "can't buy" mid-bonus) the buy button fades out and
|
|
175
|
+
* the localized total-win counter fades in over the same slot, then back on exit.
|
|
176
|
+
*/
|
|
177
|
+
private setupBonusSwap;
|
|
178
|
+
/** Fade a view's alpha to `to` over `ms` (wall-clock paced); cancels any prior fade
|
|
179
|
+
* on the same view. `onDone` runs once when it settles. */
|
|
180
|
+
private fadeTo;
|
|
181
|
+
/** Cancel an in-flight fade on `view` (if any). */
|
|
182
|
+
private stopFade;
|
|
183
|
+
/**
|
|
184
|
+
* Build the unified scrollable MENU bound to the ☰ panel. Composed `menu` blocks
|
|
185
|
+
* are given by `mountHud`; absent → a default Settings-only menu. Built-in ids
|
|
186
|
+
* ('music'/'sfx') are reused, not shadowed (P10); button blocks wire `closePanel`.
|
|
187
|
+
*/
|
|
188
|
+
private buildMenu;
|
|
189
|
+
/**
|
|
190
|
+
* Slide the whole interactive HUD in (`true`) or out (`false`): bottom-anchored
|
|
191
|
+
* controls travel down, top-anchored travel up (behind the status-bar plaque).
|
|
192
|
+
* Pure translation (no scaling); controls are non-interactive while moving/hidden.
|
|
193
|
+
*/
|
|
194
|
+
setControlsVisible(visible: boolean): void;
|
|
195
|
+
/** Apply the current slide progress: translate each interactive view toward its
|
|
196
|
+
* anchored edge (pure translation — no scaling). */
|
|
197
|
+
private applySlide;
|
|
198
|
+
unmount(): void;
|
|
199
|
+
private expose;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export { type BlockColumn as B, ControlView as C, type GsapLike as G, type OpenUIIcons as O, type SpinSkinFactory as S, type ControlViewFactory as a, OpenUIPixi as b, type OpenUIPixiOptions as c, type CellRenderer as d, type SpinSkin as e, type BlockColumnOptions as f, buildBlockColumn as g };
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import * as pixi_js from 'pixi.js';
|
|
2
|
+
import { Container, Ticker, Texture, Application } from 'pixi.js';
|
|
3
|
+
import { Theme, Control, OpenUI, ScreenState, BlockSpec, EventLog } from '@open-slot-ui/core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A skin owns a control's *look* and nothing else. The view drives it with the
|
|
7
|
+
* current state name; the skin swaps art accordingly. This is the seam where a
|
|
8
|
+
* game's design (Graphics, SVG, Spine, …) plugs in without touching control logic.
|
|
9
|
+
*/
|
|
10
|
+
interface SpinSkin {
|
|
11
|
+
/** The display object the view adds into its animated `art` container. */
|
|
12
|
+
readonly view: Container;
|
|
13
|
+
/** React to a state change (swap art, recolor, etc.). */
|
|
14
|
+
update(state: string): void;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
}
|
|
17
|
+
type SpinSkinFactory = (theme: Theme) => SpinSkin;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Base view: a Pixi Container bound to a core Control. Owns layout placement and
|
|
21
|
+
* registers the introspection hook so the core can report bounds/animation state.
|
|
22
|
+
* Subclasses draw and wire input. Dumb on its own (Charter B3).
|
|
23
|
+
*/
|
|
24
|
+
declare abstract class ControlView extends Container {
|
|
25
|
+
protected readonly control: Control;
|
|
26
|
+
protected readonly ui: OpenUI;
|
|
27
|
+
protected animating: boolean;
|
|
28
|
+
protected readonly disposers: Array<() => void>;
|
|
29
|
+
constructor(control: Control, ui: OpenUI);
|
|
30
|
+
/** Position + fit-scale from the control's layout spec against the screen. */
|
|
31
|
+
applyLayout(screen: ScreenState): void;
|
|
32
|
+
private computeRect;
|
|
33
|
+
dispose(): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Per-id view override — swap a control's renderer without forking (Charter P7). */
|
|
37
|
+
type ControlViewFactory = (control: Control, ui: OpenUI, ticker: Ticker) => ControlView;
|
|
38
|
+
interface BlockColumnOptions {
|
|
39
|
+
controlSkins?: Partial<Record<string, ControlViewFactory>>;
|
|
40
|
+
/** Unclipped layer for select dropdowns (so a scroll mask doesn't clip them). */
|
|
41
|
+
dropdownLayer?: Container;
|
|
42
|
+
}
|
|
43
|
+
interface BlockColumn {
|
|
44
|
+
/** Rows laid top→down (first row near y=0); the caller positions/scrolls it. */
|
|
45
|
+
content: Container;
|
|
46
|
+
/** Interactive child views, for disposal. */
|
|
47
|
+
views: ControlView[];
|
|
48
|
+
/** Total column height. */
|
|
49
|
+
height: number;
|
|
50
|
+
/** Inner content width (body width minus padding). */
|
|
51
|
+
innerW: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Render a declarative `BlockSpec[]` into a column of rows — interactive controls
|
|
55
|
+
* (slider/toggle/button/select/value/stepper) and static content (heading/text/
|
|
56
|
+
* callout/stat-grid/steps/paytable/image). All text flows through `ui.t`. This is
|
|
57
|
+
* the single renderer shared by the small panel body AND the scrollable menu, so
|
|
58
|
+
* blocks look identical wherever they appear (Charter B3/B9).
|
|
59
|
+
*/
|
|
60
|
+
declare function buildBlockColumn(blocks: BlockSpec[], controls: Control[], ui: OpenUI, ticker: Ticker, bodyW: number, opts?: BlockColumnOptions): BlockColumn;
|
|
61
|
+
|
|
62
|
+
interface CellRenderer<C extends Container = Container> {
|
|
63
|
+
createCell(digit: number): C;
|
|
64
|
+
setDigit(cell: C, digit: number): void;
|
|
65
|
+
setFiller(cell: C, digit: number): void;
|
|
66
|
+
createSeparator?(char: string): Container;
|
|
67
|
+
destroyCell?(cell: C): void;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Minimal GSAP-compatible API the Counter uses for `fit` animation.
|
|
71
|
+
* Passing the default `gsap` import satisfies this shape — no need for type imports.
|
|
72
|
+
*/
|
|
73
|
+
interface GsapLike {
|
|
74
|
+
to(target: object, vars: Record<string, unknown>): unknown;
|
|
75
|
+
killTweensOf(target: object): void;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface OpenUIIcons {
|
|
79
|
+
settingsIdle?: Texture;
|
|
80
|
+
settingsActive?: Texture;
|
|
81
|
+
close?: Texture;
|
|
82
|
+
rules?: Texture;
|
|
83
|
+
sliderMusic?: Texture;
|
|
84
|
+
sliderSound?: Texture;
|
|
85
|
+
turboOff?: Texture;
|
|
86
|
+
turboOn?: Texture;
|
|
87
|
+
/** One texture per turbo mode (index-aligned) — for 3-mode art. Wins over off/on. */
|
|
88
|
+
turboModes?: Texture[];
|
|
89
|
+
autoIdle?: Texture;
|
|
90
|
+
autoActive?: Texture;
|
|
91
|
+
bonus?: Texture;
|
|
92
|
+
betPlus?: Texture;
|
|
93
|
+
betMinus?: Texture;
|
|
94
|
+
}
|
|
95
|
+
interface OpenUIPixiOptions {
|
|
96
|
+
/** Expose `window.__OPENUI__` for e2e/introspection. Default true. */
|
|
97
|
+
expose?: boolean;
|
|
98
|
+
/** Override the spin control's skin (default = the art-free Graphics placeholder). */
|
|
99
|
+
spinSkin?: SpinSkinFactory;
|
|
100
|
+
/** Real art for the menu/close/slider controls (else neutral placeholders). */
|
|
101
|
+
icons?: OpenUIIcons;
|
|
102
|
+
/**
|
|
103
|
+
* The composed MENU blocks (Settings → Paytable → Rules) the ☰ button opens in a
|
|
104
|
+
* scrollable sheet. Usually built by `mountHud` via `composeMenu(spec.menu, …)`;
|
|
105
|
+
* omitted → a default Settings-only menu (Music/Sound). Pass `false` to skip the
|
|
106
|
+
* built-in Pixi menu entirely (e.g. when supplying your own HTML/DOM menu).
|
|
107
|
+
*/
|
|
108
|
+
menu?: BlockSpec[] | false;
|
|
109
|
+
/** Header title for the menu sheet (localizable). Default 'Menu'. */
|
|
110
|
+
menuTitle?: string;
|
|
111
|
+
/** Per-id view override — swap a control's renderer without forking (Charter P7). */
|
|
112
|
+
controlSkins?: Partial<Record<string, ControlViewFactory>>;
|
|
113
|
+
/**
|
|
114
|
+
* Host `gsap` — enables the value counter's auto-downscale so wide currencies
|
|
115
|
+
* (8-decimal BTC, big SATS counts, long codes) shrink to fit instead of spilling.
|
|
116
|
+
* Kept out of the lib's deps (Charter B5); the host passes its own gsap.
|
|
117
|
+
*/
|
|
118
|
+
gsap?: GsapLike;
|
|
119
|
+
/**
|
|
120
|
+
* Autoplay count-picker presentation. `'drawer'` (default) is a bottom sheet;
|
|
121
|
+
* `'radial'` fans the count chips around the spin button.
|
|
122
|
+
*/
|
|
123
|
+
autoplayPicker?: 'drawer' | 'radial';
|
|
124
|
+
/**
|
|
125
|
+
* Text colour for the top-corner compliance readouts (RTP / net / session). Defaults
|
|
126
|
+
* to the theme text colour; a light-background host can pass a dark colour so the
|
|
127
|
+
* Figma-style `Label: value` block stays legible.
|
|
128
|
+
*/
|
|
129
|
+
readoutColor?: string;
|
|
130
|
+
/**
|
|
131
|
+
* How the interactive HUD appears on mount: `'shown'` (default), `'hidden'` (off
|
|
132
|
+
* screen + non-interactive; reveal later with `showControls()`), or `'slide-in'`
|
|
133
|
+
* (start hidden, then slide in from the edges).
|
|
134
|
+
*/
|
|
135
|
+
intro?: 'shown' | 'hidden' | 'slide-in';
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The controller: mounts ONE root Container onto the host's existing stage,
|
|
139
|
+
* shares the host ticker/renderer, drives resize, and exposes introspection.
|
|
140
|
+
* `unmount()` removes the layer and every listener it created (Charter P2/P12).
|
|
141
|
+
*/
|
|
142
|
+
declare class OpenUIPixi {
|
|
143
|
+
private readonly ui;
|
|
144
|
+
private readonly opts;
|
|
145
|
+
readonly root: Container<pixi_js.ContainerChild>;
|
|
146
|
+
private readonly views;
|
|
147
|
+
/** Full-screen overlays (e.g. the autoplay drawer) that own their own layout. */
|
|
148
|
+
private readonly overlays;
|
|
149
|
+
private readonly disposers;
|
|
150
|
+
private _eventLog?;
|
|
151
|
+
/** Show/hide slide: each interactive view slides toward its anchored edge (bottom
|
|
152
|
+
* controls down, top up — behind the status-bar plaque). Views stay direct children
|
|
153
|
+
* of `root` (introspection bounds unchanged); only their y moves, and the
|
|
154
|
+
* ref-counted input lock makes them non-interactive while moving/hidden. */
|
|
155
|
+
private slideProg;
|
|
156
|
+
private slideTarget;
|
|
157
|
+
private slideHeld;
|
|
158
|
+
private lastScreenH;
|
|
159
|
+
private appTicker?;
|
|
160
|
+
private slideTickFn?;
|
|
161
|
+
private readonly slideBaseY;
|
|
162
|
+
private readonly slideSign;
|
|
163
|
+
/** Buy-feature ⇄ total-win swap: only one shows at a time (see `setupBonusSwap`). */
|
|
164
|
+
private bonusView?;
|
|
165
|
+
private totalWinView?;
|
|
166
|
+
private readonly fadeFns;
|
|
167
|
+
constructor(ui: OpenUI, opts?: OpenUIPixiOptions);
|
|
168
|
+
/** The bus event log backing `window.__OPENUI__.events` (available after mount). */
|
|
169
|
+
get eventLog(): EventLog | undefined;
|
|
170
|
+
mount(app: Application): void;
|
|
171
|
+
/**
|
|
172
|
+
* Wire the buy-feature ⇄ total-win swap. In base play the buy button shows (unless
|
|
173
|
+
* hidden by config/jurisdiction); once the spin button enters free-spins mode
|
|
174
|
+
* (`setFreeSpins(n > 0)` — you "can't buy" mid-bonus) the buy button fades out and
|
|
175
|
+
* the localized total-win counter fades in over the same slot, then back on exit.
|
|
176
|
+
*/
|
|
177
|
+
private setupBonusSwap;
|
|
178
|
+
/** Fade a view's alpha to `to` over `ms` (wall-clock paced); cancels any prior fade
|
|
179
|
+
* on the same view. `onDone` runs once when it settles. */
|
|
180
|
+
private fadeTo;
|
|
181
|
+
/** Cancel an in-flight fade on `view` (if any). */
|
|
182
|
+
private stopFade;
|
|
183
|
+
/**
|
|
184
|
+
* Build the unified scrollable MENU bound to the ☰ panel. Composed `menu` blocks
|
|
185
|
+
* are given by `mountHud`; absent → a default Settings-only menu. Built-in ids
|
|
186
|
+
* ('music'/'sfx') are reused, not shadowed (P10); button blocks wire `closePanel`.
|
|
187
|
+
*/
|
|
188
|
+
private buildMenu;
|
|
189
|
+
/**
|
|
190
|
+
* Slide the whole interactive HUD in (`true`) or out (`false`): bottom-anchored
|
|
191
|
+
* controls travel down, top-anchored travel up (behind the status-bar plaque).
|
|
192
|
+
* Pure translation (no scaling); controls are non-interactive while moving/hidden.
|
|
193
|
+
*/
|
|
194
|
+
setControlsVisible(visible: boolean): void;
|
|
195
|
+
/** Apply the current slide progress: translate each interactive view toward its
|
|
196
|
+
* anchored edge (pure translation — no scaling). */
|
|
197
|
+
private applySlide;
|
|
198
|
+
unmount(): void;
|
|
199
|
+
private expose;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export { type BlockColumn as B, ControlView as C, type GsapLike as G, type OpenUIIcons as O, type SpinSkinFactory as S, type ControlViewFactory as a, OpenUIPixi as b, type OpenUIPixiOptions as c, type CellRenderer as d, type SpinSkin as e, type BlockColumnOptions as f, buildBlockColumn as g };
|