v0.6.4: bugfixes

- fixed incorrect window layout when starting new game from gamescene
- fixed rare action indicator crashes
This commit is contained in:
Evan Debenham 2018-03-30 17:43:36 -04:00
parent d739ae30a2
commit 6756c09204
2 changed files with 12 additions and 10 deletions

View File

@ -48,7 +48,7 @@ public class ActionIndicator extends Tag {
} }
@Override @Override
protected void layout() { protected synchronized void layout() {
super.layout(); super.layout();
if (icon != null){ if (icon != null){
@ -63,7 +63,7 @@ public class ActionIndicator extends Tag {
private boolean needsLayout = false; private boolean needsLayout = false;
@Override @Override
public void update() { public synchronized void update() {
super.update(); super.update();
if (!Dungeon.hero.ready){ if (!Dungeon.hero.ready){
@ -104,13 +104,15 @@ public class ActionIndicator extends Tag {
public static void updateIcon(){ public static void updateIcon(){
if (instance != null){ if (instance != null){
if (instance.icon != null){ synchronized (instance) {
instance.icon.killAndErase(); if (instance.icon != null) {
instance.icon = null; instance.icon.killAndErase();
} instance.icon = null;
if (action != null){ }
instance.icon = action.getIcon(); if (action != null) {
instance.needsLayout = true; instance.icon = action.getIcon();
instance.needsLayout = true;
}
} }
} }
} }

View File

@ -76,7 +76,7 @@ public class WndGame extends Window {
protected void onClick() { protected void onClick() {
GamesInProgress.selectedClass = Dungeon.hero.heroClass; GamesInProgress.selectedClass = Dungeon.hero.heroClass;
InterlevelScene.noStory = true; InterlevelScene.noStory = true;
ShatteredPixelDungeon.scene().add(new WndStartGame(GamesInProgress.firstEmpty())); GameScene.show(new WndStartGame(GamesInProgress.firstEmpty()));
} }
} ); } );
btnStart.textColor(Window.TITLE_COLOR); btnStart.textColor(Window.TITLE_COLOR);