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

View File

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

View File

@@ -18,7 +18,7 @@ def dumpBase64Anim(s)
end
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
def pbExportAnim(animations)