pixi-rainman-game-engine 0.1.23 → 0.1.24

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.
@@ -5,16 +5,24 @@ import React from "react";
5
5
  import { useStores } from "../../hooks";
6
6
  export const BetControls = observer(() => {
7
7
  const { settingStore } = useStores();
8
+ const onClick = (type) => {
9
+ if (type === "increase") {
10
+ settingStore.increaseBet?.();
11
+ }
12
+ else {
13
+ settingStore.decreaseBet?.();
14
+ }
15
+ };
8
16
  return (<div className="bet-container">
9
17
  <h2>{i18next.t("totalBet")}</h2>
10
18
  <div className="bet-container__controls">
11
- <button name="bet-minus" className="bet-container__button">
19
+ <button name="bet-minus" className="bet-container__button" onClick={() => onClick("decrease")}>
12
20
  -
13
21
  </button>
14
22
  <div className="bet-container__value">
15
23
  <p>{settingStore.betText}</p>
16
24
  </div>
17
- <button name="bet-plus" className="bet-container__button">
25
+ <button name="bet-plus" className="bet-container__button" onClick={() => onClick("increase")}>
18
26
  +
19
27
  </button>
20
28
  </div>
@@ -47,7 +47,7 @@
47
47
  flex-direction: row;
48
48
  }
49
49
 
50
- .bet-container__button:hover {
50
+ .bet-container__button:active {
51
51
  background-color: #fdf42550;
52
52
  color: #fdf425;
53
53
  border: 2px solid #fdf425;
@@ -14,7 +14,8 @@
14
14
 
15
15
  @media only screen and (max-width: 900px) {
16
16
  .close-modal-button {
17
- right: 20px;
18
- top: 10px;
17
+ right: 10px;
18
+ top: -5px;
19
+ padding: 0;
19
20
  }
20
21
  }
@@ -1,10 +1,14 @@
1
1
  import "./closeModalButton.css";
2
2
  import React from "react";
3
+ import { UI_ITEMS } from "../../../utils";
3
4
  import { useStores } from "../../hooks";
4
5
  export const CloseModalButton = ({ layerId, afterClose }) => {
5
6
  const { settingStore } = useStores();
6
7
  const onClose = () => {
7
8
  settingStore.handleModalInvocation?.(layerId);
9
+ if (layerId === UI_ITEMS.speedSettings) {
10
+ settingStore.setSpeedPopupVisibility?.("none");
11
+ }
8
12
  afterClose?.();
9
13
  };
10
14
  return (<button className="close-modal-button" onClick={onClose}>
@@ -131,6 +131,15 @@ body {
131
131
  background: rgba(173, 216, 230, 0.5);
132
132
  }
133
133
 
134
+ .ios-nonInteractive {
135
+ pointer-events: none;
136
+ opacity: 0 !important;
137
+ }
138
+ .ios-interactive {
139
+ pointer-events: auto;
140
+ opacity: 1 !important;
141
+ }
142
+
134
143
  .ios-scroller-animation {
135
144
  position: fixed;
136
145
  width: 100%;
@@ -29,6 +29,7 @@ export class ButtonsEventManager {
29
29
  disableButtons = this.setButtonAvailability(true);
30
30
  constructor() {
31
31
  RainMan.settingsStore.handleModalInvocation = this.handleModalInvocation.bind(this);
32
+ RainMan.settingsStore.setSpeedPopupVisibility = this.setSpeedPopupVisibility.bind(this);
32
33
  }
33
34
  /**
34
35
  * Method for initializing events in Settings UI
@@ -70,7 +70,7 @@ export class ConnectionWrapper {
70
70
  landscape: true,
71
71
  matched_ratio: "16:9",
72
72
  },
73
- locale: i18next.language,
73
+ language_code: i18next.language,
74
74
  vendor_id: RainMan.config.gameInitVendorId,
75
75
  }));
76
76
  RainMan.globals.currency = Currencies[this._initData.currency];
@@ -26,7 +26,7 @@ export type InitServerRequest = BaseServerRequest & {
26
26
  landscape: boolean;
27
27
  matched_ratio: string;
28
28
  };
29
- locale: string;
29
+ language_code: string;
30
30
  };
31
31
  export type SpinServerRequest = BaseServerRequest & {
32
32
  action: "spin";
@@ -6,6 +6,7 @@ export interface InitDataInterface {
6
6
  token: string;
7
7
  bets: Array<number>;
8
8
  currency: string;
9
+ language: string;
9
10
  symbols_names: Array<string>;
10
11
  symbols: Array<number>;
11
12
  streaks: Array<Array<Point>>;
@@ -53,7 +53,10 @@ export type RouletteWin = BaseWin & {
53
53
  export type JackpotWin = BaseWin & {
54
54
  type: typeof PossibleWins.jackpotMini | typeof PossibleWins.jackpotMinor | typeof PossibleWins.jackpotMajor | typeof PossibleWins.jackpotGrand;
55
55
  };
56
- export type Win = StreakWin | FreeSpinWin | GambleWin | MysteryWin | EggWin | GoldWin | BigWin | BonusWin | SuperBonusWin | ScatterWin | RouletteWin | JackpotWin;
56
+ export type CoinWin = BaseWin & {
57
+ type: typeof PossibleWins.coin;
58
+ };
59
+ export type Win = StreakWin | FreeSpinWin | GambleWin | MysteryWin | EggWin | GoldWin | BigWin | BonusWin | SuperBonusWin | ScatterWin | RouletteWin | JackpotWin | CoinWin;
57
60
  /**
58
61
  * Type represents data that come from backend
59
62
  *
@@ -36,6 +36,7 @@ export declare abstract class AbstractController<T> {
36
36
  protected mysteryFxSymbolMustFormWinningLine: boolean;
37
37
  protected mysteryWinSymbol: Nullable<SymbolId>;
38
38
  private componentRegistry;
39
+ protected skipFreeSpinSummary: boolean;
39
40
  protected _lastWinAmount: number;
40
41
  protected constructor(buttonsEventManager: ButtonsEventManager, mainContainer: AbstractMainContainer, connection: SubscribableConnectionWrapper);
41
42
  init(): void;
@@ -35,6 +35,7 @@ export class AbstractController {
35
35
  mysteryFxSymbolMustFormWinningLine = false;
36
36
  mysteryWinSymbol = null;
37
37
  componentRegistry;
38
+ skipFreeSpinSummary = false;
38
39
  _lastWinAmount = 0;
39
40
  constructor(buttonsEventManager, mainContainer, connection) {
40
41
  this.buttonsEventManager = buttonsEventManager;
@@ -47,6 +48,8 @@ export class AbstractController {
47
48
  this.componentRegistry = RainMan.componentRegistry;
48
49
  this.setupSpaceOrEnterListener();
49
50
  RainMan.settingsStore.showSuperBonusWin = this.showSuperBonusWin.bind(this);
51
+ RainMan.settingsStore.increaseBet = () => this.uiController.updateBet("increase");
52
+ RainMan.settingsStore.decreaseBet = () => this.uiController.updateBet("decrease");
50
53
  }
51
54
  init() {
52
55
  const initData = this.connection.initData();
@@ -520,7 +523,7 @@ export class AbstractController {
520
523
  this.uiController.updateShownFreeSpinAmount(freeSpinAward, isAdditionalFreeSpins);
521
524
  this.uiController.messageBox.showFreeSpinText();
522
525
  }
523
- if (this.invokeFreeSpinSummaryPlateAfterWin) {
526
+ if (this.invokeFreeSpinSummaryPlateAfterWin && !this.skipFreeSpinSummary) {
524
527
  await this.handleFreeSpinSummaryPlateInvocation();
525
528
  }
526
529
  if (RainMan.settingsStore.isAutoplayEnabled) {
@@ -36,6 +36,7 @@ export declare class SettingsStore {
36
36
  howManyFreeSpinsLeft: number;
37
37
  howManyAutoSpinsLeft: number;
38
38
  volumeLevel: number;
39
+ setSpeedPopupVisibility?: (visibility: "flex" | "none") => void;
39
40
  popupPaytablePosition?: Point;
40
41
  popupPaytableData?: PaytableData[];
41
42
  currentSpeed: SpeedLevel;
@@ -43,6 +44,8 @@ export declare class SettingsStore {
43
44
  updateVolumeButtonTexture?: () => void;
44
45
  handleModalInvocation?: (layerId: string) => void;
45
46
  showSuperBonusWin?: (callback: Promise<void>) => void;
47
+ increaseBet?: () => void;
48
+ decreaseBet?: () => void;
46
49
  private readonly initialAutoplaySettingsState;
47
50
  private modalsAvailable;
48
51
  private paytableMap;
@@ -51,6 +54,7 @@ export declare class SettingsStore {
51
54
  get indexOfSpeedLevel(): number;
52
55
  get isFreeSpinsPlayEnabled(): boolean;
53
56
  addCumulativeWinAmount(amount: number): void;
57
+ isIosScrollerInteractive(flag: boolean): void;
54
58
  resetCumulativeWinAmount(): void;
55
59
  updateBet(newBet: number): void;
56
60
  setBatteryFlag(flag: boolean): void;
@@ -42,6 +42,7 @@ export class SettingsStore {
42
42
  howManyFreeSpinsLeft = 0;
43
43
  howManyAutoSpinsLeft = INITIAL_AUTO_SPIN_COUNT;
44
44
  volumeLevel = getFromLocalStorage(LOCAL_STORAGE.volumeLevel, 100);
45
+ setSpeedPopupVisibility;
45
46
  popupPaytablePosition;
46
47
  popupPaytableData;
47
48
  currentSpeed = "slow";
@@ -49,6 +50,8 @@ export class SettingsStore {
49
50
  updateVolumeButtonTexture;
50
51
  handleModalInvocation;
51
52
  showSuperBonusWin;
53
+ increaseBet;
54
+ decreaseBet;
52
55
  initialAutoplaySettingsState = {
53
56
  infinitySpinsEnabled: false,
54
57
  onAnyWin: false,
@@ -110,6 +113,14 @@ export class SettingsStore {
110
113
  addCumulativeWinAmount(amount) {
111
114
  this.cumulativeWinAmount = this.cumulativeWinAmount + amount;
112
115
  }
116
+ isIosScrollerInteractive(flag) {
117
+ const scroller = document.querySelector(".ios-scroller");
118
+ const animation = document.querySelector(".ios-scroller-animation");
119
+ scroller?.classList.add(flag ? "ios-interactive" : "ios-nonInteractive");
120
+ animation?.classList.add(flag ? "ios-interactive" : "ios-nonInteractive");
121
+ scroller?.classList.remove(flag ? "ios-nonInteractive" : "ios-interactive");
122
+ animation?.classList.remove(flag ? "ios-nonInteractive" : "ios-interactive");
123
+ }
113
124
  resetCumulativeWinAmount() {
114
125
  this.cumulativeWinAmount = 0;
115
126
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
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",