v0.2.4: added some safety checks to the quickslot button

This commit is contained in:
Evan Debenham 2015-02-10 23:38:49 -05:00
parent 0d78119ab7
commit d94847af4c
2 changed files with 10 additions and 4 deletions

View File

@ -59,6 +59,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.SewerBossLevel;
import com.shatteredpixel.shatteredpixeldungeon.levels.SewerLevel;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.scenes.StartScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndResurrect;
@ -71,7 +72,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
public class Dungeon {
@ -154,6 +154,7 @@ public class Dungeon {
Journal.reset();
quickslot.reset();
QuickSlotButton.reset();
depth = 0;
gold = 0;
@ -517,6 +518,7 @@ public class Dungeon {
Generator.reset();
quickslot.reset();
QuickSlotButton.reset();
Dungeon.challenges = bundle.getInt( CHALLENGES );

View File

@ -57,10 +57,14 @@ public class QuickSlotButton extends Button implements WndBag.Listener {
public void destroy() {
super.destroy();
instance = new QuickSlotButton[4];
lastTarget = null;
reset();
}
public static void reset() {
instance = new QuickSlotButton[4];
lastTarget = null;
}
@Override
protected void createChildren() {