From 47eea79b600bd5193da920cb9ff5c3e757aa98de Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 27 Jan 2021 11:49:04 -0500 Subject: [PATCH] Fixed #4453 / Fixed #4450 --- core/src/mindustry/ai/WaveSpawner.java | 8 +++++--- core/src/mindustry/content/Fx.java | 10 +++++----- core/src/mindustry/logic/LCanvas.java | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/core/src/mindustry/ai/WaveSpawner.java b/core/src/mindustry/ai/WaveSpawner.java index 6c542f5875..f5930ef7f2 100644 --- a/core/src/mindustry/ai/WaveSpawner.java +++ b/core/src/mindustry/ai/WaveSpawner.java @@ -13,6 +13,7 @@ import mindustry.entities.*; import mindustry.game.EventType.*; import mindustry.game.*; import mindustry.gen.*; +import mindustry.type.*; import mindustry.world.*; import static mindustry.Vars.*; @@ -177,10 +178,11 @@ public class WaveSpawner{ } private void spawnEffect(Unit unit){ - Call.spawnEffect(unit.x, unit.y, unit); unit.rotation = unit.angleTo(world.width()/2f * tilesize, world.height()/2f * tilesize); unit.apply(StatusEffects.unmoving, 30f); unit.add(); + + Call.spawnEffect(unit.x, unit.y, unit.rotation, unit.type); } private interface SpawnConsumer{ @@ -188,8 +190,8 @@ public class WaveSpawner{ } @Remote(called = Loc.server, unreliable = true) - public static void spawnEffect(float x, float y, Unit u){ - Fx.unitSpawn.at(x, y, 0f, u); + public static void spawnEffect(float x, float y, float rotation, UnitType u){ + Fx.unitSpawn.at(x, y, rotation, u); Time.run(30f, () -> Fx.spawn.at(x, y)); } diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index 00b714c26b..d60dcaf74f 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -26,23 +26,23 @@ public class Fx{ none = new Effect(0, 0f, e -> {}), unitSpawn = new Effect(30f, e -> { - if(!(e.data instanceof Unit unit)) return; + if(!(e.data instanceof UnitType unit)) return; float scl = 1f + e.fout() * 2f; - TextureRegion region = unit.type.icon(Cicon.full); + TextureRegion region = unit.icon(Cicon.full); alpha(e.fout()); mixcol(Color.white, e.fin()); - rect(region, unit.x, unit.y, 180f); + rect(region, e.x, e.y, 180f); reset(); alpha(e.fin()); - rect(region, unit.x, unit.y, - region.width * Draw.scl * scl, region.height * Draw.scl * scl, unit.rotation - 90); + rect(region, e.x, e.y, + region.width * Draw.scl * scl, region.height * Draw.scl * scl, e.rotation - 90); }), diff --git a/core/src/mindustry/logic/LCanvas.java b/core/src/mindustry/logic/LCanvas.java index 92c8f61d53..1beab892cd 100644 --- a/core/src/mindustry/logic/LCanvas.java +++ b/core/src/mindustry/logic/LCanvas.java @@ -283,13 +283,13 @@ public class LCanvas extends Table{ t.add().growX(); t.button(Icon.copy, Styles.logici, () -> { - }).padRight(6).get().tapped(this::copy); + }).size(24f).padRight(6).get().tapped(this::copy); t.button(Icon.cancel, Styles.logici, () -> { remove(); dragging = null; statements.layout(); - }); + }).size(24f); t.addListener(new InputListener(){ float lastx, lasty;