ensure that GameState.onPush is invoked after the StateInfo object is registered in the 'states' list
This commit is contained in:
parent
a65e55651c
commit
24de53b6a4
|
@ -481,12 +481,12 @@ public class StateManager implements Disposable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
states.addLast(stateInfo);
|
||||||
|
|
||||||
Gdx.app.debug("StateManager", String.format("Pushing %sstate %s from push-queue.", (stateInfo.isOverlay ? "overlay " : ""), stateInfo));
|
Gdx.app.debug("StateManager", String.format("Pushing %sstate %s from push-queue.", (stateInfo.isOverlay ? "overlay " : ""), stateInfo));
|
||||||
stateInfo.state.onPush();
|
stateInfo.state.onPush();
|
||||||
|
|
||||||
transitionIn(stateInfo, false);
|
transitionIn(stateInfo, false);
|
||||||
|
|
||||||
states.addLast(stateInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (swapQueue.size() > 0) {
|
while (swapQueue.size() > 0) {
|
||||||
|
@ -504,12 +504,12 @@ public class StateManager implements Disposable {
|
||||||
currentTopStateInfo.isOverlayed = true;
|
currentTopStateInfo.isOverlayed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
states.addLast(stateInfo);
|
||||||
|
|
||||||
Gdx.app.debug("StateManager", String.format("Pushing %sstate %s from swap-queue.", (stateInfo.isOverlay ? "overlay " : ""), stateInfo));
|
Gdx.app.debug("StateManager", String.format("Pushing %sstate %s from swap-queue.", (stateInfo.isOverlay ? "overlay " : ""), stateInfo));
|
||||||
stateInfo.state.onPush();
|
stateInfo.state.onPush();
|
||||||
|
|
||||||
transitionIn(stateInfo, false);
|
transitionIn(stateInfo, false);
|
||||||
|
|
||||||
states.addLast(stateInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pushQueueHasOverlay = false;
|
pushQueueHasOverlay = false;
|
||||||
|
|
Loading…
Reference in a new issue