pixi-rainman-game-engine 0.3.15 → 0.3.17

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.
@@ -11,6 +11,7 @@ export const CloseModalButton = observer(({ layerId, afterClose }) => {
11
11
  settingStore.handleModalInvocation?.(layerId);
12
12
  if (layerId === UI_ITEMS.speedSettings) {
13
13
  settingStore.setSpeedPopupVisibility?.("none");
14
+ settingStore.isSpeedModalShown = false;
14
15
  }
15
16
  if (isBetDisabled) {
16
17
  settingStore.enableButtons?.();
@@ -5,14 +5,24 @@
5
5
  left: 25vw;
6
6
  align-items: center;
7
7
  justify-content: center;
8
+ z-index: 0;
9
+ }
10
+
11
+ .modal-overlay {
12
+ position: fixed;
13
+ inset: 0;
14
+ background: rgba(0, 0, 0, 0.6);
15
+ backdrop-filter: blur(2px);
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+ z-index: 0;
8
20
  }
9
21
 
10
22
  .speed-settings-popup {
11
23
  display: flex;
12
24
  flex-direction: column;
13
25
  align-items: center;
14
- width: 90%;
15
- height: 90%;
16
26
  justify-content: space-between;
17
27
  }
18
28
 
@@ -1,7 +1,7 @@
1
1
  import "./index.css";
2
2
  import React from "react";
3
3
  import { UI_ITEMS } from "../utils";
4
- import { AutoplaySettings, BetSettings, BuyFreeSpinModal, GameRules, SpeedSettingsPopup, SymbolMultiplierPopup, VolumeSettings, } from "./components";
4
+ import { AutoplaySettings, BetSettings, BuyFreeSpinModal, GameRules, SpeedSettingsPopup, SymbolMultiplierPopup, VolumeSettings } from "./components";
5
5
  import { SystemSettingsComponent } from "./SystemSettings/SystemSettingsComponent";
6
6
  export const SettingsUI = () => {
7
7
  return (<>
@@ -17,8 +17,10 @@ export const SettingsUI = () => {
17
17
  <div id={UI_ITEMS.autoplay} className="modal modal-style">
18
18
  <AutoplaySettings />
19
19
  </div>
20
- <div id={UI_ITEMS.speedSettings} className="speed-settings-modal modal-style">
21
- <SpeedSettingsPopup />
20
+ <div id={UI_ITEMS.speedSettings} className=" modal-overlay">
21
+ <div className="speed-settings-modal modal-style">
22
+ <SpeedSettingsPopup />
23
+ </div>
22
24
  </div>
23
25
  <div id={UI_ITEMS.symbolPayTable}>
24
26
  <SymbolMultiplierPopup />
@@ -110,6 +110,8 @@ export class ButtonsEventManager {
110
110
  this.settingsSpeedTurtle.addEventListener("click", () => {
111
111
  RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.slow);
112
112
  this.setSpeedPopupVisibility("none");
113
+ this.enableButtons();
114
+ RainMan.settingsStore.isSpeedModalShown = false;
113
115
  messageBox.updateIncentiveText(i18n.t("turtleSelected"));
114
116
  });
115
117
  }
@@ -120,6 +122,8 @@ export class ButtonsEventManager {
120
122
  this.settingsSpeedRabbit.addEventListener("click", () => {
121
123
  RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.normal);
122
124
  this.setSpeedPopupVisibility("none");
125
+ RainMan.settingsStore.isSpeedModalShown = false;
126
+ this.enableButtons();
123
127
  messageBox.updateIncentiveText(i18n.t("rabbitSelected"));
124
128
  RainMan.globals.disableSpeedPopup?.(true);
125
129
  });
@@ -131,6 +135,8 @@ export class ButtonsEventManager {
131
135
  this.settingsSpeedCheetah.addEventListener("click", () => {
132
136
  RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.fast);
133
137
  this.setSpeedPopupVisibility("none");
138
+ this.enableButtons();
139
+ RainMan.settingsStore.isSpeedModalShown = false;
134
140
  messageBox.updateIncentiveText(i18n.t("cheetahSelected"));
135
141
  RainMan.globals.disableSpeedPopup?.(true);
136
142
  });
@@ -19,7 +19,7 @@ export declare class AnimatedNumber extends Container {
19
19
  * @private
20
20
  * @returns {void}
21
21
  */
22
- private setDigits;
22
+ setDigits(): void;
23
23
  /**
24
24
  * Function for setting move animation for digits.
25
25
  * @public
@@ -149,10 +149,13 @@ export class AbstractColumnsContainer extends Container {
149
149
  frame.invokeMysteryFx(this.currentColumn.x, this.currentColumn.y);
150
150
  this.skipScatterDelay = configureSpinAction;
151
151
  await this.currentColumn.speedUpForMysterySpin(100, 1500);
152
- setTimeout(() => {
153
- this.skipScatterDelay?.();
154
- this.skipScatterDelay = null;
155
- }, RainMan.config.durationOfActions.scatterDelayerTime);
152
+ if (!RainMan.settingsStore.isAutoplayEnabled ||
153
+ (RainMan.settingsStore.isAutoplayEnabled && !this.quickReelsStop)) {
154
+ setTimeout(() => {
155
+ this.skipScatterDelay?.();
156
+ this.skipScatterDelay = null;
157
+ }, RainMan.config.durationOfActions.scatterDelayerTime);
158
+ }
156
159
  await this.currentColumn.changeVelocity(Speed.STOP, RainMan.config.durationOfActions.scatterSpinningTime, frame);
157
160
  }
158
161
  if (!indexesOfReelsToExtendSpinningTime.includes(index)) {
@@ -26,11 +26,6 @@ export class ConnectionWrapper {
26
26
  */
27
27
  handleMessage = (messageData) => {
28
28
  this.lastFetchResponse.set(messageData.action, messageData);
29
- if (messageData.status) {
30
- if (messageData.status.code >= 300) {
31
- throw new Error(`${messageData.status.code}: ${messageData.status.message}`);
32
- }
33
- }
34
29
  switch (messageData.action) {
35
30
  case "init":
36
31
  this.config = new ApiConfig(messageData);
@@ -105,6 +100,9 @@ export class ConnectionWrapper {
105
100
  RainMan.globals.currency = Currencies[this._initData.currency];
106
101
  RainMan.settingsStore.setFreeSpinsPriceTable(this._initData.free_spins_buy_table);
107
102
  RainMan.settingsStore.setRoundNumber(this._initData.round_number);
103
+ if (this._initData.status?.code && this._initData.status.code >= 400) {
104
+ throw new Error(`Init failed with status code: ${this._initData.status?.code}: ${this._initData.status?.message}`);
105
+ }
108
106
  }
109
107
  /**
110
108
  * Method for getting initial data from the server
@@ -90,7 +90,7 @@ export class LocalConnectionWrapper {
90
90
  extra_data: {},
91
91
  reel_set_id: 1,
92
92
  round_win_amount: 0,
93
- future_balance_prediction: null
93
+ future_balance_prediction: 669.6
94
94
  };
95
95
  return Promise.resolve(new SpinData(this.config, data));
96
96
  }
@@ -26,6 +26,8 @@ export interface InitDataInterface {
26
26
  reinit_data?: SpinDataInterface[];
27
27
  extra_data: InitExtraData;
28
28
  jackpot_wins?: JackpotWins;
29
+ round_win_amount: number;
30
+ free_spins_used: number;
29
31
  }
30
32
  export interface EndDataInterface {
31
33
  action: "end";
@@ -116,7 +118,7 @@ export interface SpinDataInterface {
116
118
  balance: number;
117
119
  round_number: number;
118
120
  status: Status;
119
- future_balance_prediction: number | null;
121
+ future_balance_prediction: number;
120
122
  round_win_amount: number;
121
123
  reel_set_id: number;
122
124
  available_free_spins: number | null;
@@ -8,6 +8,7 @@ export declare class SpinData {
8
8
  readonly balance: number;
9
9
  private readonly rawData;
10
10
  private readonly config;
11
+ balanceAfterSpin: number;
11
12
  constructor(config: ApiConfig, data: SpinDataInterface);
12
13
  /**
13
14
  * Get the raw spin data from the backend server
@@ -6,10 +6,12 @@ export class SpinData {
6
6
  balance;
7
7
  rawData;
8
8
  config;
9
+ balanceAfterSpin;
9
10
  constructor(config, data) {
10
11
  this.rawData = data;
11
12
  this.config = config;
12
13
  this.balance = data.balance;
14
+ this.balanceAfterSpin = data.future_balance_prediction;
13
15
  if (data.action !== "spin" && data.action !== "buy") {
14
16
  throw new Error(`Invalid type "${data.action}" provided, "spin" or "buy" expected`);
15
17
  }
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { ApiConfig, ButtonsEventManager, SpinLogic, SymbolId, WinTypeId } from "../application";
3
3
  import { AbstractColumnsContainer, AbstractFrame, AbstractMainContainer } from "../components";
4
- import { ExtraDataRequest, FreeSpinWin, SpinData, SpinDataInterface, StreakReelsIndexes, SubscribableConnectionWrapper } from "../connectivity";
4
+ import { ExtraDataRequest, FreeSpinWin, InitDataInterface, SpinData, SpinDataInterface, StreakReelsIndexes, SubscribableConnectionWrapper } from "../connectivity";
5
5
  import { GamePhase } from "../constants";
6
6
  import { DescribedPlayableAction } from "../DescribedPlayableAction";
7
7
  import { Nullable } from "../utils";
@@ -53,11 +53,13 @@ export declare abstract class AbstractController<T> {
53
53
  protected shouldDisableBetButtons: boolean;
54
54
  protected wasAutoplayEnabledBeforeFreeSpin: boolean;
55
55
  protected setSlowerSpeedForFreeSpins: boolean;
56
+ shouldStopMobileSpin: boolean;
56
57
  protected resolveBigWin?: () => void;
57
58
  protected resolveMysteryWin?: () => void;
58
59
  protected resolveBonusWin?: () => void;
59
60
  protected resolveSuperBonusWin?: () => void;
60
61
  clearMobileSpinTimeout: (() => void) | undefined;
62
+ protected initData: InitDataInterface;
61
63
  protected _lastWinAmount: number;
62
64
  protected constructor(buttonsEventManager: ButtonsEventManager, mainContainer: AbstractMainContainer, connection: SubscribableConnectionWrapper);
63
65
  /**
@@ -274,6 +276,12 @@ export declare abstract class AbstractController<T> {
274
276
  * @returns {void}
275
277
  */
276
278
  protected clearAndDestroyActions(): void;
279
+ /**
280
+ * Function for updating balance on special occasion ex. bonusGame
281
+ * @public
282
+ * @returns {void}
283
+ */
284
+ updateBalance(): void;
277
285
  /**
278
286
  * Function that is used to invoke take action after winning (send request to backend to save status of wallet).
279
287
  * After that action, gamble and other bonus games are blocked.
@@ -53,17 +53,20 @@ export class AbstractController {
53
53
  shouldDisableBetButtons = false;
54
54
  wasAutoplayEnabledBeforeFreeSpin = false;
55
55
  setSlowerSpeedForFreeSpins = false;
56
+ shouldStopMobileSpin = false;
56
57
  resolveBigWin;
57
58
  resolveMysteryWin;
58
59
  resolveBonusWin;
59
60
  resolveSuperBonusWin;
60
61
  clearMobileSpinTimeout;
62
+ initData;
61
63
  _lastWinAmount = 0;
62
64
  constructor(buttonsEventManager, mainContainer, connection) {
63
65
  this.buttonsEventManager = buttonsEventManager;
64
66
  this.mainContainer = mainContainer;
65
67
  this.connection = connection;
66
68
  const initData = this.connection.initData();
69
+ this.initData = initData;
67
70
  this.config = new ApiConfig(initData);
68
71
  this.quickStopController = new QuickStopController(buttonsEventManager);
69
72
  this.uiController = new UiController(this.config);
@@ -101,6 +104,7 @@ export class AbstractController {
101
104
  this.uiController.currentBalance = initData.balance;
102
105
  if (RainMan.config.reinitMode) {
103
106
  this.initControllerReinit();
107
+ RainMan.settingsStore.disableSpecialButtons();
104
108
  }
105
109
  this.reinitializeAllButtons();
106
110
  this.buttonsEventManager.initSettingsEvents();
@@ -157,7 +161,10 @@ export class AbstractController {
157
161
  window.addEventListener("keydown", (keyboardEvent) => {
158
162
  if (keyboardEvent.code === "Space" || keyboardEvent.code === "Enter") {
159
163
  keyboardEvent.preventDefault();
160
- if (RainMan.settingsStore.isGambleGameActive) {
164
+ if (RainMan.settingsStore.isGambleGameActive || RainMan.settingsStore.isSpeedModalShown) {
165
+ return;
166
+ }
167
+ if (RainMan.settingsStore.disableKeyboardShortcuts) {
161
168
  return;
162
169
  }
163
170
  this.handleDisablingButtons(true);
@@ -276,6 +283,7 @@ export class AbstractController {
276
283
  if (RainMan.componentRegistry.has(BUTTONS.take)) {
277
284
  this.buttonsEventManager.initTakeButton(() => {
278
285
  RainMan.settingsStore.useTakeAction?.();
286
+ this.uiController.currentBalance = RainMan.settingsStore.balanceAfterSpin;
279
287
  RainMan.settingsStore.isTakeActionAvailable = false;
280
288
  RainMan.settingsStore.isGambleGameAvailable = false;
281
289
  if (RainMan.componentRegistry.has(BUTTONS.gamble)) {
@@ -342,6 +350,10 @@ export class AbstractController {
342
350
  const spinLogic = this.spinLogicFactory(RainMan.settingsStore.reinitData[0], this.config);
343
351
  const spinData = new SpinData(this.config, RainMan.settingsStore.reinitData[0]);
344
352
  this._lastWinAmount = this.mysteryWinSymbol ? spinLogic.winTotalAmountWithoutMystery : spinLogic.winTotalAmount;
353
+ const availableFreeSpins = spinLogic.availableFreeSpins;
354
+ if (availableFreeSpins > 0) {
355
+ this._lastWinAmount = this.initData.round_win_amount;
356
+ }
345
357
  if (spinLogic.winTotalAmount !== 0) {
346
358
  this.uiController.recentWin = ceilToDecimal(spinLogic.winTotalAmount);
347
359
  this.uiController.totalFreeSpinWinAmount = this._lastWinAmount;
@@ -349,7 +361,6 @@ export class AbstractController {
349
361
  this.uiController.currentBalance = spinData.balance;
350
362
  this.roundNumber = spinData.getRawData().round_number;
351
363
  RainMan.settingsStore.setRoundNumber(this.roundNumber);
352
- const availableFreeSpins = spinLogic.availableFreeSpins;
353
364
  if (this._lastWinAmount !== 0) {
354
365
  RainMan.settingsStore.isTakeActionAvailable = true;
355
366
  RainMan.settingsStore.isGambleGameAvailable = true;
@@ -369,6 +380,12 @@ export class AbstractController {
369
380
  }
370
381
  RainMan.settingsStore.setTotalNumberOfFreeSpins(availableFreeSpins);
371
382
  RainMan.settingsStore.setNumberOfFreeSpin(availableFreeSpins);
383
+ if (RainMan.settingsStore.isFreeSpinsPlayEnabled) {
384
+ const freeSpinsUsed = this.initData?.free_spins_used ?? 0;
385
+ const freeSpinsAvailable = RainMan.settingsStore.reinitData?.[0]?.available_free_spins ?? 0;
386
+ this.uiController.totalNumberOfFreeSpins = freeSpinsUsed + freeSpinsAvailable;
387
+ RainMan.componentRegistry.get(MessageBox.currentWinTextRegistryName).update(this.initData.round_win_amount);
388
+ }
372
389
  this.initControllerReinitModifier(spinLogic, spinData);
373
390
  }
374
391
  initControllerReinitModifier(_spinLogic, _spinData) { }
@@ -391,7 +408,9 @@ export class AbstractController {
391
408
  this.mobileSpinDelay = null;
392
409
  }
393
410
  };
394
- refreshButton.setOnClick(() => this.handleSpinLogic());
411
+ refreshButton.setOnClick(() => {
412
+ this.handleSpinLogic();
413
+ });
395
414
  refreshButton.on("touchend", () => {
396
415
  if (this.clearMobileSpinTimeout)
397
416
  this.clearMobileSpinTimeout();
@@ -408,6 +427,18 @@ export class AbstractController {
408
427
  if (this.clearMobileSpinTimeout)
409
428
  this.clearMobileSpinTimeout();
410
429
  });
430
+ refreshButton.on("pointerout", () => {
431
+ if (this.clearMobileSpinTimeout)
432
+ this.clearMobileSpinTimeout();
433
+ });
434
+ refreshButton.on("pointerup", () => {
435
+ if (this.clearMobileSpinTimeout)
436
+ this.clearMobileSpinTimeout();
437
+ });
438
+ refreshButton.on("pointerupoutside", () => {
439
+ if (this.clearMobileSpinTimeout)
440
+ this.clearMobileSpinTimeout();
441
+ });
411
442
  refreshButton.on("touchstart", () => {
412
443
  this.mobileSpinDelay = setTimeout(() => {
413
444
  this.mobileSpinTimeout = setInterval(() => {
@@ -416,6 +447,7 @@ export class AbstractController {
416
447
  this.summaryStop = this.skipFreeSpinSummary ? false : this.invokeFreeSpinSummaryPlateAfterWin;
417
448
  if (this.invokeFreeSpinPlateAfterWin ||
418
449
  this.summaryStop ||
450
+ this.shouldStopMobileSpin ||
419
451
  this.resolveBigWin !== undefined ||
420
452
  this.resolveSuperBonusWin !== undefined ||
421
453
  this.resolveMysteryWin !== undefined) {
@@ -766,6 +798,14 @@ export class AbstractController {
766
798
  this.winActionsQueue.length = 0;
767
799
  this.currentlyPlayedAction = undefined;
768
800
  }
801
+ /**
802
+ * Function for updating balance on special occasion ex. bonusGame
803
+ * @public
804
+ * @returns {void}
805
+ */
806
+ updateBalance() {
807
+ this.uiController.currentBalance = RainMan.settingsStore.balanceAfterSpin;
808
+ }
769
809
  /**
770
810
  * Function that is used to invoke take action after winning (send request to backend to save status of wallet).
771
811
  * After that action, gamble and other bonus games are blocked.
@@ -842,6 +882,7 @@ export class AbstractController {
842
882
  }
843
883
  this.changeGamePhase(gamePhases.CONFIGURING_SPIN);
844
884
  this.uiController.currentBalance = data.balance;
885
+ RainMan.settingsStore.setBalanceAfterSpin(data.balanceAfterSpin);
845
886
  this.roundNumber = data.getRawData().round_number;
846
887
  RainMan.settingsStore.setRoundNumber(data.getRawData().round_number);
847
888
  return {
@@ -1028,6 +1069,8 @@ export class AbstractController {
1028
1069
  if (RainMan.settingsStore.howManyFreeSpinsLeft !== 0 &&
1029
1070
  (this.invokeFreeSpinPlateAfterWin || this.setSlowerSpeedForFreeSpins) &&
1030
1071
  RainMan.settingsStore.isFreeSpinsPlayEnabled) {
1072
+ this.columnsContainer.clearQuickReelsStop();
1073
+ RainMan.settingsStore.setIsTemporarySpeed(false);
1031
1074
  RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.slow);
1032
1075
  this.uiController.updateShownSpeedLevel(SPEED_LEVELS.slow);
1033
1076
  this.disableSpeedButton(false);
@@ -1066,6 +1109,7 @@ export class AbstractController {
1066
1109
  this.uiController.messageBox.hideCurrentWinText();
1067
1110
  this.uiController.messageBox.hideAutoSpinText();
1068
1111
  await this.handleFreeSpinPlateInvocation(freeSpinAward, isAdditionalFreeSpins || additionalFreeSpinsOnLastSpin);
1112
+ this.uiController.currentBalance = RainMan.settingsStore.balanceAfterSpin;
1069
1113
  this.uiController.triggerUiElementsUpdate();
1070
1114
  this.uiController.messageBox.showFreeSpinText();
1071
1115
  }
@@ -1149,6 +1193,7 @@ export class AbstractController {
1149
1193
  this.uiController.resetTotalFreeSpinWinAmount();
1150
1194
  this.changeGamePhase(gamePhases.IDLE);
1151
1195
  });
1196
+ this.uiController.currentBalance = RainMan.settingsStore.balanceAfterSpin;
1152
1197
  RainMan.settingsStore.resetTotalNumberOfFreeSpins();
1153
1198
  RainMan.settingsStore.resetFreeSpinNumberBought();
1154
1199
  this.changeGamePhase(gamePhases.IDLE);
@@ -1457,7 +1502,6 @@ export class AbstractController {
1457
1502
  }
1458
1503
  else {
1459
1504
  this.uiController.delegateUpdatingWinAndBalance(value);
1460
- this.uiController.updateShownBalance();
1461
1505
  }
1462
1506
  }
1463
1507
  /**
@@ -46,6 +46,8 @@ export class QuickStopController {
46
46
  handleSpeedPopupInvocation() {
47
47
  if (this.shouldInvokeSpeedPopup && !this.speedPopupDisabled) {
48
48
  this.buttonsEventManager?.setSpeedPopupVisibility("flex");
49
+ RainMan.settingsStore.isSpeedModalShown = true;
50
+ this.buttonsEventManager.disableButtons();
49
51
  this.shouldInvokeSpeedPopup = false;
50
52
  this.speedPopupDisabled = true;
51
53
  }
@@ -138,7 +138,7 @@ export class UiController {
138
138
  case "remain":
139
139
  return this.lastBet;
140
140
  case "highest":
141
- return this.config?.getHighestBet(this.currentBalance) || 0;
141
+ return this.config?.getHighestBet(this._currentBalance) || 0;
142
142
  default:
143
143
  return this.config?.getFirstBet() || 0;
144
144
  }
@@ -242,7 +242,6 @@ export class UiController {
242
242
  this.messageBox.showCurrentWinText();
243
243
  this._promisesToSetBalances = [];
244
244
  this.updateDisplayedWin(amount);
245
- this.updateDisplayedBalance(amount);
246
245
  }
247
246
  /**
248
247
  * Function for updating displayed win amount
@@ -11,6 +11,7 @@ import { PaytableData } from "./types";
11
11
  export declare class SettingsStore {
12
12
  static instance: SettingsStore | null;
13
13
  betChangeDisabled: boolean;
14
+ disableKeyboardShortcuts: boolean;
14
15
  bet: number;
15
16
  betText: string;
16
17
  shouldPlayAmbientMusic: boolean;
@@ -39,6 +40,7 @@ export declare class SettingsStore {
39
40
  balancedIncreased: number;
40
41
  balancedDecreased: number;
41
42
  howManyFreeSpinsLeft: number;
43
+ balanceAfterSpin: number;
42
44
  howManyAutoSpinsLeft: number;
43
45
  freeSpinBuyTable: Record<number, number>;
44
46
  volumeLevel: number;
@@ -49,6 +51,7 @@ export declare class SettingsStore {
49
51
  isTemporarySpeed: boolean;
50
52
  disableBigWin: boolean;
51
53
  isAfterFreeSpinsSummary: boolean;
54
+ isSpeedModalShown: boolean;
52
55
  reinitData?: SpinDataInterface[];
53
56
  setSpeedPopupVisibility?: (visibility: "flex" | "none") => void;
54
57
  popupPaytableRepositionCallback?: () => void;
@@ -91,6 +94,13 @@ export declare class SettingsStore {
91
94
  * @returns {void}
92
95
  */
93
96
  addCumulativeWinAmount(amount: number): void;
97
+ /**
98
+ * Store balance after spin for updates.
99
+ * @public
100
+ * @param {number} balance to set.
101
+ * @returns {void}
102
+ */
103
+ setBalanceAfterSpin(balance: number): void;
94
104
  /**
95
105
  * Disables special buttons like gamble and take.
96
106
  * @public
@@ -15,6 +15,7 @@ const INITIAL_AUTO_SPIN_COUNT = 50;
15
15
  export class SettingsStore {
16
16
  static instance = null;
17
17
  betChangeDisabled = false;
18
+ disableKeyboardShortcuts = false;
18
19
  bet = 0;
19
20
  betText = "";
20
21
  shouldPlayAmbientMusic = true;
@@ -43,6 +44,7 @@ export class SettingsStore {
43
44
  balancedIncreased = 0;
44
45
  balancedDecreased = 0;
45
46
  howManyFreeSpinsLeft = 0;
47
+ balanceAfterSpin = 0;
46
48
  howManyAutoSpinsLeft = INITIAL_AUTO_SPIN_COUNT;
47
49
  freeSpinBuyTable = {};
48
50
  volumeLevel = Number(getFromLocalStorage(LOCAL_STORAGE.volumeLevel, 100));
@@ -53,6 +55,7 @@ export class SettingsStore {
53
55
  isTemporarySpeed = false;
54
56
  disableBigWin = false;
55
57
  isAfterFreeSpinsSummary = true;
58
+ isSpeedModalShown = false;
56
59
  reinitData;
57
60
  setSpeedPopupVisibility;
58
61
  popupPaytableRepositionCallback;
@@ -85,6 +88,7 @@ export class SettingsStore {
85
88
  }
86
89
  makeAutoObservable(this, {
87
90
  setBatteryFlag: action.bound,
91
+ setBalanceAfterSpin: action.bound,
88
92
  setShouldPlayAmbientMusic: action.bound,
89
93
  setShouldPlayFxSounds: action.bound,
90
94
  setFullScreenFlag: action.bound,
@@ -151,6 +155,15 @@ export class SettingsStore {
151
155
  addCumulativeWinAmount(amount) {
152
156
  this.cumulativeWinAmount = this.cumulativeWinAmount + amount;
153
157
  }
158
+ /**
159
+ * Store balance after spin for updates.
160
+ * @public
161
+ * @param {number} balance to set.
162
+ * @returns {void}
163
+ */
164
+ setBalanceAfterSpin(balance) {
165
+ this.balanceAfterSpin = balance;
166
+ }
154
167
  /**
155
168
  * Disables special buttons like gamble and take.
156
169
  * @public
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.3.15",
3
+ "version": "0.3.17",
4
4
  "description": "This repository contains all of the mechanics that used in rainman games.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",