local UIDivineWeaponForgeSuccessPanel = UIViewClass() local EventSystem = require('Event/EventSystem') local SkillPath = ConstAssetPathConfig.SkillImagePath ---------------------------------- 系统函数 ------------------------------------ function UIDivineWeaponForgeSuccessPanel:OnOpened(context) UIUtils.SetLabelText(self.UITemplatePopUpZero.txt_Title, Const_IDS.IDS_Foundry_Get) if context then local showDataId = CTL.DivineWeapon.MagicWeaponFoundryShowID(context) local skillData = DataSheetManager.SkillTipsData:GetDataByID(showDataId) if skillData then local _, level = CTL.DivineWeapon.GetLineSkillBaseIDAndSkillLevel(context) UIUtils.SetImageByAssetBundle(self.img_SkillIcon, string.format(SkillPath, skillData.SkillIcon)) UIUtils.SetLabel(self.txt_SkillName, string.FormatByIdsId(Const_IDS["IDS_TalentSkill_Level"], level)) UIUtils.SetLabel(self.txt_SkillInfo, UTL.String.FormatCombineTextByID(skillData.TipsFunc)) end local attrRepeatData = DataSheetManager.MagicWeaponFoundryAttrRepeat:GetDataByAttrRepeatID(context.AttrRepeat) if attrRepeatData then UIUtils.SetActive(self.group_Attr.gameObject, true) for i = 1, #self.group_Attr do local attrItem = self.group_Attr[i] local attrData = attrRepeatData.Attr_Table[i] if attrData then UIUtils.SetActive(attrItem.gameObject, true) UTL.Attr.SetAttrItemByCompName(attrItem, attrData.AttrType, attrData.AttrNum, true) else UIUtils.SetActive(attrItem.gameObject, false) end end end end end function UIDivineWeaponForgeSuccessPanel:OnButtonClicked(comp) if comp == self.UITemplatePopUpZero.Bottom then EventSystem.Dispatch(EventID.UI_DivineWeapon_ForgeSkillUnlockClose, self.context) self:CloseView() end end -------------------------------------------------------------------------------- return UIDivineWeaponForgeSuccessPanel