pixi-rainman-game-engine 0.2.15 → 0.2.16-b
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/SettingsUI/components/AutoplaySettings/index.jsx +2 -6
- package/dist/SettingsUI/components/Bet/BetControls.jsx +2 -2
- package/dist/application/ButtonsEventManager/ButtonsEventManager.js +5 -2
- package/dist/application/SoundManager/SoundManager.js +14 -2
- package/dist/application/SoundManager/types.d.ts +8 -0
- package/dist/application/setup.d.ts +1 -1
- package/dist/application/setup.js +1 -1
- package/dist/components/AbstractMainContainer/AbstractMainContainer.js +4 -0
- package/dist/components/frame/AbstractColumnsContainer.d.ts +7 -7
- package/dist/components/frame/AbstractColumnsContainer.js +7 -7
- package/dist/components/messageBox/MessageBox.js +1 -0
- package/dist/connectivity/ConnectionWrapper.d.ts +6 -8
- package/dist/connectivity/ConnectionWrapper.js +6 -8
- package/dist/controllers/AbstractController.d.ts +28 -3
- package/dist/controllers/AbstractController.js +38 -9
- package/package.json +1 -1
|
@@ -49,7 +49,7 @@ export const AutoplaySettings = observer(() => {
|
|
|
49
49
|
useEffect(() => {
|
|
50
50
|
updateLimitsBounds(initialAutoSpinCount);
|
|
51
51
|
}, []);
|
|
52
|
-
const { singleWinExceeds, balancedIncreased, balancedDecreased, howManyAutoSpinsLeft, infinitySpinsEnabled, setSingleWinExceeds, setBalancedIncreased, setBalancedDecreased, setAutoSpinsCount, flipInfinitySpinsFlag, resetAutoplaySettings,
|
|
52
|
+
const { singleWinExceeds, balancedIncreased, balancedDecreased, howManyAutoSpinsLeft, infinitySpinsEnabled, setSingleWinExceeds, setBalancedIncreased, setBalancedDecreased, setAutoSpinsCount, flipInfinitySpinsFlag, resetAutoplaySettings, } = settingStore;
|
|
53
53
|
return (<div className="autoplay-settings">
|
|
54
54
|
<CloseModalButton layerId={UI_ITEMS.autoplay}/>
|
|
55
55
|
<div className="autoplay-settings__title">
|
|
@@ -110,11 +110,7 @@ export const AutoplaySettings = observer(() => {
|
|
|
110
110
|
}}>
|
|
111
111
|
<p>{i18next.t("cancel")}</p>
|
|
112
112
|
</button>
|
|
113
|
-
<button id={COMPONENTS.autoSpinConfirm}
|
|
114
|
-
if (isAutoplayEnabled)
|
|
115
|
-
return;
|
|
116
|
-
settingStore.decreaseAutoSpinsCount();
|
|
117
|
-
}} className="autoplay-settings__confirmation-button">
|
|
113
|
+
<button id={COMPONENTS.autoSpinConfirm} className="autoplay-settings__confirmation-button">
|
|
118
114
|
<p>{i18next.t("confirm")}</p>
|
|
119
115
|
</button>
|
|
120
116
|
</div>
|
|
@@ -16,13 +16,13 @@ export const BetControls = observer(() => {
|
|
|
16
16
|
return (<div className="bet-container">
|
|
17
17
|
<h2>{i18next.t("totalBet")}</h2>
|
|
18
18
|
<div className="bet-container__controls">
|
|
19
|
-
<button disabled={settingStore.betChangeDisabled} onClick={() => onClick("decrease")} className="bet-container__button" name="bet-minus">
|
|
19
|
+
<button disabled={settingStore.isFreeSpinsPlayEnabled || settingStore.betChangeDisabled} onClick={() => onClick("decrease")} className="bet-container__button" name="bet-minus">
|
|
20
20
|
-
|
|
21
21
|
</button>
|
|
22
22
|
<div className="bet-container__value">
|
|
23
23
|
<p>{settingStore.betText}</p>
|
|
24
24
|
</div>
|
|
25
|
-
<button disabled={settingStore.betChangeDisabled} onClick={() => onClick("increase")} className="bet-container__button" name="bet-plus">
|
|
25
|
+
<button disabled={settingStore.isFreeSpinsPlayEnabled || settingStore.betChangeDisabled} onClick={() => onClick("increase")} className="bet-container__button" name="bet-plus">
|
|
26
26
|
+
|
|
27
27
|
</button>
|
|
28
28
|
</div>
|
|
@@ -3,7 +3,7 @@ import { sample } from "lodash";
|
|
|
3
3
|
import { SoundManager } from "../../application";
|
|
4
4
|
import { AutoplayButton, Background, BUTTONS, COMPONENTS, FreeSpinButton, MessageBox, SpeedControlButton, VolumeButton, } from "../../components";
|
|
5
5
|
import { RainMan } from "../../Rainman";
|
|
6
|
-
import { allUiItems, hideLayerIfPresent, UI_ITEMS } from "../../utils";
|
|
6
|
+
import { allUiItems, hideLayerIfPresent, UI_ITEMS, wait } from "../../utils";
|
|
7
7
|
import { SPEED_LEVELS } from "../SpeedState";
|
|
8
8
|
/** @ignore */
|
|
9
9
|
export const SPEED_PREFIX = "speed-";
|
|
@@ -130,7 +130,9 @@ export class ButtonsEventManager {
|
|
|
130
130
|
const animatedBackground = RainMan.componentRegistry.get(Background.registryName);
|
|
131
131
|
animatedBackground.eventMode = "static";
|
|
132
132
|
animatedBackground.addListener("pointerdown", () => {
|
|
133
|
-
if (hideLayerIfPresent() &&
|
|
133
|
+
if (hideLayerIfPresent() &&
|
|
134
|
+
!RainMan.settingsStore.isAutoplayEnabled &&
|
|
135
|
+
!RainMan.settingsStore.isFreeSpinsPlayEnabled) {
|
|
134
136
|
this.enableButtons();
|
|
135
137
|
}
|
|
136
138
|
});
|
|
@@ -270,6 +272,7 @@ export class ButtonsEventManager {
|
|
|
270
272
|
confirmAutoplayButton.addEventListener("click", () => {
|
|
271
273
|
RainMan.settingsStore.handleModalInvocation?.(UI_ITEMS.autoplay);
|
|
272
274
|
confirmAutoplayButtonCallback();
|
|
275
|
+
wait(1).then(() => RainMan.settingsStore.decreaseAutoSpinsCount());
|
|
273
276
|
});
|
|
274
277
|
}
|
|
275
278
|
}
|
|
@@ -42,6 +42,7 @@ export class SoundManagerInstance {
|
|
|
42
42
|
preload: true,
|
|
43
43
|
loaded: () => resolve(),
|
|
44
44
|
});
|
|
45
|
+
sound.name = soundName;
|
|
45
46
|
this.musicCatalogue.set(soundName, sound);
|
|
46
47
|
}));
|
|
47
48
|
}
|
|
@@ -52,7 +53,14 @@ export class SoundManagerInstance {
|
|
|
52
53
|
* @param {number} volumeLevel - volume level from 0-1
|
|
53
54
|
*/
|
|
54
55
|
setVolume(volumeLevel) {
|
|
55
|
-
this.musicCatalogue.forEach((sound) =>
|
|
56
|
+
this.musicCatalogue.forEach((sound) => {
|
|
57
|
+
if (sound?.name === "music") {
|
|
58
|
+
sound.volume = volumeLevel * 0.5;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
sound.volume = volumeLevel;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
56
64
|
}
|
|
57
65
|
/**
|
|
58
66
|
* Function for stopping sound effect in game
|
|
@@ -87,7 +95,11 @@ export class SoundManagerInstance {
|
|
|
87
95
|
return;
|
|
88
96
|
if (soundName === "music" && sound.isPlaying && !RainMan.settingsStore.ambientMusicFlag)
|
|
89
97
|
return;
|
|
90
|
-
sound.play({
|
|
98
|
+
sound.play({
|
|
99
|
+
loop: soundsToLoop.includes(soundName),
|
|
100
|
+
singleInstance: true,
|
|
101
|
+
volume: soundName === "music" ? 0.5 : 1,
|
|
102
|
+
});
|
|
91
103
|
}
|
|
92
104
|
/**
|
|
93
105
|
* Function for resuming all sounds in game
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Sound } from "@pixi/sound";
|
|
1
2
|
/**
|
|
2
3
|
* Object for mapping SoundTracks to appropriate asset.
|
|
3
4
|
* All properties must be set, if no sound should be played set empty string
|
|
@@ -88,3 +89,10 @@ export type GameSoundAssets = Record<SoundTrack, string>;
|
|
|
88
89
|
* @typedef {SoundOverrides}
|
|
89
90
|
*/
|
|
90
91
|
export type SoundOverrides = Partial<Record<SoundTrack, SoundTrack>>;
|
|
92
|
+
/**
|
|
93
|
+
* Type for overriding sound tracks in game, extended with sound name
|
|
94
|
+
* @typedef {NamedSound}
|
|
95
|
+
*/
|
|
96
|
+
export type NamedSound = Sound & {
|
|
97
|
+
name: string;
|
|
98
|
+
};
|
|
@@ -7,7 +7,7 @@ import { changeResolution, disableMagnifyingGlassOnIOS, getDeviceOrientation, in
|
|
|
7
7
|
*
|
|
8
8
|
* Note: This should be done once at the lifecycle of the game
|
|
9
9
|
* Function creates also the react layer
|
|
10
|
-
* @returns {ReactNode}
|
|
10
|
+
* @returns {ReactNode} the root element with canvas and react layer
|
|
11
11
|
*/
|
|
12
12
|
export const setup = () => {
|
|
13
13
|
changeResolution(RainMan.settingsStore.HiResolutionFlag);
|
|
@@ -405,6 +405,10 @@ export class AbstractMainContainer extends Container {
|
|
|
405
405
|
this.initComponentsForScreenRatio();
|
|
406
406
|
this.resizeDependentComponents();
|
|
407
407
|
this.repositionComponentsForScreenRatio();
|
|
408
|
+
if (RainMan.settingsStore.isFreeSpinsPlayEnabled) {
|
|
409
|
+
RainMan.componentRegistry.get(BUTTONS.plus).flipDisabledFlag(true);
|
|
410
|
+
RainMan.componentRegistry.get(BUTTONS.neg).flipDisabledFlag(true);
|
|
411
|
+
}
|
|
408
412
|
}
|
|
409
413
|
createLeftButtons() {
|
|
410
414
|
return new LeftButtons();
|
|
@@ -39,9 +39,9 @@ export declare abstract class AbstractColumnsContainer extends Container impleme
|
|
|
39
39
|
/**
|
|
40
40
|
* This function is responsible for setting symbols in columns
|
|
41
41
|
* @public
|
|
42
|
-
* @param {SymbolReels} finalSymbolReels
|
|
43
|
-
* @param {(value: void | PromiseLike<void>) => void} afterSpinResolver
|
|
44
|
-
* @param {number[]} indexesOfReelsToExtendSpinningTime
|
|
42
|
+
* @param {SymbolReels} finalSymbolReels final symbols in columns
|
|
43
|
+
* @param {(value: void | PromiseLike<void>) => void} afterSpinResolver resolver for after spin
|
|
44
|
+
* @param {number[]} indexesOfReelsToExtendSpinningTime indexes of reels to extend spinning time
|
|
45
45
|
* @returns {Promise<void>}
|
|
46
46
|
*/
|
|
47
47
|
configBlindSpin(finalSymbolReels: SymbolReels, afterSpinResolver: (value: void | PromiseLike<void>) => void, indexesOfReelsToExtendSpinningTime: number[]): Promise<void>;
|
|
@@ -52,10 +52,10 @@ export declare abstract class AbstractColumnsContainer extends Container impleme
|
|
|
52
52
|
/**
|
|
53
53
|
* Function for playing animation of streak
|
|
54
54
|
* @public
|
|
55
|
-
* @param {StreakReelsIndexes} streak
|
|
56
|
-
* @param {number} reelsQuantity
|
|
57
|
-
* @param {number}
|
|
58
|
-
* @param {string}
|
|
55
|
+
* @param {StreakReelsIndexes} streak streak to play
|
|
56
|
+
* @param {number} reelsQuantity number of reels
|
|
57
|
+
* @param {number} multiplier multiplier for animation
|
|
58
|
+
* @param {string} suffix suffix for animation
|
|
59
59
|
* @returns {Promise<void>}
|
|
60
60
|
*/
|
|
61
61
|
playStreak(streak: StreakReelsIndexes, reelsQuantity: number, multiplier?: number, suffix?: string): Promise<void>;
|
|
@@ -68,9 +68,9 @@ export class AbstractColumnsContainer extends Container {
|
|
|
68
68
|
/**
|
|
69
69
|
* This function is responsible for setting symbols in columns
|
|
70
70
|
* @public
|
|
71
|
-
* @param {SymbolReels} finalSymbolReels
|
|
72
|
-
* @param {(value: void | PromiseLike<void>) => void} afterSpinResolver
|
|
73
|
-
* @param {number[]} indexesOfReelsToExtendSpinningTime
|
|
71
|
+
* @param {SymbolReels} finalSymbolReels final symbols in columns
|
|
72
|
+
* @param {(value: void | PromiseLike<void>) => void} afterSpinResolver resolver for after spin
|
|
73
|
+
* @param {number[]} indexesOfReelsToExtendSpinningTime indexes of reels to extend spinning time
|
|
74
74
|
* @returns {Promise<void>}
|
|
75
75
|
*/
|
|
76
76
|
async configBlindSpin(finalSymbolReels, afterSpinResolver, indexesOfReelsToExtendSpinningTime) {
|
|
@@ -168,10 +168,10 @@ export class AbstractColumnsContainer extends Container {
|
|
|
168
168
|
/**
|
|
169
169
|
* Function for playing animation of streak
|
|
170
170
|
* @public
|
|
171
|
-
* @param {StreakReelsIndexes} streak
|
|
172
|
-
* @param {number} reelsQuantity
|
|
173
|
-
* @param {number}
|
|
174
|
-
* @param {string}
|
|
171
|
+
* @param {StreakReelsIndexes} streak streak to play
|
|
172
|
+
* @param {number} reelsQuantity number of reels
|
|
173
|
+
* @param {number} multiplier multiplier for animation
|
|
174
|
+
* @param {string} suffix suffix for animation
|
|
175
175
|
* @returns {Promise<void>}
|
|
176
176
|
*/
|
|
177
177
|
async playStreak(streak, reelsQuantity, multiplier = 1, suffix = "") {
|
|
@@ -144,6 +144,7 @@ export class MessageBox extends Container {
|
|
|
144
144
|
if (this.autoSpinShown || this.freeSpinShown)
|
|
145
145
|
return;
|
|
146
146
|
this.autoSpinShown = true;
|
|
147
|
+
this.autoSpinText.set(RainMan.settingsStore.howManyAutoSpinsLeft + 1);
|
|
147
148
|
this.centerTextOnX(this.autoSpinText);
|
|
148
149
|
this.addChild(this.autoSpinText);
|
|
149
150
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ExtraDataRequest, GambleCardColor, GambleDataInterface, InitDataInterface, ServerMessage, SpinData, SubscribableConnectionWrapper } from "../connectivity";
|
|
2
2
|
/**
|
|
3
3
|
* Class for managing connection to the server via websockets
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
4
|
*/
|
|
7
5
|
export declare class ConnectionWrapper implements SubscribableConnectionWrapper {
|
|
8
6
|
private webSocketConnection;
|
|
@@ -31,18 +29,18 @@ export declare class ConnectionWrapper implements SubscribableConnectionWrapper
|
|
|
31
29
|
private transformFreeSpinData;
|
|
32
30
|
/**
|
|
33
31
|
* Method for fetching spin data from the server
|
|
34
|
-
* @param {number} roundNumber
|
|
35
|
-
* @param {number} bet
|
|
36
|
-
* @param {ExtraDataRequest} extra_data
|
|
37
|
-
* @returns {SpinData}
|
|
32
|
+
* @param {number} roundNumber round number
|
|
33
|
+
* @param {number} bet bet amount
|
|
34
|
+
* @param {ExtraDataRequest} extra_data extra data for the spin
|
|
35
|
+
* @returns {SpinData} spin data
|
|
38
36
|
*/
|
|
39
37
|
fetchSpinData(roundNumber: number, bet: number, extra_data?: ExtraDataRequest): Promise<SpinData>;
|
|
40
38
|
fetchGambleData(roundNumber: number, bet: number, choice: GambleCardColor): Promise<GambleDataInterface>;
|
|
41
39
|
private getFreshWsInstance;
|
|
42
40
|
/**
|
|
43
41
|
* Method for fetching data from the server
|
|
44
|
-
* @param {ServerRequest} request
|
|
45
|
-
* @returns {ServerMessage}
|
|
42
|
+
* @param {ServerRequest} request request for the server
|
|
43
|
+
* @returns {ServerMessage} server response
|
|
46
44
|
*/
|
|
47
45
|
private fetch;
|
|
48
46
|
getMessageHistory(): ServerMessage[];
|
|
@@ -7,8 +7,6 @@ import { logError, logInfo, logWarn } from "../utils";
|
|
|
7
7
|
const overrideMap = new Map();
|
|
8
8
|
/**
|
|
9
9
|
* Class for managing connection to the server via websockets
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
10
|
*/
|
|
13
11
|
export class ConnectionWrapper {
|
|
14
12
|
webSocketConnection;
|
|
@@ -110,10 +108,10 @@ export class ConnectionWrapper {
|
|
|
110
108
|
}
|
|
111
109
|
/**
|
|
112
110
|
* Method for fetching spin data from the server
|
|
113
|
-
* @param {number} roundNumber
|
|
114
|
-
* @param {number} bet
|
|
115
|
-
* @param {ExtraDataRequest} extra_data
|
|
116
|
-
* @returns {SpinData}
|
|
111
|
+
* @param {number} roundNumber round number
|
|
112
|
+
* @param {number} bet bet amount
|
|
113
|
+
* @param {ExtraDataRequest} extra_data extra data for the spin
|
|
114
|
+
* @returns {SpinData} spin data
|
|
117
115
|
*/
|
|
118
116
|
async fetchSpinData(roundNumber, bet, extra_data = {}) {
|
|
119
117
|
if (typeof this.config?.token === "undefined") {
|
|
@@ -149,8 +147,8 @@ export class ConnectionWrapper {
|
|
|
149
147
|
}
|
|
150
148
|
/**
|
|
151
149
|
* Method for fetching data from the server
|
|
152
|
-
* @param {ServerRequest} request
|
|
153
|
-
* @returns {ServerMessage}
|
|
150
|
+
* @param {ServerRequest} request request for the server
|
|
151
|
+
* @returns {ServerMessage} server response
|
|
154
152
|
*/
|
|
155
153
|
async fetch(request) {
|
|
156
154
|
if (this.fetchInProgress) {
|
|
@@ -62,6 +62,7 @@ export declare abstract class AbstractController<T> {
|
|
|
62
62
|
reinitializeAllButtons(): void;
|
|
63
63
|
private setupSpaceOrEnterListener;
|
|
64
64
|
disableBetButtons(shouldBeDisabled: boolean): void;
|
|
65
|
+
disableAutoplayButton(shouldBeDisabled: boolean): void;
|
|
65
66
|
private disableSpeedButton;
|
|
66
67
|
disableInformationButtons(shouldBeDisabled: boolean): void;
|
|
67
68
|
protected handleDisablingButtons(disabled?: boolean): void;
|
|
@@ -153,8 +154,18 @@ export declare abstract class AbstractController<T> {
|
|
|
153
154
|
* @returns {boolean} can we skip actions
|
|
154
155
|
*/
|
|
155
156
|
protected canSkipActions(): boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Function to get additional actions on spin start
|
|
159
|
+
*/
|
|
156
160
|
protected onSpinningStart(): Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* Function to perform additional actions on spin end
|
|
163
|
+
* @param {SpinLogic} _spinLogic spin logic
|
|
164
|
+
*/
|
|
157
165
|
protected onSpinningEnd(_spinLogic: SpinLogic): Promise<void>;
|
|
166
|
+
/**
|
|
167
|
+
* Function to perform additional actions after spin
|
|
168
|
+
*/
|
|
158
169
|
protected performActionsAfterSpin(): Promise<void>;
|
|
159
170
|
protected gambleGameEnabler(winAmount: number): void;
|
|
160
171
|
/**
|
|
@@ -176,8 +187,8 @@ export declare abstract class AbstractController<T> {
|
|
|
176
187
|
* ```ts
|
|
177
188
|
* this.mainContainer.invokeFreeSpinPlate(numberOfFreeSpins, isAdditionalFreeSpin);
|
|
178
189
|
* ```
|
|
179
|
-
* @param numberOfFreeSpins - number of free spins, if not provided, `RainMan.settingsStore.totalNumberOfFreeSpins` will be used
|
|
180
|
-
* @param isAdditionalFreeSpin - flag for displaying additional free spins
|
|
190
|
+
* @param {number | undefined} numberOfFreeSpins - number of free spins, if not provided, `RainMan.settingsStore.totalNumberOfFreeSpins` will be used
|
|
191
|
+
* @param {boolean} isAdditionalFreeSpin - flag for displaying additional free spins
|
|
181
192
|
*/
|
|
182
193
|
private handleFreeSpinPlateInvocation;
|
|
183
194
|
/**
|
|
@@ -203,7 +214,7 @@ export declare abstract class AbstractController<T> {
|
|
|
203
214
|
*/
|
|
204
215
|
protected countBonusWin(winAmount?: number): Promise<void>;
|
|
205
216
|
/**
|
|
206
|
-
*
|
|
217
|
+
* Function for displaying super bonus win. Invoking that by `this.mainContainer.invokeSuperBonusWin();` and destroying it by `this.mainContainer.destroySuperBonusWin();`
|
|
207
218
|
* @param {number | undefined} winAmount - amount of win, if not provided `RainMan.settingsStore.cumulativeWinAmount` will be used
|
|
208
219
|
*/
|
|
209
220
|
protected countSuperBonusWin(winAmount?: number): Promise<void>;
|
|
@@ -227,7 +238,16 @@ export declare abstract class AbstractController<T> {
|
|
|
227
238
|
* @returns {SymbolId[]} - symbols from streak
|
|
228
239
|
*/
|
|
229
240
|
protected getSymbolIdsForStreak(streak: StreakReelsIndexes): SymbolId[];
|
|
241
|
+
/**
|
|
242
|
+
* Function for updating win and balance values
|
|
243
|
+
* @param {number} value - value to set
|
|
244
|
+
* @returns {void}
|
|
245
|
+
*/
|
|
230
246
|
updateUiValues(value: number): void;
|
|
247
|
+
/**
|
|
248
|
+
* Function for updating gamble values
|
|
249
|
+
* @param {number} value value to set
|
|
250
|
+
*/
|
|
231
251
|
updateGambleValues(value: number): void;
|
|
232
252
|
/**
|
|
233
253
|
* Function for composing win actions queue based on wins and transformations from {@link transformationTypes} and {@link PossibleWins}
|
|
@@ -246,5 +266,10 @@ export declare abstract class AbstractController<T> {
|
|
|
246
266
|
* Function for looping win actions queue, after initial play
|
|
247
267
|
*/
|
|
248
268
|
protected loopWinActionsQueue(): Promise<void>;
|
|
269
|
+
/**
|
|
270
|
+
* Function for getting wins from {@link spinLogic}
|
|
271
|
+
* @param {SpinLogic} spinLogic spin logic
|
|
272
|
+
* @returns {FreeSpinWin[]} - array of free spins wins
|
|
273
|
+
*/
|
|
249
274
|
getFreeSpinsWins(spinLogic: SpinLogic): FreeSpinWin[];
|
|
250
275
|
}
|
|
@@ -82,6 +82,8 @@ export class AbstractController {
|
|
|
82
82
|
this.buttonsEventManager.initFreeSpinModal();
|
|
83
83
|
this.buttonsEventManager.setUpUIElementsInteractivity();
|
|
84
84
|
this.buttonsEventManager.setConfirmAutoplayButton(() => {
|
|
85
|
+
if (RainMan.settingsStore.isAutoplayEnabled)
|
|
86
|
+
return;
|
|
85
87
|
RainMan.settingsStore.setAutoPlayEnabledFlag(true);
|
|
86
88
|
RainMan.componentRegistry.get(AutoplayButton.registryName).activate(true);
|
|
87
89
|
RainMan.componentRegistry.get(BUTTONS.plus).flipDisabledFlag(true);
|
|
@@ -132,11 +134,11 @@ export class AbstractController {
|
|
|
132
134
|
RainMan.componentRegistry.get(BUTTONS.plus),
|
|
133
135
|
RainMan.componentRegistry.get(BUTTONS.neg),
|
|
134
136
|
];
|
|
135
|
-
if (getDeviceOrientation().includes("mobile") && !RainMan.settingsStore.isAutoplayEnabled) {
|
|
136
|
-
buttonsToChange.push(RainMan.componentRegistry.get(AutoplayButton.registryName));
|
|
137
|
-
}
|
|
138
137
|
buttonsToChange.forEach((button) => button.flipDisabledFlag(shouldBeDisabled));
|
|
139
138
|
}
|
|
139
|
+
disableAutoplayButton(shouldBeDisabled) {
|
|
140
|
+
RainMan.componentRegistry.get(AutoplayButton.registryName).flipDisabledFlag(shouldBeDisabled);
|
|
141
|
+
}
|
|
140
142
|
disableSpeedButton(shouldBeDisabled) {
|
|
141
143
|
RainMan.componentRegistry.get(SpeedControlButton.registryName).flipDisabledFlag(shouldBeDisabled);
|
|
142
144
|
}
|
|
@@ -488,9 +490,8 @@ export class AbstractController {
|
|
|
488
490
|
RainMan.settingsStore.decreaseAutoSpinsCount();
|
|
489
491
|
}
|
|
490
492
|
if (RainMan.settingsStore.howManyAutoSpinsLeft === 0) {
|
|
491
|
-
this.uiController.messageBox.showIncentiveText();
|
|
492
|
-
RainMan.globals.shouldShowModals = false;
|
|
493
493
|
this.disableAutoplay();
|
|
494
|
+
RainMan.globals.shouldShowModals = false;
|
|
494
495
|
}
|
|
495
496
|
this.changeGamePhase(gamePhases.IDLE);
|
|
496
497
|
return this.throttledSpin();
|
|
@@ -506,8 +507,8 @@ export class AbstractController {
|
|
|
506
507
|
* Function disabling autoplay functionality
|
|
507
508
|
*/
|
|
508
509
|
disableAutoplay() {
|
|
509
|
-
RainMan.componentRegistry.get(AutoplayButton.registryName).activate(false);
|
|
510
510
|
RainMan.componentRegistry.get(MessageBox.registryName).hideAutoSpinText();
|
|
511
|
+
RainMan.componentRegistry.get(AutoplayButton.registryName).activate(false);
|
|
511
512
|
RainMan.componentRegistry.get(BUTTONS.plus).flipDisabledFlag(false);
|
|
512
513
|
RainMan.componentRegistry.get(BUTTONS.neg).flipDisabledFlag(false);
|
|
513
514
|
RainMan.settingsStore.resetAutoplaySettings();
|
|
@@ -560,8 +561,18 @@ export class AbstractController {
|
|
|
560
561
|
canSkipActions() {
|
|
561
562
|
return !this.isPlayingUnskippableStreak;
|
|
562
563
|
}
|
|
564
|
+
/**
|
|
565
|
+
* Function to get additional actions on spin start
|
|
566
|
+
*/
|
|
563
567
|
async onSpinningStart() { }
|
|
568
|
+
/**
|
|
569
|
+
* Function to perform additional actions on spin end
|
|
570
|
+
* @param {SpinLogic} _spinLogic spin logic
|
|
571
|
+
*/
|
|
564
572
|
async onSpinningEnd(_spinLogic) { }
|
|
573
|
+
/**
|
|
574
|
+
* Function to perform additional actions after spin
|
|
575
|
+
*/
|
|
565
576
|
async performActionsAfterSpin() { }
|
|
566
577
|
gambleGameEnabler(winAmount) {
|
|
567
578
|
if (RainMan.componentRegistry.has(BUTTONS.gamble) && !RainMan.settingsStore.gambleGameUsed) {
|
|
@@ -688,6 +699,7 @@ export class AbstractController {
|
|
|
688
699
|
this.mainContainer.destroyBigWin();
|
|
689
700
|
this.columnsContainer.resetPlayedSounds();
|
|
690
701
|
if (this.invokeFreeSpinPlateAfterWin || RainMan.settingsStore.isFreeSpinsBought) {
|
|
702
|
+
this.uiController.messageBox.hideCurrentWinText();
|
|
691
703
|
this.mainContainer.messageBox.hideFreeSpinText();
|
|
692
704
|
hideLayerIfPresent();
|
|
693
705
|
const freeSpinWins = this.getFreeSpinsWins(spinLogic);
|
|
@@ -710,6 +722,9 @@ export class AbstractController {
|
|
|
710
722
|
}
|
|
711
723
|
RainMan.settingsStore.setRoundNumber(this.roundNumber);
|
|
712
724
|
this.handleDisablingButtons();
|
|
725
|
+
if (RainMan.settingsStore.isFreeSpinsPlayEnabled) {
|
|
726
|
+
this.disableAutoplayButton(false);
|
|
727
|
+
}
|
|
713
728
|
RainMan.settingsStore.setModalsAvailability(true);
|
|
714
729
|
await this.performActionsAfterSpin();
|
|
715
730
|
RainMan.globals.shouldShowModals = true;
|
|
@@ -719,8 +734,8 @@ export class AbstractController {
|
|
|
719
734
|
* ```ts
|
|
720
735
|
* this.mainContainer.invokeFreeSpinPlate(numberOfFreeSpins, isAdditionalFreeSpin);
|
|
721
736
|
* ```
|
|
722
|
-
* @param numberOfFreeSpins - number of free spins, if not provided, `RainMan.settingsStore.totalNumberOfFreeSpins` will be used
|
|
723
|
-
* @param isAdditionalFreeSpin - flag for displaying additional free spins
|
|
737
|
+
* @param {number | undefined} numberOfFreeSpins - number of free spins, if not provided, `RainMan.settingsStore.totalNumberOfFreeSpins` will be used
|
|
738
|
+
* @param {boolean} isAdditionalFreeSpin - flag for displaying additional free spins
|
|
724
739
|
*/
|
|
725
740
|
async handleFreeSpinPlateInvocation(numberOfFreeSpins, isAdditionalFreeSpin = false) {
|
|
726
741
|
await this.buttonsEventManager.disableButtonsForAction(async () => {
|
|
@@ -846,7 +861,7 @@ export class AbstractController {
|
|
|
846
861
|
});
|
|
847
862
|
}
|
|
848
863
|
/**
|
|
849
|
-
*
|
|
864
|
+
* Function for displaying super bonus win. Invoking that by `this.mainContainer.invokeSuperBonusWin();` and destroying it by `this.mainContainer.destroySuperBonusWin();`
|
|
850
865
|
* @param {number | undefined} winAmount - amount of win, if not provided `RainMan.settingsStore.cumulativeWinAmount` will be used
|
|
851
866
|
*/
|
|
852
867
|
async countSuperBonusWin(winAmount) {
|
|
@@ -933,6 +948,11 @@ export class AbstractController {
|
|
|
933
948
|
});
|
|
934
949
|
return symbolsIds;
|
|
935
950
|
}
|
|
951
|
+
/**
|
|
952
|
+
* Function for updating win and balance values
|
|
953
|
+
* @param {number} value - value to set
|
|
954
|
+
* @returns {void}
|
|
955
|
+
*/
|
|
936
956
|
updateUiValues(value) {
|
|
937
957
|
if (this.isLoopingWinActionsQueue)
|
|
938
958
|
return;
|
|
@@ -946,6 +966,10 @@ export class AbstractController {
|
|
|
946
966
|
this.uiController.updateShownBalance();
|
|
947
967
|
}
|
|
948
968
|
}
|
|
969
|
+
/**
|
|
970
|
+
* Function for updating gamble values
|
|
971
|
+
* @param {number} value value to set
|
|
972
|
+
*/
|
|
949
973
|
updateGambleValues(value) {
|
|
950
974
|
this.uiController.setDisplayedCurrentWinGamble(value);
|
|
951
975
|
}
|
|
@@ -963,6 +987,11 @@ export class AbstractController {
|
|
|
963
987
|
* Function for looping win actions queue, after initial play
|
|
964
988
|
*/
|
|
965
989
|
async loopWinActionsQueue() { }
|
|
990
|
+
/**
|
|
991
|
+
* Function for getting wins from {@link spinLogic}
|
|
992
|
+
* @param {SpinLogic} spinLogic spin logic
|
|
993
|
+
* @returns {FreeSpinWin[]} - array of free spins wins
|
|
994
|
+
*/
|
|
966
995
|
getFreeSpinsWins(spinLogic) {
|
|
967
996
|
const wins = spinLogic.winScenarios.find((winScenario) => winScenario.wins.find((win) => win.type === PossibleWins.freeSpins))?.wins || [];
|
|
968
997
|
return wins;
|
package/package.json
CHANGED