---@class KLUnionActivityItem:UIKmlLuaPanelBase ---@field view KLUnionActivityItemView local KLUnionActivityItem = class(UIKmlLuaPanelBase) local this =KLUnionActivityItem ---创建时调用一次 function this:Init() self.activityId = self.args.activityId self.isOpen = false GUI:setVisible(self.view.ImgOpen, false) end ---创建或者刷新界面数据时调用 function this:Refresh() ---@type cfg_activity_rule_column local tbl = SL:GetConfig("cfg_activity_rule", self.activityId) GUI:Text_setString(self.view.TxtOpenTime, tbl.timeText) GUI:Text_setString(self.view.TxtLimit, tbl.uiTextSynopsis) GUI:Image_loadTexture(self.view.Bg, tbl.unionUiBg,"Atlas/Guild.spriteatlas") end ---注册UI事件和服务器消息 function this:RegistEvents() GUI:AddOnClickEvent(self.view.Bg, self, self.ActivityOnClick) end function this:SetOpen(isOpen) self.isOpen = isOpen GUI:setVisible(self.view.ImgOpen, isOpen) end function this:ActivityOnClick() if not self.isOpen then SL:TipMessage(SL:GetConfig('cfg_string',250).text, 1, NoticeType.NoticeMid)--"活动未开启", return end ---@type cfg_activity_rule_column local tbl = SL:GetConfig("cfg_activity_rule", self.activityId) ---狼魂要塞 if tbl.id == EActivityType.WolfSoulFortress then ---没有公会 if SL:MeData_GetUnionId() == 0 then SL:TipMessage( SL:GetConfig('cfg_string', 433).text, 1, NoticeType.NoticeMid ) return end ---@type cfg_rep_column local tempTbl = InfoManager.wolfSoulFortressInfo:GetCfgByOpenServerDay() if tempTbl then SL:SendLuaNetMsg(LuaMessageIdToSever.REQ_ENTER_DUPLICATE, tempTbl.id) end else SL:ShortcutDO(tbl.panel) end end function this:Close() end return this