local UICountryForeshowState3 = UIViewClass() --开启的活动id 顺序依赖界面顺序 0表示未开放活动 local ActiveArrayToId = { LuaConst.ActivityType.ThreeTeamFight, LuaConst.ActivityType.CountryWorldBoss, LuaConst.ActivityType.WantedTask, LuaConst.ActivityType.DragonArtery, LuaConst.ActivityType.CountryNightBoss, LuaConst.ActivityType.SyncCityWar, } function UICountryForeshowState3:OnOpened(context) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.Country_SyncCityWar, self.RefreshSyncCityWarBtnRp) local stage = MDL.Country.GetCurStage() if stage and stage >= MDL.Country.Stage.CountryBuild then self:InitActivity() UIUtils.SetActive(self.ani_Tip, MDL.Country.GetCurStage() == MDL.Country.Stage.CountryReset) else self:InitLock() UIUtils.SetActive(self.ani_Tip, false) end --越南 0180 一直屏蔽巅峰演武的入口 if GameAppInfo.IsVietnamPackage() then self:CloseThreeTeamFightEntry() end end function UICountryForeshowState3:RefreshSyncCityWarBtnRp() self.activityGroups[6].btn:SetRedPoint(CTL.RedPoint.GetRedPointActive(CTL.RedPoint.RedPointKey.Country_SyncCityWar)) end function UICountryForeshowState3:InitLock() for i, v in ipairs(self.activityGroups) do v.btn:SetGray(true, false) UIUtils.SetActive(v.img_BgCommingSoon, true) end end function UICountryForeshowState3:InitActivity() for i, v in ipairs(self.activityGroups) do UIUtils.SetLabelText(v.txt_Going, Const_IDS.IDS_GuildActivity_Opening) if ActiveArrayToId[i] > 0 then local activityData = DataSheetManager.ActivityData:GetDataByID(ActiveArrayToId[i]) UIUtils.SetActive(v.img_OpenTime, true) if #activityData.Time_Table <= 0 then UIUtils.SetLabelText(v.txt_OpenTime, Const_IDS.IDS_Activity_TimeShow01) v.txt_Time.text = nil else local date, time, extra = CTL.Activities.GetDetailsTimeDesc(activityData) v.txt_Time.text = time v.txt_OpenTime.text = date end if ActiveArrayToId[i] == LuaConst.ActivityType.ThreeTeamFight then --显示逻辑: --1、玩法没开启的时候,显示x天开启 --2、玩法开启后,活动时间内:显示活动进行中;不在活动时间内:隐藏活动进行中 if MDL.ThreeTeamFight.IsSeasonOpen() == false then UIUtils.SetActive(v.img_Going, true) v.txt_Going.text = CTL.ThreeTeamFight.GetActivityNotOpenTips(false) else if CTL.ThreeTeamFight.IsActivityOpen() and CTL.Activities.GetState(LuaConst.ActivityType.ThreeTeamFight) == CTL.Activities.ActivityState.Opening then UIUtils.SetActive(v.img_Going, true) UIUtils.SetLabelText(v.txt_Going, Const_IDS.IDS_GuildActivity_Opening) else UIUtils.SetActive(v.img_Going, false) end end elseif ActiveArrayToId[i] ~= LuaConst.ActivityType.CountryWorldBoss then local isNotReset = MDL.Country.GetCurStage() ~= MDL.Country.Stage.CountryReset UIUtils.SetActive(v.img_Going, isNotReset and CTL.Activities.IsOpeningTime(ActiveArrayToId[i])) else UIUtils.SetActive(v.img_Going, CTL.Activities.IsOpeningTime(ActiveArrayToId[i])) end if ActiveArrayToId[i] == LuaConst.ActivityType.SyncCityWar then v.btn:SetRedPoint(CTL.RedPoint.GetRedPointActive(CTL.RedPoint.RedPointKey.Country_SyncCityWar)) end else v.btn:SetGray(true, false) UIUtils.SetActive(v.img_BgCommingSoon, true) end end end function UICountryForeshowState3:OnButtonClicked(comp) for i, v in ipairs(self.activityGroups) do if v.btn == comp then if MDL.Country.GetCurStage() == MDL.Country.Stage.CountryReset and ActiveArrayToId[i] ~= LuaConst.ActivityType.CountryWorldBoss and ActiveArrayToId[i] ~= LuaConst.ActivityType.ThreeTeamFight and ActiveArrayToId[i] ~= LuaConst.ActivityType.SyncCityWar then CTL.Tips.AddTipsMsgAndPlaySound(Const_IDS.IDS_DragonArtery_OpenCondition1) else CTL.Activities.OpenActivityWindowByID(ActiveArrayToId[i]) end end end end function UICountryForeshowState3:CloseThreeTeamFightEntry() self.activityGroups[1].btn:SetGray(true, false) UIUtils.SetActive(self.activityGroups[1].img_BgCommingSoon, true) UIUtils.SetActive(self.activityGroups[1].img_OpenTime, false) UIUtils.SetActive(self.activityGroups[1].txt_Time, false) UIUtils.SetActive(self.activityGroups[1].img_Going, false) end return UICountryForeshowState3