local UIOfficialPrivilegeSuccessPopUp = UIViewClass() local ids_Success_type = { [MDL.OfficialPrivilege.OptType.Inquire] = Const_IDS.IDS_OfficialPrivilege_Success1, [MDL.OfficialPrivilege.OptType.Strengthen] = Const_IDS.IDS_OfficialPrivilege_Success2, [MDL.OfficialPrivilege.OptType.Silence] = Const_IDS.IDS_OfficialPrivilege_Success3, [MDL.OfficialPrivilege.OptType.Punishment] = Const_IDS.IDS_OfficialPrivilege_Success4, [MDL.OfficialPrivilege.OptType.Promote] = Const_IDS.IDS_OfficialPrivilege_Success5, } local sound_Success_type = { [MDL.OfficialPrivilege.OptType.Inquire] = "UI_visit", [MDL.OfficialPrivilege.OptType.Strengthen] = "UI_healthy", } ----------- function UIOfficialPrivilegeSuccessPopUp:OnOpened(context) local sound = sound_Success_type[context.RightsID] if sound then CTL.Sound.PlayGameSound(sound) end local rightsID = context.RightsID local rightsData = DataSheetManager.OfficialRights:GetDataByRightsID(rightsID) UIUtils.SetImageByAssetBundle(self.img_Privilege, rightsData.Picture) UIUtils.SetLabelText(self.txt_Success, ids_Success_type[rightsID]) end function UIOfficialPrivilegeSuccessPopUp:OnButtonClicked(comp) if self.event_Click == comp then self:CloseView() CTL.OfficialPrivilege.OnOfficialPrivilegeSuccessClose() end end ----------- return UIOfficialPrivilegeSuccessPopUp