Fixed battle recordings playback, fixed being unable to import .anm files in the Animations Editor

This commit is contained in:
Maruno17
2021-05-15 21:01:39 +01:00
parent 66b40fd181
commit 206244a3f0
3 changed files with 16 additions and 9 deletions

View File

@@ -61,6 +61,9 @@ module PokeBattle_RecordedBattleModule
@properties["switchStyle"] = @switchStyle @properties["switchStyle"] = @switchStyle
@properties["showAnims"] = @showAnims @properties["showAnims"] = @showAnims
@properties["items"] = Marshal.dump(@items) @properties["items"] = Marshal.dump(@items)
@properties["backdrop"] = @backdrop
@properties["backdropBase"] = @backdropBase
@properties["time"] = @time
@properties["environment"] = @environment @properties["environment"] = @environment
@properties["rules"] = Marshal.dump(@rules) @properties["rules"] = Marshal.dump(@rules)
super super
@@ -188,16 +191,16 @@ module PokeBattle_BattlePlayerModule
@randomindex = 0 @randomindex = 0
@switchindex = 0 @switchindex = 0
super(scene, super(scene,
Marshal.restore(StringInput.new(@properties["party1"])), Marshal.restore(@properties["party1"]),
Marshal.restore(StringInput.new(@properties["party2"])), Marshal.restore(@properties["party2"]),
BattlePlayerHelper.pbCreateTrainerInfo(@properties["player"]), BattlePlayerHelper.pbCreateTrainerInfo(@properties["player"]),
BattlePlayerHelper.pbCreateTrainerInfo(@properties["opponent"]) BattlePlayerHelper.pbCreateTrainerInfo(@properties["opponent"])
) )
end end
def pbStartBattle def pbStartBattle
@party1starts = @properties["party1starts"] @party1starts = Marshal.restore(@properties["party1starts"])
@party2starts = @properties["party2starts"] @party2starts = Marshal.restore(@properties["party2starts"])
@internalBattle = @properties["internalBattle"] @internalBattle = @properties["internalBattle"]
@endSpeeches = @properties["endSpeeches"] @endSpeeches = @properties["endSpeeches"]
@endSpeechesWin = @properties["endSpeechesWin"] @endSpeechesWin = @properties["endSpeechesWin"]
@@ -206,9 +209,12 @@ module PokeBattle_BattlePlayerModule
@canRun = @properties["canRun"] @canRun = @properties["canRun"]
@switchStyle = @properties["switchStyle"] @switchStyle = @properties["switchStyle"]
@showAnims = @properties["showAnims"] @showAnims = @properties["showAnims"]
@backdrop = @properties["backdrop"]
@backdropBase = @properties["backdropBase"]
@time = @properties["time"]
@environment = @properties["environment"] @environment = @properties["environment"]
@items = Marshal.restore(StringInput.new(@properties["items"])) @items = Marshal.restore(@properties["items"])
@rules = Marshal.restore(StringInput.new(@properties["rules"])) @rules = Marshal.restore(@properties["rules"])
super super
end end
@@ -228,7 +234,8 @@ module PokeBattle_BattlePlayerModule
pbDisplay(str) pbDisplay(str)
end end
def pbCommandPhaseCore def pbCommandPhaseLoop(isPlayer)
return if !isPlayer
@roundindex += 1 @roundindex += 1
for i in 0...4 for i in 0...4
next if @rounds[@roundindex][i].length==0 next if @rounds[@roundindex][i].length==0

View File

@@ -109,7 +109,7 @@ def pbPlayBattle(battledata)
return if !battledata return if !battledata
scene = pbNewBattleScene scene = pbNewBattleScene
scene.abortable = true scene.abortable = true
lastbattle = Marshal.restore(StringInput.new(battledata)) lastbattle = Marshal.restore(battledata)
case lastbattle[0] case lastbattle[0]
when BattleChallenge::BattleTowerID when BattleChallenge::BattleTowerID
battleplayer = PokeBattle_BattlePlayer.new(scene, lastbattle) battleplayer = PokeBattle_BattlePlayer.new(scene, lastbattle)

View File

@@ -18,7 +18,7 @@ def dumpBase64Anim(s)
end end
def loadBase64Anim(s) def loadBase64Anim(s)
return Marshal.restore(StringInput.new(Zlib::Inflate.inflate(s.unpack("m")[0]))) return Marshal.restore(Zlib::Inflate.inflate(s.unpack("m")[0]))
end end
def pbExportAnim(animations) def pbExportAnim(animations)