v0.2.3: fixed various UI bugs

This commit is contained in:
Evan Debenham 2014-12-08 23:07:43 -05:00
parent 5bf2d72a90
commit 92c018ac44
3 changed files with 16 additions and 8 deletions

View File

@ -409,7 +409,7 @@ public class Hero extends Char {
}
checkVisibleMobs();
AttackIndicator.updateState();
if (curAction == null) {
@ -496,6 +496,8 @@ public class Hero extends Char {
damageInterrupt = true;
ready = true;
AttackIndicator.updateState();
GameScene.ready();
}

View File

@ -69,7 +69,11 @@ public class AttackIndicator extends Tag {
public void update() {
super.update();
if (!Dungeon.hero.isAlive()) {
if (Dungeon.hero.isAlive()) {
enable(Dungeon.hero.ready);
} else {
visible( false );
enable( false );
}
@ -129,6 +133,7 @@ public class AttackIndicator extends Tag {
private boolean enabled = true;
private void enable( boolean value ) {
enabled = value;
active = value;
if (sprite != null) {
sprite.alpha( value ? ENABLED : DISABLED );
}
@ -143,11 +148,10 @@ public class AttackIndicator extends Tag {
@Override
protected void onClick() {
if (Dungeon.hero.curAction != null)
Dungeon.hero.interrupt();
else
if (enabled) {
Dungeon.hero.handle( lastTarget.pos );
}
}
public static void target( Char target ) {
lastTarget = (Mob)target;

View File

@ -98,7 +98,9 @@ public class DangerIndicator extends Tag {
HealthIndicator.instance.target( target == HealthIndicator.instance.target() ? null : target );
if (Dungeon.hero.curAction == null) {
Camera.main.target = null;
Camera.main.focusOn( target.sprite );
Camera.main.focusOn(target.sprite);
}
}
}