UnionBossInfo.lua 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ---@class UnionBossInfo
  2. UnionBossInfo = class()
  3. local this = UnionBossInfo
  4. local UnionBossTaskPanelPath = "dev/outui/Union/Panel/KLUnionBossTask/KLUnionBossTaskPanel"
  5. function this:Init()
  6. SL:RegisterLuaNetMsg(LuaMessageIdToClient.RES_WAR_ALLIANCE_TASK_INFO,self.RES_WAR_ALLIANCE_TASK_INFO,self)
  7. SL:RegisterLuaNetMsg(LuaMessageIdToClient.RES_WAR_ALLIANCE_STATE_INFO,self.RES_WAR_ALLIANCE_STATE_INFO,self)
  8. SL:RegisterLuaNetMsg(LuaMessageIdToClient.RES_WAR_ALLIANCE_EXIT,self.RES_WAR_ALLIANCE_EXIT,self)
  9. SL:RegisterLuaNetMsg(LuaMessageIdToClient.RES_WAR_ALLIANCE_OPEN_AUCTION,self.RES_WAR_ALLIANCE_OPEN_AUCTION,self)
  10. end
  11. function this:RES_WAR_ALLIANCE_OPEN_AUCTION()
  12. ---@type KLPopoverPanel
  13. local popoverPanel = GUI:GetUI("dev/ui/Preview/Panel/KLPopover/KLPopoverPanel")
  14. popoverPanel:SetPopoverData(17)
  15. popoverPanel:RefreshUI()
  16. end
  17. function this:RES_WAR_ALLIANCE_EXIT()
  18. ---@type KLUILeftUpPanel
  19. local leftUpPanel = GUI:GetUI("dev/ui/MainUI/Panel/KLUILeftUp/KLUILeftUpPanel")
  20. leftUpPanel:HookTaskPanel(nil)
  21. end
  22. function this:RES_WAR_ALLIANCE_STATE_INFO(_,message)
  23. self.dupEndTime = tonumber(message["2"])
  24. if message["1"] == 3 then
  25. self:RES_WAR_ALLIANCE_EXIT()
  26. end
  27. end
  28. function this:RES_WAR_ALLIANCE_TASK_INFO(_,message)
  29. ---@type KLUILeftUpPanel
  30. local leftUpPanel = GUI:GetUI("dev/ui/MainUI/Panel/KLUILeftUp/KLUILeftUpPanel")
  31. leftUpPanel:HookTaskPanel(self:GetUnionBossTaskPanel(message))
  32. --隐藏地图传送点
  33. local config = SL:GetConfig("cfg_repGlobal",14001003).value
  34. local transPoints = string.split(config,"|")
  35. local p = message.nowCount >= message.totalCount and 1 or 0
  36. ---@type KLMiniMapPanel
  37. local minimapPanel = GUI:GetUI("dev/ui/Map/Panel/KLMiniMap/KLMiniMapPanel")
  38. if minimapPanel then
  39. for i = 1, #transPoints do
  40. local transPointId = string.split(transPoints[i],"#")[2]
  41. minimapPanel:SetMapIconVisible("MapTransferIcon" .. transPointId,i < p + message.phrase)
  42. end
  43. end
  44. end
  45. function this:GetUnionBossTaskPanel(message)
  46. local panel = GUI:GetUI(UnionBossTaskPanelPath)
  47. if not panel then
  48. panel = GUI:UIPanel_Open(UnionBossTaskPanelPath)
  49. end
  50. panel:SetData(message)
  51. return panel
  52. end
  53. function this:Reset()
  54. end