pixi-rainman-game-engine 0.2.26 → 0.2.27

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,15 +1,17 @@
1
1
  import { Container } from "pixi.js";
2
+ import { Spine } from "pixi-spine";
2
3
  /**
3
4
  * Class representing animated number, based on spine animation.
4
5
  * Animation names should be exact the same as a represented symbol.
5
6
  */
6
7
  export declare class AnimatedNumber extends Container {
7
- private spineName;
8
- private number;
9
- private digits;
8
+ spineName: string;
9
+ number: number | string;
10
+ digits: Spine[];
10
11
  constructor(spineName: string, number: number | string);
11
12
  private setDigits;
12
- private removeDigits;
13
+ setMoveAnimation(): void;
14
+ removeDigits(): void;
13
15
  get value(): number | string;
14
16
  set value(value: number | string);
15
17
  play(): void;
@@ -31,6 +31,22 @@ export class AnimatedNumber extends Container {
31
31
  });
32
32
  this.pivot.set(this.width / 2, this.height / 2);
33
33
  }
34
+ setMoveAnimation() {
35
+ this.removeDigits();
36
+ Array.from(this.number.toString()).forEach((digit) => {
37
+ const digitSpine = new Spine(getSpineData(this.spineName));
38
+ digitSpine.state.setAnimation(0, digit + "-move", true);
39
+ digitSpine.x = (this.digits.at(-1)?.x || 0) + digitSpine.width * 2;
40
+ if (digit === "." || digit === ",") {
41
+ digitSpine.x += 15;
42
+ digitSpine.y += 25;
43
+ }
44
+ digitSpine.state.timeScale = 1;
45
+ this.addChild(digitSpine);
46
+ this.digits.push(digitSpine);
47
+ });
48
+ this.pivot.set(this.width / 2, this.height / 2);
49
+ }
34
50
  removeDigits() {
35
51
  this.digits.forEach((digit) => this.removeChild(digit));
36
52
  this.digits = [];
@@ -150,7 +150,7 @@ export class ConnectionWrapper {
150
150
  extra_data
151
151
  });
152
152
  this._messageHistory.push(data);
153
- this.sendEndOfRoundData(roundNumber - 1);
153
+ this.sendEndOfRoundData(roundNumber);
154
154
  return new SpinData(this.config, data);
155
155
  }
156
156
  /**
@@ -192,7 +192,7 @@ export class ConnectionWrapper {
192
192
  choice
193
193
  }));
194
194
  this._messageHistory.push(this.lastGambleResponse);
195
- this.sendEndOfRoundData(roundNumber - 1);
195
+ this.sendEndOfRoundData(roundNumber);
196
196
  return this.lastGambleResponse;
197
197
  }
198
198
  /**
@@ -86,12 +86,17 @@ export declare abstract class AbstractController<T> {
86
86
  * Function for disabling speed button
87
87
  * @param {boolean} shouldBeDisabled flag to disable speed button
88
88
  */
89
- private disableSpeedButton;
89
+ disableSpeedButton(shouldBeDisabled: boolean): void;
90
90
  /**
91
91
  * Function for disabling information buttons
92
92
  * @param {boolean} shouldBeDisabled flag to disable information buttons
93
93
  */
94
94
  disableInformationButtons(shouldBeDisabled: boolean): void;
95
+ /**
96
+ * Function for disabling refresh buttons
97
+ * @param {boolean} shouldBeDisabled flag to disable refresh buttons
98
+ */
99
+ disableRefreshButton(shouldBeDisabled: boolean): void;
95
100
  /**
96
101
  * Function for handling disabling buttons
97
102
  * @param {boolean} disabled flag to disable buttons
@@ -177,6 +177,13 @@ export class AbstractController {
177
177
  ];
178
178
  buttonsToChange.forEach((button) => button.flipDisabledFlag(shouldBeDisabled));
179
179
  }
180
+ /**
181
+ * Function for disabling refresh buttons
182
+ * @param {boolean} shouldBeDisabled flag to disable refresh buttons
183
+ */
184
+ disableRefreshButton(shouldBeDisabled) {
185
+ RainMan.componentRegistry.get(BUTTONS.refresh).flipDisabledFlag(shouldBeDisabled);
186
+ }
180
187
  /**
181
188
  * Function for handling disabling buttons
182
189
  * @param {boolean} disabled flag to disable buttons
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.2.26",
3
+ "version": "0.2.27",
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",