v0.9.3a: reverted attack indicator changes due to deadlock concerns
This commit is contained in:
parent
785c869f2b
commit
fa2e63a529
|
@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||||
import com.watabou.input.GameAction;
|
import com.watabou.input.GameAction;
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
|
import com.watabou.utils.Reflection;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
@ -82,17 +83,10 @@ public class AttackIndicator extends Tag {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean needsImageUpdate = false;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void update() {
|
public synchronized void update() {
|
||||||
super.update();
|
super.update();
|
||||||
|
|
||||||
if (needsImageUpdate){
|
|
||||||
updateImage();
|
|
||||||
needsImageUpdate = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bg.visible){
|
if (!bg.visible){
|
||||||
enable(false);
|
enable(false);
|
||||||
if (delay > 0f) delay -= Game.elapsed;
|
if (delay > 0f) delay -= Game.elapsed;
|
||||||
|
@ -129,7 +123,7 @@ public class AttackIndicator extends Tag {
|
||||||
} else {
|
} else {
|
||||||
active = true;
|
active = true;
|
||||||
lastTarget = Random.element( candidates );
|
lastTarget = Random.element( candidates );
|
||||||
needsImageUpdate = true;
|
updateImage();
|
||||||
flash();
|
flash();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -150,15 +144,13 @@ public class AttackIndicator extends Tag {
|
||||||
sprite = null;
|
sprite = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastTarget != null) {
|
sprite = Reflection.newInstance(lastTarget.spriteClass);
|
||||||
sprite = lastTarget.sprite();
|
|
||||||
active = true;
|
active = true;
|
||||||
sprite.linkVisuals(lastTarget);
|
sprite.linkVisuals(lastTarget);
|
||||||
sprite.idle();
|
sprite.idle();
|
||||||
sprite.paused = true;
|
sprite.paused = true;
|
||||||
sprite.visible = bg.visible;
|
sprite.visible = bg.visible;
|
||||||
add(sprite);
|
add( sprite );
|
||||||
}
|
|
||||||
|
|
||||||
layout();
|
layout();
|
||||||
}
|
}
|
||||||
|
@ -190,7 +182,7 @@ public class AttackIndicator extends Tag {
|
||||||
public static void target( Char target ) {
|
public static void target( Char target ) {
|
||||||
synchronized (instance) {
|
synchronized (instance) {
|
||||||
instance.lastTarget = (Mob) target;
|
instance.lastTarget = (Mob) target;
|
||||||
instance.needsImageUpdate = true;
|
instance.updateImage();
|
||||||
|
|
||||||
TargetHealthIndicator.instance.target(target);
|
TargetHealthIndicator.instance.target(target);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user