--[[ 神兽突破成功弹窗 ]]-- local UIGodBeastBreakSuccess = UIViewClass() function UIGodBeastBreakSuccess:OnOpened(context) self:RefreshPanel() end function UIGodBeastBreakSuccess:RefreshPanel() local panelType = self.context.panelType local godBeastID = self.context.godBeastID self.txtState:SetState(1) UIUtils.SetActive(self.ImageKuang, false) if panelType == CTL.GodBeast.SuccessPanelType.Break then UIUtils.SetLabelText(self.UITemplatePopUpZero.txt_Title, Const_IDS.IDS_Godbeast_FateWheelLevel8) self:SetBreakSuccessInfo(godBeastID) else UIUtils.SetLabelText(self.UITemplatePopUpZero.txt_Title, Const_IDS.IDS_Godbeast_FateWheelLevel7) self:SetLevelUpSuccessInfo(godBeastID) end end function UIGodBeastBreakSuccess:SetBreakSuccessInfo(godBeastID) local info = MDL.GodBeast.GetGodBeastInfoByID(godBeastID) local starLevel = info.starLevel UIUtils.SetLabel(self.txt_OldStar, string.FormatByIdsId(Const_IDS.IDS_Horse_Star_2, starLevel - 1)) UIUtils.SetLabel(self.txt_NewStar, string.FormatByIdsId(Const_IDS.IDS_Horse_Star_2, starLevel)) local breakStarData = DataSheetManager.GodBeastStar:GetDataByID_Star(godBeastID, starLevel - 1) UIUtils.SetLabel(self.txt_DevelopEffectInfo, string.FormatByIdsId(Const_IDS.IDS_Godbeast_Talent12, breakStarData.SkillPoint)) local attrData = DataSheetManager.GodBeastStarAttr:GetDataByID(breakStarData.StarAttr).Attr_Table self:SetAttrItem(self.group_Info.group_Hp, self.group_Info.group_Hp.Lab_Hp, attrData[1]) self:SetAttrItem(self.group_Info.group_Atk, self.group_Info.group_Atk.Lab_Atk, attrData[2]) self:SetAttrItem(self.group_Info.group_Def, self.group_Info.group_Def.Lab_Def, attrData[3]) end function UIGodBeastBreakSuccess:SetLevelUpSuccessInfo(godBeastID) local raiseLevel = MDL.GodBeast.GetSlotRaiseLevel(godBeastID) local godBeastData = DataSheetManager.GodBeastData:GetDataByID(godBeastID) local levelUpData = DataSheetManager.GodBeastLevelUp:GetDataByLevelUpID_GodBeastLevel(godBeastData.LevelUpID, raiseLevel - 1) UIUtils.SetLabel(self.txt_OldStar, CTL.GodBeast.GetLevelUpYearText(levelUpData.GodBeastLevel)) UIUtils.SetLabelText(self.txt_DevelopEffectInfo, Const_IDS.IDS_Godbeast_LevelUp13) UIUtils.SetLabel(self.txt_NewStar, CTL.GodBeast.GetLevelUpYearText(levelUpData.GodBeastLevel + 1)) local attrData = levelUpData.Attr_Table self:SetAttrItem(self.group_Info.group_Hp, self.group_Info.group_Hp.Lab_Hp, attrData[1]) self:SetAttrItem(self.group_Info.group_Atk, self.group_Info.group_Atk.Lab_Atk, attrData[2]) self:SetAttrItem(self.group_Info.group_Def, self.group_Info.group_Def.Lab_Def, attrData[3]) end function UIGodBeastBreakSuccess:SetAttrItem(attrGroup, attrName, attr) local attrData = DataSheetManager.AttrData:GetDataByID(attr.AttrType) UIUtils.SetLabelText(attrName, Const_IDS[attrData.Name]) UTL.Attr.SetAttrIconByAttrIcon(attrGroup.img_Icon, attrData.Icon) UIUtils.SetLabel(attrGroup.txt_New, "+" .. attr.AttrNum) UIUtils.SetActive(attrGroup.gameObject, true) UIUtils.SetActive(attrGroup.txt_Old, false) UIUtils.SetActive(attrGroup.Arrow, false) end function UIGodBeastBreakSuccess:OnButtonClicked(comp) if comp == self.UITemplatePopUpZero.Bottom then self:CloseView() end end return UIGodBeastBreakSuccess