pixi-rainman-game-engine 0.3.38 → 0.3.39

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.
Files changed (33) hide show
  1. package/dist/Rainman/Rainman.js +1 -3
  2. package/dist/Rainman/appConfig.js +0 -1
  3. package/dist/Rainman/types.d.ts +0 -2
  4. package/dist/SettingsUI/components/CloseModalButton/index.jsx +0 -5
  5. package/dist/SettingsUI/components/UXSettings/index.jsx +0 -3
  6. package/dist/SettingsUI/components/index.d.ts +0 -1
  7. package/dist/SettingsUI/components/index.jsx +0 -1
  8. package/dist/SettingsUI/index.jsx +1 -6
  9. package/dist/application/ButtonsEventManager/ButtonsEventManager.d.ts +3 -17
  10. package/dist/application/ButtonsEventManager/ButtonsEventManager.js +62 -95
  11. package/dist/application/SoundManager/SoundManager.d.ts +6 -0
  12. package/dist/application/SoundManager/SoundManager.js +50 -21
  13. package/dist/application/SpeedState/SpeedLevelHandler.js +0 -2
  14. package/dist/application/setup.js +1 -1
  15. package/dist/components/AbstractBuyFreeSpins/AbstractBuyFreeSpinsPlate.js +1 -0
  16. package/dist/components/AbstractMainContainer/AbstractMainContainer.js +4 -1
  17. package/dist/controllers/AbstractController.d.ts +3 -4
  18. package/dist/controllers/AbstractController.js +22 -30
  19. package/dist/controllers/index.d.ts +0 -1
  20. package/dist/controllers/index.js +0 -1
  21. package/dist/localStorage/localStorage.d.ts +0 -1
  22. package/dist/localStorage/localStorage.js +0 -1
  23. package/dist/stores/SettingsStore.d.ts +3 -13
  24. package/dist/stores/SettingsStore.js +16 -23
  25. package/dist/utils/common/functions.d.ts +1 -1
  26. package/dist/utils/common/functions.js +2 -3
  27. package/dist/utils/common/sound.js +5 -8
  28. package/package.json +1 -1
  29. package/dist/SettingsUI/components/SpeedSettingsPopup/index.d.ts +0 -7
  30. package/dist/SettingsUI/components/SpeedSettingsPopup/index.jsx +0 -27
  31. package/dist/SettingsUI/components/SpeedSettingsPopup/speedSettingsPopup.css +0 -159
  32. package/dist/controllers/QuickStopController.d.ts +0 -54
  33. package/dist/controllers/QuickStopController.js +0 -86
@@ -37,7 +37,7 @@ export class RainMan {
37
37
  isSuperBonusGameEnabled: false
38
38
  };
39
39
  this.initLocalStorageSettings();
40
- RainMan.settingsStore.setHiResolutionFlag(false);
40
+ RainMan.settingsStore.refreshBatterySaver();
41
41
  }
42
42
  /**
43
43
  * Method for genereting a token or getting existing token for the game session.
@@ -57,13 +57,11 @@ export class RainMan {
57
57
  }
58
58
  }
59
59
  initLocalStorageSettings() {
60
- setIfDoesntExistInLocalStorage(LOCAL_STORAGE.hiResolution, false);
61
60
  setIfDoesntExistInLocalStorage(LOCAL_STORAGE.batterySaver, false);
62
61
  setIfDoesntExistInLocalStorage(LOCAL_STORAGE.volumeLevel, 100);
63
62
  setToLocalStorage(LOCAL_STORAGE.isSoundFxEnabled, true);
64
63
  setToLocalStorage(LOCAL_STORAGE.isSoundEnabled, true);
65
64
  setToLocalStorage(LOCAL_STORAGE.isSoundFxEnabled, true);
66
65
  setToLocalStorage(LOCAL_STORAGE.isAmbientMusicEnabled, true);
67
- setToLocalStorage(LOCAL_STORAGE.hiResolution, false);
68
66
  }
69
67
  }
@@ -49,7 +49,6 @@ export const defaultAppConfig = {
49
49
  bonusWinMinimumTime: 2000,
50
50
  superBonusWinMinimumTime: 2000,
51
51
  superBonusWinPhaseTimeout: 2600,
52
- speedPopupVisibleTime: 2000,
53
52
  minAnimationTime: 1000
54
53
  },
55
54
  constants: {
@@ -57,7 +57,6 @@ export type OptionalAppConfig = {
57
57
  bonusWinMinimumTime: number;
58
58
  superBonusWinPhaseTimeout: number;
59
59
  superBonusWinMinimumTime: number;
60
- speedPopupVisibleTime: number;
61
60
  minAnimationTime: number;
62
61
  };
63
62
  constants: {
@@ -78,7 +77,6 @@ export interface Globals {
78
77
  loadingContainerReference?: AbstractLoadingContainer;
79
78
  getWebSocketConnection?: () => WebSocket;
80
79
  actionsAfterClosureWebSocket?: () => void;
81
- disableSpeedPopup?: (value: boolean) => void;
82
80
  handleDisablingButtons?: (value?: boolean) => void;
83
81
  throttledSpin?: () => void;
84
82
  handleSpinLogic?: () => void;
@@ -1,7 +1,6 @@
1
1
  import "./closeModalButton.css";
2
2
  import { observer } from "mobx-react-lite";
3
3
  import React from "react";
4
- import { UI_ITEMS } from "../../../utils";
5
4
  import { useStores } from "../../hooks";
6
5
  export const CloseModalButton = observer(({ layerId, afterClose }) => {
7
6
  const { settingStore } = useStores();
@@ -9,10 +8,6 @@ export const CloseModalButton = observer(({ layerId, afterClose }) => {
9
8
  const isBetDisabled = isFreeSpinsPlayEnabled || betChangeDisabled || isFreeSpinsBought;
10
9
  const onClose = () => {
11
10
  settingStore.handleModalInvocation?.(layerId);
12
- if (layerId === UI_ITEMS.speedSettings) {
13
- settingStore.setSpeedPopupVisibility?.("none");
14
- settingStore.isSpeedModalShown = false;
15
- }
16
11
  if (!isBetDisabled) {
17
12
  settingStore.enableButtons?.();
18
13
  }
@@ -22,9 +22,6 @@ export const UXSettings = observer(() => {
22
22
  <div className="ux-settings__switch">
23
23
  <SwitchWithHeader header="Full screen mode" description="Turn on or off game fullscreen" flag={settingStore.fullScreenFlag} setFlag={settingStore.setFullScreenFlag}/>
24
24
  </div>
25
- <div className="ux-settings__switch">
26
- <SwitchWithHeader header="HI resolution" description="Enable high resolution files" flag={settingStore.HiResolutionFlag} setFlag={settingStore.setHiResolutionFlag}/>
27
- </div>
28
25
  </div>
29
26
  </div>);
30
27
  });
@@ -5,7 +5,6 @@ export * from "./CloseModalButton";
5
5
  export * from "./GameRules";
6
6
  export * from "./OptionButton";
7
7
  export * from "./SlidingSwitch";
8
- export * from "./SpeedSettingsPopup";
9
8
  export * from "./SwitchWithHeader";
10
9
  export * from "./SymbolMultiplierPopup";
11
10
  export * from "./UXSettings";
@@ -5,7 +5,6 @@ export * from "./CloseModalButton";
5
5
  export * from "./GameRules";
6
6
  export * from "./OptionButton";
7
7
  export * from "./SlidingSwitch";
8
- export * from "./SpeedSettingsPopup";
9
8
  export * from "./SwitchWithHeader";
10
9
  export * from "./SymbolMultiplierPopup";
11
10
  export * from "./UXSettings";
@@ -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, SymbolMultiplierPopup, VolumeSettings } from "./components";
5
5
  import { SystemSettingsComponent } from "./SystemSettings/SystemSettingsComponent";
6
6
  export const SettingsUI = () => {
7
7
  return (<>
@@ -17,11 +17,6 @@ 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=" modal-overlay">
21
- <div className="speed-settings-modal modal-style">
22
- <SpeedSettingsPopup />
23
- </div>
24
- </div>
25
20
  <div id={UI_ITEMS.symbolPayTable}>
26
21
  <SymbolMultiplierPopup />
27
22
  </div>
@@ -29,12 +29,6 @@ export declare class ButtonsEventManager {
29
29
  * @memberof ButtonsEventManager
30
30
  */
31
31
  private lastLayerInvoked;
32
- /**
33
- * Speed popup shown at for measuring time of showing speed popup
34
- * @public
35
- * @memberof ButtonsEventManager
36
- */
37
- speedPopupShownAt: number;
38
32
  /**
39
33
  * Function for enabling/disabling buttons in game
40
34
  * @private
@@ -57,13 +51,6 @@ export declare class ButtonsEventManager {
57
51
  */
58
52
  disableButtons: () => void;
59
53
  constructor();
60
- /**
61
- * Method for initializing events in Settings UI
62
- * This method also change the incentive text based on the selected speed level
63
- * @public
64
- * @returns {void}
65
- */
66
- initSettingsEvents(): void;
67
54
  /**
68
55
  * Method for setting up animated background
69
56
  * @public
@@ -134,13 +121,12 @@ export declare class ButtonsEventManager {
134
121
  */
135
122
  initTakeButton(onClick: () => void, disabled: boolean): void;
136
123
  /**
137
- * Function for displaying speed modal
138
- * This modal is used while doing turbo spin
124
+ * Method for initializing events in Settings UI
125
+ * This method also change the incentive text based on the selected speed level
139
126
  * @public
140
- * @param {("flex" | "none")} displayValue - flag for displaying modal
141
127
  * @returns {void}
142
128
  */
143
- setSpeedPopupVisibility(displayValue: "flex" | "none"): void;
129
+ initSettingsEvents(): void;
144
130
  /**
145
131
  * Function for handling autostart conformation
146
132
  * @public
@@ -1,10 +1,9 @@
1
1
  import i18n from "i18next";
2
2
  import { sample } from "lodash";
3
- import { SoundManager, SoundTracks } from "../../application";
3
+ import { SoundManager, SoundTracks, SPEED_LEVELS } from "../../application";
4
4
  import { AutoplayButton, Background, BUTTONS, COMPONENTS, FreeSpinButton, MessageBox, VolumeButton } from "../../components";
5
5
  import { RainMan } from "../../Rainman";
6
6
  import { allUiItems, hideLayerIfPresent, UI_ITEMS, wait } from "../../utils";
7
- import { SPEED_LEVELS } from "../SpeedState";
8
7
  /** @ignore */
9
8
  export const SPEED_PREFIX = "speed-";
10
9
  /**
@@ -34,12 +33,6 @@ export class ButtonsEventManager {
34
33
  * @memberof ButtonsEventManager
35
34
  */
36
35
  lastLayerInvoked = "";
37
- /**
38
- * Speed popup shown at for measuring time of showing speed popup
39
- * @public
40
- * @memberof ButtonsEventManager
41
- */
42
- speedPopupShownAt = 0;
43
36
  /**
44
37
  * Function for enabling/disabling buttons in game
45
38
  * @private
@@ -67,87 +60,10 @@ export class ButtonsEventManager {
67
60
  disableButtons = this.setButtonAvailability(true);
68
61
  constructor() {
69
62
  RainMan.settingsStore.handleModalInvocation = this.handleModalInvocation.bind(this);
70
- RainMan.settingsStore.setSpeedPopupVisibility = this.setSpeedPopupVisibility.bind(this);
71
63
  RainMan.settingsStore.enableButtons = this.enableButtons.bind(this);
72
64
  RainMan.settingsStore.closeOtherModals = this.closeOtherModals.bind(this);
73
65
  RainMan.settingsStore.closeCurrentlyOpenModal = this.closeCurrentlyOpenModal.bind(this);
74
66
  }
75
- /**
76
- * Method for initializing events in Settings UI
77
- * This method also change the incentive text based on the selected speed level
78
- * @public
79
- * @returns {void}
80
- */
81
- initSettingsEvents() {
82
- const messageBox = RainMan.componentRegistry.get(MessageBox.registryName);
83
- if (this.settingsSpeedButton === null) {
84
- const speedLevelButton = window.document.getElementsByClassName("speed-level-id");
85
- if (speedLevelButton.length !== 0) {
86
- const numberOfReactSpeedButtons = 2;
87
- for (let i = 0; i < numberOfReactSpeedButtons; i++) {
88
- this.settingsSpeedButton = speedLevelButton.item(i);
89
- if (this.settingsSpeedButton) {
90
- this.settingsSpeedButton.addEventListener("click", () => {
91
- RainMan.componentRegistry.nextSpeedLevel();
92
- if (RainMan.settingsStore.currentSpeed === SPEED_LEVELS.fast ||
93
- RainMan.settingsStore.currentSpeed === SPEED_LEVELS.normal) {
94
- RainMan.globals.disableSpeedPopup?.(true);
95
- }
96
- messageBox.updateIncentiveText(sample(i18n.t("idleMessages", { returnObjects: true })[RainMan.componentRegistry.getSpeedLevel()]));
97
- });
98
- }
99
- }
100
- }
101
- }
102
- if (this.settingsSpeedTurtle === null) {
103
- this.settingsSpeedTurtle = window.document.getElementById(`${SPEED_PREFIX}${SPEED_LEVELS.slow}`);
104
- if (this.settingsSpeedTurtle !== null) {
105
- this.settingsSpeedTurtle.addEventListener("click", () => {
106
- RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.slow);
107
- this.setSpeedPopupVisibility("none");
108
- this.enableButtons();
109
- RainMan.settingsStore.isSpeedModalShown = false;
110
- messageBox.updateIncentiveText(i18n.t("turtleSelected"));
111
- });
112
- }
113
- }
114
- if (this.settingsSpeedRabbit === null) {
115
- this.settingsSpeedRabbit = window.document.getElementById(`${SPEED_PREFIX}${SPEED_LEVELS.normal}`);
116
- if (this.settingsSpeedRabbit !== null) {
117
- this.settingsSpeedRabbit.addEventListener("click", () => {
118
- RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.normal);
119
- this.setSpeedPopupVisibility("none");
120
- RainMan.settingsStore.isSpeedModalShown = false;
121
- this.enableButtons();
122
- messageBox.updateIncentiveText(i18n.t("rabbitSelected"));
123
- RainMan.globals.disableSpeedPopup?.(true);
124
- });
125
- }
126
- }
127
- if (this.settingsSpeedCheetah === null) {
128
- this.settingsSpeedCheetah = window.document.getElementById(`${SPEED_PREFIX}${SPEED_LEVELS.fast}`);
129
- if (this.settingsSpeedCheetah !== null) {
130
- this.settingsSpeedCheetah.addEventListener("click", () => {
131
- RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.fast);
132
- this.setSpeedPopupVisibility("none");
133
- this.enableButtons();
134
- RainMan.settingsStore.isSpeedModalShown = false;
135
- messageBox.updateIncentiveText(i18n.t("cheetahSelected"));
136
- RainMan.globals.disableSpeedPopup?.(true);
137
- });
138
- }
139
- }
140
- document.addEventListener("fullscreenchange", () => {
141
- if (document.fullscreenElement) {
142
- RainMan.settingsStore.setFullScreenFlag(true);
143
- window.dispatchEvent(new Event("resize"));
144
- }
145
- else {
146
- RainMan.settingsStore.setFullScreenFlag(false);
147
- window.dispatchEvent(new Event("resize"));
148
- }
149
- });
150
- }
151
67
  /**
152
68
  * Method for setting up animated background
153
69
  * @public
@@ -310,20 +226,71 @@ export class ButtonsEventManager {
310
226
  RainMan.componentRegistry.get(BUTTONS.take).flipDisabledFlag(disabled);
311
227
  }
312
228
  /**
313
- * Function for displaying speed modal
314
- * This modal is used while doing turbo spin
229
+ * Method for initializing events in Settings UI
230
+ * This method also change the incentive text based on the selected speed level
315
231
  * @public
316
- * @param {("flex" | "none")} displayValue - flag for displaying modal
317
232
  * @returns {void}
318
233
  */
319
- setSpeedPopupVisibility(displayValue) {
320
- if (displayValue === "flex")
321
- this.speedPopupShownAt = performance.now();
322
- const spinSpeedSettingsLayer = window.document.getElementById(UI_ITEMS.speedSettings);
323
- if (spinSpeedSettingsLayer !== null) {
324
- RainMan.globals.handleDisablingButtons?.();
325
- spinSpeedSettingsLayer.style.display = displayValue;
234
+ initSettingsEvents() {
235
+ const messageBox = RainMan.componentRegistry.get(MessageBox.registryName);
236
+ if (this.settingsSpeedButton === null) {
237
+ const speedLevelButton = window.document.getElementsByClassName("speed-level-id");
238
+ if (speedLevelButton.length !== 0) {
239
+ const numberOfReactSpeedButtons = 2;
240
+ for (let i = 0; i < numberOfReactSpeedButtons; i++) {
241
+ this.settingsSpeedButton = speedLevelButton.item(i);
242
+ if (this.settingsSpeedButton) {
243
+ this.settingsSpeedButton.addEventListener("click", () => {
244
+ RainMan.componentRegistry.nextSpeedLevel();
245
+ messageBox.updateIncentiveText(sample(i18n.t("idleMessages", { returnObjects: true })[RainMan.componentRegistry.getSpeedLevel()]));
246
+ });
247
+ }
248
+ }
249
+ }
250
+ }
251
+ if (this.settingsSpeedTurtle === null) {
252
+ this.settingsSpeedTurtle = window.document.getElementById(`${SPEED_PREFIX}${SPEED_LEVELS.slow}`);
253
+ if (this.settingsSpeedTurtle !== null) {
254
+ this.settingsSpeedTurtle.addEventListener("click", () => {
255
+ RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.slow);
256
+ this.enableButtons();
257
+ RainMan.settingsStore.isSpeedModalShown = false;
258
+ messageBox.updateIncentiveText(i18n.t("turtleSelected"));
259
+ });
260
+ }
326
261
  }
262
+ if (this.settingsSpeedRabbit === null) {
263
+ this.settingsSpeedRabbit = window.document.getElementById(`${SPEED_PREFIX}${SPEED_LEVELS.normal}`);
264
+ if (this.settingsSpeedRabbit !== null) {
265
+ this.settingsSpeedRabbit.addEventListener("click", () => {
266
+ RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.normal);
267
+ RainMan.settingsStore.isSpeedModalShown = false;
268
+ this.enableButtons();
269
+ messageBox.updateIncentiveText(i18n.t("rabbitSelected"));
270
+ });
271
+ }
272
+ }
273
+ if (this.settingsSpeedCheetah === null) {
274
+ this.settingsSpeedCheetah = window.document.getElementById(`${SPEED_PREFIX}${SPEED_LEVELS.fast}`);
275
+ if (this.settingsSpeedCheetah !== null) {
276
+ this.settingsSpeedCheetah.addEventListener("click", () => {
277
+ RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.fast);
278
+ this.enableButtons();
279
+ RainMan.settingsStore.isSpeedModalShown = false;
280
+ messageBox.updateIncentiveText(i18n.t("cheetahSelected"));
281
+ });
282
+ }
283
+ }
284
+ document.addEventListener("fullscreenchange", () => {
285
+ if (document.fullscreenElement) {
286
+ RainMan.settingsStore.setFullScreenFlag(true);
287
+ window.dispatchEvent(new Event("resize"));
288
+ }
289
+ else {
290
+ RainMan.settingsStore.setFullScreenFlag(false);
291
+ window.dispatchEvent(new Event("resize"));
292
+ }
293
+ });
327
294
  }
328
295
  /**
329
296
  * Function for handling autostart conformation
@@ -15,6 +15,7 @@ export declare class SoundManagerInstance implements SpeedAdapterInterface<Sound
15
15
  private overrides;
16
16
  readonly speedLevelMapper: SpeedLevelDirectory<SoundOverrides>;
17
17
  private musicCatalogue;
18
+ private currentAmbientTrack;
18
19
  constructor();
19
20
  /**
20
21
  * Function for loading sounds into pixi
@@ -36,6 +37,7 @@ export declare class SoundManagerInstance implements SpeedAdapterInterface<Sound
36
37
  * @returns {void}
37
38
  */
38
39
  stopPlayingFxSounds(): void;
40
+ stopSoundsForPageHide(): void;
39
41
  /**
40
42
  * Function for resuming and pausing sound in game
41
43
  * @public
@@ -57,6 +59,10 @@ export declare class SoundManagerInstance implements SpeedAdapterInterface<Sound
57
59
  * @returns {number} The volume level for the sound track.
58
60
  */
59
61
  getVolumeLevel(soundName: SoundTrack): number;
62
+ private isAmbientTrack;
63
+ private getOppositeAmbientTrack;
64
+ private getSound;
65
+ stopAmbientMusic(): void;
60
66
  /**
61
67
  * Function for resuming all sounds in game
62
68
  * If sound is not playing, it will be skipped
@@ -25,6 +25,7 @@ export class SoundManagerInstance {
25
25
  slow: {}
26
26
  };
27
27
  musicCatalogue = new Map();
28
+ currentAmbientTrack = null;
28
29
  constructor() {
29
30
  this.overrides = this.speedLevelMapper.slow;
30
31
  }
@@ -88,6 +89,20 @@ export class SoundManagerInstance {
88
89
  sound.stop();
89
90
  }
90
91
  }
92
+ stopSoundsForPageHide() {
93
+ const music = this.getSound(SoundTracks.music);
94
+ const freeSpinsMusic = this.getSound(SoundTracks.freeSpinsMusic);
95
+ const isMusicPlaying = Boolean(music?.isPlaying && !music.paused);
96
+ const isFreeSpinsMusicPlaying = Boolean(freeSpinsMusic?.isPlaying && !freeSpinsMusic.paused);
97
+ if (isFreeSpinsMusicPlaying) {
98
+ this.currentAmbientTrack = SoundTracks.freeSpinsMusic;
99
+ }
100
+ else if (isMusicPlaying) {
101
+ this.currentAmbientTrack = SoundTracks.music;
102
+ }
103
+ this.stopAmbientMusic();
104
+ this.stopPlayingFxSounds();
105
+ }
91
106
  /**
92
107
  * Function for resuming and pausing sound in game
93
108
  * @public
@@ -108,24 +123,27 @@ export class SoundManagerInstance {
108
123
  if (!RainMan.settingsStore.isSoundStarted) {
109
124
  return;
110
125
  }
111
- if (!RainMan.settingsStore.shouldPlayFxSounds &&
112
- !(soundName === SoundTracks.music || soundName === SoundTracks.freeSpinsMusic)) {
126
+ if (!RainMan.settingsStore.shouldPlayFxSounds && !this.isAmbientTrack(soundName)) {
113
127
  return;
114
128
  }
115
- const overrideSoundName = this.overrides[soundName];
116
- const sound = overrideSoundName
117
- ? this.musicCatalogue.get(overrideSoundName)
118
- : this.musicCatalogue.get(soundName);
129
+ const sound = this.getSound(soundName);
119
130
  if (!sound) {
120
131
  return;
121
132
  }
122
- if (soundName === "music" && !RainMan.settingsStore.shouldPlayAmbientMusic) {
123
- return;
124
- }
125
- if (soundName === "freeSpinsMusic" &&
126
- !RainMan.settingsStore.isAfterFreeSpinsSummary &&
127
- !RainMan.settingsStore.shouldPlayAmbientMusic) {
128
- return;
133
+ if (this.isAmbientTrack(soundName)) {
134
+ if (!RainMan.settingsStore.shouldPlayAmbientMusic) {
135
+ return;
136
+ }
137
+ const oppositeAmbientTrack = this.getOppositeAmbientTrack(soundName);
138
+ this.stop(oppositeAmbientTrack);
139
+ this.currentAmbientTrack = soundName;
140
+ if (sound.isPlaying && !sound.paused) {
141
+ return;
142
+ }
143
+ if (sound.isPlaying && sound.paused) {
144
+ sound.resume();
145
+ return;
146
+ }
129
147
  }
130
148
  sound.play({
131
149
  singleInstance: true,
@@ -148,6 +166,20 @@ export class SoundManagerInstance {
148
166
  return Number(RainMan.settingsStore.volumeLevel / 100);
149
167
  }
150
168
  }
169
+ isAmbientTrack(soundName) {
170
+ return soundName === SoundTracks.music || soundName === SoundTracks.freeSpinsMusic;
171
+ }
172
+ getOppositeAmbientTrack(soundName) {
173
+ return soundName === SoundTracks.freeSpinsMusic ? SoundTracks.music : SoundTracks.freeSpinsMusic;
174
+ }
175
+ getSound(soundName) {
176
+ const overrideSoundName = this.overrides[soundName];
177
+ return this.musicCatalogue.get(overrideSoundName ?? soundName);
178
+ }
179
+ stopAmbientMusic() {
180
+ this.stop(SoundTracks.music);
181
+ this.stop(SoundTracks.freeSpinsMusic);
182
+ }
151
183
  /**
152
184
  * Function for resuming all sounds in game
153
185
  * If sound is not playing, it will be skipped
@@ -182,17 +214,15 @@ export class SoundManagerInstance {
182
214
  * @returns {void}
183
215
  */
184
216
  restoreAmbientPlayback() {
185
- if (!RainMan.settingsStore.isSoundStarted || !RainMan.settingsStore.shouldPlayAmbientMusic) {
217
+ if (!RainMan.settingsStore.isSoundStarted) {
186
218
  return;
187
219
  }
188
- const ambientTrack = RainMan.settingsStore.isFreeSpinsPlayEnabled
189
- ? SoundTracks.freeSpinsMusic
190
- : SoundTracks.music;
191
- const ambientMusic = this.musicCatalogue.get(ambientTrack);
192
- if (!ambientMusic || ambientMusic.isPlaying) {
220
+ if (!RainMan.settingsStore.shouldPlayAmbientMusic) {
221
+ this.stopAmbientMusic();
193
222
  return;
194
223
  }
195
- ambientMusic.stop();
224
+ const ambientTrack = this.currentAmbientTrack ??
225
+ (RainMan.settingsStore.isFreeSpinsStarted ? SoundTracks.freeSpinsMusic : SoundTracks.music);
196
226
  this.play(ambientTrack);
197
227
  }
198
228
  /**
@@ -281,7 +311,6 @@ export class SoundManagerInstance {
281
311
  if (!isAudioContextRunning) {
282
312
  return false;
283
313
  }
284
- sound.resumeAll();
285
314
  this.restoreAmbientPlayback();
286
315
  return true;
287
316
  }
@@ -1,4 +1,3 @@
1
- import { RainMan } from "../../Rainman";
2
1
  import { DEFAULT_SPEED, SPEED_LEVELS } from "./SpeedLevel";
3
2
  /**
4
3
  * Class for handling speed levels
@@ -59,7 +58,6 @@ export class SpeedLevelHandler {
59
58
  * @returns {void}
60
59
  */
61
60
  nextSpeed() {
62
- RainMan.globals.disableSpeedPopup?.(true);
63
61
  if (this.shouldResetSpeedOptionsLoop()) {
64
62
  this.chosenSpeedLevel = 0;
65
63
  return;
@@ -9,7 +9,7 @@ import { changeResolution, disableMagnifyingGlassOnIOS, getDeviceOrientation, in
9
9
  * @returns {ReactNode} the root element with canvas and react layer
10
10
  */
11
11
  export const setup = () => {
12
- changeResolution(RainMan.settingsStore.HiResolutionFlag);
12
+ changeResolution();
13
13
  resizeCanvas();
14
14
  setupFullscreenForIOS();
15
15
  loadSoundsOnTabChange();
@@ -172,6 +172,7 @@ export class AbstractBuyFreeSpinsPlate extends Container {
172
172
  this.cleanup();
173
173
  this.onContinueCallback();
174
174
  setTimeout(() => {
175
+ RainMan.settingsStore.disableKeyboardShortcuts = false;
175
176
  RainMan.globals.handleSpinLogic?.();
176
177
  }, 1000);
177
178
  }
@@ -549,8 +549,11 @@ export class AbstractMainContainer extends Container {
549
549
  async invokeGambleGame() {
550
550
  if (!this.gambleGameSpineName)
551
551
  return;
552
+ const gambleWinAmount = this._controller?.freeSpinsWin && this._controller.freeSpinsWin > 0
553
+ ? this._controller.freeSpinsWin
554
+ : this._controller.lastWinAmount;
552
555
  await new Promise((resolve) => {
553
- this.gambleGame = new GambleGame(this.gambleGameSpineName, resolve, this._controller.lastWinAmount, this._controller.balance);
556
+ this.gambleGame = new GambleGame(this.gambleGameSpineName, resolve, gambleWinAmount, this._controller.balance);
554
557
  RainMan.settingsStore.isGambleGameActive = true;
555
558
  this.showOverlay();
556
559
  this.addChild(this.gambleGame);
@@ -1,11 +1,10 @@
1
1
  /// <reference types="node" />
2
- import { ApiConfig, ButtonsEventManager, SpinLogic, SymbolId, WinTypeId } from "../application";
2
+ import { ApiConfig, ButtonsEventManager, SpeedLevel, SpinLogic, SymbolId, WinTypeId } from "../application";
3
3
  import { AbstractColumnsContainer, AbstractFrame, AbstractMainContainer } from "../components";
4
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";
8
- import { QuickStopController } from "./QuickStopController";
9
8
  import { SpinDataWithLogic } from "./types";
10
9
  import { UiController } from "./UiController";
11
10
  /**
@@ -42,7 +41,6 @@ export declare abstract class AbstractController<T> {
42
41
  protected invokeFreeSpinPlateAfterWin: boolean;
43
42
  protected invokeFreeSpinSummaryPlateAfterWin: boolean;
44
43
  protected hideFreeSpinsMessageBox: boolean;
45
- protected quickStopController: QuickStopController;
46
44
  protected uiController: UiController;
47
45
  protected mysteryFxSymbol: SymbolId | SymbolId[] | null;
48
46
  protected mysteryFxSymbolMustFormWinningLine: boolean;
@@ -53,12 +51,13 @@ export declare abstract class AbstractController<T> {
53
51
  protected shouldDisableBetButtons: boolean;
54
52
  protected wasAutoplayEnabledBeforeFreeSpin: boolean;
55
53
  protected setSlowerSpeedForFreeSpins: boolean;
56
- protected quickReelsCounter: number;
54
+ protected speedLevelBeforeFreeSpins: SpeedLevel | null;
57
55
  protected buttonPressed: boolean;
58
56
  protected buttonHeldSince: number;
59
57
  shouldStopMobileSpin: boolean;
60
58
  disableMessageBoxChange: boolean;
61
59
  shouldClearQuickReelsStopAfterSpin: boolean;
60
+ freeSpinsWin: Nullable<number>;
62
61
  protected resolveBigWin?: () => void;
63
62
  protected resolveMysteryWin?: () => void;
64
63
  protected resolveBonusWin?: () => void;