pixi-rainman-game-engine 0.1.27 → 0.1.29

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.
@@ -1,4 +1,4 @@
1
- import { isIncentiveComponentInterface, isSpeedAdapterInterface, SpeedLevelHandler, TimedIncentiveController, } from "../application";
1
+ import { isIncentiveComponentInterface, isSpeedAdapterInterface, SPEED_LEVELS, SpeedLevelHandler, TimedIncentiveController, } from "../application";
2
2
  import { SpeedControlButton } from "../components";
3
3
  import { RainMan } from "../Rainman";
4
4
  import { openFullscreen } from "../utils";
@@ -52,6 +52,9 @@ export class ComponentRegistry {
52
52
  */
53
53
  nextSpeedLevel() {
54
54
  this.speedLevelHandler.nextSpeed();
55
+ if (this.speedLevelHandler.currentSpeed !== SPEED_LEVELS.slow) {
56
+ RainMan.globals.disableSpeedPopup?.(false);
57
+ }
55
58
  RainMan.settingsStore.setSpeedLevel(this.speedLevelHandler.currentSpeed);
56
59
  this.updateAllSpeedAdaptable(RainMan.settingsStore.currentSpeed);
57
60
  this.get(SpeedControlButton.registryName).forceTextureUpdate();
@@ -15,6 +15,7 @@ export const defaultAppConfig = {
15
15
  updatableTextValueColor: new Color(0xffffff).toHex(),
16
16
  autoplayGlowColor: new Color(0xff3000).toNumber(),
17
17
  fontFace: ["HelveticaNeueLTStd"],
18
+ disableFreeSpinText: false,
18
19
  winLineIndicatorSymbolScale: 0.75,
19
20
  durationOfActions: {
20
21
  eachColumnsSpinDelay: [0, 200, 700, 1200, 1800],
@@ -22,6 +22,7 @@ export type OptionalAppConfig = {
22
22
  mobileFontFace?: string[];
23
23
  autoplayGlowColor: number;
24
24
  winLineIndicatorSymbolScale: number;
25
+ disableFreeSpinText: boolean;
25
26
  durationOfActions: {
26
27
  eachColumnsSpinDelay: number[];
27
28
  spinBaseTime: number;
@@ -56,5 +57,6 @@ export type OptionalAppConfig = {
56
57
  export type AppConfig = RequiredAppConfig & DeepPartial<OptionalAppConfig>;
57
58
  export interface Globals {
58
59
  currency: Currency;
60
+ disableSpeedPopup?: (value: boolean) => void;
59
61
  throttledSpin?: () => void;
60
62
  }
@@ -224,7 +224,7 @@
224
224
  width: 100%;
225
225
  flex-wrap: wrap;
226
226
  height: fit-content;
227
- overflow: hidden;
227
+ margin-block: 8px;
228
228
  }
229
229
 
230
230
  .autoplay-settings__limit.circle p {
@@ -11,16 +11,17 @@
11
11
  display: flex;
12
12
  align-items: center;
13
13
  justify-content: center;
14
- width: 150px;
15
- height: 60px;
16
- border-radius: 60px;
14
+ min-width: 140px;
15
+ width: fit-content;
16
+ text-align: center;
17
+ height: fit-content;
18
+ border-radius: 32px;
17
19
  border: 2px white;
18
20
  border-style: solid;
19
- margin: 0px 10px;
20
21
  }
21
22
 
22
23
  .bet-container__value p {
23
- font-size: 25px;
24
+ font-size: 24px;
24
25
  }
25
26
 
26
27
  .bet-container__button {
@@ -44,7 +45,7 @@
44
45
 
45
46
  .bet-container__controls {
46
47
  display: flex;
47
- flex-direction: row;
48
+ gap: 8px;
48
49
  }
49
50
 
50
51
  .bet-container__button:active {
@@ -70,6 +70,7 @@ export class ButtonsEventManager {
70
70
  RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.normal);
71
71
  this.setSpeedPopupVisibility("none");
72
72
  messageBox.updateIncentiveText(i18n.t("rabbitSelected"));
73
+ RainMan.globals.disableSpeedPopup?.(true);
73
74
  });
74
75
  }
75
76
  }
@@ -80,6 +81,7 @@ export class ButtonsEventManager {
80
81
  RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.fast);
81
82
  this.setSpeedPopupVisibility("none");
82
83
  messageBox.updateIncentiveText(i18n.t("cheetahSelected"));
84
+ RainMan.globals.disableSpeedPopup?.(true);
83
85
  });
84
86
  }
85
87
  }
@@ -13,6 +13,7 @@ export interface SoundTracks {
13
13
  mysteryFxEnd: "mysteryFxEnd";
14
14
  mysteryFxLoop: "mysteryFxLoop";
15
15
  line: "line";
16
+ freeLine: "freeLine";
16
17
  mysteryDrawLoop: "mysteryDrawLoop";
17
18
  rollStop: "rollStop";
18
19
  specialSymbolOnReel: "specialSymbolOnReel";
@@ -36,6 +37,7 @@ export type SoundTrack = SoundTracks[keyof SoundTracks];
36
37
  * @property {string} mysteryFxEnd - on mystery fx hides
37
38
  * @property {string} mysteryFxLoop - when mystery fx in visible in loop
38
39
  * @property {string} line - default win line sound, for both single and multiple lines
40
+ * @property {string} freeLine - win line sound for free spins
39
41
  * @property {string} mysteryDrawLoop - on show mystery popup, play during randomizing win
40
42
  * @property {string} rollStop - single reel stopping
41
43
  * @property {string} specialSymbolOnReel - single reel stopping with special symbol like bonus or mystery
@@ -16,5 +16,6 @@ export const SoundTracks = {
16
16
  rollStop: "rollStop",
17
17
  specialSymbolOnReel: "specialSymbolOnReel",
18
18
  start: "start",
19
+ freeLine: "freeLine",
19
20
  symbol: "symbol",
20
21
  };
@@ -1,6 +1,6 @@
1
1
  import { BaseButton } from "../BaseButton";
2
2
  export declare class VolumeButton extends BaseButton {
3
- static readonly registryName = "volume";
3
+ static readonly registryName = "volumeButton";
4
4
  private readonly normalTextureMap;
5
5
  private readonly muteTextureMap;
6
6
  constructor();
@@ -2,7 +2,7 @@ import { RainMan } from "../../../Rainman";
2
2
  import { getTexture } from "../../../utils";
3
3
  import { BaseButton, ButtonStates } from "../BaseButton";
4
4
  export class VolumeButton extends BaseButton {
5
- static registryName = "volume";
5
+ static registryName = "volumeButton";
6
6
  normalTextureMap;
7
7
  muteTextureMap;
8
8
  constructor() {
@@ -5,6 +5,7 @@ export declare const BUTTONS: {
5
5
  readonly info: "infoButton";
6
6
  readonly more: "moreButton";
7
7
  readonly gamble: "gambleButton";
8
+ readonly volume: "volumeButton";
8
9
  };
9
10
  export declare const REGISTRY: {
10
11
  leftButtons: string;
@@ -5,6 +5,7 @@ export const BUTTONS = {
5
5
  info: "infoButton",
6
6
  more: "moreButton",
7
7
  gamble: "gambleButton",
8
+ volume: "volumeButton",
8
9
  };
9
10
  export const REGISTRY = {
10
11
  leftButtons: "leftButtons",
@@ -123,8 +123,8 @@ export class AbstractColumnsContainer extends Container {
123
123
  promises.push(promise);
124
124
  });
125
125
  });
126
- SoundManager.play(SoundTracks.line);
127
- await Promise.all(promises);
126
+ SoundManager.play(RainMan.settingsStore.isFreeSpinsPlayEnabled ? SoundTracks.freeLine : SoundTracks.line);
127
+ await Promise.allSettled(promises);
128
128
  }
129
129
  resetPlayedSounds() {
130
130
  this.playedSounds = [];
@@ -140,7 +140,7 @@ export class AbstractColumnsContainer extends Container {
140
140
  return;
141
141
  }
142
142
  if (this.playLineSoundOnEachStreak)
143
- SoundManager.play(SoundTracks.line);
143
+ SoundManager.play(RainMan.settingsStore.isFreeSpinsPlayEnabled ? SoundTracks.freeLine : SoundTracks.line);
144
144
  }
145
145
  /**
146
146
  * Function for playing animation of streak
@@ -100,6 +100,8 @@ export class MessageBox extends Container {
100
100
  }
101
101
  }
102
102
  showCurrentWinText() {
103
+ if (RainMan.settingsStore.isFreeSpinsPlayEnabled && RainMan.config.disableFreeSpinText)
104
+ return;
103
105
  this.hideIncentiveText();
104
106
  if (this.currentWinShown)
105
107
  return;
@@ -117,6 +119,8 @@ export class MessageBox extends Container {
117
119
  this.addChild(this.autoSpinText);
118
120
  }
119
121
  showFreeSpinText() {
122
+ if (RainMan.config.disableFreeSpinText)
123
+ return;
120
124
  this.hideIncentiveText();
121
125
  this.hideAutoSpinText();
122
126
  this.hideWinLineIndicator();
@@ -45,6 +45,7 @@ export declare abstract class AbstractController<T> {
45
45
  private setupSpaceOrEnterListener;
46
46
  private disableBetButtons;
47
47
  private disableSpeedButton;
48
+ private disableInformationButtons;
48
49
  protected handleDisablingButtons(disabled?: boolean): void;
49
50
  private initButtons;
50
51
  private initBetButtons;
@@ -109,9 +109,18 @@ export class AbstractController {
109
109
  disableSpeedButton(shouldBeDisabled) {
110
110
  RainMan.componentRegistry.get(SpeedControlButton.registryName).flipDisabledFlag(shouldBeDisabled);
111
111
  }
112
+ disableInformationButtons(shouldBeDisabled) {
113
+ const buttonsToChange = [
114
+ RainMan.componentRegistry.get(BUTTONS.info),
115
+ RainMan.componentRegistry.get(BUTTONS.more),
116
+ RainMan.componentRegistry.get(BUTTONS.volume),
117
+ ];
118
+ buttonsToChange.forEach((button) => button.flipDisabledFlag(shouldBeDisabled));
119
+ }
112
120
  handleDisablingButtons(disabled) {
113
121
  this.disableBetButtons(disabled ?? this.shouldBetButtonsBeDisabled);
114
122
  this.disableSpeedButton(disabled ?? this.shouldButtonsBeDisabled);
123
+ this.disableInformationButtons(disabled ?? this.shouldButtonsBeDisabled);
115
124
  }
116
125
  initButtons() {
117
126
  this.buttonsEventManager.initVolumeButtonEvent();
@@ -8,5 +8,6 @@ export declare class QuickStopController {
8
8
  constructor(buttonsEventManager: ButtonsEventManager);
9
9
  handleInvokingSpeedPopup(): void;
10
10
  handleSpeedPopupInvocation(): void;
11
+ setSpeedPopupDisabled(value: boolean): void;
11
12
  handleResetCounter(shouldReset: boolean): void;
12
13
  }
@@ -9,6 +9,7 @@ export class QuickStopController {
9
9
  speedPopupDisabled = false;
10
10
  constructor(buttonsEventManager) {
11
11
  this.buttonsEventManager = buttonsEventManager;
12
+ RainMan.globals.disableSpeedPopup = this.handleSpeedPopupInvocation.bind(this);
12
13
  }
13
14
  handleInvokingSpeedPopup() {
14
15
  if (!this.quickStopCounterLock &&
@@ -29,6 +30,9 @@ export class QuickStopController {
29
30
  }
30
31
  this.quickStopCounterLock = false;
31
32
  }
33
+ setSpeedPopupDisabled(value) {
34
+ this.speedPopupDisabled = value;
35
+ }
32
36
  handleResetCounter(shouldReset) {
33
37
  if (shouldReset)
34
38
  this.quickStopsCounter = 0;
@@ -4,7 +4,7 @@ import { RainMan } from "../Rainman";
4
4
  import { ceilToDecimal } from "../utils";
5
5
  export class UiController {
6
6
  config;
7
- lastBet = 0;
7
+ lastBet = RainMan.settingsStore.bet ?? 0;
8
8
  _messageBox;
9
9
  _totalNumberOfFreeSpins = 0;
10
10
  _totalFreeSpinWinAmount = 0;
@@ -71,7 +71,7 @@ export class UiController {
71
71
  beforeUpdateBet(_lastBet) { }
72
72
  afterUpdateBet(_bet) { }
73
73
  updateBet(strategy) {
74
- if (RainMan.settingsStore.isFreeSpinsPlayEnabled || RainMan.settingsStore.isAutoplayEnabled)
74
+ if (RainMan.settingsStore.isFreeSpinsPlayEnabled)
75
75
  return;
76
76
  const bet = this.getNewBet(strategy);
77
77
  this.beforeUpdateBet(this.lastBet);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "This repository contains all of the mechanics that used in rainman games.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",