v0.8.0: fixed info windows from WndStartGame rarely appearing beneath it

This commit is contained in:
Evan Debenham 2019-11-14 11:08:08 -05:00
parent b6b3c107f9
commit 1bc5845e77

View File

@ -122,7 +122,7 @@ public class WndStartGame extends Window {
Icons.get( SPDSettings.challenges() > 0 ? Icons.CHALLENGE_ON :Icons.CHALLENGE_OFF)){ Icons.get( SPDSettings.challenges() > 0 ? Icons.CHALLENGE_ON :Icons.CHALLENGE_OFF)){
@Override @Override
protected void onClick() { protected void onClick() {
ShatteredPixelDungeon.scene().add(new WndChallenges(SPDSettings.challenges(), true) { ShatteredPixelDungeon.scene().addToFront(new WndChallenges(SPDSettings.challenges(), true) {
public void onBackPressed() { public void onBackPressed() {
super.onBackPressed(); super.onBackPressed();
icon( Icons.get( SPDSettings.challenges() > 0 ? icon( Icons.get( SPDSettings.challenges() > 0 ?
@ -208,8 +208,7 @@ public class WndStartGame extends Window {
super.onClick(); super.onClick();
if( !cl.isUnlocked() ){ if( !cl.isUnlocked() ){
ShatteredPixelDungeon.scene().add( ShatteredPixelDungeon.scene().addToFront( new WndMessage(cl.unlockMsg()));
new WndMessage(cl.unlockMsg()));
} else { } else {
GamesInProgress.selectedClass = cl; GamesInProgress.selectedClass = cl;
} }
@ -243,7 +242,7 @@ public class WndStartGame extends Window {
@Override @Override
protected void onClick() { protected void onClick() {
if (cl == null) return; if (cl == null) return;
ShatteredPixelDungeon.scene().add(new WndMessage(Messages.get(cl, cl.name() + "_desc_item"))); ShatteredPixelDungeon.scene().addToFront(new WndMessage(Messages.get(cl, cl.name() + "_desc_item")));
} }
}; };
heroItem.setSize(BTN_SIZE, BTN_SIZE); heroItem.setSize(BTN_SIZE, BTN_SIZE);
@ -253,7 +252,7 @@ public class WndStartGame extends Window {
@Override @Override
protected void onClick() { protected void onClick() {
if (cl == null) return; if (cl == null) return;
ShatteredPixelDungeon.scene().add(new WndMessage(Messages.get(cl, cl.name() + "_desc_loadout"))); ShatteredPixelDungeon.scene().addToFront(new WndMessage(Messages.get(cl, cl.name() + "_desc_loadout")));
} }
}; };
heroLoadout.setSize(BTN_SIZE, BTN_SIZE); heroLoadout.setSize(BTN_SIZE, BTN_SIZE);
@ -263,7 +262,7 @@ public class WndStartGame extends Window {
@Override @Override
protected void onClick() { protected void onClick() {
if (cl == null) return; if (cl == null) return;
ShatteredPixelDungeon.scene().add(new WndMessage(Messages.get(cl, cl.name() + "_desc_misc"))); ShatteredPixelDungeon.scene().addToFront(new WndMessage(Messages.get(cl, cl.name() + "_desc_misc")));
} }
}; };
heroMisc.setSize(BTN_SIZE, BTN_SIZE); heroMisc.setSize(BTN_SIZE, BTN_SIZE);
@ -277,7 +276,7 @@ public class WndStartGame extends Window {
for (HeroSubClass sub : cl.subClasses()){ for (HeroSubClass sub : cl.subClasses()){
msg += "\n\n" + sub.desc(); msg += "\n\n" + sub.desc();
} }
ShatteredPixelDungeon.scene().add(new WndMessage(msg)); ShatteredPixelDungeon.scene().addToFront(new WndMessage(msg));
} }
}; };
heroSubclass.setSize(BTN_SIZE, BTN_SIZE); heroSubclass.setSize(BTN_SIZE, BTN_SIZE);