From 6bcf00a69a06f9c7629821e851161c95b6cd6015 Mon Sep 17 00:00:00 2001 From: dgflash Date: Mon, 3 Oct 2022 22:08:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DDialog=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=90=8C=E8=B5=84=E6=BA=90=E7=AA=97=E5=8F=A3=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/core/gui/layer/LayerDialog.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/core/gui/layer/LayerDialog.ts b/assets/core/gui/layer/LayerDialog.ts index 4e17717..b43fb14 100644 --- a/assets/core/gui/layer/LayerDialog.ts +++ b/assets/core/gui/layer/LayerDialog.ts @@ -14,7 +14,11 @@ import { LayerPopUp } from "./LayerPopup"; * 模式弹窗层,该层的窗口同时只能显示一个,删除以后会自动从队列当中取一个弹窗,直到队列为空 */ export class LayerDialog extends LayerPopUp { + /** 窗口数据队列 */ private queue: Array = []; + /** 窗口参数队列 - 预防同一资源的窗口参数覆盖 */ + private queue_params: Array = []; + /** 当前窗口数据 */ private current!: ViewParams; add(config: UIConfig, params?: any, callbacks?: UICallbacks): string { @@ -27,7 +31,6 @@ export class LayerDialog extends LayerPopUp { viewParams = new ViewParams(); viewParams.uuid = this.getUuid(prefabPath); viewParams.prefabPath = prefabPath; - viewParams.params = params || {}; viewParams.callbacks = callbacks || {}; var onRemove_Source = viewParams.callbacks.onRemoved; @@ -45,8 +48,10 @@ export class LayerDialog extends LayerPopUp { if (this.current && this.current.valid) { this.queue.push(viewParams); + this.queue_params.push(params || {}); } else { + viewParams.params = params || {}; this.current = viewParams; this.load(viewParams); } @@ -61,6 +66,7 @@ export class LayerDialog extends LayerPopUp { private next() { if (this.queue.length > 0) { this.current = this.queue.shift()!; + this.current.params = this.queue_params.shift(); if (this.current.node) { this.createNode(this.current); }