From 93353ff90084478aa62c59c633de79ef11dc6b30 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 21 May 2018 11:05:10 -0400 Subject: [PATCH] Removed action-based item transfer animation --- .../build/libs/annotations-release.jar | Bin 10793 -> 10793 bytes core/src/io/anuke/mindustry/core/UI.java | 2 +- .../ui/fragments/BlockInventoryFragment.java | 40 +++--------------- 3 files changed, 8 insertions(+), 34 deletions(-) diff --git a/annotations/build/libs/annotations-release.jar b/annotations/build/libs/annotations-release.jar index f6457dfeb481894f1bfe105e1a9420ce0de66f38..73c6ad517fd9d4bcd63147296de062950384ea9d 100644 GIT binary patch delta 283 zcmZ1(vND7>z?+$ci-CcIgF!uF>qK5PW)NlOrKS?G)rSEHm_P&&FavRBzCJSpLIY6A z#ARyCAnLpkh}z7;7|jS~Br$!L1T$h}wljelV)CUBsXhg9Moy6FujejF7nsbiY_$1- zq8dbwQ#lsG$W#dgGbZm<)daa{@=H|{Fs-0w4>E3YlA0cveyJ)wd7T>AuF0p=9Kd3{ p>M>wCM?DfupHPnm(`p)lV7dxQpVNo~^Yt|$^aRatF#naNJpe;jRK@@R delta 283 zcmZ1(vND7>z?+$ci-CcIgTbVr*bTWk*N~M$P6@p@?KR move(item.region, v, () -> { + Timers.run(j*5, () -> move(item, tile, () -> { player.inventory.addItem(item, all ? soFar[0] : per); soFar[0] -= per; - }, Color.WHITE)); + })); } } }); @@ -149,30 +145,8 @@ public class BlockInventoryFragment implements Fragment { updateTablePosition(); } - private void move(TextureRegion region, Vector2 v, Callable c, Color color){ - Player player = input.player; - - Vector2 tv = Graphics.screen(player.x + Angles.trnsx(player.rotation + 180f, 5f), player.y + Angles.trnsy(player.rotation + 180f, 5f)); - float tx = tv.x, ty = tv.y; - float dur = 40f / 60f; - - Image mover = new Image(region); - mover.setColor(color); - mover.setSize(32f, 32f); - mover.setOrigin(Align.center); - mover.setPosition(v.x, v.y, Align.center); - mover.setTouchable(Touchable.disabled); - mover.actions( - Actions.parallel( - Actions.moveToAligned(tx, ty, Align.center, dur, Interpolation.fade), - Actions.scaleTo(0.7f, 0.7f, dur, Interpolation.fade), - Actions.rotateTo(player.rotation, dur, Interpolation.fade) - ), - Actions.call(c), - Actions.removeActor() - ); - - Core.scene.add(mover); + private void move(Item item, Tile tile, Callable c){ + ItemTransfer.create(item, tile.drawx(), tile.drawy(), input.player.x, input.player.y, c); } private String round(float f){