improvement: make char switch instant

This commit is contained in:
Kazhnuz 2021-04-10 17:43:10 +02:00
parent 91c885e1fb
commit 16fa9f49eb

View file

@ -18,6 +18,7 @@ end
function Team:switchActiveCharacter() function Team:switchActiveCharacter()
if (self.canChangeActive) then if (self.canChangeActive) then
game.characters:setActiveCharacter() game.characters:setActiveCharacter()
self.active = game.characters:getActiveCharacterData()
self.canChangeActive = false self.canChangeActive = false
self.tweens:newTimer(0.3, "changeCharacter") self.tweens:newTimer(0.3, "changeCharacter")
self.tweens:newTween(0, 0.3, {activeVisible = self.activeVisible + 1}, "inQuad") self.tweens:newTween(0, 0.3, {activeVisible = self.activeVisible + 1}, "inQuad")
@ -27,7 +28,6 @@ end
function Team:endCharacterSwitchAnimation() function Team:endCharacterSwitchAnimation()
self.canChangeActive = true self.canChangeActive = true
self.activeVisible = game.characters.active self.activeVisible = game.characters.active
self.active = game.characters:getActiveCharacterData()
self:updateCurrentCharset() self:updateCurrentCharset()
end end