pixi-rainman-game-engine 0.3.0 → 0.3.2
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.d.ts +23 -9
- package/dist/ComponentRegistry/ComponentRegistry.js +25 -10
- package/dist/ComponentRegistry/types.d.ts +3 -4
- package/dist/DescribedPlayableAction/DescribedPlayableAction.d.ts +2 -0
- package/dist/DescribedPlayableAction/DescribedPlayableAction.js +2 -0
- package/dist/Money/MoneyText.d.ts +5 -0
- package/dist/Money/MoneyText.js +5 -0
- package/dist/Rainman/appConfig.js +1 -0
- package/dist/Rainman/types.d.ts +1 -0
- package/dist/SettingsUI/hooks/useBuyFreeSpins/useBuyFreeSpins.d.ts +4 -0
- package/dist/SettingsUI/hooks/useBuyFreeSpins/useBuyFreeSpins.js +4 -0
- package/dist/SettingsUI/hooks/useDeviceOrientations.d.ts +4 -0
- package/dist/SettingsUI/hooks/useDeviceOrientations.js +4 -0
- package/dist/application/ApiConfig/ApiConfig.d.ts +2 -1
- package/dist/application/ApiConfig/ApiConfig.js +3 -2
- package/dist/application/ApiConfig/SymbolId.d.ts +1 -1
- package/dist/application/ButtonsEventManager/ButtonsEventManager.d.ts +42 -5
- package/dist/application/ButtonsEventManager/ButtonsEventManager.js +51 -9
- package/dist/application/SoundManager/SoundManager.d.ts +26 -1
- package/dist/application/SoundManager/SoundManager.js +30 -2
- package/dist/application/SpeedState/SpeedAdapter.d.ts +9 -0
- package/dist/application/SpeedState/SpeedAdapter.js +9 -0
- package/dist/application/SpeedState/SpeedLevel.d.ts +42 -0
- package/dist/application/SpeedState/SpeedLevel.js +30 -0
- package/dist/application/SpeedState/SpeedLevelHandler.d.ts +7 -0
- package/dist/application/SpeedState/SpeedLevelHandler.js +7 -0
- package/dist/application/SpinLogic/SpinLogic.d.ts +58 -0
- package/dist/application/SpinLogic/SpinLogic.js +58 -0
- package/dist/application/SpinLogic/SpinLogicDTO.d.ts +70 -0
- package/dist/application/SpinLogic/SpinLogicDTO.js +70 -0
- package/dist/application/SpinLogic/WinScenarios.d.ts +12 -0
- package/dist/application/SpinLogic/WinScenarios.js +12 -0
- package/dist/application/SpinLogic/types.d.ts +10 -0
- package/dist/application/TimedActions/IncentiveComponent.d.ts +10 -0
- package/dist/application/TimedActions/IncentiveComponent.js +9 -1
- package/dist/application/TimedActions/TimedIncentiveController.d.ts +37 -0
- package/dist/application/TimedActions/TimedIncentiveController.js +37 -0
- package/dist/application/setup.d.ts +0 -1
- package/dist/application/setup.js +0 -1
- package/dist/components/AbstractFreeSpinContainer/AbstractFreeSpinContainer.d.ts +36 -1
- package/dist/components/AbstractFreeSpinContainer/AbstractFreeSpinContainer.js +25 -0
- package/dist/components/AbstractMainContainer/AbstractMainContainer.d.ts +83 -2
- package/dist/components/AbstractMainContainer/AbstractMainContainer.js +97 -11
- package/dist/components/DoubleBorderText/DoubleBorderText.d.ts +10 -0
- package/dist/components/DoubleBorderText/DoubleBorderText.js +24 -0
- package/dist/components/DoubleBorderText/index.d.ts +1 -0
- package/dist/components/DoubleBorderText/index.js +1 -0
- package/dist/components/GambleGame/GambleGame.d.ts +39 -0
- package/dist/components/GambleGame/GambleGame.js +44 -3
- package/dist/components/GambleGame/types.d.ts +5 -0
- package/dist/components/buttons/BaseButton/BaseButton.d.ts +73 -2
- package/dist/components/buttons/BaseButton/BaseButton.js +73 -2
- package/dist/components/buttons/BaseButton/types.d.ts +5 -0
- package/dist/components/buttons/buttonGroups/LeftButtons.d.ts +11 -0
- package/dist/components/buttons/buttonGroups/LeftButtons.js +11 -0
- package/dist/components/buttons/buttonGroups/LeftButtonsLandscape.d.ts +13 -1
- package/dist/components/buttons/buttonGroups/LeftButtonsLandscape.js +13 -1
- package/dist/components/buttons/buttonGroups/LeftButtonsMobile.d.ts +19 -1
- package/dist/components/buttons/buttonGroups/LeftButtonsMobile.js +19 -1
- package/dist/components/buttons/buttonGroups/MiddleButtons.d.ts +27 -2
- package/dist/components/buttons/buttonGroups/MiddleButtons.js +46 -3
- package/dist/components/buttons/buttonGroups/RightButtons.d.ts +19 -3
- package/dist/components/buttons/buttonGroups/RightButtons.js +29 -1
- package/dist/components/buttons/buttonGroups/RightButtonsLandscape.d.ts +11 -0
- package/dist/components/buttons/buttonGroups/RightButtonsLandscape.js +11 -0
- package/dist/components/buttons/buttonGroups/RightButtonsMobile.d.ts +17 -0
- package/dist/components/buttons/buttonGroups/RightButtonsMobile.js +17 -0
- package/dist/components/buttons/default/AutoplayButton.d.ts +6 -0
- package/dist/components/buttons/default/AutoplayButton.js +8 -1
- package/dist/components/buttons/default/GambleButton.d.ts +13 -0
- package/dist/components/buttons/default/GambleButton.js +43 -0
- package/dist/components/buttons/default/RefreshButton.d.ts +30 -0
- package/dist/components/buttons/default/RefreshButton.js +36 -3
- package/dist/components/buttons/default/SpeedControlButton.d.ts +2 -0
- package/dist/components/buttons/default/SpeedControlButton.js +2 -0
- package/dist/components/buttons/default/TakeButton.d.ts +13 -0
- package/dist/components/buttons/default/TakeButton.js +37 -0
- package/dist/components/buttons/default/VolumeButton.d.ts +2 -0
- package/dist/components/buttons/default/VolumeButton.js +2 -0
- package/dist/components/buttons/default/index.d.ts +2 -0
- package/dist/components/buttons/default/index.js +2 -0
- package/dist/components/buttons/registrynames.d.ts +2 -0
- package/dist/components/buttons/registrynames.js +3 -1
- package/dist/components/common/AnimatedBackground.d.ts +22 -0
- package/dist/components/common/AnimatedBackground.js +22 -0
- package/dist/components/common/AnimatedNumber.d.ts +36 -0
- package/dist/components/common/AnimatedNumber.js +36 -0
- package/dist/components/common/Background.d.ts +20 -0
- package/dist/components/common/Background.js +22 -1
- package/dist/components/common/FreeSpinButton.d.ts +33 -1
- package/dist/components/common/FreeSpinButton.js +37 -4
- package/dist/components/common/IResizableContainer.d.ts +4 -0
- package/dist/components/common/Logo.d.ts +21 -0
- package/dist/components/common/Logo.js +21 -0
- package/dist/components/common/LogoStatic.d.ts +10 -0
- package/dist/components/common/LogoStatic.js +10 -0
- package/dist/components/common/ResponsiveComponent.d.ts +22 -0
- package/dist/components/common/ResponsiveComponent.js +10 -0
- package/dist/components/common/ResumableContainers.d.ts +6 -0
- package/dist/components/common/ResumableContainers.js +6 -0
- package/dist/components/common/ScalableSpine.d.ts +11 -0
- package/dist/components/common/ScalableSpine.js +11 -0
- package/dist/components/frame/AbstractColumnsContainer.d.ts +20 -6
- package/dist/components/frame/AbstractColumnsContainer.js +18 -4
- package/dist/components/frame/AbstractFrame.d.ts +115 -0
- package/dist/components/frame/AbstractFrame.js +97 -2
- package/dist/components/frame/AbstractInnerFrame.d.ts +5 -0
- package/dist/components/frame/AbstractInnerFrame.js +5 -0
- package/dist/components/frame/WinLineAnimation.d.ts +10 -0
- package/dist/components/frame/WinLineAnimation.js +12 -1
- package/dist/components/frame/constants.d.ts +7 -0
- package/dist/components/frame/constants.js +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/messageBox/MessageBox.d.ts +33 -0
- package/dist/components/messageBox/MessageBox.js +34 -1
- package/dist/components/symbols/AbstractSymbolBase.d.ts +146 -2
- package/dist/components/symbols/AbstractSymbolBase.js +137 -14
- package/dist/components/symbols/AbstractSymbolsColumn.d.ts +233 -3
- package/dist/components/symbols/AbstractSymbolsColumn.js +220 -10
- package/dist/components/symbols/DroppableSymbol.d.ts +16 -0
- package/dist/components/symbols/DroppableSymbol.js +16 -0
- package/dist/components/symbols/DroppableSymbolsColumn.d.ts +51 -0
- package/dist/components/symbols/DroppableSymbolsColumn.js +57 -3
- package/dist/components/symbols/types.d.ts +8 -0
- package/dist/components/symbols/types.js +4 -0
- package/dist/components/updatable/GambleUpdatableText.d.ts +5 -0
- package/dist/components/updatable/GambleUpdatableText.js +5 -0
- package/dist/components/updatable/StylefulUpdatableText.d.ts +23 -0
- package/dist/components/updatable/StylefulUpdatableText.js +25 -1
- package/dist/components/updatable/UpdatableValueComponent.d.ts +71 -0
- package/dist/components/updatable/UpdatableValueComponent.js +77 -4
- package/dist/connectivity/ConnectionWrapper.d.ts +20 -1
- package/dist/connectivity/ConnectionWrapper.js +23 -3
- package/dist/connectivity/LocalConnectionWrapper.d.ts +2 -2
- package/dist/connectivity/LocalConnectionWrapper.js +2 -2
- package/dist/connectivity/serverConnection.d.ts +59 -0
- package/dist/connectivity/serverData.d.ts +3 -1
- package/dist/connectivity/spinData.d.ts +15 -0
- package/dist/connectivity/spinData.js +15 -0
- package/dist/constants/gamePhase.d.ts +4 -0
- package/dist/controllers/AbstractController.d.ts +114 -5
- package/dist/controllers/AbstractController.js +180 -37
- package/dist/controllers/QuickStopController.d.ts +3 -0
- package/dist/controllers/QuickStopController.js +3 -0
- package/dist/controllers/UiController.d.ts +163 -1
- package/dist/controllers/UiController.js +170 -5
- package/dist/errors/LanguageNotDefinedError.d.ts +4 -0
- package/dist/errors/LanguageNotDefinedError.js +4 -0
- package/dist/errors/SpineDataNotFound.d.ts +4 -0
- package/dist/errors/SpineDataNotFound.js +4 -0
- package/dist/errors/TextureNotFound.d.ts +4 -0
- package/dist/errors/TextureNotFound.js +4 -0
- package/dist/loading/AbstractLoadingContainer.d.ts +16 -0
- package/dist/loading/AbstractLoadingContainer.js +16 -0
- package/dist/loading/SpriteLoadingContainer.d.ts +18 -0
- package/dist/loading/SpriteLoadingContainer.js +18 -0
- package/dist/localStorage/localStorage.d.ts +23 -0
- package/dist/localStorage/localStorage.js +19 -0
- package/dist/stores/SettingsStore.d.ts +276 -4
- package/dist/stores/SettingsStore.js +309 -14
- package/dist/stores/types.d.ts +4 -0
- package/dist/utils/assets/assetGetter.js +6 -3
- package/dist/utils/common/deviceOrientation.js +2 -1
- package/dist/utils/common/functions.d.ts +57 -1
- package/dist/utils/common/functions.js +63 -4
- package/dist/utils/common/logger.js +4 -2
- package/dist/utils/common/placementHelpers.d.ts +14 -0
- package/dist/utils/common/placementHelpers.js +20 -1
- package/dist/utils/common/screenHelpers.d.ts +28 -0
- package/dist/utils/common/screenHelpers.js +34 -3
- package/dist/utils/common/sound.d.ts +1 -0
- package/dist/utils/common/sound.js +2 -0
- package/dist/utils/common/stats.d.ts +1 -0
- package/dist/utils/common/stats.js +2 -0
- package/dist/winComponents/AnimableParticlesEmitter.d.ts +6 -0
- package/dist/winComponents/AnimableParticlesEmitter.js +6 -0
- package/dist/winComponents/BaseWinContainer.d.ts +64 -0
- package/dist/winComponents/BaseWinContainer.js +66 -1
- package/dist/winComponents/PositioningFrame.d.ts +7 -0
- package/dist/winComponents/PositioningFrame.js +7 -0
- package/dist/winComponents/TexturedText.d.ts +23 -0
- package/dist/winComponents/TexturedText.js +23 -0
- package/dist/winComponents/UpdatableSpineContainer.d.ts +25 -0
- package/dist/winComponents/UpdatableSpineContainer.js +25 -0
- package/package.json +1 -1
|
@@ -16,20 +16,91 @@ export declare class BaseButton extends Sprite {
|
|
|
16
16
|
private isActive;
|
|
17
17
|
private isOver;
|
|
18
18
|
private isDisabled;
|
|
19
|
-
|
|
19
|
+
protected _onClick: () => void;
|
|
20
20
|
private _customClickHandler;
|
|
21
21
|
constructor(name: string, textureMap: TextureMap, stateful?: boolean, clickSound?: Nullable<SoundTrack>);
|
|
22
|
+
/**
|
|
23
|
+
* Getter for active state
|
|
24
|
+
* @public
|
|
25
|
+
* @returns {boolean} true if button is active
|
|
26
|
+
*/
|
|
22
27
|
get active(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Function for forcing the button to change state
|
|
30
|
+
* This is based on isActive flag
|
|
31
|
+
* @public
|
|
32
|
+
* @returns {void}
|
|
33
|
+
*/
|
|
23
34
|
forceTextureUpdate(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Setter for onClick callback
|
|
37
|
+
* @public
|
|
38
|
+
* @param {() => void} callback callback for the button click event
|
|
39
|
+
* @returns {void}
|
|
40
|
+
*/
|
|
24
41
|
setOnClick(callback: () => void): void;
|
|
25
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Activate button to make it clickable
|
|
44
|
+
* @public
|
|
45
|
+
* @param {boolean} shouldActivate flag for the flag activation
|
|
46
|
+
* @returns {void}
|
|
47
|
+
*/
|
|
48
|
+
activate(shouldActivate: boolean): void;
|
|
49
|
+
/**
|
|
50
|
+
* Function for changing state of the button
|
|
51
|
+
* @public
|
|
52
|
+
* @param {boolean} makeDisabled flag for disabling the button
|
|
53
|
+
* @returns {void}
|
|
54
|
+
*/
|
|
26
55
|
flipDisabledFlag(makeDisabled: boolean): void;
|
|
56
|
+
/**
|
|
57
|
+
* Function for switching texture based on the state
|
|
58
|
+
* @protected
|
|
59
|
+
* @param {keyof typeof ButtonStates} state button state that we want to change
|
|
60
|
+
* @returns {void}
|
|
61
|
+
*/
|
|
27
62
|
protected switchTexture(state: keyof typeof ButtonStates): void;
|
|
63
|
+
/**
|
|
64
|
+
* Function for setting the texture map
|
|
65
|
+
* @protected
|
|
66
|
+
* @param {TextureMap} textureMap textures map used for button states
|
|
67
|
+
* @returns {void}
|
|
68
|
+
*/
|
|
28
69
|
protected setTextureMap(textureMap: TextureMap): void;
|
|
70
|
+
/**
|
|
71
|
+
* Getter for disabled state
|
|
72
|
+
* @public
|
|
73
|
+
* @returns {boolean} true if button is disabled
|
|
74
|
+
*/
|
|
29
75
|
get disabled(): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Getter for onClick callback
|
|
78
|
+
* @public
|
|
79
|
+
* @returns {typeof this._onClick} onClick callback
|
|
80
|
+
*/
|
|
30
81
|
get onClick(): typeof this._onClick;
|
|
82
|
+
/**
|
|
83
|
+
* Function for managing the state when the pointer is released
|
|
84
|
+
* @private
|
|
85
|
+
* @returns {void}
|
|
86
|
+
*/
|
|
31
87
|
private _manageStateUp;
|
|
88
|
+
/**
|
|
89
|
+
* Function for managing the state when the pointer is over (hovering) the button
|
|
90
|
+
* @private
|
|
91
|
+
* @returns {void}
|
|
92
|
+
*/
|
|
32
93
|
private _manageStateOver;
|
|
94
|
+
/**
|
|
95
|
+
* Function for managing the state when the pointer is clicked on the button
|
|
96
|
+
* @private
|
|
97
|
+
* @returns {void}
|
|
98
|
+
*/
|
|
33
99
|
private _manageStateDown;
|
|
100
|
+
/**
|
|
101
|
+
* Function for managing the state when the pointer is out of the button
|
|
102
|
+
* @private
|
|
103
|
+
* @returns {void}
|
|
104
|
+
*/
|
|
34
105
|
private _manageStateOut;
|
|
35
106
|
}
|
|
@@ -38,9 +38,20 @@ export class BaseButton extends Sprite {
|
|
|
38
38
|
this.eventMode = "dynamic";
|
|
39
39
|
this.isActive = false;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Getter for active state
|
|
43
|
+
* @public
|
|
44
|
+
* @returns {boolean} true if button is active
|
|
45
|
+
*/
|
|
41
46
|
get active() {
|
|
42
47
|
return this.isActive;
|
|
43
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Function for forcing the button to change state
|
|
51
|
+
* This is based on isActive flag
|
|
52
|
+
* @public
|
|
53
|
+
* @returns {void}
|
|
54
|
+
*/
|
|
44
55
|
forceTextureUpdate() {
|
|
45
56
|
this.isOver = false;
|
|
46
57
|
if (this.isActive) {
|
|
@@ -50,6 +61,12 @@ export class BaseButton extends Sprite {
|
|
|
50
61
|
this.switchTexture("NORMAL");
|
|
51
62
|
}
|
|
52
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Setter for onClick callback
|
|
66
|
+
* @public
|
|
67
|
+
* @param {() => void} callback callback for the button click event
|
|
68
|
+
* @returns {void}
|
|
69
|
+
*/
|
|
53
70
|
setOnClick(callback) {
|
|
54
71
|
this.removeAllListeners();
|
|
55
72
|
this._customClickHandler = callback;
|
|
@@ -67,29 +84,68 @@ export class BaseButton extends Sprite {
|
|
|
67
84
|
.on("touchcancel", this._manageStateUp)
|
|
68
85
|
.on("pointerdown", () => this.clickSound && SoundManager.play(this.clickSound));
|
|
69
86
|
}
|
|
70
|
-
|
|
71
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Activate button to make it clickable
|
|
89
|
+
* @public
|
|
90
|
+
* @param {boolean} shouldActivate flag for the flag activation
|
|
91
|
+
* @returns {void}
|
|
92
|
+
*/
|
|
93
|
+
activate(shouldActivate) {
|
|
94
|
+
this.isActive = shouldActivate;
|
|
72
95
|
this.forceTextureUpdate();
|
|
73
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Function for changing state of the button
|
|
99
|
+
* @public
|
|
100
|
+
* @param {boolean} makeDisabled flag for disabling the button
|
|
101
|
+
* @returns {void}
|
|
102
|
+
*/
|
|
74
103
|
flipDisabledFlag(makeDisabled) {
|
|
75
104
|
this.isDisabled = makeDisabled;
|
|
76
105
|
this.eventMode = makeDisabled ? "auto" : "static";
|
|
77
106
|
this.tint = makeDisabled ? TINT_DISABLED : TINT_ENABLED;
|
|
78
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Function for switching texture based on the state
|
|
110
|
+
* @protected
|
|
111
|
+
* @param {keyof typeof ButtonStates} state button state that we want to change
|
|
112
|
+
* @returns {void}
|
|
113
|
+
*/
|
|
79
114
|
switchTexture(state) {
|
|
80
115
|
if (this.textures[state]) {
|
|
81
116
|
this.texture = this.textures[state];
|
|
82
117
|
}
|
|
83
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Function for setting the texture map
|
|
121
|
+
* @protected
|
|
122
|
+
* @param {TextureMap} textureMap textures map used for button states
|
|
123
|
+
* @returns {void}
|
|
124
|
+
*/
|
|
84
125
|
setTextureMap(textureMap) {
|
|
85
126
|
this.textures = textureMap;
|
|
86
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Getter for disabled state
|
|
130
|
+
* @public
|
|
131
|
+
* @returns {boolean} true if button is disabled
|
|
132
|
+
*/
|
|
87
133
|
get disabled() {
|
|
88
134
|
return this.isDisabled;
|
|
89
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Getter for onClick callback
|
|
138
|
+
* @public
|
|
139
|
+
* @returns {typeof this._onClick} onClick callback
|
|
140
|
+
*/
|
|
90
141
|
get onClick() {
|
|
91
142
|
return this._onClick;
|
|
92
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Function for managing the state when the pointer is released
|
|
146
|
+
* @private
|
|
147
|
+
* @returns {void}
|
|
148
|
+
*/
|
|
93
149
|
_manageStateUp() {
|
|
94
150
|
if (this.isActive) {
|
|
95
151
|
if (this.isOver) {
|
|
@@ -106,6 +162,11 @@ export class BaseButton extends Sprite {
|
|
|
106
162
|
this.switchTexture("OVER");
|
|
107
163
|
}
|
|
108
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* Function for managing the state when the pointer is over (hovering) the button
|
|
167
|
+
* @private
|
|
168
|
+
* @returns {void}
|
|
169
|
+
*/
|
|
109
170
|
_manageStateOver() {
|
|
110
171
|
this.isOver = true;
|
|
111
172
|
if (this.isActive) {
|
|
@@ -115,6 +176,11 @@ export class BaseButton extends Sprite {
|
|
|
115
176
|
this.switchTexture("OVER");
|
|
116
177
|
}
|
|
117
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Function for managing the state when the pointer is clicked on the button
|
|
181
|
+
* @private
|
|
182
|
+
* @returns {void}
|
|
183
|
+
*/
|
|
118
184
|
_manageStateDown() {
|
|
119
185
|
if (this.isActive) {
|
|
120
186
|
this.switchTexture("ACTIVE_CLICKED");
|
|
@@ -123,6 +189,11 @@ export class BaseButton extends Sprite {
|
|
|
123
189
|
this.switchTexture("CLICKED");
|
|
124
190
|
}
|
|
125
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* Function for managing the state when the pointer is out of the button
|
|
194
|
+
* @private
|
|
195
|
+
* @returns {void}
|
|
196
|
+
*/
|
|
126
197
|
_manageStateOut() {
|
|
127
198
|
this.isOver = false;
|
|
128
199
|
if (this.isActive) {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Texture } from "pixi.js";
|
|
2
2
|
import { ButtonStates } from "./ButtonState";
|
|
3
|
+
/**
|
|
4
|
+
* Texture map for button states
|
|
5
|
+
* This map holds the textures for each button state
|
|
6
|
+
* @typedef {TextureMap}
|
|
7
|
+
*/
|
|
3
8
|
export type TextureMap = {
|
|
4
9
|
[ButtonStates.NORMAL]: Texture;
|
|
5
10
|
[ButtonStates.CLICKED]?: Texture;
|
|
@@ -17,6 +17,17 @@ export declare class LeftButtons extends ResponsiveContainer {
|
|
|
17
17
|
protected readonly credit: UpdatableTextComponent;
|
|
18
18
|
protected readonly bet: UpdatableTextComponent;
|
|
19
19
|
constructor(scaleMultiplier?: number);
|
|
20
|
+
/**
|
|
21
|
+
* Function for removing children from the registry
|
|
22
|
+
* This function removes the credit and bet text components from the RainMan component registry
|
|
23
|
+
* @public
|
|
24
|
+
* @returns {void}
|
|
25
|
+
*/
|
|
20
26
|
removeChildrenFromRegistry(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Function for reposition of the left buttons
|
|
29
|
+
* @protected
|
|
30
|
+
* @returns {void}
|
|
31
|
+
*/
|
|
21
32
|
protected reposition(): void;
|
|
22
33
|
}
|
|
@@ -30,6 +30,12 @@ export class LeftButtons extends ResponsiveContainer {
|
|
|
30
30
|
this.addChild(this.volumeButton, this.moreButton, this.infoButton, this.credit, this.bet);
|
|
31
31
|
RainMan.componentRegistry.addMany([this.volumeButton, this.moreButton, this.infoButton, this.credit, this.bet]);
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Function for removing children from the registry
|
|
35
|
+
* This function removes the credit and bet text components from the RainMan component registry
|
|
36
|
+
* @public
|
|
37
|
+
* @returns {void}
|
|
38
|
+
*/
|
|
33
39
|
removeChildrenFromRegistry() {
|
|
34
40
|
RainMan.componentRegistry.removeMany([
|
|
35
41
|
this.credit,
|
|
@@ -39,6 +45,11 @@ export class LeftButtons extends ResponsiveContainer {
|
|
|
39
45
|
this.infoButton
|
|
40
46
|
]);
|
|
41
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Function for reposition of the left buttons
|
|
50
|
+
* @protected
|
|
51
|
+
* @returns {void}
|
|
52
|
+
*/
|
|
42
53
|
reposition() {
|
|
43
54
|
const margin = 15;
|
|
44
55
|
this.y = RainMan.app.screen.height - this.height;
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import { ResponsiveContainer } from "../../common";
|
|
2
2
|
import { UpdatableTextComponent } from "../../updatable";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Buttons for mobile version.
|
|
5
|
+
* It's similar to PC, it has a bet value and total credit text, both created by {@link UpdatableTextComponent}.
|
|
6
|
+
* @augments {ResponsiveContainer}
|
|
5
7
|
*/
|
|
6
8
|
export declare class LeftButtonsLandscape extends ResponsiveContainer {
|
|
7
9
|
protected readonly credit: UpdatableTextComponent;
|
|
8
10
|
protected readonly bet: UpdatableTextComponent;
|
|
9
11
|
constructor();
|
|
12
|
+
/**
|
|
13
|
+
* Function for removing children from the registry
|
|
14
|
+
* @public
|
|
15
|
+
* @returns {void}
|
|
16
|
+
*/
|
|
10
17
|
removeChildrenFromRegistry(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Function for repositioning the left buttons
|
|
20
|
+
* @protected
|
|
21
|
+
* @returns {void}
|
|
22
|
+
*/
|
|
11
23
|
protected reposition(): void;
|
|
12
24
|
}
|
|
@@ -5,7 +5,9 @@ import { ResponsiveContainer } from "../../common";
|
|
|
5
5
|
import { UPDATABLE_MODES, UpdatableTextComponent } from "../../updatable";
|
|
6
6
|
import { COMPONENTS, REGISTRY } from "../registrynames";
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Buttons for mobile version.
|
|
9
|
+
* It's similar to PC, it has a bet value and total credit text, both created by {@link UpdatableTextComponent}.
|
|
10
|
+
* @augments {ResponsiveContainer}
|
|
9
11
|
*/
|
|
10
12
|
export class LeftButtonsLandscape extends ResponsiveContainer {
|
|
11
13
|
credit = new UpdatableTextComponent(COMPONENTS.creditText, i18next.t("credit"), UPDATABLE_MODES.money, RainMan.config.mobileFontSize);
|
|
@@ -19,9 +21,19 @@ export class LeftButtonsLandscape extends ResponsiveContainer {
|
|
|
19
21
|
RainMan.componentRegistry.addMany([this.credit, this.bet]);
|
|
20
22
|
this.resize();
|
|
21
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Function for removing children from the registry
|
|
26
|
+
* @public
|
|
27
|
+
* @returns {void}
|
|
28
|
+
*/
|
|
22
29
|
removeChildrenFromRegistry() {
|
|
23
30
|
RainMan.componentRegistry.removeMany([this.credit, this.bet]);
|
|
24
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Function for repositioning the left buttons
|
|
34
|
+
* @protected
|
|
35
|
+
* @returns {void}
|
|
36
|
+
*/
|
|
25
37
|
reposition() {
|
|
26
38
|
this.y = RainMan.app.screen.height - this.height;
|
|
27
39
|
this.credit.x = 70;
|
|
@@ -3,14 +3,32 @@ import { ResponsiveContainer } from "../../common";
|
|
|
3
3
|
import { UpdatableTextComponent } from "../../updatable";
|
|
4
4
|
import { MoreButton, VolumeButton } from "../default";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Buttons for mobile version. It has a settings button and total credit text {@link UpdatableTextComponent}.
|
|
7
|
+
* @augments {ResponsiveContainer}
|
|
7
8
|
*/
|
|
8
9
|
export declare class LeftButtonsMobile extends ResponsiveContainer {
|
|
9
10
|
protected readonly credit: UpdatableTextComponent;
|
|
10
11
|
protected readonly moreButton: MoreButton;
|
|
11
12
|
protected readonly volumeButton: VolumeButton;
|
|
12
13
|
constructor();
|
|
14
|
+
/**
|
|
15
|
+
* Function for removing children from the registry
|
|
16
|
+
* @public
|
|
17
|
+
* @returns {void}
|
|
18
|
+
*/
|
|
13
19
|
removeChildrenFromRegistry(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Function for repositions the buttons
|
|
22
|
+
* This function repositions the buttons in the mobile layout
|
|
23
|
+
* @protected
|
|
24
|
+
* @returns {void}
|
|
25
|
+
*/
|
|
14
26
|
protected reposition(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Function for updating the credit text style
|
|
29
|
+
* @public
|
|
30
|
+
* @param {Partial<ITextStyle>} style new style of credit text
|
|
31
|
+
* @returns {void}
|
|
32
|
+
*/
|
|
15
33
|
updateCreditTextStyle(style: Partial<ITextStyle>): void;
|
|
16
34
|
}
|
|
@@ -7,7 +7,8 @@ import { MoreButton, VolumeButton } from "../default";
|
|
|
7
7
|
import { COMPONENTS, REGISTRY } from "../registrynames";
|
|
8
8
|
import { MOBILE_BUTTONS_GAP, MOBILE_PANEL_BUTTON_SCALE, MOBILE_X_OFFSET, MOBILE_Y_BOTTOM_OFFSET } from "./constants";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Buttons for mobile version. It has a settings button and total credit text {@link UpdatableTextComponent}.
|
|
11
|
+
* @augments {ResponsiveContainer}
|
|
11
12
|
*/
|
|
12
13
|
export class LeftButtonsMobile extends ResponsiveContainer {
|
|
13
14
|
credit = new UpdatableTextComponent(COMPONENTS.creditText, i18next.t("credit"), UPDATABLE_MODES.money, RainMan.config.mobileFontSize);
|
|
@@ -24,9 +25,20 @@ export class LeftButtonsMobile extends ResponsiveContainer {
|
|
|
24
25
|
this.addChild(this.credit, this.moreButton);
|
|
25
26
|
RainMan.componentRegistry.addMany([this.credit, this.moreButton, this.volumeButton]);
|
|
26
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Function for removing children from the registry
|
|
30
|
+
* @public
|
|
31
|
+
* @returns {void}
|
|
32
|
+
*/
|
|
27
33
|
removeChildrenFromRegistry() {
|
|
28
34
|
RainMan.componentRegistry.removeMany([this.credit, this.volumeButton, this.moreButton]);
|
|
29
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Function for repositions the buttons
|
|
38
|
+
* This function repositions the buttons in the mobile layout
|
|
39
|
+
* @protected
|
|
40
|
+
* @returns {void}
|
|
41
|
+
*/
|
|
30
42
|
reposition() {
|
|
31
43
|
this.y = RainMan.app.screen.height;
|
|
32
44
|
this.moreButton.y = -MOBILE_Y_BOTTOM_OFFSET;
|
|
@@ -34,6 +46,12 @@ export class LeftButtonsMobile extends ResponsiveContainer {
|
|
|
34
46
|
this.credit.y = -MOBILE_Y_BOTTOM_OFFSET;
|
|
35
47
|
this.credit.x = this.moreButton.x + this.moreButton.width + MOBILE_BUTTONS_GAP;
|
|
36
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Function for updating the credit text style
|
|
51
|
+
* @public
|
|
52
|
+
* @param {Partial<ITextStyle>} style new style of credit text
|
|
53
|
+
* @returns {void}
|
|
54
|
+
*/
|
|
37
55
|
updateCreditTextStyle(style) {
|
|
38
56
|
this.credit.updateBaseTextStyle(style);
|
|
39
57
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Graphics } from "pixi.js";
|
|
2
2
|
import { ResponsiveContainer } from "../../common";
|
|
3
|
-
import { AutoplayButton, PlusButton, RefreshButton } from "../default";
|
|
3
|
+
import { AutoplayButton, GambleButton, PlusButton, RefreshButton, TakeButton } from "../default";
|
|
4
4
|
/**
|
|
5
|
-
* Class for managing middle buttons in game (MOBILE ONLY).
|
|
5
|
+
* Class for managing middle buttons in game (MOBILE ONLY).
|
|
6
|
+
* The class uses {@link AutoplayButton}, {@link PlusButton}, {@link RefreshButton}.
|
|
7
|
+
* @augments {ResponsiveContainer}
|
|
6
8
|
*/
|
|
7
9
|
export declare class MiddleButtons extends ResponsiveContainer {
|
|
8
10
|
private landscape;
|
|
@@ -10,8 +12,31 @@ export declare class MiddleButtons extends ResponsiveContainer {
|
|
|
10
12
|
protected readonly betButton: PlusButton;
|
|
11
13
|
protected readonly refreshButton: RefreshButton;
|
|
12
14
|
protected readonly positioningFrame: Graphics;
|
|
15
|
+
protected readonly gambleButton: GambleButton;
|
|
16
|
+
protected readonly takeButton: TakeButton;
|
|
13
17
|
constructor(landscape?: boolean);
|
|
18
|
+
/**
|
|
19
|
+
* Function for removing children from the registry
|
|
20
|
+
* @public
|
|
21
|
+
* @returns {void}
|
|
22
|
+
*/
|
|
14
23
|
removeChildrenFromRegistry(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Function for adding Gamble and Take buttons if they are defined
|
|
26
|
+
* @protected
|
|
27
|
+
* @returns {void}
|
|
28
|
+
*/
|
|
29
|
+
protected addGambleAndTakeButtons(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Function for initializing child positions
|
|
32
|
+
* @private
|
|
33
|
+
* @returns {void}
|
|
34
|
+
*/
|
|
15
35
|
private initChildPositions;
|
|
36
|
+
/**
|
|
37
|
+
* Function for repositioning the middle buttons
|
|
38
|
+
* @protected
|
|
39
|
+
* @returns {void}
|
|
40
|
+
*/
|
|
16
41
|
protected reposition(): void;
|
|
17
42
|
}
|
|
@@ -2,10 +2,12 @@ import { Graphics } from "pixi.js";
|
|
|
2
2
|
import { UXLayer } from "../../../layers";
|
|
3
3
|
import { RainMan } from "../../../Rainman";
|
|
4
4
|
import { ResponsiveContainer } from "../../common";
|
|
5
|
-
import { AutoplayButton, PlusButton, RefreshButton } from "../default";
|
|
5
|
+
import { AutoplayButton, GambleButton, PlusButton, RefreshButton, TakeButton } from "../default";
|
|
6
6
|
import { REGISTRY } from "../registrynames";
|
|
7
7
|
/**
|
|
8
|
-
* Class for managing middle buttons in game (MOBILE ONLY).
|
|
8
|
+
* Class for managing middle buttons in game (MOBILE ONLY).
|
|
9
|
+
* The class uses {@link AutoplayButton}, {@link PlusButton}, {@link RefreshButton}.
|
|
10
|
+
* @augments {ResponsiveContainer}
|
|
9
11
|
*/
|
|
10
12
|
export class MiddleButtons extends ResponsiveContainer {
|
|
11
13
|
landscape;
|
|
@@ -13,6 +15,8 @@ export class MiddleButtons extends ResponsiveContainer {
|
|
|
13
15
|
betButton = new PlusButton(true);
|
|
14
16
|
refreshButton = new RefreshButton(true);
|
|
15
17
|
positioningFrame = new Graphics();
|
|
18
|
+
gambleButton = new GambleButton(true);
|
|
19
|
+
takeButton = new TakeButton(true);
|
|
16
20
|
constructor(landscape = false) {
|
|
17
21
|
super();
|
|
18
22
|
this.landscape = landscape;
|
|
@@ -21,35 +25,69 @@ export class MiddleButtons extends ResponsiveContainer {
|
|
|
21
25
|
const buttons = [this.autoplayButton, this.betButton, this.refreshButton];
|
|
22
26
|
this.addChild(...buttons);
|
|
23
27
|
RainMan.componentRegistry.addMany(buttons);
|
|
28
|
+
this.addGambleAndTakeButtons();
|
|
24
29
|
this.positioningFrame.beginFill(0x000000, 0);
|
|
25
30
|
this.positioningFrame.drawRect(0, 0, 800, 250);
|
|
26
31
|
this.addChild(this.positioningFrame);
|
|
27
32
|
this.refreshButton.scale.set(0.75);
|
|
28
33
|
this.autoplayButton.scale.set(0.75);
|
|
29
34
|
this.betButton.scale.set(0.75);
|
|
35
|
+
this.takeButton.scale.set(0.75);
|
|
36
|
+
this.gambleButton.scale.set(0.75);
|
|
30
37
|
if (this.landscape) {
|
|
31
38
|
this.betButton.anchor.set(0.5, 2);
|
|
32
39
|
this.refreshButton.anchor.set(0.5, 0.5);
|
|
33
40
|
this.autoplayButton.anchor.set(0.5, -1);
|
|
41
|
+
this.takeButton.anchor.set(0.5, 2);
|
|
42
|
+
this.gambleButton.anchor.set(0.5, -1);
|
|
34
43
|
}
|
|
35
44
|
else {
|
|
36
45
|
this.autoplayButton.anchor.set(2, 0.5);
|
|
37
46
|
this.refreshButton.anchor.set(0.5, 0.5);
|
|
38
47
|
this.betButton.anchor.set(-1, 0.5);
|
|
48
|
+
this.takeButton.anchor.set(-1, 0.5);
|
|
49
|
+
this.gambleButton.anchor.set(2, 0.5);
|
|
39
50
|
}
|
|
40
51
|
this.initChildPositions();
|
|
41
52
|
if (this.landscape) {
|
|
42
53
|
this.scale.set(-1);
|
|
43
54
|
}
|
|
44
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Function for removing children from the registry
|
|
58
|
+
* @public
|
|
59
|
+
* @returns {void}
|
|
60
|
+
*/
|
|
45
61
|
removeChildrenFromRegistry() {
|
|
46
62
|
RainMan.componentRegistry.removeMany([
|
|
47
63
|
this.refreshButton,
|
|
48
64
|
this.autoplayButton,
|
|
49
65
|
this.betButton,
|
|
50
|
-
this.positioningFrame
|
|
66
|
+
this.positioningFrame,
|
|
67
|
+
...(this.gambleButton && RainMan.config.gambleGameEnabled ? [this.gambleButton] : []),
|
|
68
|
+
...(this.takeButton ? [this.takeButton] : [])
|
|
51
69
|
]);
|
|
52
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Function for adding Gamble and Take buttons if they are defined
|
|
73
|
+
* @protected
|
|
74
|
+
* @returns {void}
|
|
75
|
+
*/
|
|
76
|
+
addGambleAndTakeButtons() {
|
|
77
|
+
if (this.gambleButton && RainMan.config.gambleGameEnabled) {
|
|
78
|
+
this.addChild(this.gambleButton);
|
|
79
|
+
RainMan.componentRegistry.add(this.gambleButton);
|
|
80
|
+
}
|
|
81
|
+
if (this.takeButton) {
|
|
82
|
+
this.addChild(this.takeButton);
|
|
83
|
+
RainMan.componentRegistry.add(this.takeButton);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Function for initializing child positions
|
|
88
|
+
* @private
|
|
89
|
+
* @returns {void}
|
|
90
|
+
*/
|
|
53
91
|
initChildPositions() {
|
|
54
92
|
const { width, height } = this.positioningFrame;
|
|
55
93
|
this.refreshButton.x = width / 2;
|
|
@@ -67,5 +105,10 @@ export class MiddleButtons extends ResponsiveContainer {
|
|
|
67
105
|
this.betButton.y = height;
|
|
68
106
|
}
|
|
69
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Function for repositioning the middle buttons
|
|
110
|
+
* @protected
|
|
111
|
+
* @returns {void}
|
|
112
|
+
*/
|
|
70
113
|
reposition() { }
|
|
71
114
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Nullable } from "../../../utils";
|
|
2
2
|
import { ResponsiveContainer } from "../../common";
|
|
3
|
-
import {
|
|
4
|
-
import { AutoplayButton, NegButton, PlusButton, RefreshButton, SpeedControlButton } from "../default";
|
|
3
|
+
import { AutoplayButton, GambleButton, NegButton, PlusButton, RefreshButton, SpeedControlButton, TakeButton } from "../default";
|
|
5
4
|
/**
|
|
6
5
|
* Class for managing right buttons in game. The class uses {@link AutoplayButton}, {@link NegButton}, {@link PlusButton},
|
|
7
6
|
* {@link RefreshButton}, {@link SpeedControlButton} and gamble button {@link BaseButton} if exists.
|
|
@@ -15,8 +14,25 @@ export declare class RightButtons extends ResponsiveContainer {
|
|
|
15
14
|
protected readonly plusButton: PlusButton;
|
|
16
15
|
protected readonly refreshButton: RefreshButton;
|
|
17
16
|
protected readonly speedControlButton: SpeedControlButton;
|
|
18
|
-
protected readonly gambleButton: Nullable<
|
|
17
|
+
protected readonly gambleButton: Nullable<GambleButton>;
|
|
18
|
+
protected readonly takeButton: Nullable<TakeButton>;
|
|
19
19
|
constructor();
|
|
20
|
+
/**
|
|
21
|
+
* Function for removing the components from the registry
|
|
22
|
+
* @public
|
|
23
|
+
* @returns {void}
|
|
24
|
+
*/
|
|
20
25
|
removeChildrenFromRegistry(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Function for repositioning the right buttons
|
|
28
|
+
* @protected
|
|
29
|
+
* @returns {void}
|
|
30
|
+
*/
|
|
21
31
|
protected reposition(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Function for adding Gamble and Take buttons if they are defined
|
|
34
|
+
* @protected
|
|
35
|
+
* @returns {void}
|
|
36
|
+
*/
|
|
37
|
+
protected addGambleAndTakeButtons(): void;
|
|
22
38
|
}
|
|
@@ -17,6 +17,7 @@ export class RightButtons extends ResponsiveContainer {
|
|
|
17
17
|
refreshButton = new RefreshButton();
|
|
18
18
|
speedControlButton = new SpeedControlButton();
|
|
19
19
|
gambleButton = null;
|
|
20
|
+
takeButton = null;
|
|
20
21
|
constructor() {
|
|
21
22
|
super(-1);
|
|
22
23
|
this.name = REGISTRY.rightButtons;
|
|
@@ -31,17 +32,44 @@ export class RightButtons extends ResponsiveContainer {
|
|
|
31
32
|
]);
|
|
32
33
|
this.resize();
|
|
33
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Function for removing the components from the registry
|
|
37
|
+
* @public
|
|
38
|
+
* @returns {void}
|
|
39
|
+
*/
|
|
34
40
|
removeChildrenFromRegistry() {
|
|
35
41
|
RainMan.componentRegistry.removeMany([
|
|
36
42
|
this.autoplayButton,
|
|
37
43
|
this.negButton,
|
|
38
44
|
this.plusButton,
|
|
39
45
|
this.refreshButton,
|
|
40
|
-
this.speedControlButton
|
|
46
|
+
this.speedControlButton,
|
|
47
|
+
...(this.gambleButton ? [this.gambleButton] : []),
|
|
48
|
+
...(this.takeButton ? [this.takeButton] : [])
|
|
41
49
|
]);
|
|
42
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Function for repositioning the right buttons
|
|
53
|
+
* @protected
|
|
54
|
+
* @returns {void}
|
|
55
|
+
*/
|
|
43
56
|
reposition() {
|
|
44
57
|
this.y = RainMan.app.screen.height;
|
|
45
58
|
this.x = RainMan.app.screen.width;
|
|
46
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Function for adding Gamble and Take buttons if they are defined
|
|
62
|
+
* @protected
|
|
63
|
+
* @returns {void}
|
|
64
|
+
*/
|
|
65
|
+
addGambleAndTakeButtons() {
|
|
66
|
+
if (this.gambleButton && RainMan.config.gambleGameEnabled) {
|
|
67
|
+
this.addChild(this.gambleButton);
|
|
68
|
+
RainMan.componentRegistry.add(this.gambleButton);
|
|
69
|
+
}
|
|
70
|
+
if (this.takeButton) {
|
|
71
|
+
this.addChild(this.takeButton);
|
|
72
|
+
RainMan.componentRegistry.add(this.takeButton);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
47
75
|
}
|