local UIWarHorseRelationActivePopUp = UIViewClass() function UIWarHorseRelationActivePopUp:OnOpened(context) CTL.Sound.PlayGameSound("UI_completion") self:RefreshPanel(context.HorseID, context.HeroID) end function UIWarHorseRelationActivePopUp:OnClosed() CTL.Tips.PopRelationShowPanel() end function UIWarHorseRelationActivePopUp:OnButtonClicked(comp) if comp == self.UITemplatePopUpZero.Bottom then self:CloseView() end end function UIWarHorseRelationActivePopUp:RefreshPanel(horseID, heroID) UIUtils.SetLabelText(self.UITemplatePopUpZero.txt_Title, Const_IDS.IDS_HorseRelation_Active) local heroData = DataSheetManager.HeroNum:GetDataByID(heroID) if MDL.HeroAwaken.GetIsHeroAwaken(heroID) then UTL.Item.SetItemCell(self.Hero, CTL.HeroAwaken.GetItemIconId(heroID)) else UTL.Item.SetItemCell(self.Hero, heroData.HeroItem) end local horseData = DataSheetManager.HorseData:GetDataByHorseID(horseID) UTL.Item.SetItemCell(self.Horse, horseData.Item_Table[1].ItemID) UIUtils.SetActive(self.Horse.group_Shard, false) UIUtils.SetActive(self.Horse.group_Count, false) local curRelationData = CTL.WarHorse.GetHorousBreakRelation(horseID, heroID, false) if curRelationData then local skillData = DataSheetManager.HorseSkillData:GetDataByHorseSkill(curRelationData.RelationSkill) if skillData then UIUtils.SetLabel(self.txt_Info, UTL.String.FormatCombineTextByID(skillData.HorseSkillDes)) else logging.error(LTAG.ERROR, "战骑羁绊配表错误 : 未找到该技能;horseID = ", horseID, ",heroID = ", heroID, ",技能Id = ", curRelationData.RelationSkill) end else logging.error(LTAG.ERROR, "战骑羁绊配表错误 : 请检查;horseID = ", horseID, ",heroID = ", heroID, "这一条数据") end end return UIWarHorseRelationActivePopUp