UIBattleWinCtr.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. local UIBattleWinCtr = class("UIBattleWinCtr", require("UICtrBase"))
  2. function UIBattleWinCtr:Init(view)
  3. self.view = view
  4. end
  5. function UIBattleWinCtr:SetData(data)
  6. self.asyncIdx = 0
  7. self:InitCfg()
  8. if data == nil then return end
  9. self:InitData(data)
  10. end
  11. function UIBattleWinCtr:InitData(data)
  12. if self.data == nil then
  13. self.data = {}
  14. end
  15. self.data.BaseExp = 0
  16. self.data.Zeny = 0
  17. self.data.Parter = 0
  18. self.data.JobExp = 0
  19. self.data.Gold = 0
  20. self.data.FreeInvest = 0
  21. for k, v in pairs(data) do
  22. --LogError(k.."----------------------"..Inspect(v))
  23. if v.key == 1 then
  24. self.data.Zeny = v.value
  25. elseif v.key == 2 then
  26. self.data.Gold = v.value
  27. elseif v.key == 3 then
  28. self.data.BaseExp = v.value
  29. elseif v.key == 4 then
  30. self.data.JobExp = v.value
  31. elseif v.key == 5 then
  32. self.data.Parter = v.value
  33. elseif v.key == 53 then
  34. self.data.FreeInvest = v.value
  35. end
  36. end
  37. end
  38. function UIBattleWinCtr:GetAsyncIdx()
  39. self.asyncIdx = self.asyncIdx + 1
  40. return self.asyncIdx
  41. end
  42. function UIBattleWinCtr:GetData()
  43. return self.data
  44. end
  45. function UIBattleWinCtr:OnDispose()
  46. self.data = nil
  47. self.view = nil
  48. self.curMapId = nil
  49. self.curLevelId = nil
  50. self.lastLevelUniqueId = nil
  51. self.levelCfgData = nil
  52. end
  53. function UIBattleWinCtr:InitCfg()
  54. self.curMapId, self.curLevelId = ManagerContainer.LuaBattleMgr:GetCurMapAndLevel()
  55. self.curLevelId = self.curLevelId - 1
  56. self.lastLevelUniqueId = ManagerContainer.LuaBattleMgr:GetLastLevelUniqueId()
  57. --self.levelCfgData = ManagerContainer.CfgMgr:GetLevelDataById(self.lastLevelUniqueId)
  58. end
  59. function UIBattleWinCtr:GetCurMapAndLevel()
  60. return self.curMapId, self.curLevelId
  61. end
  62. function UIBattleWinCtr:GetCurLevelUniqueId()
  63. return self.lastLevelUniqueId
  64. end
  65. function UIBattleWinCtr:GetLevelCfgData()
  66. -- if ManagerContainer.LuaBattleMgr:GetBattleMode() == 1 then
  67. -- --LogError("----------------------"..Inspect(self.data))
  68. -- return self.data
  69. -- end
  70. return self.data
  71. --return self.levelCfgData
  72. end
  73. return UIBattleWinCtr