v1.2.0: added several checks to prevent simultaneous hero actions
This commit is contained in:
parent
9225ce1854
commit
7c596ccab7
|
@ -368,7 +368,7 @@ public class CellSelector extends ScrollArea {
|
|||
private int lastCellMoved = 0;
|
||||
|
||||
private boolean moveFromActions(GameAction... actions){
|
||||
if (Dungeon.hero == null){
|
||||
if (Dungeon.hero == null || !Dungeon.hero.ready){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -98,9 +98,10 @@ public class ActionIndicator extends Tag {
|
|||
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if (action != null && Dungeon.hero.ready)
|
||||
if (action != null && Dungeon.hero.ready) {
|
||||
action.doAction();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String hoverText() {
|
||||
|
|
|
@ -175,7 +175,7 @@ public class AttackIndicator extends Tag {
|
|||
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if (enabled) {
|
||||
if (enabled && Dungeon.hero.ready) {
|
||||
if (Dungeon.hero.handle( lastTarget.pos )) {
|
||||
Dungeon.hero.next();
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class LootIndicator extends Tag {
|
|||
|
||||
slot = new ItemSlot() {
|
||||
protected void onClick() {
|
||||
if (Dungeon.hero.handle(Dungeon.hero.pos)){
|
||||
if (Dungeon.hero.ready && Dungeon.hero.handle(Dungeon.hero.pos)){
|
||||
Dungeon.hero.next();
|
||||
}
|
||||
|
||||
|
|
|
@ -67,8 +67,10 @@ public class ResumeIndicator extends Tag {
|
|||
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if (Dungeon.hero.ready) {
|
||||
Dungeon.hero.resume();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String hoverText() {
|
||||
|
|
|
@ -92,7 +92,7 @@ public class Toolbar extends Component {
|
|||
add(btnWait = new Tool(24, 0, 20, 26) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if (!GameScene.cancel()) {
|
||||
if (Dungeon.hero.ready && !GameScene.cancel()) {
|
||||
examining = false;
|
||||
Dungeon.hero.rest(false);
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ public class Toolbar extends Component {
|
|||
}
|
||||
|
||||
protected boolean onLongClick() {
|
||||
if (!GameScene.cancel()) {
|
||||
if (Dungeon.hero.ready && !GameScene.cancel()) {
|
||||
examining = false;
|
||||
Dungeon.hero.rest(true);
|
||||
}
|
||||
|
@ -120,9 +120,11 @@ public class Toolbar extends Component {
|
|||
add(new Button(){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if (Dungeon.hero.ready) {
|
||||
examining = false;
|
||||
Dungeon.hero.rest(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameAction keyAction() {
|
||||
|
@ -134,6 +136,7 @@ public class Toolbar extends Component {
|
|||
add(btnSearch = new Tool(44, 0, 20, 26) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if (Dungeon.hero.ready) {
|
||||
if (!examining) {
|
||||
GameScene.selectCell(informer);
|
||||
examining = true;
|
||||
|
@ -142,6 +145,7 @@ public class Toolbar extends Component {
|
|||
Dungeon.hero.search(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameAction keyAction() {
|
||||
|
@ -167,12 +171,14 @@ public class Toolbar extends Component {
|
|||
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if (SPDSettings.interfaceSize() == 2){
|
||||
if (Dungeon.hero.ready || !Dungeon.hero.isAlive()) {
|
||||
if (SPDSettings.interfaceSize() == 2) {
|
||||
GameScene.toggleInvPane();
|
||||
} else {
|
||||
GameScene.show(new WndBag(Dungeon.hero.belongings.backpack));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameAction keyAction() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user