local UIFairSoloTournamentInvitation = UIViewClass() function UIFairSoloTournamentInvitation:OnOpened(context) self:RegistSystemEvent(EventID.UI_FairSoloTournament_OnSeasonEnd, self.OnBackButtonPressed) self.txt_Name.text = string.FormatByIdsId(Const_IDS.IDS_FairTournament_LetterPlayerName, BattleDataGetter.GetPlayerName()) self.txt_Letter01.text = string.FormatByIdsId(Const_IDS.IDS_FairTournament_Letter1, MDL.FairSoloTournament.GetGroupCompetitionId()) local symbol = MDL.FairSoloTournament.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 UIFairSoloTournamentInvitation:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIFairSoloTournamentInvitation:OnButtonClicked(comp) if comp == self.btn_Close then CTL.PushInterface.HidePushInterface(self.__viewClassPath) self:CloseView() elseif comp == self.btn_Go then self:CloseView() MDL.FairSoloTournament.SetSeasonPlayerValue("hasAcceptInvitation", true) CTL.FairSoloTournament.OpenMain() UIManager.OpenView(Const_UI_Lua.UIEnum.UIFairSoloTournamentList) end end return UIFairSoloTournamentInvitation