From ad1a9c7ea071605e3d19a77c3c42ede9983127ad Mon Sep 17 00:00:00 2001 From: dgflash Date: Thu, 24 Apr 2025 09:26:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=9A=E7=94=A8LayerDialog?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E6=97=A0=E6=B3=95=E5=85=B3=E9=97=AD=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/core/gui/layer/LayerDialog.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/assets/core/gui/layer/LayerDialog.ts b/assets/core/gui/layer/LayerDialog.ts index 068cb04..796ace2 100644 --- a/assets/core/gui/layer/LayerDialog.ts +++ b/assets/core/gui/layer/LayerDialog.ts @@ -34,14 +34,15 @@ export class LayerDialog extends LayerPopUp { return; } - this.show(config, params, callbacks); + this.show(uiid, config, params, callbacks); } /** 显示模式弹窗 */ - private show(config: UIConfig, params?: any, callbacks?: UICallbacks) { + private show(uiid: number, config: UIConfig, params?: any, callbacks?: UICallbacks) { let vp = this.ui_cache.get(config.prefab); if (vp == null) { vp = new ViewParams(); + vp.uiid = uiid; vp.valid = true; vp.config = config; } @@ -55,7 +56,9 @@ export class LayerDialog extends LayerPopUp { protected onCloseWindow(vp: ViewParams) { super.onCloseWindow(vp); - setTimeout(this.next.bind(this), 0); + setTimeout(() => { + this.next(vp); + }, 0); } protected setBlackDisable() { @@ -66,10 +69,10 @@ export class LayerDialog extends LayerPopUp { } } - private next() { + private next(vp: ViewParams) { if (this.params.length > 0) { let param = this.params.shift()!; - this.show(param.config, param.params, param.callbacks); + this.show(vp.uiid, param.config, param.params, param.callbacks); } } } \ No newline at end of file -- Gitee