UIPvpSuppressTipsView.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. local UIPvpSuppressTipsView = require("UIRoleMain/UIPvpSuppressTipsView_Generate")
  2. function UIPvpSuppressTipsView:OnAwake(data)
  3. self.controller = require("UIRoleMain/UIPvpSuppressTipsCtr"):new()
  4. self.controller:Init(self)
  5. self.controller:SetData(data)
  6. end
  7. function UIPvpSuppressTipsView:AddEventListener()
  8. ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name)
  9. ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_SKILL_CHANGED,self,self.RefreshPress)
  10. end
  11. function UIPvpSuppressTipsView:FillContent(data, uiBase)
  12. self.uiBase = uiBase
  13. local gameObject = self.uiBase:GetRoot()
  14. if gameObject ~= nil then
  15. self.gameObject = gameObject
  16. self.transform = gameObject.transform
  17. end
  18. self:InitGenerate(self.transform, data)
  19. self:Init()
  20. end
  21. function UIPvpSuppressTipsView:Init()
  22. local currValue = ManagerContainer.DataMgr.UserData:GetCurrRoleSkillPress()
  23. local maxValue = ManagerContainer.DataMgr.UserData:GetAllUnlockRoleSkillPress()
  24. self.text.text.text = currValue.."/"..maxValue
  25. end
  26. function UIPvpSuppressTipsView:RefreshPress()
  27. local currValue = ManagerContainer.DataMgr.UserData:GetCurrRoleSkillPress()
  28. local maxValue = ManagerContainer.DataMgr.UserData:GetAllUnlockRoleSkillPress()
  29. self.text.text.text = currValue.."/"..maxValue
  30. end
  31. function UIPvpSuppressTipsView:RemoveEventListener()
  32. ManagerContainer.LuaEventMgr:Unregister(self.uiData.name)
  33. end
  34. function UIPvpSuppressTipsView:OnCloseClick()
  35. self:UIClose()
  36. end
  37. function UIPvpSuppressTipsView:AddUIEventListener()
  38. self.uiBase:AddButtonEventListener(self.AnyBtn.button,self,self.OnCloseClick)
  39. end
  40. function UIPvpSuppressTipsView:OnHide()
  41. end
  42. function UIPvpSuppressTipsView:OnShow(data)
  43. self.controller:SetData(data)
  44. end
  45. function UIPvpSuppressTipsView:OnClose()
  46. end
  47. function UIPvpSuppressTipsView:OnDispose()
  48. self.controller:OnDispose()
  49. end
  50. return UIPvpSuppressTipsView