@urso/core 0.7.39 → 0.7.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urso/core",
3
- "version": "0.7.39",
3
+ "version": "0.7.40",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
@@ -1,4 +1,5 @@
1
1
  class ModulesStatesManagerController {
2
+
2
3
  constructor() {
3
4
  this.singleton = true;
4
5
 
@@ -66,14 +67,16 @@ class ModulesStatesManagerController {
66
67
 
67
68
  return {
68
69
  next: (() => {
70
+ let statesArray = Object.keys(this._configStates);
71
+
72
+ //force next state
69
73
  if (this._forceNextStateKey) {
70
74
  const forceNextStateKey = this._forceNextStateKey;
71
75
  this._forceNextStateKey = null;
76
+ nextIndex = statesArray.indexOf(forceNextStateKey) + 1;
72
77
  return forceNextStateKey;
73
78
  }
74
79
 
75
- let statesArray = Object.keys(this._configStates);
76
-
77
80
  //nextState
78
81
  if (this._currentState) {
79
82
  const currentState = this._configStates[this._currentState];
@@ -173,7 +176,9 @@ class ModulesStatesManagerController {
173
176
  }
174
177
 
175
178
  checkStateGuard = (key) => {
176
- return this.statesGuards.checkGuard(key);
179
+ const guardResult = this.statesGuards.checkGuard(key);
180
+ log('%c State guard ' + key + ' is ' + guardResult, 'background: #DA55C4; color: #000')
181
+ return guardResult;
177
182
  }
178
183
 
179
184
  removeStateGuard = (key, guard) => {
@@ -182,4 +187,4 @@ class ModulesStatesManagerController {
182
187
 
183
188
  }
184
189
 
185
- module.exports = ModulesStatesManagerController;
190
+ module.exports = ModulesStatesManagerController;