Select effect

This commit is contained in:
Anuken
2020-10-07 14:20:09 -04:00
parent 30f5340a22
commit 8ba4458a1a
+3 -1
View File
@@ -523,10 +523,10 @@ public class MobileInput extends InputHandler implements GestureListener{
//handle long tap when player isn't building //handle long tap when player isn't building
if(mode == none){ if(mode == none){
Vec2 pos = Core.input.mouseWorld(x, y);
//TODO find payload target //TODO find payload target
if(player.unit() instanceof Payloadc pay){ if(player.unit() instanceof Payloadc pay){
Vec2 pos = Core.input.mouseWorld(x, y);
Unit target = Units.closest(player.team(), pos.x, pos.y, 8f, u -> u.isAI() && u.isGrounded() && pay.canPickup(u) && u.within(pos, u.hitSize + 8f)); Unit target = Units.closest(player.team(), pos.x, pos.y, 8f, u -> u.isAI() && u.isGrounded() && pay.canPickup(u) && u.within(pos, u.hitSize + 8f));
if(target != null){ if(target != null){
payloadTarget = target; payloadTarget = target;
@@ -545,6 +545,8 @@ public class MobileInput extends InputHandler implements GestureListener{
}else{ }else{
manualShooting = true; manualShooting = true;
} }
if(!state.isPlaying()) Fx.select.at(pos);
}else{ }else{
//ignore off-screen taps //ignore off-screen taps