local UICountryForeshowState1 = UIViewClass() local EventSystem = require('Event/EventSystem') function UICountryForeshowState1:OnOpened(context) self:OnButtonClicked(self.bottom_Btns[1].Rect) end function UICountryForeshowState1:OnButtonClicked(comp) if comp == self.btn_Info then UIManager.OpenView(Const_UI_Lua.UIEnum.UIDescriptionPanel, {target = self.btn_Info, posType = LuaConst.DescriptionPanelType.RightLower, text = self.curInfoText}) else for i, v in ipairs(self.bottom_Btns) do if v.Rect == comp then v.state_Tier:SetState(1) self:ShowInfo(i) else v.state_Tier:SetState(0) end end end end function UICountryForeshowState1:ShowInfo(index) local data = DataSheetManager.CountryForeshow:GetDataByID(index) UIUtils.SetLocalizationImage(self.img_Title, data.PhaseNameImage) UIUtils.SetLabelText(self.txt_Title, Const_IDS[data.PhaseName]) UIUtils.SetLabelText(self.txt_Tip2, Const_IDS[data.PhaseIntro]) self.curInfoText = UIUtils.GetLocalizedTxt(Const_IDS[data.PhaseText]) EventSystem.Dispatch(EventID.UI_Country_ChangeBGImage, data.PhaseImage) end return UICountryForeshowState1