v1.3.0: fixed toolbar instance persisting when it shouldn't
This commit is contained in:
@@ -75,6 +75,12 @@ public class Toolbar extends Component {
|
|||||||
height = btnInventory.height();
|
height = btnInventory.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void destroy() {
|
||||||
|
super.destroy();
|
||||||
|
if (instance == this) instance = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createChildren() {
|
protected void createChildren() {
|
||||||
|
|
||||||
@@ -406,8 +412,10 @@ public class Toolbar extends Component {
|
|||||||
private static CellSelector.Listener informer = new CellSelector.Listener() {
|
private static CellSelector.Listener informer = new CellSelector.Listener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSelect( Integer cell ) {
|
public void onSelect( Integer cell ) {
|
||||||
instance.examining = false;
|
if (instance != null) {
|
||||||
GameScene.examineCell( cell );
|
instance.examining = false;
|
||||||
|
GameScene.examineCell(cell);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String prompt() {
|
public String prompt() {
|
||||||
@@ -527,7 +535,7 @@ public class Toolbar extends Component {
|
|||||||
@Override
|
@Override
|
||||||
public synchronized void destroy() {
|
public synchronized void destroy() {
|
||||||
super.destroy();
|
super.destroy();
|
||||||
SWAP_INSTANCE = null;
|
if (SWAP_INSTANCE == this) SWAP_INSTANCE = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user