pixi-rainman-game-engine 0.3.43-c → 0.3.44

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.
@@ -49,7 +49,8 @@ export class ComponentRegistry {
49
49
  this.speedLevelHandler.setSpeed(newSpeedLevel);
50
50
  RainMan.settingsStore.setSpeedLevel(this.speedLevelHandler.currentSpeed);
51
51
  this.updateAllSpeedAdaptable(RainMan.settingsStore.currentSpeed);
52
- this.get(SpeedControlButton.registryName).forceTextureUpdate();
52
+ this.getIfExists(SpeedControlButton.registryName)?.forceTextureUpdate();
53
+ this.getIfExists(SpeedControlButtonMobile.registryName)?.forceTextureUpdate();
53
54
  }
54
55
  /**
55
56
  * Setting the next available speed level
@@ -10,5 +10,8 @@ export declare class DescribedPlayableAction<T> {
10
10
  winAmount: Nullable<number>;
11
11
  skipLooping: boolean;
12
12
  isFirstStreak: boolean;
13
+ animationTarget: {
14
+ isCurrentAnimationPastProgressThreshold?: () => boolean;
15
+ } | null;
13
16
  constructor(type: T, action: PlayableAction, winAmount?: Nullable<number>, skipLooping?: boolean);
14
17
  }
@@ -9,6 +9,7 @@ export class DescribedPlayableAction {
9
9
  winAmount;
10
10
  skipLooping;
11
11
  isFirstStreak = false;
12
+ animationTarget = null;
12
13
  constructor(type, action, winAmount = null, skipLooping = false) {
13
14
  this.type = type;
14
15
  this.action = action;
@@ -154,6 +154,7 @@ export declare class ButtonsEventManager {
154
154
  * @returns {void}
155
155
  */
156
156
  private handleModalInvocation;
157
+ private closeAllModals;
157
158
  /**
158
159
  * Function for closing all other modals except the one with given name
159
160
  * @param {string} activeLayerName - name of the layer that should remain open
@@ -62,6 +62,7 @@ export class ButtonsEventManager {
62
62
  RainMan.settingsStore.handleModalInvocation = this.handleModalInvocation.bind(this);
63
63
  RainMan.settingsStore.enableButtons = this.enableButtons.bind(this);
64
64
  RainMan.settingsStore.closeOtherModals = this.closeOtherModals.bind(this);
65
+ RainMan.settingsStore.closeAllModals = this.closeAllModals.bind(this);
65
66
  RainMan.settingsStore.closeCurrentlyOpenModal = this.closeCurrentlyOpenModal.bind(this);
66
67
  }
67
68
  /**
@@ -359,6 +360,14 @@ export class ButtonsEventManager {
359
360
  }
360
361
  }
361
362
  }
363
+ closeAllModals() {
364
+ for (const itemId of allUiItems) {
365
+ const layer = window.document.getElementById(itemId);
366
+ if (layer !== null && layer.style.display === "flex") {
367
+ layer.style.display = "none";
368
+ }
369
+ }
370
+ }
362
371
  /**
363
372
  * Function for closing all other modals except the one with given name
364
373
  * @param {string} activeLayerName - name of the layer that should remain open
@@ -252,6 +252,7 @@ export class AbstractMainContainer extends Container {
252
252
  invokeBuyFreeSpinPlate() {
253
253
  const refreshButton = RainMan.componentRegistry.get(RefreshButton.registryName);
254
254
  refreshButton.flipDisabledFlag(true);
255
+ RainMan.settingsStore.closeAllModals?.();
255
256
  this._buyFreeSpinsPlate = this.createBuyFreeSpinPlate();
256
257
  if (!this._buyFreeSpinsPlate) {
257
258
  refreshButton.flipDisabledFlag(false);
@@ -108,13 +108,13 @@ export class MiddleButtons extends ResponsiveContainer {
108
108
  }
109
109
  if (this.landscape) {
110
110
  this.betButton.x = width / 2;
111
- this.betButton.y = -20;
111
+ this.betButton.y = -25;
112
112
  this.autoplayButton.x = width / 2;
113
- this.autoplayButton.y = height + 30;
113
+ this.autoplayButton.y = height + 35;
114
114
  }
115
115
  else {
116
116
  this.autoplayButton.x = -width;
117
- this.autoplayButton.y = 50;
117
+ this.autoplayButton.y = 0;
118
118
  this.betButton.x = width;
119
119
  this.betButton.y = height;
120
120
  }
@@ -98,6 +98,7 @@ export declare abstract class AbstractSymbolBase extends Container implements Sp
98
98
  * @returns {Promise<void>} - A promise that resolves when the animation is complete
99
99
  */
100
100
  play(suffix?: string): Promise<void>;
101
+ isCurrentAnimationPastProgressThreshold(): boolean;
101
102
  /**
102
103
  * Function for stopping the symbol animation.
103
104
  * @public
@@ -214,6 +214,18 @@ export class AbstractSymbolBase extends Container {
214
214
  });
215
215
  });
216
216
  }
217
+ isCurrentAnimationPastProgressThreshold() {
218
+ const entry = this.spine.state.tracks[0];
219
+ if (!entry) {
220
+ return false;
221
+ }
222
+ const trackTime = entry.trackTime ?? 0;
223
+ const animationEnd = entry.animationEnd ?? 0;
224
+ if (animationEnd <= 0) {
225
+ return false;
226
+ }
227
+ return trackTime >= animationEnd / 3;
228
+ }
217
229
  /**
218
230
  * Function for stopping the symbol animation.
219
231
  * @public
@@ -57,6 +57,9 @@ export declare abstract class AbstractController<T> {
57
57
  shouldStopMobileSpin: boolean;
58
58
  disableMessageBoxChange: boolean;
59
59
  shouldClearQuickReelsStopAfterSpin: boolean;
60
+ protected firstAnimationTarget: {
61
+ isCurrentAnimationPastProgressThreshold?: () => boolean;
62
+ } | null;
60
63
  freeSpinsWin: Nullable<number>;
61
64
  protected resolveBigWin?: () => void;
62
65
  protected resolveMysteryWin?: () => void;
@@ -57,6 +57,7 @@ export class AbstractController {
57
57
  shouldStopMobileSpin = false;
58
58
  disableMessageBoxChange = false;
59
59
  shouldClearQuickReelsStopAfterSpin = false;
60
+ firstAnimationTarget = null;
60
61
  freeSpinsWin = null;
61
62
  resolveBigWin;
62
63
  resolveMysteryWin;
@@ -769,7 +770,7 @@ export class AbstractController {
769
770
  return;
770
771
  }
771
772
  if (this.gamePhase === gamePhases.HANDLING_ACTIONS) {
772
- this.shouldPlayNextSpin = true;
773
+ this.shouldPlayNextSpin = !RainMan.settingsStore.isFreeSpinsPlayEnabled;
773
774
  }
774
775
  if (this.mainContainer.mysteryWinVisibleFor) {
775
776
  RainMan.componentRegistry.get(COMPONENTS.mysteryWin).stopUpdate();
@@ -916,7 +917,7 @@ export class AbstractController {
916
917
  async useTakeAction() {
917
918
  if (!RainMan.settingsStore.isTakeActionAvailable ||
918
919
  RainMan.settingsStore.roundNumber === 0 ||
919
- this._lastWinAmount === 0) {
920
+ (this._lastWinAmount === 0 && !RainMan.settingsStore.isAfterFreeSpinsSummary)) {
920
921
  logInfo("Take action can't be performed");
921
922
  return;
922
923
  }
@@ -1168,6 +1169,8 @@ export class AbstractController {
1168
1169
  this.uiController.limitWinAmount(spinLogic.winTotalAmount);
1169
1170
  }
1170
1171
  this.composeWinActionsQueue(spinLogic);
1172
+ this.firstAnimationTarget =
1173
+ this.winActionsQueue.find((action) => action.animationTarget)?.animationTarget ?? null;
1171
1174
  if (spinLogic.winTotalAmount === 0 && this.invokeFreeSpinPlateAfterWin) {
1172
1175
  this.uiController.messageBox.hideCurrentWinText();
1173
1176
  }
@@ -1321,6 +1324,8 @@ export class AbstractController {
1321
1324
  * @returns {Promise<void>} - promise that resolves when free spin plate is invoked
1322
1325
  */
1323
1326
  async handleFreeSpinPlateInvocation(numberOfFreeSpins, isAdditionalFreeSpin = false) {
1327
+ RainMan.componentRegistry.getIfExists(SpeedControlButtonMobile.registryName)?.flipDisabledFlag(true);
1328
+ RainMan.componentRegistry.getIfExists(SpeedControlButton.registryName)?.flipDisabledFlag(true);
1324
1329
  await this.buttonsEventManager.disableButtonsForAction(async () => {
1325
1330
  await this.mainContainer.invokeFreeSpinPlate(numberOfFreeSpins ?? RainMan.settingsStore.totalNumberOfFreeSpins, isAdditionalFreeSpin);
1326
1331
  });
@@ -1337,9 +1342,12 @@ export class AbstractController {
1337
1342
  * @returns {Promise<void>} - promise that resolves when free spin summary plate is invoked
1338
1343
  */
1339
1344
  async handleFreeSpinSummaryPlateInvocation() {
1345
+ this.shouldPlayNextSpin = false;
1340
1346
  await this.buttonsEventManager.disableButtonsForAction(async () => {
1341
1347
  this.uiController.messageBox.hideFreeSpinText();
1342
1348
  this.uiController.messageBox.hideCurrentWinText();
1349
+ RainMan.componentRegistry.getIfExists(SpeedControlButtonMobile.registryName)?.flipDisabledFlag(true);
1350
+ RainMan.componentRegistry.getIfExists(SpeedControlButton.registryName)?.flipDisabledFlag(true);
1343
1351
  await this.mainContainer.invokeFreeSpinSummary(this.uiController.totalNumberOfFreeSpins, this.uiController.totalFreeSpinWinAmount);
1344
1352
  this.uiController.totalNumberOfFreeSpins = 0;
1345
1353
  this.uiController.resetTotalFreeSpinWinAmount();
@@ -149,6 +149,7 @@ export declare class UiController {
149
149
  updateShownPossibleWin(): void;
150
150
  /**
151
151
  * Shows game pays in a bottom panel, if exists
152
+ * @param amount
152
153
  * @public
153
154
  * @returns {void}
154
155
  */
@@ -220,6 +220,7 @@ export class UiController {
220
220
  }
221
221
  /**
222
222
  * Shows game pays in a bottom panel, if exists
223
+ * @param amount
223
224
  * @public
224
225
  * @returns {void}
225
226
  */
@@ -63,6 +63,7 @@ export declare class SettingsStore {
63
63
  updateVolumeButtonTexture?: () => void;
64
64
  handleModalInvocation?: (layerId: string) => void;
65
65
  closeOtherModals?: (layerId: string) => void;
66
+ closeAllModals?: () => void;
66
67
  closeCurrentlyOpenModal?: () => void;
67
68
  handleInvokeFreeSpinPlate?: (freeSpinAmount: number, isAdditionalFreeSpin: boolean) => Promise<void>;
68
69
  handleBuyFreeSpinPopupActivation?: () => void;
@@ -69,6 +69,7 @@ export class SettingsStore {
69
69
  updateVolumeButtonTexture;
70
70
  handleModalInvocation;
71
71
  closeOtherModals;
72
+ closeAllModals;
72
73
  closeCurrentlyOpenModal;
73
74
  handleInvokeFreeSpinPlate;
74
75
  handleBuyFreeSpinPopupActivation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.3.43c",
3
+ "version": "0.3.44",
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",