@energy8platform/shell 0.6.0 → 0.6.1

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/pixi.d.ts CHANGED
@@ -513,7 +513,7 @@ declare class ShellController extends EventEmitter<ShellEvents> implements Shell
513
513
  tokens: ShellTokens;
514
514
  layout: ShellLayoutMode;
515
515
  soundOn: boolean;
516
- readonly engineVersion = "0.6.0";
516
+ readonly engineVersion = "0.6.1";
517
517
  readonly actions: ShellActions;
518
518
  private renderer;
519
519
  private i18n;
@@ -555,7 +555,12 @@ declare class ShellController extends EventEmitter<ShellEvents> implements Shell
555
555
  deactivateFeature(): void;
556
556
  private money;
557
557
  setBalance(n: number): void;
558
- setWin(n: number): void;
558
+ /** Set the WIN readout. Counts up/down from the previous value by default. Pass
559
+ * `{ animate: false }` to SNAP instantly (renderBar cancels any in-flight count-up) — used by the
560
+ * host to clear WIN to 0 at spin start, where an animated count-DOWN would look wrong. */
561
+ setWin(n: number, opts?: {
562
+ animate?: boolean;
563
+ }): void;
559
564
  setBet(n: number): void;
560
565
  setMode(mode: ShellMode): void;
561
566
  setBusy(busy: boolean): void;
@@ -590,7 +595,7 @@ interface I18n {
590
595
  declare function createI18n(opts: I18nOptions): I18n;
591
596
 
592
597
  /** The @energy8platform/shell package version, stamped into the game-info footer. */
593
- declare const PACKAGE_VERSION = "0.6.0";
598
+ declare const PACKAGE_VERSION = "0.6.1";
594
599
 
595
600
  /** A shell: the renderer-agnostic controller plus the surface facade (safeArea/barHeight/setVisible)
596
601
  * an embedding host reads. `createShell`, `createGameShell` and `createPixiShell` all return this. */
package/dist/pixi.esm.js CHANGED
@@ -1447,7 +1447,7 @@ class KeyboardController {
1447
1447
 
1448
1448
  // AUTO-GENERATED by scripts/gen-version.mjs — do not edit. Mirrors package.json "version".
1449
1449
  /** The @energy8platform/shell package version, stamped into the game-info footer. */
1450
- const PACKAGE_VERSION = '0.6.0';
1450
+ const PACKAGE_VERSION = '0.6.1';
1451
1451
 
1452
1452
  /** Apply defaults to the raw config (the mount target lives on the renderer, not here). */
1453
1453
  function resolveConfig(config) {
@@ -1725,10 +1725,17 @@ class ShellController extends EventEmitter {
1725
1725
  this.prevBalance = n;
1726
1726
  this.money('balance', from, n);
1727
1727
  }
1728
- setWin(n) {
1728
+ /** Set the WIN readout. Counts up/down from the previous value by default. Pass
1729
+ * `{ animate: false }` to SNAP instantly (renderBar cancels any in-flight count-up) — used by the
1730
+ * host to clear WIN to 0 at spin start, where an animated count-DOWN would look wrong. */
1731
+ setWin(n, opts) {
1729
1732
  const from = this.prevWin;
1730
1733
  this.state.win = n;
1731
1734
  this.prevWin = n;
1735
+ if (opts?.animate === false) {
1736
+ this.renderer.renderBar(); // instant repaint from state; cancels running money anims
1737
+ return;
1738
+ }
1732
1739
  this.money('win', from, n);
1733
1740
  }
1734
1741
  setBet(n) {
@@ -5924,6 +5931,13 @@ class PixiRenderer {
5924
5931
  // make sure the stage delivers global pointer moves (drag, sliders)
5925
5932
  this.app.stage.eventMode = 'static';
5926
5933
  this.app.renderer.on('resize', this.onResize);
5934
+ // Seed the layout from the CURRENT screen size. The renderer was resized to the container during
5935
+ // boot (ViewportManager.refresh) BEFORE this shell mounted and subscribed above, so that initial
5936
+ // 'resize' event is already gone and won't fire again on a stationary device. Without this seed
5937
+ // the controller's layout stays at its 'wide' DEFAULT — a portrait mobile would show the DESKTOP
5938
+ // bar. (The HTML renderer gets this for free: its ResizeObserver fires immediately on observe.)
5939
+ if (this.screenW > 0)
5940
+ this.host.notifyResize(this.screenW, this.screenH);
5927
5941
  whenFontReady(() => {
5928
5942
  if (!this.destroyed)
5929
5943
  this.renderBar();