mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 15:27:27 +07:00
Resolved #10474 - Add/remove attack images on the tile, even if the attacked unit has meanwhile been killed
This commit is contained in:
parent
e8b9864287
commit
870c146e34
@ -9,7 +9,6 @@ import com.badlogic.gdx.scenes.scene2d.Touchable
|
||||
import com.badlogic.gdx.scenes.scene2d.actions.Actions
|
||||
import com.badlogic.gdx.scenes.scene2d.actions.FloatAction
|
||||
import com.badlogic.gdx.scenes.scene2d.actions.RelativeTemporalAction
|
||||
import com.badlogic.gdx.scenes.scene2d.actions.RepeatAction
|
||||
import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction
|
||||
import com.badlogic.gdx.scenes.scene2d.actions.TemporalAction
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Image
|
||||
@ -85,8 +84,10 @@ object BattleTableHelpers {
|
||||
var i = 1
|
||||
while (ImageGetter.imageExists(attackAnimationLocation + i)) {
|
||||
val image = ImageGetter.getImage(attackAnimationLocation + i)
|
||||
|
||||
val defenderParentGroup = defenderActors.first().parent
|
||||
addAction(Actions.run {
|
||||
defenderActors.first().parent.addActor(image)
|
||||
defenderParentGroup.addActor(image)
|
||||
})
|
||||
addAction(Actions.delay(attackAnimationFrameDuration))
|
||||
addAction(Actions.removeActor(image))
|
||||
|
Loading…
Reference in New Issue
Block a user