| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- local UIBattleWinCtr = class("UIBattleWinCtr", require("UICtrBase"))
- function UIBattleWinCtr:Init(view)
- self.view = view
- end
- function UIBattleWinCtr:SetData(data)
- self.asyncIdx = 0
- self:InitCfg()
- if data == nil then return end
- self:InitData(data)
- end
- function UIBattleWinCtr:InitData(data)
- if self.data == nil then
- self.data = {}
- end
- self.data.BaseExp = 0
- self.data.Zeny = 0
- self.data.Parter = 0
- self.data.JobExp = 0
- self.data.Gold = 0
-
- self.data.FreeInvest = 0
- for k, v in pairs(data) do
- --LogError(k.."----------------------"..Inspect(v))
- if v.key == 1 then
- self.data.Zeny = v.value
- elseif v.key == 2 then
- self.data.Gold = v.value
- elseif v.key == 3 then
- self.data.BaseExp = v.value
- elseif v.key == 4 then
- self.data.JobExp = v.value
- elseif v.key == 5 then
- self.data.Parter = v.value
- elseif v.key == 53 then
- self.data.FreeInvest = v.value
- end
- end
- end
- function UIBattleWinCtr:GetAsyncIdx()
- self.asyncIdx = self.asyncIdx + 1
- return self.asyncIdx
- end
- function UIBattleWinCtr:GetData()
- return self.data
- end
- function UIBattleWinCtr:OnDispose()
- self.data = nil
- self.view = nil
- self.curMapId = nil
- self.curLevelId = nil
- self.lastLevelUniqueId = nil
- self.levelCfgData = nil
- end
- function UIBattleWinCtr:InitCfg()
- self.curMapId, self.curLevelId = ManagerContainer.LuaBattleMgr:GetCurMapAndLevel()
- self.curLevelId = self.curLevelId - 1
- self.lastLevelUniqueId = ManagerContainer.LuaBattleMgr:GetLastLevelUniqueId()
- --self.levelCfgData = ManagerContainer.CfgMgr:GetLevelDataById(self.lastLevelUniqueId)
- end
- function UIBattleWinCtr:GetCurMapAndLevel()
- return self.curMapId, self.curLevelId
- end
- function UIBattleWinCtr:GetCurLevelUniqueId()
- return self.lastLevelUniqueId
- end
- function UIBattleWinCtr:GetLevelCfgData()
- -- if ManagerContainer.LuaBattleMgr:GetBattleMode() == 1 then
- -- --LogError("----------------------"..Inspect(self.data))
- -- return self.data
- -- end
- return self.data
- --return self.levelCfgData
- end
- return UIBattleWinCtr
|