@energy8platform/shell 0.11.0 → 0.11.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
@@ -643,7 +643,7 @@ declare class ShellController extends EventEmitter<ShellEvents> implements Shell
643
643
  tokens: ShellTokens;
644
644
  layout: ShellLayoutMode;
645
645
  soundOn: boolean;
646
- readonly engineVersion = "0.11.0";
646
+ readonly engineVersion = "0.11.1";
647
647
  readonly actions: ShellActions;
648
648
  private renderer;
649
649
  private i18n;
@@ -802,7 +802,7 @@ declare function createI18n(opts: I18nOptions): I18n;
802
802
  declare const DISCLAIMER_LINES: readonly string[];
803
803
 
804
804
  /** The @energy8platform/shell package version, stamped into the game-info footer. */
805
- declare const PACKAGE_VERSION = "0.11.0";
805
+ declare const PACKAGE_VERSION = "0.11.1";
806
806
 
807
807
  /**
808
808
  * What a scrollable region should ADVERTISE about itself.
package/dist/pixi.esm.js CHANGED
@@ -323,6 +323,20 @@ function nextTurbo(current, maxLevels) {
323
323
  return 0;
324
324
  return current >= maxLevels ? 0 : current + 1;
325
325
  }
326
+ /**
327
+ * Is a bonus buy unavailable right now?
328
+ *
329
+ * The three RUNTIME locks, in one place because they used to be in three: both bottom bars spelled
330
+ * them out for the coin, and the Shift+B hotkey spelled out a different, shorter set — so the
331
+ * keyboard opened the buy-bonus overlay mid-round and let a player stake a second bet on top of a
332
+ * round already in flight. A predicate the bars and the hotkey share cannot drift apart again.
333
+ *
334
+ * Runtime only. Whether the feature EXISTS at all is a config question (`features.buyBonus`), and
335
+ * whether this particular surface should offer it (mode, replay) belongs to the caller.
336
+ */
337
+ function bonusBuyLocked(s) {
338
+ return s.busy || s.autoplay.active || !s.buyBonusEnabled;
339
+ }
326
340
 
327
341
  /** The single brand accent (purple). The bar accent default (theme.ts) and the buy-a-bonus
328
342
  * card default both derive from this, so a rebrand only touches one constant. */
@@ -1625,7 +1639,9 @@ class KeyboardController {
1625
1639
  }
1626
1640
  break;
1627
1641
  case 'KeyB':
1628
- if (h.buyBonusEnabled && s.mode === 'base' && !s.replay) {
1642
+ // `bonusBuyLocked` is the same predicate the bar's coin uses. Without it this hotkey
1643
+ // reached past a disabled coin and opened the overlay mid-round.
1644
+ if (h.buyBonusEnabled && s.mode === 'base' && !s.replay && !bonusBuyLocked(s)) {
1629
1645
  h.openBuyBonus();
1630
1646
  return;
1631
1647
  }
@@ -1737,7 +1753,7 @@ function keyboardCapable(win = typeof window === 'undefined' ? undefined : windo
1737
1753
 
1738
1754
  // AUTO-GENERATED by scripts/gen-version.mjs — do not edit. Mirrors package.json "version".
1739
1755
  /** The @energy8platform/shell package version, stamped into the game-info footer. */
1740
- const PACKAGE_VERSION = '0.11.0';
1756
+ const PACKAGE_VERSION = '0.11.1';
1741
1757
 
1742
1758
  /** Apply defaults to the raw config (the mount target lives on the renderer, not here). */
1743
1759
  function resolveConfig(config) {
@@ -3927,7 +3943,12 @@ class BottomBar extends Container {
3927
3943
  if (config.features.turbo > 0) {
3928
3944
  this.turboBtn = makeTurboButton(this.host, state.turbo, () => this.onTurbo(), 40, 22);
3929
3945
  }
3930
- const buy = isBase ? (this.buildBuy(M_BUY, 9, 2) ?? undefined) : undefined;
3946
+ // On `this`, not a local: applyBusy() guards every line with `if (this.<control>)`, so a coin
3947
+ // kept in a local is drawn, laid out, tappable — and unreachable by every lock there is.
3948
+ // That is exactly how a phone player could tap SPIN and open buy-bonus on the round in
3949
+ // flight. (Safe for layout: applyFit() hands mobile to applyFitMobile() before it touches
3950
+ // `this.buy` for the wide bar's positioning.)
3951
+ this.buy = isBase ? (this.buildBuy(M_BUY, 9, 2) ?? undefined) : undefined;
3931
3952
  // level 1 — controls bar (dark)
3932
3953
  const controls = new FlexBox({
3933
3954
  direction: 'row',
@@ -3948,8 +3969,8 @@ class BottomBar extends Container {
3948
3969
  const rz = new FlexBox({ direction: 'row', align: 'center', gap: SIDE, justify: 'end' });
3949
3970
  if (this.turboBtn)
3950
3971
  rz.add(this.turboBtn);
3951
- if (buy)
3952
- rz.add(buy);
3972
+ if (this.buy)
3973
+ rz.add(this.buy);
3953
3974
  const zw = Math.max(lz.measureSize().w, rz.measureSize().w);
3954
3975
  lz.setLayoutSize(zw, undefined);
3955
3976
  rz.setLayoutSize(zw, undefined);
@@ -4115,7 +4136,7 @@ class BottomBar extends Container {
4115
4136
  if (this.autoBtn)
4116
4137
  this.autoBtn.disabled = state.busy && !auto;
4117
4138
  if (this.buy)
4118
- this.buy.disabled = state.busy || auto || !state.buyBonusEnabled;
4139
+ this.buy.disabled = bonusBuyLocked(state);
4119
4140
  if (this.betReadout && lockBet) {
4120
4141
  this.betReadout.eventMode = 'none';
4121
4142
  this.betReadout.cursor = 'default';