local UITeamFairChampionshipInvitation = UIViewClass() function UITeamFairChampionshipInvitation:OnOpened(context) self:RegistSystemEvent(EventID.UI_FairSoloTournament_OnSeasonEnd, self.OnBackButtonPressed) self.txt_Name.text = string.FormatByIdsId(Const_IDS.IDS_TeamFairTournamen_LetterPlayerName, BattleDataGetter.GetPlayerName()) self.txt_Letter01.text = string.FormatByIdsId(Const_IDS.IDS_TeamFairTournamen_Letter1, MDL.TeamFairChampionship.GetMyFilterGroupId()) local symbol = MDL.TeamFairChampionship.GetSeasonPlayerValue("hasAcceptInvitation") if symbol then UIUtils.SetLabelText(self.lab_Go, Const_IDS["IDS_FairTournament_Shortlist"]) else UIUtils.SetLabelText(self.lab_Go, Const_IDS["IDS_FairTournament_Accept"]) end end function UITeamFairChampionshipInvitation:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UITeamFairChampionshipInvitation:OnButtonClicked(comp) if comp == self.btn_Close then CTL.PushInterface.HidePushInterface(self.__viewClassPath) self:CloseView() elseif comp == self.btn_Go then self:CloseView() MDL.TeamFairChampionship.SetSeasonPlayerValue("hasAcceptInvitation", true) CTL.TeamFairChampionship.OpenMainPanel() UIManager.OpenView(Const_UI_Lua.UIEnum.UITeamFairChampionshipPromotList) end end return UITeamFairChampionshipInvitation