diff --git a/lua/app/common/local_data.lua b/lua/app/common/local_data.lua index 7b6da257..0ed517ac 100644 --- a/lua/app/common/local_data.lua +++ b/lua/app/common/local_data.lua @@ -435,7 +435,9 @@ function LocalData:saveBattleSnapshot(snapshot) if EDITOR_MODE then Logger.logHighlight(json.encode(snapshot)) end + print("Snapshot: " .. json.encode(snapshot)) self:setString(LocalData:getRoleKey(LOCAL_DATA_KEY.BATTLE_SNAPSHOT), json.encode(snapshot)) + LocalData:save() end function LocalData:getBattleSnapshot() @@ -443,6 +445,7 @@ function LocalData:getBattleSnapshot() if EDITOR_MODE then Logger.logHighlight(dealedSnapshot) end + print("Snapshot: " .. dealedSnapshot) return json.decode(dealedSnapshot) end diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua index ee39b0c5..f414d36c 100644 --- a/lua/app/module/battle/controller/battle_base_controller.lua +++ b/lua/app/module/battle/controller/battle_base_controller.lua @@ -480,6 +480,10 @@ function BattleBaseController:init(params, snapshot) self.delayEffectTextList = {} self.delayEffectTextCount = 0 self.time = 0 + print("Snapshot: -----------------------------------------") + if snapshot then + print("Snapshot: " .. snapshot.battleType) + end if snapshot then -- 处理战斗快照 self:dealSnapshotBattleBaseInfo(snapshot) self.battleData:init(params, snapshot.battledataShopInfo) diff --git a/lua/app/module/battle/helper/battle_snapshot_helper.lua b/lua/app/module/battle/helper/battle_snapshot_helper.lua index 3d86918e..d3cc49de 100644 --- a/lua/app/module/battle/helper/battle_snapshot_helper.lua +++ b/lua/app/module/battle/helper/battle_snapshot_helper.lua @@ -117,12 +117,15 @@ function BattleSnapshotHelper:snapshotBattleInfo(battleBaseController) end function BattleSnapshotHelper:dealSnapshotBattleBaseInfo(battleBaseController, snapInfo) + print("Snapshot: dealSnapshotBattleBaseInfo") if not snapInfo then return end + print("Snapshot: snapInfo") if not NEED_SAVE_SNAPSHOT_BATTLE_TYPE[snapInfo.battleType] then return end + print("Snapshot: NEED_SAVE_SNAPSHOT_BATTLE_TYPE") local atkFormation = snapInfo.params.atkFormation snapInfo.params.atkFormation = {}