UIAntiCheatMsgWndView.lua 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. local UIAntiCheatMsgWndView = require("UICommonTips/UIAntiCheatMsgWndView_Generate")
  2. local NoticeList = {
  3. ["AntiCheatMsg"] = {title = "jiasutishi1", notice = "jiasutishi2" , btnSure = "jiasutishi3"},
  4. ["ErrorQuitBattleTip"] = {title = "Tips", notice = "BattleWatchError", btnSure = "BtnQuit"},
  5. }
  6. function UIAntiCheatMsgWndView:OnAwake(data)
  7. self.controller = require("UICommonTips/UIAntiCheatMsgWndCtr"):new()
  8. self.controller:Init(self)
  9. self.controller:SetData(data)
  10. end
  11. function UIAntiCheatMsgWndView:AddEventListener()
  12. ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name)
  13. end
  14. function UIAntiCheatMsgWndView:FillContent(data, uiBase)
  15. self.uiBase = uiBase
  16. local gameObject = self.uiBase:GetRoot()
  17. if gameObject ~= nil then
  18. self.gameObject = gameObject
  19. self.transform = gameObject.transform
  20. end
  21. self:InitGenerate(self.transform, data)
  22. self:Init()
  23. end
  24. function UIAntiCheatMsgWndView:Init()
  25. local data = self.controller:GetData()
  26. local strId = data[1]
  27. self.noticeTitle.uILocalizeScript:SetContent(NoticeList[strId].title)
  28. self.questionTxt.uILocalizeScript:SetContent(NoticeList[strId].notice)
  29. self.btnSure.uILocalizeScript:SetContent(NoticeList[strId].btnSure)
  30. end
  31. function UIAntiCheatMsgWndView:RemoveEventListener()
  32. ManagerContainer.LuaEventMgr:Unregister(self.uiData.name)
  33. end
  34. function UIAntiCheatMsgWndView:AddUIEventListener()
  35. self.uiBase:AddButtonEventListener(self.btnRight.button, self, self.OnQuit)
  36. end
  37. function UIAntiCheatMsgWndView:OnHide()
  38. end
  39. function UIAntiCheatMsgWndView:OnShow(data)
  40. self.controller:SetData(data)
  41. self:Init()
  42. end
  43. function UIAntiCheatMsgWndView:CloseUI()
  44. self:UIClose()
  45. end
  46. function UIAntiCheatMsgWndView:OnClose()
  47. end
  48. function UIAntiCheatMsgWndView:OnDispose()
  49. self.controller:OnDispose()
  50. end
  51. function UIAntiCheatMsgWndView:OnQuit()
  52. local data = self.controller:GetData()
  53. local sureCb = data[2]
  54. if sureCb then
  55. sureCb()
  56. end
  57. self:CloseUI()
  58. end
  59. return UIAntiCheatMsgWndView