local UITreasureRelationActivePopUp = UIViewClass() function UITreasureRelationActivePopUp:OnOpened(context) CTL.Sound.PlayGameSound("UI_completion") self:RefreshPanel(context.treasureID, context.heroID) end function UITreasureRelationActivePopUp:OnClosed() CTL.Tips.PopRelationShowPanel() end function UITreasureRelationActivePopUp:RefreshPanel(treasureID, heroID) UIUtils.SetLabelText(self.UITemplatePopUpZero.txt_Title, Const_IDS["IDS_TreasureFetter_Active"]) -- 武将和宝物图标 local heroData = DataSheetManager.HeroNum:GetDataByID(heroID) local treasureData = DataSheetManager.TreasureData:GetDataByTreasureID(treasureID) local treasureSkillData = CTL.Treasure.GetTreasureSkillData(treasureID) if MDL.HeroAwaken.GetIsHeroAwaken(heroID) then UTL.Item.SetItemCell(self.Hero, CTL.HeroAwaken.GetItemIconId(heroID)) else UTL.Item.SetItemCell(self.Hero, heroData.HeroItem) end UTL.Item.SetItemCell(self.Treasure, treasureData.Item_Table[1].ItemID) UIUtils.SetActive(self.Treasure.group_Shard, false) -- 技能图标 UIUtils.SetImageByAssetBundle(self.img_Skill, treasureSkillData.TreasureSkillIcon) -- 当前宝物技能描述 UIUtils.SetLabel(self.txt_SkillDes, CTL.Treasure.GetRelationSkillDesc(treasureID, 0)) -- 默认羁绊技能描述 local starLevel = MDL.Treasure.GetTreasureInfo(treasureID).TreasureInfo.starLevel local secondRelationStarLevel = DataSheetManager.TreasureRelation:GetDataByTreasureID_HeroID(treasureID, heroID).Relation_Table[2].RelationLevel if starLevel >= secondRelationStarLevel then UIUtils.SetActive(self.img_FetterBg, true) UIUtils.SetLabel(self.txt_SkillRelationDes, CTL.Treasure.GetRelationSkillDesc(treasureID, MDL.Treasure.GetTreasureInfo(treasureID).TreasureInfo.starLevel)) else UIUtils.SetActive(self.img_FetterBg, false) end end function UITreasureRelationActivePopUp:OnButtonClicked(comp) if comp == self.UITemplatePopUpZero.Bottom then self:CloseView() end end return UITreasureRelationActivePopUp