MainUiStateManager.lua 926 B

123456789101112131415161718192021222324252627282930313233343536
  1. ---
  2. --- Generated by EmmyLua(https://github.com/EmmyLua)
  3. --- Created by PZM.
  4. --- DateTime: 2024/7/9 11:21
  5. ---@class MainUiStateManager
  6. MainUiStateManager = {}
  7. local this = MainUiStateManager
  8. function this.Init()
  9. this.RegistEvents()
  10. this.showPanelMap = {}
  11. end
  12. function this.RegistEvents()
  13. SL:RegisterLUAEvent(LUA_EVENT_MAIN_UI_VISIBLE,this.LUA_EVENT_MAIN_UI_VISIBLE)
  14. end
  15. function this.UnRegistEvents()
  16. SL:UnRegisterLUAEvent(LUA_EVENT_ENTER_MAP,this.LUA_EVENT_ENTER_MAP)
  17. SL:RegisterLUAEvent(LUA_EVENT_PLAYER_CREATE, this.LUA_EVENT_PLAYER_CREATE)
  18. SL:UnRegisterLuaNetMsg(LuaMessageIdToClient.RES_SEND_GET_REWARD_MSG,this.RES_SEND_GET_REWARD_MSG)
  19. end
  20. function this.Reset()
  21. this.UnRegistEvents()
  22. end
  23. function this:LUA_EVENT_MAIN_UI_VISIBLE(info)
  24. local vis = info.vis
  25. local name = info.name
  26. this.showPanelMap[name] = vis
  27. SL:onLUAEvent(LUA_EVENT_MAIN_UI_VISIBLE_AFTER, info)
  28. end