@energy8platform/shell 0.11.3 → 0.11.5
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/html.cjs.js +2 -2
- package/dist/html.d.ts +3 -3
- package/dist/html.esm.js +2 -2
- package/dist/index.cjs.js +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.esm.js +2 -2
- package/dist/pixi.cjs.js +55 -18
- package/dist/pixi.cjs.js.map +1 -1
- package/dist/pixi.d.ts +7 -3
- package/dist/pixi.esm.js +55 -18
- package/dist/pixi.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/core/locales.ts +1 -1
- package/src/core/version.ts +1 -1
- package/src/ui/pixi/PixiRenderer.ts +52 -15
package/package.json
CHANGED
package/src/core/locales.ts
CHANGED
|
@@ -884,7 +884,7 @@ const D = {
|
|
|
884
884
|
* supported, the disclaimer is translated and displayed in each language").
|
|
885
885
|
*
|
|
886
886
|
* Brand-free by construction. Stake's own template ends with a seventh line — "TM and © {year}
|
|
887
|
-
*
|
|
887
|
+
* Engine." — and that one belongs to a Stake launch alone: it arrives with the Stake bridge's
|
|
888
888
|
* `INIT.config.disclaimerLines`, which outrank this default, and renders verbatim (see the host's
|
|
889
889
|
* `isBrandLine`). Every other platform gets the same mandated wording without someone else's mark.
|
|
890
890
|
*/
|
package/src/core/version.ts
CHANGED
|
@@ -44,6 +44,10 @@ export class PixiRenderer implements ShellRenderer {
|
|
|
44
44
|
private bar?: BottomBar;
|
|
45
45
|
private currentLayer: ShellLayer | null = null;
|
|
46
46
|
private backdrop?: { node: Container; texture: RenderTexture };
|
|
47
|
+
/** Whether `currentLayer` asked for a frosted backdrop. Light-dismiss layers (the menu popover)
|
|
48
|
+
* pass `{ backdrop: false }`, and that answer has to survive past the open: a resize re-snapshots
|
|
49
|
+
* the backdrop, and without this it re-snapshotted for layers that never wanted one. */
|
|
50
|
+
private layerBackdrop = false;
|
|
47
51
|
private moneyAnims: Array<() => void> = [];
|
|
48
52
|
private destroyed = false;
|
|
49
53
|
|
|
@@ -213,7 +217,8 @@ export class PixiRenderer implements ShellRenderer {
|
|
|
213
217
|
this.clearLayer();
|
|
214
218
|
// Light-dismiss layers (the menu popover) opt out with `{ backdrop: false }` — no frosted
|
|
215
219
|
// snapshot, the game stays visible behind them. Every other caller is unaffected (defaults on).
|
|
216
|
-
|
|
220
|
+
this.layerBackdrop = opts?.backdrop !== false;
|
|
221
|
+
if (this.layerBackdrop) this.makeBackdrop(); // frosted snapshot (the DOM's backdrop-filter:blur)
|
|
217
222
|
this.currentLayer = node;
|
|
218
223
|
this.modalLayer.addChild(node);
|
|
219
224
|
this.fitModals();
|
|
@@ -236,6 +241,7 @@ export class PixiRenderer implements ShellRenderer {
|
|
|
236
241
|
this.currentLayer.destroy({ children: true });
|
|
237
242
|
this.currentLayer = null;
|
|
238
243
|
}
|
|
244
|
+
this.layerBackdrop = false;
|
|
239
245
|
this.removeBackdrop();
|
|
240
246
|
}
|
|
241
247
|
|
|
@@ -260,7 +266,10 @@ export class PixiRenderer implements ShellRenderer {
|
|
|
260
266
|
// reads as more frost, never sharp game.
|
|
261
267
|
node.addChild(new Graphics().rect(0, 0, w, h).fill(0x0c111c));
|
|
262
268
|
this.modalLayer.addChild(node);
|
|
263
|
-
this.backdrop = {
|
|
269
|
+
this.backdrop = {
|
|
270
|
+
node,
|
|
271
|
+
texture: RenderTexture.create({ width: w, height: h, resolution: 0.25 }),
|
|
272
|
+
};
|
|
264
273
|
try {
|
|
265
274
|
// Heavy downscale (¼ res) is the blur-STRENGTH lever (each texel covers more screen), far cheaper
|
|
266
275
|
// than a full-res large-radius blur and smooth over fine detail. Effective on-screen blur ≈
|
|
@@ -321,8 +330,14 @@ export class PixiRenderer implements ShellRenderer {
|
|
|
321
330
|
this.host.notifyResize(this.screenW, this.screenH);
|
|
322
331
|
if (this.currentLayer) {
|
|
323
332
|
this.currentLayer.resize?.(this.screenW, this.screenH);
|
|
324
|
-
|
|
325
|
-
|
|
333
|
+
// Only for a layer that ASKED for the frost. A rotation with the bar menu open used to slap a
|
|
334
|
+
// backdrop under a light-dismiss popover that had opted out of one — and since modalLayer
|
|
335
|
+
// draws above barLayer, that frozen blurred snapshot covered the game AND the bar until the
|
|
336
|
+
// menu was closed. That is the "UI is not adopted on rotation while the menu is open" remark.
|
|
337
|
+
if (this.layerBackdrop) {
|
|
338
|
+
this.makeBackdrop(); // re-snapshot at the new size
|
|
339
|
+
if (this.backdrop) this.modalLayer.setChildIndex(this.backdrop.node, 0); // keep it below the layer
|
|
340
|
+
}
|
|
326
341
|
}
|
|
327
342
|
};
|
|
328
343
|
|
|
@@ -335,13 +350,27 @@ export class PixiRenderer implements ShellRenderer {
|
|
|
335
350
|
const self = this;
|
|
336
351
|
const ctx: PixiComponentContext = {
|
|
337
352
|
// — core ShellHost (forwarded) —
|
|
338
|
-
get state() {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
get
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
get
|
|
353
|
+
get state() {
|
|
354
|
+
return host.state;
|
|
355
|
+
},
|
|
356
|
+
get config() {
|
|
357
|
+
return host.config;
|
|
358
|
+
},
|
|
359
|
+
get tokens() {
|
|
360
|
+
return host.tokens;
|
|
361
|
+
},
|
|
362
|
+
get layout() {
|
|
363
|
+
return host.layout;
|
|
364
|
+
},
|
|
365
|
+
get soundOn() {
|
|
366
|
+
return host.soundOn;
|
|
367
|
+
},
|
|
368
|
+
get menu() {
|
|
369
|
+
return host.menu;
|
|
370
|
+
},
|
|
371
|
+
get actions() {
|
|
372
|
+
return host.actions;
|
|
373
|
+
},
|
|
345
374
|
openReplay: (opts) => host.openReplay(opts),
|
|
346
375
|
t: (s) => host.t(s),
|
|
347
376
|
formatCurrency: (n, win) => host.formatCurrency(n, win),
|
|
@@ -354,10 +383,18 @@ export class PixiRenderer implements ShellRenderer {
|
|
|
354
383
|
setMenuValue: (id, v) => host.setMenuValue(id, v),
|
|
355
384
|
setMenuRefresh: (fn) => host.setMenuRefresh(fn),
|
|
356
385
|
// — Pixi-specific surface —
|
|
357
|
-
get ticker() {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
get
|
|
386
|
+
get ticker() {
|
|
387
|
+
return self.app.ticker;
|
|
388
|
+
},
|
|
389
|
+
get canvas() {
|
|
390
|
+
return self.app.canvas as HTMLCanvasElement | undefined;
|
|
391
|
+
},
|
|
392
|
+
get screenW() {
|
|
393
|
+
return self.app.screen.width;
|
|
394
|
+
},
|
|
395
|
+
get screenH() {
|
|
396
|
+
return self.app.screen.height;
|
|
397
|
+
},
|
|
361
398
|
render: () => self.renderBar(),
|
|
362
399
|
pushLayer: (node, opts) => self.pushLayer(node, opts),
|
|
363
400
|
// Route component-initiated closes through the controller (not straight to self.closeLayer) so
|