local UIPetReproductionPopUp = UIViewClass() function UIPetReproductionPopUp:OnOpened(context) self.modelComponentDataHandle = UTL.UIRender.CreateModelComponentDatas(self.model_Show) UIUtils.SetLabelText(self.UIPetPopUpSmall.txt_Title, Const_IDS.IDS_PetReproduce8) self:SetBreedInfo(context.breedInfo) end function UIPetReproductionPopUp:SetBreedInfo(breedInfo) self.lab_Pelease.text = string.FormatByIdsId(Const_IDS.IDS_PetReproduce19, breedInfo.playerName) local petCfg = DataSheetManager.PetData:GetDataByID_Stage(breedInfo.petId, breedInfo.petVariation) UIUtils.SetLabel(self.group_NameNormal.txt_Qua, CTL.Pet.GetPetPedigreeImgText(breedInfo.petPedigree)) UIUtils.SetLabelText(self.group_NameNormal.txt_Name, Const_IDS[petCfg.PetName]) self:LoadModel(petCfg) end function UIPetReproductionPopUp:LoadModel(petConfig) UTL.UIRender.CreateRTSceneTrans(self.modelComponentDataHandle, petConfig.PetModelLight) local modelPath, modelScale, showEquipmentID, renderID, idleAnimCilp, heroEffectPath, psEffectPath, modelXYZ, modelRot = CTL.Pet.GetRenderTextureModelParam(petConfig, self.__viewClassPath) UTL.UIRender.CreateRTRenderModel(self.modelComponentDataHandle, modelPath, modelScale, showEquipmentID, renderID, idleAnimCilp, heroEffectPath, psEffectPath) UTL.UIRender.SetRTRootParam(self.modelComponentDataHandle, modelXYZ, modelRot) end function UIPetReproductionPopUp:OnClosed() UTL.UIRender.DisposeModelComponentData(self.modelComponentDataHandle) end function UIPetReproductionPopUp:OnBackButtonPressed() self:OnButtonClicked(self.UIPetPopUpSmall.btn_Close) end function UIPetReproductionPopUp:OnButtonClicked(comp) if comp == self.UIPetPopUpSmall.btn_Close or comp == self.btn_2 then self:CloseView() elseif comp == self.btn_1 then local breedInfo = self.context.breedInfo MDL.Pet.BreedPetInviteHandleReq(breedInfo.playerAcid, breedInfo.petId, {playerAcid = breedInfo.playerAcid, playerName = breedInfo.playerName, petId = breedInfo.petId}) self:CloseView() end end return UIPetReproductionPopUp