pixi-rainman-game-engine 0.3.38 → 0.3.39-beta.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/ComponentRegistry/ComponentRegistry.js +3 -2
- package/dist/ComponentRegistry/types.d.ts +2 -1
- package/dist/ComponentRegistry/types.js +1 -1
- package/dist/Rainman/Rainman.js +1 -3
- package/dist/Rainman/appConfig.js +0 -1
- package/dist/Rainman/types.d.ts +0 -2
- package/dist/SettingsUI/components/CloseModalButton/index.jsx +0 -5
- package/dist/SettingsUI/components/UXSettings/index.jsx +0 -3
- package/dist/SettingsUI/components/index.d.ts +0 -1
- package/dist/SettingsUI/components/index.jsx +0 -1
- package/dist/SettingsUI/index.jsx +1 -6
- package/dist/application/ButtonsEventManager/ButtonsEventManager.d.ts +3 -17
- package/dist/application/ButtonsEventManager/ButtonsEventManager.js +62 -95
- package/dist/application/SoundManager/SoundManager.d.ts +6 -0
- package/dist/application/SoundManager/SoundManager.js +50 -21
- package/dist/application/SpeedState/SpeedLevelHandler.js +0 -2
- package/dist/application/setup.js +1 -1
- package/dist/components/AbstractBuyFreeSpins/AbstractBuyFreeSpinsPlate.js +1 -0
- package/dist/components/AbstractMainContainer/AbstractMainContainer.d.ts +3 -1
- package/dist/components/AbstractMainContainer/AbstractMainContainer.js +19 -5
- package/dist/components/GambleGame/GambleGame.d.ts +0 -2
- package/dist/components/GambleGame/GambleGame.js +0 -2
- package/dist/components/buttons/buttonGroups/MiddleButtons.d.ts +3 -2
- package/dist/components/buttons/buttonGroups/MiddleButtons.js +19 -5
- package/dist/components/buttons/buttonGroups/RightButtonsMobile.d.ts +3 -3
- package/dist/components/buttons/buttonGroups/RightButtonsMobile.js +10 -7
- package/dist/components/buttons/default/SpeedControlButtonMobile.d.ts +22 -0
- package/dist/components/buttons/default/SpeedControlButtonMobile.js +51 -0
- package/dist/components/buttons/default/index.d.ts +1 -0
- package/dist/components/buttons/default/index.js +1 -0
- package/dist/controllers/AbstractController.d.ts +3 -4
- package/dist/controllers/AbstractController.js +43 -42
- package/dist/controllers/UiController.d.ts +0 -1
- package/dist/controllers/UiController.js +7 -4
- package/dist/controllers/index.d.ts +0 -1
- package/dist/controllers/index.js +0 -1
- package/dist/localStorage/localStorage.d.ts +0 -1
- package/dist/localStorage/localStorage.js +0 -1
- package/dist/stores/SettingsStore.d.ts +3 -13
- package/dist/stores/SettingsStore.js +16 -23
- package/dist/utils/common/functions.d.ts +1 -1
- package/dist/utils/common/functions.js +2 -3
- package/dist/utils/common/sound.js +5 -8
- package/package.json +1 -1
- package/dist/SettingsUI/components/SpeedSettingsPopup/index.d.ts +0 -7
- package/dist/SettingsUI/components/SpeedSettingsPopup/index.jsx +0 -27
- package/dist/SettingsUI/components/SpeedSettingsPopup/speedSettingsPopup.css +0 -159
- package/dist/controllers/QuickStopController.d.ts +0 -54
- package/dist/controllers/QuickStopController.js +0 -86
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isIncentiveComponentInterface, isSpeedAdapterInterface, SpeedLevelHandler, TimedIncentiveController } from "../application";
|
|
2
|
-
import { AbstractSymbolsColumn, SpeedControlButton } from "../components";
|
|
2
|
+
import { AbstractSymbolsColumn, SpeedControlButton, SpeedControlButtonMobile } from "../components";
|
|
3
3
|
import { RainMan } from "../Rainman";
|
|
4
4
|
import { openFullscreen } from "../utils";
|
|
5
5
|
/**
|
|
@@ -60,7 +60,8 @@ export class ComponentRegistry {
|
|
|
60
60
|
this.speedLevelHandler.nextSpeed();
|
|
61
61
|
RainMan.settingsStore.setSpeedLevel(this.speedLevelHandler.currentSpeed);
|
|
62
62
|
this.updateAllSpeedAdaptable(RainMan.settingsStore.currentSpeed);
|
|
63
|
-
this.
|
|
63
|
+
this.getIfExists(SpeedControlButton.registryName)?.forceTextureUpdate();
|
|
64
|
+
this.getIfExists(SpeedControlButtonMobile.registryName)?.forceTextureUpdate();
|
|
64
65
|
}
|
|
65
66
|
/**
|
|
66
67
|
* Getter for current speed level
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbstractColumnsContainer, AbstractFrame, AbstractInnerFrame, AutoplayButton, Background, BUTTONS, COMPONENTS, FreeSpinButton, GambleButton, InfoButton, MessageBox, MoreButton, NegButton, PlusButton, RefreshButton, SpeedControlButton, StylefulUpdatableText, TakeButton, UpdatableTextComponent, UpdatableValueComponent, VolumeButton } from "../components";
|
|
1
|
+
import { AbstractColumnsContainer, AbstractFrame, AbstractInnerFrame, AutoplayButton, Background, BUTTONS, COMPONENTS, FreeSpinButton, GambleButton, InfoButton, MessageBox, MoreButton, NegButton, PlusButton, RefreshButton, SpeedControlButton, SpeedControlButtonMobile, StylefulUpdatableText, TakeButton, UpdatableTextComponent, UpdatableValueComponent, VolumeButton } from "../components";
|
|
2
2
|
/**
|
|
3
3
|
* RegistryMap is a map of all components that are registered in the ComponentRegistry.
|
|
4
4
|
* It is used to type-check the components that are registered in the ComponentRegistry.
|
|
@@ -11,6 +11,7 @@ export interface RegistryMap {
|
|
|
11
11
|
[MessageBox.gamePaysTextRegistryName]: UpdatableTextComponent;
|
|
12
12
|
[MessageBox.registryName]: MessageBox;
|
|
13
13
|
[SpeedControlButton.registryName]: SpeedControlButton;
|
|
14
|
+
[SpeedControlButtonMobile.registryName]: SpeedControlButtonMobile;
|
|
14
15
|
[Background.registryName]: Background;
|
|
15
16
|
[VolumeButton.registryName]: VolumeButton;
|
|
16
17
|
[AutoplayButton.registryName]: AutoplayButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import { AbstractColumnsContainer, AbstractFrame, AbstractInnerFrame, AutoplayButton, Background, BUTTONS, COMPONENTS, FreeSpinButton, InfoButton, MessageBox, MoreButton, NegButton, PlusButton, RefreshButton, SpeedControlButton, VolumeButton } from "../components";
|
|
1
|
+
import { AbstractColumnsContainer, AbstractFrame, AbstractInnerFrame, AutoplayButton, Background, BUTTONS, COMPONENTS, FreeSpinButton, InfoButton, MessageBox, MoreButton, NegButton, PlusButton, RefreshButton, SpeedControlButton, SpeedControlButtonMobile, VolumeButton } from "../components";
|
package/dist/Rainman/Rainman.js
CHANGED
|
@@ -37,7 +37,7 @@ export class RainMan {
|
|
|
37
37
|
isSuperBonusGameEnabled: false
|
|
38
38
|
};
|
|
39
39
|
this.initLocalStorageSettings();
|
|
40
|
-
RainMan.settingsStore.
|
|
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
|
}
|
package/dist/Rainman/types.d.ts
CHANGED
|
@@ -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,
|
|
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
|
-
*
|
|
138
|
-
* This
|
|
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
|
-
|
|
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
|
-
*
|
|
314
|
-
* This
|
|
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
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
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
|
|
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
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
|
217
|
+
if (!RainMan.settingsStore.isSoundStarted) {
|
|
186
218
|
return;
|
|
187
219
|
}
|
|
188
|
-
|
|
189
|
-
|
|
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
|
-
|
|
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(
|
|
12
|
+
changeResolution();
|
|
13
13
|
resizeCanvas();
|
|
14
14
|
setupFullscreenForIOS();
|
|
15
15
|
loadSoundsOnTabChange();
|
|
@@ -6,7 +6,7 @@ import { RainMan } from "../../Rainman";
|
|
|
6
6
|
import { Nullable, PromiseResolverType } from "../../utils";
|
|
7
7
|
import { BigWinContainer, MysteryWinContainer, UpdatableSpineContainer } from "../../winComponents";
|
|
8
8
|
import { AbstractFreeSpinContainer } from "../AbstractFreeSpinContainer";
|
|
9
|
-
import { LeftButtons, LeftButtonsLandscape, LeftButtonsMobile, MiddleButtons, RightButtons, RightButtonsLandscape, RightButtonsMobile } from "../buttons";
|
|
9
|
+
import { LeftButtons, LeftButtonsLandscape, LeftButtonsMobile, MiddleButtons, RightButtons, RightButtonsLandscape, RightButtonsMobile, SpeedControlButtonMobile } from "../buttons";
|
|
10
10
|
import { FreeSpinButton, Logo, ResponsiveContainer } from "../common";
|
|
11
11
|
import { IResizableContainer } from "../common/IResizableContainer";
|
|
12
12
|
import { AbstractFrame } from "../frame";
|
|
@@ -34,6 +34,7 @@ export declare abstract class AbstractMainContainer extends Container {
|
|
|
34
34
|
static readonly registryName = "mainContainer";
|
|
35
35
|
messageBox: MessageBox;
|
|
36
36
|
protected bigWinContainer: Nullable<UpdatableSpineContainer> | BigWinContainer;
|
|
37
|
+
protected readonly mobileSpeedButton: SpeedControlButtonMobile;
|
|
37
38
|
protected mysteryWinContainer: Nullable<UpdatableSpineContainer> | MysteryWinContainer;
|
|
38
39
|
protected bonusWinContainer: Nullable<UpdatableSpineContainer>;
|
|
39
40
|
protected superBonusWinContainer: Nullable<UpdatableSpineContainer>;
|
|
@@ -75,6 +76,7 @@ export declare abstract class AbstractMainContainer extends Container {
|
|
|
75
76
|
* @returns {Promise<void>} - A promise that resolves when the animation is complete.
|
|
76
77
|
*/
|
|
77
78
|
invokeMysteryWinPlate(_animationName: string, _popupAnimation: string, _winType: WinTypeId, _amount: number, _isAdditionalFreeSpins: boolean): Promise<void>;
|
|
79
|
+
protected attachMobileSpeedButton(parent: Container): void;
|
|
78
80
|
/**
|
|
79
81
|
* This function initializes the spines that should be paused when the battery saver is on
|
|
80
82
|
* @protected
|