Commit 835fad6e authored by Anton Danilov's avatar Anton Danilov Committed by Matyáš Latner

#439 Fixed black screen when pressed back button while loading new game

parent 3e6a99ef
......@@ -88,6 +88,7 @@ public class KidnappingGame extends AbstractTablexiaGame<GameState> {
private Group ruleMessage;
private boolean ruleMessageShown = false;
private StandardTablexiaButton ruleButton;
private boolean isBackButtonAllowed;
private DirectionSounds.SoundPack actualSoundPack;
......@@ -104,6 +105,7 @@ public class KidnappingGame extends AbstractTablexiaGame<GameState> {
@Override
protected void gameLoaded(final java.util.Map<String, String> gameState) {
isBackButtonAllowed = false;
getStage().addActor(map = Map.MapFactory.createInstance(this, gfxLibrary, getData()));
map.setMapScale(MAP_SCALE);
......@@ -210,7 +212,12 @@ public class KidnappingGame extends AbstractTablexiaGame<GameState> {
ruleMessageShown = true;
}
private void playRuleSound(float delay) {
@Override
public void backButtonPressed() {
if(isBackButtonAllowed) super.backButtonPressed();
}
private void playRuleSound(float delay) {
Timer.schedule(new Timer.Task(){
@Override
public void run() {
......@@ -241,6 +248,7 @@ public class KidnappingGame extends AbstractTablexiaGame<GameState> {
}
})));
}
isBackButtonAllowed = true;
}
@Override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment