local UISyncTeamPVPHallOfFame = require "View/SyncTeamPVP/UISyncTeamPVPHallOfFame" local UISyncTeamPVPHallOfFame_FairSoloTournament = UIViewClass(UISyncTeamPVPHallOfFame) local TAB_TYPE_SOLO = 0 function UISyncTeamPVPHallOfFame_FairSoloTournament:OnOpened(context) self.fairSoloTournamentFamousDict = {} self:RegistSystemEvent(EventID.UI_FairSoloTournament_UpdateFamousInfo, self.UpdateFairSoloTournamentFamousInfo) UTL.Toggle.InitToggleGroupByIDS(self.group_FairToggles, "txt", { Const_IDS.IDS_1v1Sync_Title, Const_IDS.IDS_FairTournament_Name }) self.group_FairToggles:SelectIndex(0) end function UISyncTeamPVPHallOfFame_FairSoloTournament:OnValueChanged(comp, index) if self.tabType == index then return end self.tabType = index if index == TAB_TYPE_SOLO then --1v1 UIUtils.SetActive(self.cells.gameObject, true) self.UICommonPopUp.loop_Tab:ClearCells() self.loop_FairTourNament:ClearCells() MDL.FairPlay.HistoryFamousRequest(LuaConst.ActivityType.SyncSolo) else --天下会武 UIUtils.SetActive(self.cells.gameObject, false) self.UICommonPopUp.loop_Tab:ClearCells() MDL.FairSoloTournament.FairTournamentGetFamousReq() end end function UISyncTeamPVPHallOfFame_FairSoloTournament:UpdateFairSoloTournamentFamousInfo(seasonInfos) if seasonInfos and #seasonInfos > 0 then for i, v in ipairs(seasonInfos) do self.fairSoloTournamentFamousDict[v.seasonId] = v.famous self.UICommonPopUp.loop_Tab:AddData(v.seasonId, 0) end self.UICommonPopUp.loop_Tab:SelectIndex(0) end end function UISyncTeamPVPHallOfFame_FairSoloTournament:OnCellSelect(scrollRect, index, cellTable, data) if scrollRect == self.UICommonPopUp.loop_Tab then if self.tabType == TAB_TYPE_SOLO then UISyncTeamPVPHallOfFame.OnCellSelect(self, scrollRect, index, cellTable, data) else self:LoadFairSoloTournamentData(data) end end end function UISyncTeamPVPHallOfFame_FairSoloTournament:OnCellClicked(scrollRect, index, cellTable, target, data) if scrollRect == self.loop_FairTourNament then if data.acid ~= BattleDataGetter.GetAcID() then CTL.PlayerInteract.OpenFriendInteractView(data.acid) end end end function UISyncTeamPVPHallOfFame_FairSoloTournament:LoadFairSoloTournamentData(seasonId) local info = self.fairSoloTournamentFamousDict[seasonId] if info then self.loop_FairTourNament:ReloadAll(info) end end function UISyncTeamPVPHallOfFame_FairSoloTournament:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.UICommonPopUp.loop_Tab then UISyncTeamPVPHallOfFame.OnCellInit(self, scrollRect, index, cellTable, data) else --4强,3个状态 if data.ranking == 4 then cellTable.UIState_Rank:SetState(2) else cellTable.UIState_Rank:SetState(data.ranking - 1) end cellTable.txt_PlayerName.text = data.name if string.isNilOrEmpty(data.guildName) then UIUtils.SetActive(cellTable.group_Guild, false) else UIUtils.SetActive(cellTable.group_Guild, true) CTL.Guild.SetGuildEmblem(cellTable.img_Guild, cellTable.txt_Guild, data.emblemFrame, data.emblemContent) UIUtils.SetLabel(cellTable.txt_GuildName, data.guildName) end cellTable.txt_Server.text = CTL.CrossServer.GetServerShowStr(data.serId) CTL.Character.SetPortraitAndFrame(cellTable.UIHeroHead150, data.portraitId, data.frameId, nil, data.acid) end end --空方法不能删,防止走到父类的逻辑 function UISyncTeamPVPHallOfFame_FairSoloTournament:InitData() --do nothing end return UISyncTeamPVPHallOfFame_FairSoloTournament