UIBigMapCtr.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. local UIBigMapCtr = class("UIBigMapCtr", require("UICtrBase"))
  2. function UIBigMapCtr:Init(view)
  3. self.view = view
  4. end
  5. --@param data table {id = integer, enterType = Enum.BigMapEnterType} 当前地图id
  6. function UIBigMapCtr:SetData(data)
  7. self.asyncIdx = 0
  8. self.data = data
  9. self:InitData()
  10. end
  11. function UIBigMapCtr:GetAsyncIdx()
  12. self.asyncIdx = self.asyncIdx + 1
  13. return self.asyncIdx
  14. end
  15. function UIBigMapCtr:GetData()
  16. return self.data
  17. end
  18. function UIBigMapCtr:OnDispose()
  19. self.data = nil
  20. self.view = nil
  21. self.mapId = nil
  22. self.enterType = nil
  23. self.curMapId = nil
  24. self.curLevelId = nil
  25. end
  26. function UIBigMapCtr:InitData()
  27. self.mapId = self.data and self.data.id or ManagerContainer.LuaBattleMgr:GetCurMapId()
  28. self.enterType = self.data and self.data.enterType or Enum.BigMapEnterType.Default
  29. self:RefreshLevelData()
  30. end
  31. function UIBigMapCtr:RefreshLevelData()
  32. self.curMapId, self.curLevelId = ManagerContainer.LuaBattleMgr:GetCurMapAndLevel()
  33. end
  34. function UIBigMapCtr:GetCurMapId()
  35. return self.curMapId
  36. end
  37. function UIBigMapCtr:GetCurLevelId()
  38. return self.curLevelId
  39. end
  40. function UIBigMapCtr:GetMapId()
  41. return self.mapId
  42. end
  43. function UIBigMapCtr:GetEnterType()
  44. return self.enterType
  45. end
  46. function UIBigMapCtr:GetMapData()
  47. return ManagerContainer.CfgMgr:GetMapData(self.mapId)
  48. end
  49. return UIBigMapCtr