ohzi-core 6.3.2 → 6.3.3

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": "ohzi-core",
3
- "version": "6.3.2",
3
+ "version": "6.3.3",
4
4
  "description": "OHZI Core Library",
5
5
  "source": "src/index.js",
6
6
  "module": "build/index.module.js",
@@ -8,11 +8,11 @@ export default class TransitionTable
8
8
  this.initial_state_data = {};
9
9
  }
10
10
 
11
- get(to_state, current_context)
11
+ get(from_state_name, to_state_name, current_context)
12
12
  {
13
13
  for (let i = 0; i < this.transitions.length; i++)
14
14
  {
15
- if (this.transitions[i].to === to_state)
15
+ if (this.transitions[i].from === from_state_name && this.transitions[i].to === to_state_name)
16
16
  {
17
17
  const action_sequencer = new ActionSequencerBuilder(this.initial_state_data).from_animation_sheet(this.transitions[i].data, current_context);
18
18
 
@@ -20,7 +20,17 @@ export default class TransitionTable
20
20
  }
21
21
  }
22
22
 
23
- console.error('TransitionTable.get no data found for: ', to_state);
23
+ for (let i = 0; i < this.transitions.length; i++)
24
+ {
25
+ if (this.transitions[i].to === to_state_name)
26
+ {
27
+ const action_sequencer = new ActionSequencerBuilder(this.initial_state_data).from_animation_sheet(this.transitions[i].data, current_context);
28
+
29
+ return action_sequencer;
30
+ }
31
+ }
32
+
33
+ console.error('TransitionTable.get no data found for: ', from_state_name, to_state_name);
24
34
  return undefined;
25
35
  }
26
36
 
@@ -29,7 +29,7 @@ export default class ViewStateTransitionHandler
29
29
  this.last_state.before_exit();
30
30
  this.current_state.show();
31
31
 
32
- this.action_sequencer = this.transition_table.get(this.current_state.name, this.current_state_data);
32
+ this.action_sequencer = this.transition_table.get(this.last_state.name, this.current_state.name, this.current_state_data);
33
33
  this.current_state.before_enter();
34
34
 
35
35
  this.action_sequencer.play();