pixi-rainman-game-engine 0.1.2 → 0.1.4
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/UXSettings/index.d.ts +1 -1
- package/dist/SettingsUI/components/UXSettings/index.jsx +1 -1
- package/dist/SettingsUI/components/VolumeSettings/index.jsx +1 -1
- package/dist/application/ButtonsEventManager/ButtonsEventManager.js +2 -1
- package/dist/components/buttons/default/VolumeButton.js +2 -2
- package/dist/components/symbols/AbstractSymbolsColumn.d.ts +3 -2
- package/dist/components/symbols/AbstractSymbolsColumn.js +14 -1
- package/dist/stores/SettingsStore.d.ts +2 -0
- package/dist/stores/SettingsStore.js +5 -0
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import { useStores } from "../../hooks";
|
|
|
8
8
|
const handleStyle = { width: "7px", height: "24px", bottom: "-6px", borderRadius: "4px" };
|
|
9
9
|
const onChange = (newVolumeLevel) => {
|
|
10
10
|
RainMan.settingsStore.setVolumeLevel(newVolumeLevel);
|
|
11
|
-
RainMan.settingsStore.setIsSoundEnabled(newVolumeLevel > 0
|
|
11
|
+
RainMan.settingsStore.setIsSoundEnabled(newVolumeLevel > 0);
|
|
12
12
|
};
|
|
13
13
|
export const VolumeSettings = observer(() => {
|
|
14
14
|
const { settingStore } = useStores();
|
|
@@ -110,8 +110,9 @@ export class ButtonsEventManager {
|
|
|
110
110
|
?.setOnClick(() => this.handleModalInvocation(UI_ITEMS.freeSpin));
|
|
111
111
|
}
|
|
112
112
|
initVolumeButtonEvent() {
|
|
113
|
+
RainMan.settingsStore.setUpdateVolumeButtonTexture(() => RainMan.componentRegistry.get(VolumeButton.registryName).changeTextureDependOnVolume());
|
|
113
114
|
RainMan.componentRegistry.get(VolumeButton.registryName).setOnClick(() => {
|
|
114
|
-
RainMan.settingsStore.setIsSoundEnabled(
|
|
115
|
+
RainMan.settingsStore.setIsSoundEnabled(!RainMan.settingsStore.isSoundEnabled);
|
|
115
116
|
RainMan.componentRegistry.get(VolumeButton.registryName).changeTextureDependOnVolume();
|
|
116
117
|
this.handleModalInvocation(UI_ITEMS.volume);
|
|
117
118
|
});
|
|
@@ -16,13 +16,13 @@ export class VolumeButton extends BaseButton {
|
|
|
16
16
|
[ButtonStates.OVER]: getTexture("mute-h.png"),
|
|
17
17
|
[ButtonStates.CLICKED]: getTexture("mute-c.png"),
|
|
18
18
|
};
|
|
19
|
-
const isSoundEnabled = RainMan.settingsStore.
|
|
19
|
+
const isSoundEnabled = RainMan.settingsStore.isSoundEnabled;
|
|
20
20
|
super(VolumeButton.registryName, isSoundEnabled ? normalTextureMap : muteTextureMap);
|
|
21
21
|
this.normalTextureMap = normalTextureMap;
|
|
22
22
|
this.muteTextureMap = muteTextureMap;
|
|
23
23
|
}
|
|
24
24
|
changeTextureDependOnVolume() {
|
|
25
|
-
if (RainMan.settingsStore.
|
|
25
|
+
if (RainMan.settingsStore.isSoundEnabled) {
|
|
26
26
|
this.texture = this.normalTextureMap.NORMAL;
|
|
27
27
|
this.textures = this.normalTextureMap;
|
|
28
28
|
}
|
|
@@ -4,7 +4,7 @@ import { DropTransformationDetails, SymbolReel } from "../../connectivity";
|
|
|
4
4
|
import { AbstractColumnsContainer, AbstractFrame } from "../frame";
|
|
5
5
|
import { AbstractSymbolBase } from "./AbstractSymbolBase";
|
|
6
6
|
export declare abstract class AbstractSymbolsColumn extends Container implements SpeedAdapterInterface<number> {
|
|
7
|
-
|
|
7
|
+
protected columnsContainer: AbstractColumnsContainer;
|
|
8
8
|
protected allSymbols: SymbolId[];
|
|
9
9
|
spinning: boolean;
|
|
10
10
|
speedLevelMapper: import("../../application").SpeedLevelDirectory<number>;
|
|
@@ -29,6 +29,7 @@ export declare abstract class AbstractSymbolsColumn extends Container implements
|
|
|
29
29
|
private spinEndPromise;
|
|
30
30
|
protected abstract symbolTopOffset: number;
|
|
31
31
|
skipHidingMysteryFx: boolean;
|
|
32
|
+
protected abstract bonusSymbol: SymbolId;
|
|
32
33
|
private readonly _id;
|
|
33
34
|
protected constructor(id: string, columnsContainer: AbstractColumnsContainer, allSymbols: SymbolId[]);
|
|
34
35
|
protected abstract get tileHeight(): number;
|
|
@@ -51,7 +52,7 @@ export declare abstract class AbstractSymbolsColumn extends Container implements
|
|
|
51
52
|
handleMultipleSymbolDropping(transformations: DropTransformationDetails[], skipAnimation?: boolean): Promise<void>;
|
|
52
53
|
private changePhase;
|
|
53
54
|
private moveToTop;
|
|
54
|
-
protected
|
|
55
|
+
protected shouldPlaySpecialRollStopSound(): boolean;
|
|
55
56
|
handleStopping(): void;
|
|
56
57
|
protected abstract createNewSymbol(): AbstractSymbolBase;
|
|
57
58
|
private initSymbolSprites;
|
|
@@ -289,12 +289,25 @@ export class AbstractSymbolsColumn extends Container {
|
|
|
289
289
|
this.ensureTopOffset();
|
|
290
290
|
this.swapSymbolFace(symbol);
|
|
291
291
|
}
|
|
292
|
+
shouldPlaySpecialRollStopSound() {
|
|
293
|
+
for (let i = 0; i <= RainMan.config.numberOfColumns; i++) {
|
|
294
|
+
const currentColumn = this.columnsContainer.getColumnAtPosition(i);
|
|
295
|
+
const hasBonus = !!currentColumn.symbols
|
|
296
|
+
.toSpliced(RainMan.config.numberOfRows, 1)
|
|
297
|
+
.find((symbol) => symbol.id === this.bonusSymbol);
|
|
298
|
+
if (hasBonus && currentColumn === this)
|
|
299
|
+
return true;
|
|
300
|
+
if (!hasBonus)
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
292
305
|
handleStopping() {
|
|
293
306
|
if (!this.topMostSymbol || this.phase === Phase.END)
|
|
294
307
|
return;
|
|
295
308
|
if (this.topMostSymbol.y >= this.tileHeight / 2) {
|
|
296
309
|
if (!this.columnsContainer.quickReelsStop && RainMan.settingsStore.currentSpeed !== SPEED_LEVELS.fast)
|
|
297
|
-
SoundManager.play(this.shouldPlaySpecialRollStopSound() ? SoundTracks.
|
|
310
|
+
SoundManager.play(this.shouldPlaySpecialRollStopSound() ? SoundTracks.bonus : SoundTracks.rollStop);
|
|
298
311
|
this.fixStationaryPositions();
|
|
299
312
|
this.doStop();
|
|
300
313
|
return;
|
|
@@ -33,6 +33,7 @@ export declare class SettingsStore {
|
|
|
33
33
|
popupPaytableData?: PaytableData[];
|
|
34
34
|
currentSpeed: SpeedLevel;
|
|
35
35
|
popupPaytableRepositionCallback?: () => void;
|
|
36
|
+
updateVolumeButtonTexture?: () => void;
|
|
36
37
|
private readonly initialAutoplaySettingsState;
|
|
37
38
|
private modalsAvailable;
|
|
38
39
|
private paytableMap;
|
|
@@ -55,6 +56,7 @@ export declare class SettingsStore {
|
|
|
55
56
|
setBalancedDecreased(newValue: number): void;
|
|
56
57
|
setDataForSymbolPaytablePopup(symbolId: SymbolId, repositionCallback: () => void): void;
|
|
57
58
|
resetDataForSymbolPaytablePopup(): void;
|
|
59
|
+
setUpdateVolumeButtonTexture(fn: () => void): void;
|
|
58
60
|
repositionSymbolPaytablePopup(x: number, y: number): void;
|
|
59
61
|
initPaytableMap(initConfigData: InitDataInterface): void;
|
|
60
62
|
decreaseAutoSpinsCount(): void;
|
|
@@ -36,6 +36,7 @@ export class SettingsStore {
|
|
|
36
36
|
popupPaytableData;
|
|
37
37
|
currentSpeed = "slow";
|
|
38
38
|
popupPaytableRepositionCallback;
|
|
39
|
+
updateVolumeButtonTexture;
|
|
39
40
|
initialAutoplaySettingsState = {
|
|
40
41
|
infinitySpinsEnabled: false,
|
|
41
42
|
onAnyWin: false,
|
|
@@ -183,6 +184,9 @@ export class SettingsStore {
|
|
|
183
184
|
this.popupPaytableData = undefined;
|
|
184
185
|
this.popupPaytableRepositionCallback = undefined;
|
|
185
186
|
}
|
|
187
|
+
setUpdateVolumeButtonTexture(fn) {
|
|
188
|
+
this.updateVolumeButtonTexture = fn;
|
|
189
|
+
}
|
|
186
190
|
repositionSymbolPaytablePopup(x, y) {
|
|
187
191
|
this.popupPaytablePosition = { x, y };
|
|
188
192
|
}
|
|
@@ -254,6 +258,7 @@ export class SettingsStore {
|
|
|
254
258
|
}
|
|
255
259
|
setIsSoundEnabled(flag) {
|
|
256
260
|
this.isSoundEnabled = flag;
|
|
261
|
+
this.updateVolumeButtonTexture?.();
|
|
257
262
|
setToLocalStorage(LOCAL_STORAGE.isSoundEnabled, flag);
|
|
258
263
|
}
|
|
259
264
|
getMysteryPaytable(mysterySymbol, quantity = 3) {
|