//********************* // create by 流云 // time: Fri Jun 13 2025 // desc: //********************* import { _decorator } from 'cc'; import { Auto_MsgBox } from './Auto_MsgBox'; const { ccclass, property } = _decorator; @ccclass('UIMsgBox') export class UIMsgBox extends Auto_MsgBox { onLoad(): void { super.onLoad(); } onEnable(): void { super.onEnable(); } onDisable(): void { super.onDisable(); } onInit(): void { if (this.prema["title"]) this.title = this.prema["title"]; if (this.prema["content"]) this.content = this.prema["content"]; if (this.prema["yesFun"]) this.yesFun = this.prema["yesFun"]; if (this.prema["noFun"]) this.noFun = this.prema["noFun"]; this.lb_content.string = this.content; this.btnOk.x = this.noFun ? -110 : 0; this.btnNo.active = this.noFun != null; } title: string = ""; content: string = ""; yesFun: Function = null; noFun: Function = null; click_btnNo(): void { const noFun = this.noFun; this.close(2).then(() => { noFun?.(); }); } click_btnOk(): void { const yesFun = this.yesFun; this.close(2).then(() => { yesFun?.(); }); } }