pixi-rainman-game-engine 0.1.16 → 0.1.18
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 +3 -3
- package/dist/SettingsUI/components/CloseModalButton/index.d.ts +0 -1
- package/dist/SettingsUI/components/CloseModalButton/index.jsx +7 -7
- package/dist/SettingsUI/components/GameRules/index.jsx +4 -2
- package/dist/SettingsUI/components/OptionButton/index.jsx +1 -2
- package/dist/application/ButtonsEventManager/ButtonsEventManager.d.ts +1 -0
- package/dist/application/ButtonsEventManager/ButtonsEventManager.js +3 -0
- package/dist/components/common/AnimatedBackground.js +1 -0
- package/dist/stores/SettingsStore.d.ts +1 -0
- package/dist/stores/SettingsStore.js +1 -0
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import React, { useEffect, useState } from "react";
|
|
|
6
6
|
import { COMPONENTS } from "../../../components";
|
|
7
7
|
import { UI_ITEMS } from "../../../utils";
|
|
8
8
|
import { useStores } from "../../hooks";
|
|
9
|
-
import {
|
|
9
|
+
import { CloseModalButton } from "../CloseModalButton";
|
|
10
10
|
import { RichLimitingSlider } from "../RichLimitingSlider";
|
|
11
11
|
import { SpeedButtonWithHeader, SwitchWithHeader } from "../SwitchWithHeader";
|
|
12
12
|
export const AutoplaySettings = observer(() => {
|
|
@@ -109,11 +109,11 @@ export const AutoplaySettings = observer(() => {
|
|
|
109
109
|
<div className="autoplay-settings__confirmation-button" onClick={() => {
|
|
110
110
|
resetAutoplaySettings();
|
|
111
111
|
updateLimitsBounds(initialAutoSpinCount);
|
|
112
|
-
|
|
112
|
+
settingStore.handleModalInvocation?.(UI_ITEMS.autoplay);
|
|
113
113
|
}}>
|
|
114
114
|
<p>{i18next.t("cancel")}</p>
|
|
115
115
|
</div>
|
|
116
|
-
<div id={COMPONENTS.autoSpinConfirm} className="autoplay-settings__confirmation-button" onClick={() =>
|
|
116
|
+
<div id={COMPONENTS.autoSpinConfirm} className="autoplay-settings__confirmation-button" onClick={() => settingStore.handleModalInvocation?.(UI_ITEMS.autoplay)}>
|
|
117
117
|
<p>{i18next.t("confirm")}</p>
|
|
118
118
|
</div>
|
|
119
119
|
</div>
|
|
@@ -4,5 +4,4 @@ export type CloseModalButtonProps = {
|
|
|
4
4
|
layerId: string;
|
|
5
5
|
afterClose?: () => void;
|
|
6
6
|
};
|
|
7
|
-
export declare const closeModal: (modalID: string, afterCloseCallBack?: () => void) => void;
|
|
8
7
|
export declare const CloseModalButton: ({ layerId, afterClose }: CloseModalButtonProps) => JSX.Element;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "./closeModalButton.css";
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
4
|
-
const gameRulesModal = window.document.getElementById(modalID);
|
|
5
|
-
if (gameRulesModal !== null)
|
|
6
|
-
gameRulesModal.style.display = "none";
|
|
7
|
-
afterCloseCallBack && afterCloseCallBack();
|
|
8
|
-
};
|
|
3
|
+
import { useStores } from "../../hooks";
|
|
9
4
|
export const CloseModalButton = ({ layerId, afterClose }) => {
|
|
10
|
-
|
|
5
|
+
const { settingStore } = useStores();
|
|
6
|
+
const onClose = () => {
|
|
7
|
+
settingStore.handleModalInvocation?.(layerId);
|
|
8
|
+
afterClose?.();
|
|
9
|
+
};
|
|
10
|
+
return (<button className="close-modal-button" onClick={onClose}>
|
|
11
11
|
x
|
|
12
12
|
</button>);
|
|
13
13
|
};
|
|
@@ -5,9 +5,11 @@ import { observer } from "mobx-react-lite";
|
|
|
5
5
|
import React, { useState } from "react";
|
|
6
6
|
import CustomScroll from "react-custom-scroll";
|
|
7
7
|
import { UI_ITEMS } from "../../../utils";
|
|
8
|
-
import {
|
|
8
|
+
import { useStores } from "../../hooks";
|
|
9
|
+
import { CloseModalButton } from "../CloseModalButton";
|
|
9
10
|
import { gameRulesContent } from "./data";
|
|
10
11
|
export const GameRules = observer(() => {
|
|
12
|
+
const { settingStore } = useStores();
|
|
11
13
|
const [pageNumber, setPageNumber] = useState(0);
|
|
12
14
|
const changePage = (incrementor) => {
|
|
13
15
|
const numberOfPages = gameRulesContent.pages.length;
|
|
@@ -34,7 +36,7 @@ export const GameRules = observer(() => {
|
|
|
34
36
|
</div>
|
|
35
37
|
<div className="game-rules__page-control">
|
|
36
38
|
<div className="page-left" onClick={() => changePage(-1)}></div>
|
|
37
|
-
<div className="page-middle" onClick={() =>
|
|
39
|
+
<div className="page-middle" onClick={() => settingStore.handleModalInvocation?.(UI_ITEMS.gameRules)}></div>
|
|
38
40
|
<div className="page-right" onClick={() => changePage(1)}></div>
|
|
39
41
|
</div>
|
|
40
42
|
</div>);
|
|
@@ -4,7 +4,6 @@ import React from "react";
|
|
|
4
4
|
import { RainMan } from "../../../Rainman";
|
|
5
5
|
import { UI_ITEMS } from "../../../utils";
|
|
6
6
|
import { useStores } from "../../hooks";
|
|
7
|
-
import { closeModal } from "../CloseModalButton";
|
|
8
7
|
export const OptionButton = ({ option, currency, setMessage }) => {
|
|
9
8
|
const { settingStore } = useStores();
|
|
10
9
|
const onButtonClick = async (option) => {
|
|
@@ -24,7 +23,7 @@ export const OptionButton = ({ option, currency, setMessage }) => {
|
|
|
24
23
|
settingStore.setRoundNumber(data.getRawData().round_number);
|
|
25
24
|
settingStore.setFreeSpinNumberBought(option.amount);
|
|
26
25
|
RainMan.globals.throttledSpin?.();
|
|
27
|
-
|
|
26
|
+
settingStore.handleModalInvocation?.(UI_ITEMS.freeSpin);
|
|
28
27
|
}
|
|
29
28
|
catch (err) {
|
|
30
29
|
setMessage(err.message);
|
|
@@ -27,6 +27,9 @@ export class ButtonsEventManager {
|
|
|
27
27
|
};
|
|
28
28
|
enableButtons = this.setButtonAvailability(false);
|
|
29
29
|
disableButtons = this.setButtonAvailability(true);
|
|
30
|
+
constructor() {
|
|
31
|
+
RainMan.settingsStore.handleModalInvocation = this.handleModalInvocation.bind(this);
|
|
32
|
+
}
|
|
30
33
|
/**
|
|
31
34
|
* Method for initializing events in Settings UI
|
|
32
35
|
*
|
|
@@ -25,6 +25,7 @@ export class AnimatedBackground extends ResumableContainer {
|
|
|
25
25
|
this.mobileSpineName = mobileSpineName;
|
|
26
26
|
this.name = AnimatedBackground.registryName;
|
|
27
27
|
this.parentLayer = BackgroundLayer;
|
|
28
|
+
RainMan.settingsStore.containersWithSpines.push(this);
|
|
28
29
|
}
|
|
29
30
|
resize() {
|
|
30
31
|
this.changeSpineForOrientation();
|
|
@@ -40,6 +40,7 @@ export declare class SettingsStore {
|
|
|
40
40
|
currentSpeed: SpeedLevel;
|
|
41
41
|
popupPaytableRepositionCallback?: () => void;
|
|
42
42
|
updateVolumeButtonTexture?: () => void;
|
|
43
|
+
handleModalInvocation?: (layerId: string) => void;
|
|
43
44
|
private readonly initialAutoplaySettingsState;
|
|
44
45
|
private modalsAvailable;
|
|
45
46
|
private paytableMap;
|
package/package.json
CHANGED