@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energy8platform/shell",
3
- "version": "0.11.3",
3
+ "version": "0.11.5",
4
4
  "description": "Energy8 branded game shell — one logic core, pluggable html/pixi renderers behind a stable contract.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",
@@ -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
- * Stake Engine." — and that one belongs to a Stake launch alone: it arrives with the Stake bridge's
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
  */
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED by scripts/gen-version.mjs — do not edit. Mirrors package.json "version".
2
2
  /** The @energy8platform/shell package version, stamped into the game-info footer. */
3
- export const PACKAGE_VERSION = '0.11.3';
3
+ export const PACKAGE_VERSION = '0.11.5';
@@ -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
- if (opts?.backdrop !== false) this.makeBackdrop(); // frosted snapshot (the DOM's backdrop-filter:blur)
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 = { node, texture: RenderTexture.create({ width: w, height: h, resolution: 0.25 }) };
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
- this.makeBackdrop(); // re-snapshot at the new size
325
- if (this.backdrop) this.modalLayer.setChildIndex(this.backdrop.node, 0); // keep it below the layer
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() { return host.state; },
339
- get config() { return host.config; },
340
- get tokens() { return host.tokens; },
341
- get layout() { return host.layout; },
342
- get soundOn() { return host.soundOn; },
343
- get menu() { return host.menu; },
344
- get actions() { return host.actions; },
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() { return self.app.ticker; },
358
- get canvas() { return self.app.canvas as HTMLCanvasElement | undefined; },
359
- get screenW() { return self.app.screen.width; },
360
- get screenH() { return self.app.screen.height; },
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