KLNPCTalkPanel.lua 751 B

123456789101112131415161718192021222324252627282930313233
  1. ---@class KLNPCTalkPanel:UIKmlLuaPanelBase
  2. ---@field view KLNPCTalkPanelView
  3. local KLNPCTalkPanel = class(UIKmlLuaPanelBase)
  4. local this =KLNPCTalkPanel
  5. ---创建时调用一次
  6. function this:Init()
  7. SL.HideMainPanel()
  8. end
  9. ---创建或者刷新界面数据时调用
  10. function this:Refresh()
  11. end
  12. function this:SetContent(content)
  13. GUI:Text_setString(self.view.ContentTxt, content)
  14. end
  15. ---注册UI事件和服务器消息
  16. function this:RegistEvents()
  17. GUI:AddOnClickEvent(self.view.cancelBtn,self,self.ClosePanel)
  18. GUI:AddOnClickEvent(self.view.bg1,self,self.ClosePanel)
  19. end
  20. function this:ClosePanel()
  21. GUI:UIPanel_Close("dev/ui/NPC/Panel/KLNPCTalk/KLNPCTalkPanel")
  22. end
  23. function this:Close()
  24. SL.ShowMainPanel()
  25. end
  26. return this