Skip to content

Commit 00ac451

Browse files
committed
Trying to fix State order.
1 parent e0f0b35 commit 00ac451

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

v3/src/boot/CreateRenderer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ var CreateRenderer = function (game)
8080
{
8181
game.renderer = new CanvasRenderer(game);
8282
game.context = game.renderer.gameContext;
83+
// debug
84+
game.canvas.id = 'game';
8385
}
8486
};
8587

v3/src/checksum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
var CHECKSUM = {
2-
build: 'd9e54760-ed4f-11e6-a917-0f5f0c1052e9'
2+
build: 'ec84a400-ed6e-11e6-b72e-61e1cba6b1dc'
33
};
44
module.exports = CHECKSUM;

v3/src/state/StateManager.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -463,14 +463,6 @@ StateManager.prototype = {
463463

464464
console.log('loadComplete', state.sys.settings.key);
465465

466-
// Make sure to do load-update one last time before state is set to _created
467-
468-
// Stop doing this ...
469-
if (state.hasOwnProperty('loadUpdate'))
470-
{
471-
state.loadUpdate.call(state);
472-
}
473-
474466
this.startCreate(state);
475467
},
476468

@@ -492,8 +484,14 @@ StateManager.prototype = {
492484

493485
this.active.push({ index: i, state: state });
494486

487+
// console.log('a1');
488+
// console.dir(this.active);
489+
495490
// Sort the 'active' array based on the index property
496-
this.active.sort(this.sortStates.bind(this));
491+
this.active.sort(this.sortStates);
492+
493+
// console.log('a2');
494+
// console.dir(this.active);
497495

498496
state.sys.updates.running = true;
499497
},
@@ -516,6 +514,8 @@ StateManager.prototype = {
516514

517515
sortStates: function (stateA, stateB)
518516
{
517+
// console.log('sortStates', stateA.state.sys.settings.key, stateA.index, stateB.state.sys.settings.key, stateB.index);
518+
519519
// Sort descending
520520
if (stateA.index < stateB.index)
521521
{

0 commit comments

Comments
 (0)