UIBattleCtr.lua 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. local UIBattleCtr = class("UIBattleCtr", require("UICtrBase"))
  2. function UIBattleCtr:Init(view)
  3. self.view = view
  4. end
  5. function UIBattleCtr:SetData(data)
  6. self.asyncIdx = 0
  7. if data == nil then return end
  8. self.data = data
  9. end
  10. function UIBattleCtr:GetAsyncIdx()
  11. self.asyncIdx = self.asyncIdx + 1
  12. return self.asyncIdx
  13. end
  14. function UIBattleCtr:InitHeroData()
  15. end
  16. function UIBattleCtr:UpToLimit()
  17. local usedCnt = ManagerContainer.LuaBattleMgr:UsedQuickBattleTimes();
  18. local maxCnt = ManagerContainer.LuaBattleMgr:MaxQuickBattleTimes();
  19. return usedCnt >= maxCnt;
  20. end
  21. function UIBattleCtr:IsUnlockQuickBattle()
  22. local curMapId,curLevelId = ManagerContainer.LuaBattleMgr:GetCurMapAndLevel()
  23. local curUniqueId = curMapId * 10000 + curLevelId
  24. return curUniqueId > GlobalConfig.Instance:GetConfigIntValue(89)
  25. end
  26. function UIBattleCtr:UnlockQuickBattleCondition()
  27. return "通关" .. LuaBattleBridge.GetLevelName(GlobalConfig.Instance:GetConfigIntValue(89)) .. "关卡后解锁快速挂机功能"
  28. end
  29. function UIBattleCtr:SendGetMainTaskRewardReq()
  30. --local curGoalData = ManagerContainer.DataMgr.StageGoalData:GetCurGoalData()
  31. --ManagerContainer.NetManager:SendMessage(ProtoMsgId.CS_GET_MAIN_TASK_REWARD_REQ, {task_id = curGoalData.taskId })
  32. end
  33. function UIBattleCtr:SendPlayerQuery(uid)
  34. ManagerContainer.LuaUIMgr:OpenRoleMessagePanel(uid);
  35. --[[
  36. ManagerContainer.NetManager:SendMessage(ProtoMsgId.CS_GET_OTHER_PLAYER_DETAIL_INFO_REQ,
  37. {t_uid = int64.new(uid)})]]--
  38. end
  39. function UIBattleCtr:GeAnchoredPosition3DByType(type)
  40. if self.view == nil then return nil end
  41. return self.view:GeAnchoredPosition3DByType(type)
  42. end
  43. function UIBattleCtr:GetMiniMapPosition()
  44. if self.view == nil then return nil end
  45. return self.view:GetMiniMapPosition()
  46. end
  47. function UIBattleCtr:GetBattleState()
  48. if self.view == nil then return nil end
  49. return self.view:GetBattleState()
  50. end
  51. function UIBattleCtr:SetChatChannelType(type)
  52. self.curChatType = type
  53. end
  54. function UIBattleCtr:GetChatChannelType()
  55. self.curChatType = self.curChatType or Enum.ChatChannel.World
  56. return self.curChatType
  57. end
  58. function UIBattleCtr:SetNewForceId(id)
  59. self.newForceId = id
  60. end
  61. function UIBattleCtr:GetNewForceId()
  62. return self.newForceId
  63. end
  64. function UIBattleCtr:OnDispose()
  65. self.data = nil
  66. self.view = nil
  67. end
  68. return UIBattleCtr