pixi-rainman-game-engine 0.3.37 → 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.
- 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 +12 -0
- package/dist/application/SoundManager/SoundManager.js +69 -22
- 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/AbstractIntroScreen/AbstractIntroScreen.js +1 -0
- package/dist/components/AbstractMainContainer/AbstractMainContainer.js +4 -2
- package/dist/components/GambleGame/GambleGame.js +0 -1
- package/dist/components/dictionary/locales/en.json +2 -1
- package/dist/controllers/AbstractController.d.ts +3 -4
- package/dist/controllers/AbstractController.js +40 -31
- package/dist/controllers/index.d.ts +0 -1
- package/dist/controllers/index.js +0 -1
- package/dist/loading/AbstractLoadingContainer.d.ts +1 -0
- package/dist/loading/AbstractLoadingContainer.js +4 -5
- package/dist/loading/SpriteLoadingContainer.d.ts +10 -2
- package/dist/loading/SpriteLoadingContainer.js +53 -10
- package/dist/localStorage/localStorage.d.ts +0 -1
- package/dist/localStorage/localStorage.js +0 -1
- package/dist/stores/SettingsStore.d.ts +5 -13
- package/dist/stores/SettingsStore.js +22 -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,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
|
|
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;
|
|
@@ -6,7 +6,6 @@ import { SpinData } from "../connectivity";
|
|
|
6
6
|
import { gamePhases, PossibleWins } from "../constants";
|
|
7
7
|
import { RainMan } from "../Rainman";
|
|
8
8
|
import { ceilToDecimal, debugSpinData, debugSymbolsMatchConfiguration, getDeviceOrientation, hideLayerIfPresent, hidePaytable, hideVolumeModal, logGroup, logGroupEnd, logInfo, logWarn, UI_ITEMS } from "../utils";
|
|
9
|
-
import { QuickStopController } from "./QuickStopController";
|
|
10
9
|
import { UiController } from "./UiController";
|
|
11
10
|
/**
|
|
12
11
|
* Abstract controller class for games, this class control game flow
|
|
@@ -42,7 +41,6 @@ export class AbstractController {
|
|
|
42
41
|
invokeFreeSpinPlateAfterWin = false;
|
|
43
42
|
invokeFreeSpinSummaryPlateAfterWin = false;
|
|
44
43
|
hideFreeSpinsMessageBox = false;
|
|
45
|
-
quickStopController;
|
|
46
44
|
uiController;
|
|
47
45
|
mysteryFxSymbol = null;
|
|
48
46
|
mysteryFxSymbolMustFormWinningLine = false;
|
|
@@ -53,12 +51,13 @@ export class AbstractController {
|
|
|
53
51
|
shouldDisableBetButtons = false;
|
|
54
52
|
wasAutoplayEnabledBeforeFreeSpin = false;
|
|
55
53
|
setSlowerSpeedForFreeSpins = false;
|
|
56
|
-
|
|
54
|
+
speedLevelBeforeFreeSpins = null;
|
|
57
55
|
buttonPressed = false;
|
|
58
56
|
buttonHeldSince = 0;
|
|
59
57
|
shouldStopMobileSpin = false;
|
|
60
58
|
disableMessageBoxChange = false;
|
|
61
59
|
shouldClearQuickReelsStopAfterSpin = false;
|
|
60
|
+
freeSpinsWin = null;
|
|
62
61
|
resolveBigWin;
|
|
63
62
|
resolveMysteryWin;
|
|
64
63
|
resolveBonusWin;
|
|
@@ -74,7 +73,6 @@ export class AbstractController {
|
|
|
74
73
|
const initData = this.connection.initData();
|
|
75
74
|
this.initData = initData;
|
|
76
75
|
this.config = new ApiConfig(initData);
|
|
77
|
-
this.quickStopController = new QuickStopController(buttonsEventManager);
|
|
78
76
|
this.uiController = new UiController(this.config);
|
|
79
77
|
this.componentRegistry = RainMan.componentRegistry;
|
|
80
78
|
this.setupSpaceOrEnterListener();
|
|
@@ -119,7 +117,6 @@ export class AbstractController {
|
|
|
119
117
|
this.buttonsEventManager.initFreeSpinModal();
|
|
120
118
|
this.buttonsEventManager.setUpUIElementsInteractivity();
|
|
121
119
|
this.buttonsEventManager.setConfirmAutoplayButton(() => {
|
|
122
|
-
this.quickStopController.speedPopupDisabled = true;
|
|
123
120
|
if (RainMan.settingsStore.isAutoplayEnabled) {
|
|
124
121
|
return;
|
|
125
122
|
}
|
|
@@ -132,6 +129,9 @@ export class AbstractController {
|
|
|
132
129
|
});
|
|
133
130
|
SoundManager.setPlayStatus(SoundTracks.music, RainMan.settingsStore.shouldPlayAmbientMusic);
|
|
134
131
|
this.changeGamePhase(gamePhases.IDLE);
|
|
132
|
+
if (!RainMan.settingsStore.isFreeSpinsPlayEnabled) {
|
|
133
|
+
RainMan.componentRegistry.getIfExists(FreeSpinButton.registryName)?.setInteractivity(true);
|
|
134
|
+
}
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* Function for initializing function after timeout
|
|
@@ -312,7 +312,12 @@ export class AbstractController {
|
|
|
312
312
|
this.buttonsEventManager.initGambleButton(() => {
|
|
313
313
|
RainMan.settingsStore.isGambleGameAvailable = false;
|
|
314
314
|
this.mainContainer.invokeGambleGame();
|
|
315
|
-
},
|
|
315
|
+
}, !RainMan.settingsStore.isGambleGameAvailable ||
|
|
316
|
+
RainMan.settingsStore.isPlayingAnyAction ||
|
|
317
|
+
this.gamePhase === gamePhases.HANDLING_ACTIONS ||
|
|
318
|
+
this.gamePhase === gamePhases.STOPPING_HANDLING_ACTIONS ||
|
|
319
|
+
this.gamePhase === gamePhases.SPINNING ||
|
|
320
|
+
this.gamePhase === gamePhases.GAME_SUMMARY);
|
|
316
321
|
}
|
|
317
322
|
if (RainMan.componentRegistry.has(BUTTONS.take)) {
|
|
318
323
|
this.buttonsEventManager.initTakeButton(() => {
|
|
@@ -326,10 +331,15 @@ export class AbstractController {
|
|
|
326
331
|
RainMan.componentRegistry
|
|
327
332
|
.get(BUTTONS.take)
|
|
328
333
|
.flipDisabledFlag(!RainMan.settingsStore.isTakeActionAvailable);
|
|
329
|
-
},
|
|
334
|
+
}, this.lastWinAmount === 0 ||
|
|
335
|
+
!RainMan.settingsStore.isGambleGameAvailable ||
|
|
336
|
+
RainMan.settingsStore.isPlayingAnyAction ||
|
|
337
|
+
this.gamePhase === gamePhases.HANDLING_ACTIONS ||
|
|
338
|
+
this.gamePhase === gamePhases.STOPPING_HANDLING_ACTIONS ||
|
|
339
|
+
this.gamePhase === gamePhases.SPINNING ||
|
|
340
|
+
this.gamePhase === gamePhases.GAME_SUMMARY);
|
|
330
341
|
}
|
|
331
342
|
RainMan.componentRegistry.get(SpeedControlButton.registryName).setOnClick(() => {
|
|
332
|
-
this.quickStopController.speedPopupDisabled = true;
|
|
333
343
|
RainMan.settingsStore.closeCurrentlyOpenModal?.();
|
|
334
344
|
RainMan.componentRegistry.nextSpeedLevel();
|
|
335
345
|
this.uiController.messageBox.updateIncentiveText(sample(i18next.t("idleMessages", { returnObjects: true })[RainMan.componentRegistry.getSpeedLevel()]));
|
|
@@ -401,7 +411,7 @@ export class AbstractController {
|
|
|
401
411
|
}
|
|
402
412
|
this.roundNumber = spinData.getRawData().round_number;
|
|
403
413
|
RainMan.settingsStore.setRoundNumber(this.roundNumber);
|
|
404
|
-
if (this._lastWinAmount !== 0) {
|
|
414
|
+
if (this._lastWinAmount !== 0 && spinData.getRawData().round_win_amount) {
|
|
405
415
|
RainMan.settingsStore.isTakeActionAvailable = true;
|
|
406
416
|
RainMan.settingsStore.isGambleGameAvailable = true;
|
|
407
417
|
}
|
|
@@ -454,7 +464,6 @@ export class AbstractController {
|
|
|
454
464
|
}
|
|
455
465
|
else {
|
|
456
466
|
this.columnsContainer.clearQuickReelsStop();
|
|
457
|
-
this.quickStopController.setQuickStopCounterLock(false);
|
|
458
467
|
this.shouldClearQuickReelsStopAfterSpin = false;
|
|
459
468
|
}
|
|
460
469
|
};
|
|
@@ -515,7 +524,6 @@ export class AbstractController {
|
|
|
515
524
|
}
|
|
516
525
|
this.columnsContainer.enableQuickReelsStop();
|
|
517
526
|
this.handleDisablingButtons(true);
|
|
518
|
-
this.quickStopController.setQuickStopCounterLock(true);
|
|
519
527
|
this.summaryStop = this.skipFreeSpinSummary ? false : this.invokeFreeSpinSummaryPlateAfterWin;
|
|
520
528
|
if (this.invokeFreeSpinPlateAfterWin ||
|
|
521
529
|
this.summaryStop ||
|
|
@@ -539,9 +547,6 @@ export class AbstractController {
|
|
|
539
547
|
* @returns {boolean} should buttons be disabled
|
|
540
548
|
*/
|
|
541
549
|
get shouldButtonsBeDisabled() {
|
|
542
|
-
if (this.quickStopController.quickStopCounterLock) {
|
|
543
|
-
return true;
|
|
544
|
-
}
|
|
545
550
|
if (RainMan.settingsStore.isAutoplayEnabled) {
|
|
546
551
|
return true;
|
|
547
552
|
}
|
|
@@ -797,23 +802,15 @@ export class AbstractController {
|
|
|
797
802
|
* @returns {void}
|
|
798
803
|
*/
|
|
799
804
|
throttledSpin() {
|
|
800
|
-
this.quickReelsCounter += 1;
|
|
801
805
|
this.columnsContainer.setInteractivityForSymbols(false);
|
|
802
806
|
this.handleDisablingButtons(true);
|
|
803
807
|
RainMan.globals.shouldShowModals = false;
|
|
804
|
-
if (performance.now() - this.buttonsEventManager.speedPopupShownAt <
|
|
805
|
-
RainMan.config.durationOfActions.speedPopupVisibleTime) {
|
|
806
|
-
RainMan.globals.handleDisablingButtons?.();
|
|
807
|
-
this.columnsContainer.clearQuickReelsStop();
|
|
808
|
-
}
|
|
809
808
|
hidePaytable();
|
|
810
809
|
if (this.gamePhase === gamePhases.DATA_FETCH ||
|
|
811
810
|
this.gamePhase === gamePhases.SPINNING ||
|
|
812
811
|
this.gamePhase === gamePhases.CONFIGURING_SPIN) {
|
|
813
812
|
this.columnsContainer.enableQuickReelsStop();
|
|
814
813
|
this.isSpinThrottled = true;
|
|
815
|
-
this.quickStopController.handleResetCounter(this.spinThrottlerTimeout !== null);
|
|
816
|
-
this.quickStopController.handleInvokingSpeedPopup();
|
|
817
814
|
return;
|
|
818
815
|
}
|
|
819
816
|
this.prepareBoughtFreeSpins();
|
|
@@ -929,7 +926,6 @@ export class AbstractController {
|
|
|
929
926
|
* @returns {void}
|
|
930
927
|
*/
|
|
931
928
|
disableAutoplay() {
|
|
932
|
-
this.quickStopController.speedPopupDisabled = false;
|
|
933
929
|
this.autoSpinBalance = 0;
|
|
934
930
|
RainMan.componentRegistry.get(MessageBox.registryName).hideAutoSpinText();
|
|
935
931
|
RainMan.componentRegistry.get(AutoplayButton.registryName).activate(false);
|
|
@@ -1089,7 +1085,6 @@ export class AbstractController {
|
|
|
1089
1085
|
default:
|
|
1090
1086
|
throw new Error(`Exception in game phase: ${this.gamePhase}`);
|
|
1091
1087
|
}
|
|
1092
|
-
this.buttonsEventManager.setSpeedPopupVisibility("none");
|
|
1093
1088
|
RainMan.settingsStore.setModalsAvailability(false);
|
|
1094
1089
|
this.spinning = true;
|
|
1095
1090
|
logGroup("🟢 spinning start");
|
|
@@ -1109,12 +1104,12 @@ export class AbstractController {
|
|
|
1109
1104
|
RainMan.settingsStore.disableSpecialButtons();
|
|
1110
1105
|
this.columnsContainer.blindSpin();
|
|
1111
1106
|
this.clearAndDestroyActions();
|
|
1112
|
-
const { spinLogic } = await this.fetchAndPrepareSpinData();
|
|
1107
|
+
const { spinLogic, data } = await this.fetchAndPrepareSpinData();
|
|
1113
1108
|
const beforeFetchFreeSpins = RainMan.settingsStore.howManyFreeSpinsLeft;
|
|
1114
1109
|
const availableFreeSpins = spinLogic.availableFreeSpins;
|
|
1115
1110
|
const availableFreeSpinsIncreased = availableFreeSpins > RainMan.settingsStore.howManyFreeSpinsLeft;
|
|
1116
1111
|
this.hideFreeSpinsMessageBox = availableFreeSpinsIncreased;
|
|
1117
|
-
if (this._lastWinAmount !== 0 && !(availableFreeSpins > 0)) {
|
|
1112
|
+
if ((this._lastWinAmount !== 0 || data.getRawData().round_win_amount) && !(availableFreeSpins > 0)) {
|
|
1118
1113
|
RainMan.settingsStore.isTakeActionAvailable = true;
|
|
1119
1114
|
RainMan.settingsStore.isGambleGameAvailable = true;
|
|
1120
1115
|
}
|
|
@@ -1166,6 +1161,9 @@ export class AbstractController {
|
|
|
1166
1161
|
(this.invokeFreeSpinPlateAfterWin || this.setSlowerSpeedForFreeSpins) &&
|
|
1167
1162
|
RainMan.settingsStore.isFreeSpinsPlayEnabled) {
|
|
1168
1163
|
this.columnsContainer.clearQuickReelsStop();
|
|
1164
|
+
if (this.speedLevelBeforeFreeSpins === null) {
|
|
1165
|
+
this.speedLevelBeforeFreeSpins = RainMan.settingsStore.currentSpeed;
|
|
1166
|
+
}
|
|
1169
1167
|
RainMan.settingsStore.setIsTemporarySpeed(false);
|
|
1170
1168
|
RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.slow);
|
|
1171
1169
|
this.uiController.updateShownSpeedLevel(SPEED_LEVELS.slow);
|
|
@@ -1175,13 +1173,10 @@ export class AbstractController {
|
|
|
1175
1173
|
debugSymbolsMatchConfiguration(spinLogic.finalBlindsConfiguration);
|
|
1176
1174
|
await Promise.allSettled(this.uiController.promisesToSetBalances);
|
|
1177
1175
|
this.changeGamePhase(this.uiController.recentWin === 0 ? gamePhases.IDLE : gamePhases.GAME_SUMMARY);
|
|
1178
|
-
this.quickStopController.handleSpeedPopupInvocation();
|
|
1179
|
-
this.quickStopController.handleResetCounter(!this.isSpinThrottled);
|
|
1180
1176
|
logInfo("🔴 spinning end");
|
|
1181
1177
|
RainMan.settingsStore.reinitData = undefined;
|
|
1182
1178
|
logGroupEnd();
|
|
1183
1179
|
await this.onSpinningEnd(spinLogic);
|
|
1184
|
-
this.gambleGameEnabler(this.lastWinAmount);
|
|
1185
1180
|
this.winActionsQueue = [];
|
|
1186
1181
|
this.spinning = false;
|
|
1187
1182
|
this.isSpinThrottled = false;
|
|
@@ -1205,7 +1200,9 @@ export class AbstractController {
|
|
|
1205
1200
|
this.uiController.messageBox.hideCurrentWinText();
|
|
1206
1201
|
this.uiController.messageBox.hideAutoSpinText();
|
|
1207
1202
|
await this.handleFreeSpinPlateInvocation(freeSpinAward, isAdditionalFreeSpins || additionalFreeSpinsOnLastSpin);
|
|
1208
|
-
if (!
|
|
1203
|
+
if (!RainMan.settingsStore.isFreeSpinsPlayEnabled &&
|
|
1204
|
+
!isAdditionalFreeSpins &&
|
|
1205
|
+
!additionalFreeSpinsOnLastSpin) {
|
|
1209
1206
|
this.uiController.currentBalance = RainMan.settingsStore.balanceAfterSpin;
|
|
1210
1207
|
}
|
|
1211
1208
|
this.uiController.triggerUiElementsUpdate();
|
|
@@ -1214,11 +1211,15 @@ export class AbstractController {
|
|
|
1214
1211
|
if (availableFreeSpinsIncreased) {
|
|
1215
1212
|
this.uiController.updateShownFreeSpinAmount(availableFreeSpins);
|
|
1216
1213
|
}
|
|
1214
|
+
let gambleWinAmount = this.lastWinAmount;
|
|
1217
1215
|
if (this.invokeFreeSpinSummaryPlateAfterWin && !this.skipFreeSpinSummary) {
|
|
1216
|
+
gambleWinAmount = this.uiController.totalFreeSpinWinAmount;
|
|
1218
1217
|
hideLayerIfPresent();
|
|
1219
1218
|
await this.handleFreeSpinSummaryPlateInvocation();
|
|
1220
1219
|
}
|
|
1221
1220
|
await this.performActionsAfterSpin();
|
|
1221
|
+
this.freeSpinsWin = gambleWinAmount > 0 ? gambleWinAmount : null;
|
|
1222
|
+
this.gambleGameEnabler(gambleWinAmount);
|
|
1222
1223
|
if (RainMan.settingsStore.isAutoplayEnabled ||
|
|
1223
1224
|
(RainMan.settingsStore.howManyFreeSpinsLeft !== 0 && this.shouldAutoplayFreeSpins)) {
|
|
1224
1225
|
this.handleAutoplayLogic();
|
|
@@ -1233,6 +1234,13 @@ export class AbstractController {
|
|
|
1233
1234
|
this.disableAutoplayButton(false);
|
|
1234
1235
|
}
|
|
1235
1236
|
await this.performActionsAfterAllActions();
|
|
1237
|
+
if (this.speedLevelBeforeFreeSpins !== null &&
|
|
1238
|
+
!RainMan.settingsStore.isFreeSpinsPlayEnabled &&
|
|
1239
|
+
!RainMan.globals.isSuperBonusGameEnabled) {
|
|
1240
|
+
RainMan.componentRegistry.setSpeedLevel(this.speedLevelBeforeFreeSpins);
|
|
1241
|
+
this.uiController.updateShownSpeedLevel(this.speedLevelBeforeFreeSpins);
|
|
1242
|
+
this.speedLevelBeforeFreeSpins = null;
|
|
1243
|
+
}
|
|
1236
1244
|
if (this.wasAutoplayEnabledBeforeFreeSpin &&
|
|
1237
1245
|
!RainMan.settingsStore.isFreeSpinsPlayEnabled &&
|
|
1238
1246
|
!RainMan.globals.isSuperBonusGameEnabled) {
|
|
@@ -1279,7 +1287,6 @@ export class AbstractController {
|
|
|
1279
1287
|
return;
|
|
1280
1288
|
}
|
|
1281
1289
|
this.columnsContainer.clearQuickReelsStop();
|
|
1282
|
-
this.quickStopController.setQuickStopCounterLock(false);
|
|
1283
1290
|
this.shouldClearQuickReelsStopAfterSpin = false;
|
|
1284
1291
|
}
|
|
1285
1292
|
/**
|
|
@@ -1298,6 +1305,7 @@ export class AbstractController {
|
|
|
1298
1305
|
});
|
|
1299
1306
|
this.changeGamePhase(gamePhases.IDLE);
|
|
1300
1307
|
this.invokeFreeSpinPlateAfterWin = false;
|
|
1308
|
+
RainMan.settingsStore.isFreeSpinsStarted = true;
|
|
1301
1309
|
}
|
|
1302
1310
|
/**
|
|
1303
1311
|
* Function for invoking free spin summary plate, invoked in mainContainer
|
|
@@ -1320,6 +1328,7 @@ export class AbstractController {
|
|
|
1320
1328
|
RainMan.settingsStore.resetFreeSpinNumberBought();
|
|
1321
1329
|
this.changeGamePhase(gamePhases.IDLE);
|
|
1322
1330
|
this.invokeFreeSpinSummaryPlateAfterWin = false;
|
|
1331
|
+
RainMan.settingsStore.isFreeSpinsStarted = false;
|
|
1323
1332
|
}
|
|
1324
1333
|
/**
|
|
1325
1334
|
* Function for handling autoplay logic
|
|
@@ -48,6 +48,7 @@ export declare abstract class AbstractLoadingContainer extends Container {
|
|
|
48
48
|
*/
|
|
49
49
|
protected setupInitAnimations(): void;
|
|
50
50
|
waitForPresentationToFinish(): Promise<void>;
|
|
51
|
+
showContinueAfterLoading(label?: string): void;
|
|
51
52
|
scaleInitSpineToScreenWidth(): void;
|
|
52
53
|
private tryResolvePresentationFinished;
|
|
53
54
|
}
|
|
@@ -24,11 +24,7 @@ export class AbstractLoadingContainer extends Container {
|
|
|
24
24
|
this.name = "loadingContainer";
|
|
25
25
|
this.x = 0;
|
|
26
26
|
this.y = 0;
|
|
27
|
-
this.loaderContainer = new SpriteLoadingContainer("./assets/images/materials/texture.png"
|
|
28
|
-
fill: ["#FCD784", "#AE6119", "#FEE391"],
|
|
29
|
-
stroke: "#4a1850",
|
|
30
|
-
dropShadowColor: "#000000"
|
|
31
|
-
});
|
|
27
|
+
this.loaderContainer = new SpriteLoadingContainer("./assets/images/materials/texture.png");
|
|
32
28
|
this.presentationFinishedPromise = new Promise((resolve) => {
|
|
33
29
|
this.resolvePresentationFinished = resolve;
|
|
34
30
|
});
|
|
@@ -102,6 +98,9 @@ export class AbstractLoadingContainer extends Container {
|
|
|
102
98
|
waitForPresentationToFinish() {
|
|
103
99
|
return this.presentationFinishedPromise;
|
|
104
100
|
}
|
|
101
|
+
showContinueAfterLoading(label) {
|
|
102
|
+
this.loaderContainer.showContinue(label);
|
|
103
|
+
}
|
|
105
104
|
scaleInitSpineToScreenWidth() {
|
|
106
105
|
if (getDeviceOrientation() === "mobile-portrait") {
|
|
107
106
|
this.initAnimation?.scale.set(0.5 * globalMinRatio());
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Container,
|
|
1
|
+
import { Container, Sprite } from "pixi.js";
|
|
2
2
|
import { ProgressiveLoader } from "./ProgressiveLoader";
|
|
3
3
|
/**
|
|
4
4
|
* This class contains the loading process to pixi application
|
|
@@ -16,6 +16,10 @@ export declare class SpriteLoadingContainer extends Container implements Progres
|
|
|
16
16
|
progressBorder: Sprite;
|
|
17
17
|
private progress;
|
|
18
18
|
private targetProgress;
|
|
19
|
+
private continueText;
|
|
20
|
+
private shouldShowContinue;
|
|
21
|
+
private wasContinueClicked;
|
|
22
|
+
private isContinueVisible;
|
|
19
23
|
private completionPromiseResolver;
|
|
20
24
|
private completionPromise;
|
|
21
25
|
private readonly loadingStatusContainerHeight;
|
|
@@ -28,7 +32,7 @@ export declare class SpriteLoadingContainer extends Container implements Progres
|
|
|
28
32
|
* @param {Partial<ITextStyle>} textOptions contains the options for text color blur
|
|
29
33
|
* @returns {void}
|
|
30
34
|
*/
|
|
31
|
-
constructor(texture: string
|
|
35
|
+
constructor(texture: string);
|
|
32
36
|
waitForCompletion(): Promise<void>;
|
|
33
37
|
/**
|
|
34
38
|
* Function for updating loading progress
|
|
@@ -37,6 +41,7 @@ export declare class SpriteLoadingContainer extends Container implements Progres
|
|
|
37
41
|
* @returns {void}
|
|
38
42
|
*/
|
|
39
43
|
updateProgress(progress: number): void;
|
|
44
|
+
showContinue(label?: string): void;
|
|
40
45
|
/**
|
|
41
46
|
* Function for setting error text
|
|
42
47
|
* @public
|
|
@@ -63,5 +68,8 @@ export declare class SpriteLoadingContainer extends Container implements Progres
|
|
|
63
68
|
private updateProgressMask;
|
|
64
69
|
private animateProgress;
|
|
65
70
|
private isComplete;
|
|
71
|
+
private canResolveCompletion;
|
|
72
|
+
private showContinueIfReady;
|
|
73
|
+
private handleContinueClick;
|
|
66
74
|
private resolveCompletionIfReady;
|
|
67
75
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i18next from "i18next";
|
|
2
|
+
import { Container, Graphics, Rectangle, Sprite, Text, TextStyle, Texture } from "pixi.js";
|
|
2
3
|
import { RainMan } from "../Rainman";
|
|
3
4
|
import { getDeviceOrientation } from "../utils/common/deviceOrientation";
|
|
4
5
|
/**
|
|
@@ -17,6 +18,10 @@ export class SpriteLoadingContainer extends Container {
|
|
|
17
18
|
progressBorder;
|
|
18
19
|
progress = 0;
|
|
19
20
|
targetProgress = 0;
|
|
21
|
+
continueText = i18next.t("clickAnywhereToContinue");
|
|
22
|
+
shouldShowContinue = false;
|
|
23
|
+
wasContinueClicked = false;
|
|
24
|
+
isContinueVisible = false;
|
|
20
25
|
completionPromiseResolver = null;
|
|
21
26
|
completionPromise = null;
|
|
22
27
|
loadingStatusContainerHeight = 10;
|
|
@@ -29,7 +34,7 @@ export class SpriteLoadingContainer extends Container {
|
|
|
29
34
|
* @param {Partial<ITextStyle>} textOptions contains the options for text color blur
|
|
30
35
|
* @returns {void}
|
|
31
36
|
*/
|
|
32
|
-
constructor(texture
|
|
37
|
+
constructor(texture) {
|
|
33
38
|
super();
|
|
34
39
|
this.progressBarMask = new Graphics();
|
|
35
40
|
this.progressBorderMask = new Graphics();
|
|
@@ -52,12 +57,8 @@ export class SpriteLoadingContainer extends Container {
|
|
|
52
57
|
fontFamily: RainMan.config.fontFace,
|
|
53
58
|
fontSize: 24,
|
|
54
59
|
strokeThickness: 3,
|
|
55
|
-
dropShadow: true,
|
|
56
|
-
dropShadowBlur: 4,
|
|
57
|
-
dropShadowAngle: Math.PI / 6,
|
|
58
|
-
dropShadowDistance: 6,
|
|
59
60
|
align: "center",
|
|
60
|
-
|
|
61
|
+
fill: "#ffffff"
|
|
61
62
|
});
|
|
62
63
|
this.text = new Text("", loaderTextStyle);
|
|
63
64
|
this.text.anchor.set(0.5, 0.5);
|
|
@@ -71,7 +72,7 @@ export class SpriteLoadingContainer extends Container {
|
|
|
71
72
|
RainMan.app.ticker.add(this.animateProgress, this);
|
|
72
73
|
}
|
|
73
74
|
waitForCompletion() {
|
|
74
|
-
if (this.
|
|
75
|
+
if (this.canResolveCompletion()) {
|
|
75
76
|
return Promise.resolve();
|
|
76
77
|
}
|
|
77
78
|
if (!this.completionPromise) {
|
|
@@ -94,6 +95,13 @@ export class SpriteLoadingContainer extends Container {
|
|
|
94
95
|
}
|
|
95
96
|
this.targetProgress = normalizedProgress;
|
|
96
97
|
this.updateProgressMask();
|
|
98
|
+
this.showContinueIfReady();
|
|
99
|
+
}
|
|
100
|
+
showContinue(label = i18next.t("clickAnywhereToContinue")) {
|
|
101
|
+
this.shouldShowContinue = true;
|
|
102
|
+
this.continueText = label;
|
|
103
|
+
this.text.visible = false;
|
|
104
|
+
this.showContinueIfReady();
|
|
97
105
|
}
|
|
98
106
|
/**
|
|
99
107
|
* Function for setting error text
|
|
@@ -164,7 +172,12 @@ export class SpriteLoadingContainer extends Container {
|
|
|
164
172
|
this.progressBorder.y = startY;
|
|
165
173
|
this.progressBorderMask.x = this.progressBorder.x;
|
|
166
174
|
this.progressBorderMask.y = this.progressBorder.y;
|
|
167
|
-
if (this.
|
|
175
|
+
if (this.isContinueVisible) {
|
|
176
|
+
this.hitArea = new Rectangle(0, 0, RainMan.app.screen.width, RainMan.app.screen.height);
|
|
177
|
+
this.text.x = RainMan.app.screen.width / 2;
|
|
178
|
+
this.text.y = startY + this.loadingStatusContainerHeight / 2;
|
|
179
|
+
}
|
|
180
|
+
else if (this.text.text !== "") {
|
|
168
181
|
this.text.x = RainMan.app.screen.width / 2;
|
|
169
182
|
this.text.y = RainMan.app.screen.height / 2;
|
|
170
183
|
}
|
|
@@ -198,13 +211,43 @@ export class SpriteLoadingContainer extends Container {
|
|
|
198
211
|
const maxStep = RainMan.app.ticker.deltaMS / this.minimumFullProgressDuration;
|
|
199
212
|
this.progress = Math.min(this.progress + maxStep, this.targetProgress);
|
|
200
213
|
this.updateProgressMask();
|
|
214
|
+
this.showContinueIfReady();
|
|
201
215
|
this.resolveCompletionIfReady();
|
|
202
216
|
}
|
|
203
217
|
isComplete() {
|
|
204
218
|
return this.targetProgress === 1 && this.progress >= this.targetProgress;
|
|
205
219
|
}
|
|
220
|
+
canResolveCompletion() {
|
|
221
|
+
return this.isComplete() && (!this.shouldShowContinue || this.wasContinueClicked);
|
|
222
|
+
}
|
|
223
|
+
showContinueIfReady() {
|
|
224
|
+
if (!this.shouldShowContinue || !this.isComplete() || this.isContinueVisible) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
this.isContinueVisible = true;
|
|
228
|
+
this.removeChild(this.progressBorderShadow);
|
|
229
|
+
this.removeChild(this.progressBorderMask);
|
|
230
|
+
this.removeChild(this.progressBorder);
|
|
231
|
+
this.removeChild(this.progressBarMask);
|
|
232
|
+
this.removeChild(this.progressBar);
|
|
233
|
+
this.text.text = this.continueText;
|
|
234
|
+
this.text.visible = true;
|
|
235
|
+
this.eventMode = "static";
|
|
236
|
+
this.cursor = "pointer";
|
|
237
|
+
this.on("pointertap", this.handleContinueClick, this);
|
|
238
|
+
this.reposition();
|
|
239
|
+
}
|
|
240
|
+
handleContinueClick() {
|
|
241
|
+
RainMan.settingsStore.startSound();
|
|
242
|
+
this.wasContinueClicked = true;
|
|
243
|
+
this.eventMode = "passive";
|
|
244
|
+
this.cursor = "default";
|
|
245
|
+
this.hitArea = null;
|
|
246
|
+
this.off("pointertap", this.handleContinueClick, this);
|
|
247
|
+
this.resolveCompletionIfReady();
|
|
248
|
+
}
|
|
206
249
|
resolveCompletionIfReady() {
|
|
207
|
-
if (!this.
|
|
250
|
+
if (!this.canResolveCompletion() || !this.completionPromiseResolver) {
|
|
208
251
|
return;
|
|
209
252
|
}
|
|
210
253
|
this.completionPromiseResolver();
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const LOCAL_STORAGE: {
|
|
5
5
|
readonly roundNumber: "roundNumberLocalStorage";
|
|
6
|
-
readonly hiResolution: "hiResolutionLocalStorage";
|
|
7
6
|
readonly batterySaver: "batterySaverLocalStorage";
|
|
8
7
|
readonly volumeLevel: "volumeLevelLocalStorage";
|
|
9
8
|
readonly isSoundEnabled: "isSoundEnabledLocalStorage";
|
|
@@ -15,6 +15,7 @@ export declare class SettingsStore {
|
|
|
15
15
|
isQuickSpinsActive: boolean;
|
|
16
16
|
bet: number;
|
|
17
17
|
betText: string;
|
|
18
|
+
isSoundStarted: boolean;
|
|
18
19
|
shouldPlayAmbientMusic: boolean;
|
|
19
20
|
shouldPlayFxSounds: boolean;
|
|
20
21
|
fullScreenFlag: boolean;
|
|
@@ -30,7 +31,6 @@ export declare class SettingsStore {
|
|
|
30
31
|
infinitySpinsEnabled: boolean;
|
|
31
32
|
roundNumber: number;
|
|
32
33
|
reelSetId: number;
|
|
33
|
-
HiResolutionFlag: boolean;
|
|
34
34
|
batterySaverFlag: boolean;
|
|
35
35
|
isGambleGameAvailable: boolean;
|
|
36
36
|
isGambleGameActive: boolean;
|
|
@@ -57,8 +57,8 @@ export declare class SettingsStore {
|
|
|
57
57
|
disableBigWin: boolean;
|
|
58
58
|
isAfterFreeSpinsSummary: boolean;
|
|
59
59
|
isSpeedModalShown: boolean;
|
|
60
|
+
isFreeSpinsStarted: boolean;
|
|
60
61
|
reinitData?: SpinDataInterface[];
|
|
61
|
-
setSpeedPopupVisibility?: (visibility: "flex" | "none") => void;
|
|
62
62
|
popupPaytableRepositionCallback?: () => void;
|
|
63
63
|
updateVolumeButtonTexture?: () => void;
|
|
64
64
|
handleModalInvocation?: (layerId: string) => void;
|
|
@@ -136,8 +136,7 @@ export declare class SettingsStore {
|
|
|
136
136
|
/**
|
|
137
137
|
* Sets the free spins price table.
|
|
138
138
|
* @public
|
|
139
|
-
* @param freeSpinsBuyOptions
|
|
140
|
-
* @param {Record<number, number>} freeSpinsPriceTable table with free spins prices
|
|
139
|
+
* @param {FreeSpinsBuyOption[]} freeSpinsBuyOptions array with free spins buy options
|
|
141
140
|
* @returns {void}
|
|
142
141
|
*/
|
|
143
142
|
setFreeSpinsBuyOptions(freeSpinsBuyOptions: FreeSpinsBuyOption[]): void;
|
|
@@ -151,8 +150,7 @@ export declare class SettingsStore {
|
|
|
151
150
|
/**
|
|
152
151
|
* Sets the free spins price table.
|
|
153
152
|
* @public
|
|
154
|
-
* @param buyTypes
|
|
155
|
-
* @param {Record<number, number>} jokerBuyOption table with free spins prices
|
|
153
|
+
* @param {BuyType[]} buyTypes array with available buy types
|
|
156
154
|
* @returns {void}
|
|
157
155
|
*/
|
|
158
156
|
setGameBuyTypes(buyTypes: BuyType[]): void;
|
|
@@ -191,6 +189,7 @@ export declare class SettingsStore {
|
|
|
191
189
|
* @returns {void}
|
|
192
190
|
*/
|
|
193
191
|
setShouldPlayAmbientMusic(flag: boolean, saveToLocalStorage?: boolean): void;
|
|
192
|
+
startSound(): void;
|
|
194
193
|
/**
|
|
195
194
|
* Sets flag for effect sounds
|
|
196
195
|
* @public
|
|
@@ -219,13 +218,6 @@ export declare class SettingsStore {
|
|
|
219
218
|
* @returns {void}
|
|
220
219
|
*/
|
|
221
220
|
setFullScreenFlag(flag: boolean): void;
|
|
222
|
-
/**
|
|
223
|
-
* Sets the high resolution flag.
|
|
224
|
-
* @public
|
|
225
|
-
* @param {boolean} flag - New value for high resolution flag.
|
|
226
|
-
* @returns {void}
|
|
227
|
-
*/
|
|
228
|
-
setHiResolutionFlag(flag: boolean): void;
|
|
229
221
|
/**
|
|
230
222
|
* Sets the temporary speed flag.
|
|
231
223
|
* @public
|