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,cAAc,EAAE;YAChB,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACnC,cAAc,GAAG,SAAS,CAAC;SAC9B;IACL,CAAC;IALe,+BAAqB,wBAKpC,CAAA;IAED,SAAgB,iBAAiB;QAC7B,OAAO,cAAc,CAAC;IAC1B,CAAC;IAFe,2BAAiB,oBAEhC,CAAA;IAED,SAAgB,SAAS,CAAC,OAAyB;QAC/C,2BAAY,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAFe,mBAAS,YAExB,CAAA;IAED;;;;OAIG;IACH,SAAgB,cAAc,CAAC,OAAyB,EAAE,OAAe,CAAC;QACtE,2BAAY,CAAC,QAAQ,CAAC,eAAe,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC;IAFe,wBAAc,iBAE7B,CAAA;IAED;;;OAGG;IACH,SAAgB,gBAAgB,CAAC,IAAsB;QACnD,2BAAY,CAAC,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;IAFe,0BAAgB,mBAE/B,CAAA;IAED,SAAgB,YAAY,CAAC,IAAY;QACrC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAFe,sBAAY,eAE3B,CAAA;IAED,SAAgB,SAAS,CAAC,YAA8B,EAAE,OAAO,GAAG,IAAI;QACpE,OAAO,2BAAY,CAAC,SAAS,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAFe,mBAAS,YAExB,CAAA;AAEL,CAAC,EAzXgB,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAyXzB","file":"","sourceRoot":"/","sourcesContent":["import { ResUtils } from \"simba-cc-resutils\";\nimport { ToastManager } from \"./ToastManager\";\nimport { Presenter, createPresenter, PresenterParamType } from \"../../classbase/PresenterBase\";\nimport { View } from \"../../classbase/ViewBase\";\nimport { CCView } from \"../../classbase/CCViewBase\";\nimport { AlertManager } from \"./AlertManager\";\nimport { SpecialToastType } from \"../../../game/ui/SpecialToast\";\n\nexport namespace UIManager {\n const MODAL_Z = 1000;\n const ALERT_Z = 2000;\n const TOAST_Z = 3000;\n\n let rootNode: cc.Node;\n let rootView: View;\n let modalPresenter: Presenter<any> | undefined;\n let toastRoot: cc.Node;\n let alertRoot: cc.Node;\n let modalRoot: cc.Node;\n let modalRootView: View;\n let loadingContainer: cc.Node;\n let loadingView: cc.Node;\n\n /**场景最上层如提示父节点 */\n let toastParentNode:cc.Node;\n\n type PresenterExt = Presenter<any> & { hideViews?: string[] };\n const presenterStack: PresenterExt[] = [];\n const viewMap: { [key: string]: PresenterExt } = {};\n const viewCache: { [key: string]: PresenterExt } = {};\n const loadingViews: string[] = [];\n\n export async function init(uiRoot: cc.Node,toastParentNode_:cc.Node) {\n let promise = ToastManager.init();\n rootNode = uiRoot;\n rootView = rootNode.addComponent(CCView);\n toastParentNode = toastParentNode_;\n if (!modalRoot) {\n modalRoot = new cc.Node();\n modalRoot.name = \"modalRoot\";\n modalRoot.zIndex = MODAL_Z;\n rootNode.addChild(modalRoot);\n modalRootView = modalRoot.addComponent(CCView);\n }\n\n if (!alertRoot) {\n alertRoot = new cc.Node();\n alertRoot.name = \"alertRoot\";\n alertRoot.zIndex = ALERT_Z;\n rootNode.addChild(alertRoot);\n }\n\n if (!toastRoot) {\n toastRoot = new cc.Node();\n toastRoot.name = \"toastRoot\";\n toastRoot.zIndex = TOAST_Z;\n rootNode.addChild(toastRoot);\n }\n\n if (!loadingContainer) {\n loadingContainer = new cc.Node();\n loadingContainer.name = \"loadingContainer\";\n loadingContainer.zIndex = 99;\n loadingContainer.active = false;\n rootNode.addChild(loadingContainer);\n\n\n let widget = loadingContainer.addComponent(cc.Widget);\n widget.top = widget.bottom = widget.left = widget.right = 0;\n widget.isAlignTop = widget.isAlignBottom = widget.isAlignLeft = widget.isAlignRight = true;\n loadingContainer.addComponent(cc.BlockInputEvents);\n }\n\n if (!loadingView) {\n let ret = await ResUtils.loadRes(\"prefab/ui/ViewLoading\", cc.Prefab);\n loadingView = cc.instantiate(ret);\n loadingContainer.addChild(loadingView);\n loadingView.active = false;\n }\n await promise;\n }\n\n let viewInstanceId = 0;\n export function pushPresenter<T extends Presenter<any, any>>(presentCls: { new(): T, uuid: string, allowMultiInstances?: boolean }, param: PresenterParamType<T>, hideOthers = false) {\n return new Promise<T>(async (resolve, reject) => {\n try {\n if (presenterStack.length > 0) presenterStack[presenterStack.length - 1].onEnterBackground();\n let nodeName = presentCls.allowMultiInstances ? presentCls.uuid + (viewInstanceId++) : presentCls.uuid;\n if (viewMap[nodeName]) {\n if (presenterStack[presenterStack.length - 1].view.name == nodeName) {\n console.log(presentCls.uuid + \"视图已经在最顶层\");\n presenterStack[presenterStack.length - 1].onOpen(param);\n resolve(presenterStack[presenterStack.length - 1] as T);\n return;\n }\n // move view to top\n let index = presenterStack.findIndex(v => v.view.name === nodeName);\n let presenter = presenterStack[index];\n presenterStack.push(presenter);\n presenterStack.splice(index, 1);\n (presenter.view as CCView).node.setSiblingIndex(presenterStack.length);\n presenter.onOpen(param);\n if (presenter.hideViews) {\n let len = presenterStack.length - 1;\n if (hideOthers) {\n for (let i = index; i < len; i++) {\n if (!presenterStack[i].view.isHidden) {\n presenterStack[i].view.hide();\n presenter.hideViews!.push(presenterStack[i].view.name);\n }\n }\n } else {\n let hideNode: PresenterExt | undefined;\n for (let i = index; i < len; i++) {\n if (presenterStack[i].hideViews) {\n hideNode = presenterStack[i];\n break;\n }\n }\n if (hideNode) {\n for (let str of presenter.hideViews!) {\n hideNode.hideViews!.push(str);\n }\n } else {\n for (let str of presenter.hideViews!) {\n viewMap[str].view.show();\n }\n }\n delete presenter.hideViews;\n }\n } else if (hideOthers) {\n let len = presenterStack.length - 1;\n presenter.hideViews = [];\n for (let i = 0; i < len; i++) {\n if (!presenterStack[i].view.isHidden) {\n presenterStack[i].view.hide();\n presenter.hideViews.push(presenterStack[i].view.name);\n }\n }\n }\n resolve(presenter as T);\n } else {\n if (!loadingContainer.active) {\n loadingViews.push(presentCls.uuid);\n loadingContainer.active = true;\n loadingView.active = false;\n (<any>loadingView).timer = setTimeout(() => {\n (<any>loadingView).timer = undefined;\n loadingView.active = true;\n }, 1000);\n } else {\n let index = loadingViews.findIndex(v => v === presentCls.uuid);\n if (index >= 0) {\n reject(\"View is already loading.\");\n return;\n }\n }\n\n let error: Error | undefined;\n let presenter: PresenterExt = viewCache[presentCls.uuid];\n if (!presenter) {\n // create a view\n try {\n presenter = await createPresenter(presentCls);\n presenter.view.name = nodeName;\n viewCache[presentCls.uuid] = presenter;\n } catch (e) {\n error = e;\n }\n }\n if (presenter) {\n (presenter as T).open(rootView, param);\n (presenter.view as CCView).onClose.once((destroy) => {\n onPresenterInStackClose(presenter, destroy);\n });\n if (hideOthers) {\n presenter.hideViews = [];\n let len = presenterStack.length;\n for (let i = 0; i < len; i++) {\n if (!presenterStack[i].view.isHidden) {\n presenterStack[i].view.hide();\n presenter.hideViews.push(presenterStack[i].view.name);\n }\n }\n }\n presenterStack.push(presenter);\n viewMap[nodeName] = presenter;\n }\n let index = loadingViews.findIndex(v => v === presentCls.uuid);\n loadingViews.splice(index, 1);\n if (loadingViews.length == 0) {\n if ((<any>loadingView).timer) {\n clearTimeout((<any>loadingView).timer);\n (<any>loadingView).timer = undefined;\n }\n loadingContainer.active = false;\n }\n if (!presenter) reject(error ? error : new Error());\n else resolve(presenter as T);\n }\n } catch (error) {\n console.log(\"pushPresenter error, \", error);\n }\n\n });\n }\n\n export function getTopPresenter(): Presenter {\n return presenterStack[presenterStack.length - 1];\n }\n\n export function popPresenter(destroy: boolean = false) {\n let presenter = presenterStack.pop();\n if (presenter) {\n delete viewMap[presenter.view.name];\n if (destroy) delete viewCache[presenter.view.name];\n presenter.view.close(destroy);\n if (presenter.hideViews) {\n for (let v of presenter.hideViews) {\n viewMap[v].view.show();\n }\n }\n if (presenterStack.length > 0) presenterStack[presenterStack.length - 1].onEnterForeground();\n }\n }\n\n /**弹出到具体某个presenter */\n export function popToPresenter(presenter: Presenter<any, any>) {\n while (presenterStack && presenterStack[presenterStack.length - 1] !== presenter) {\n popPresenter();\n }\n }\n\n /**\n * 弹出所有presenter\n * @param destroy 是否销毁\n */\n export function popAll(destroy?: boolean) {\n while (presenterStack.length) {\n let presenter = presenterStack.pop()!;\n delete viewMap[presenter.view.name];\n presenter.view.close(destroy);\n }\n }\n\n function onPresenterInStackClose(presenter: Presenter<any>, destroy?: boolean) {\n let view = presenter.view.name;\n if (!viewMap[view]) return;\n let presenterExt = presenter as PresenterExt;\n let index = presenterStack.findIndex(v => v === presenter);\n presenterStack.splice(index, 1);\n if (index === presenterStack.length) {\n presenterStack[presenterStack.length - 1].onEnterForeground();\n }\n delete viewMap[view];\n if (destroy) {\n delete viewCache[view];\n }\n if (presenterExt.hideViews && presenterExt.hideViews.length) {\n let len = presenterStack.length;\n let node1: PresenterExt | undefined;\n for (let i = index; i < len; i++) {\n if (presenterStack[i].hideViews) {\n node1 = presenterStack[i];\n break;\n }\n }\n if (node1) {\n presenterExt.hideViews.push(...presenterExt.hideViews);\n } else {\n for (let i of presenterExt.hideViews) {\n if (viewMap[i] && viewMap[i].view) {\n viewMap[i].view.show();\n }\n }\n }\n }\n }\n\n export function closePresenterInStack(presenter: Presenter<any>, destroy?: boolean) {\n let view = ((presenter.constructor as any).uuid as string);\n if (!viewMap[view]) return;\n if (presenterStack[presenterStack.length - 1] === presenter) {\n popPresenter();\n } else {\n presenter.view.close(destroy);\n }\n }\n\n export function showModalPresenter<T extends Presenter<any, any>>(presentCls: { new(): T, uuid: string, allowMultiInstances?: boolean }, param: PresenterParamType<T>) {\n return new Promise<T>(async (resolve, reject) => {\n if (modalPresenter instanceof presentCls) {\n resolve(modalPresenter);\n } else {\n let nodeName = presentCls.uuid;\n if (!loadingContainer.active) {\n loadingViews.push(presentCls.uuid);\n loadingContainer.active = true;\n loadingView.active = false;\n (<any>loadingView).timer = setTimeout(() => {\n (<any>loadingView).timer = undefined;\n loadingView.active = true;\n }, 1000);\n } else {\n let index = loadingViews.findIndex(v => v === presentCls.uuid);\n if (index >= 0) {\n reject(\"View is already loading.\");\n return;\n }\n }\n\n let error: Error | undefined;\n let presenter: PresenterExt = viewCache[presentCls.uuid];\n if (!presenter) {\n // create a view\n try {\n presenter = await createPresenter(presentCls);\n presenter.view.name = nodeName;\n viewCache[presentCls.uuid] = presenter;\n } catch (e) {\n error = e;\n }\n }\n if (presenter) {\n (presenter as T).open(modalRootView, param);\n modalPresenter = presenter;\n (modalPresenter.view as CCView).onClose.once(() => {\n modalPresenter = undefined;\n })\n }\n let index = loadingViews.findIndex(v => v === presentCls.uuid);\n loadingViews.splice(index, 1);\n if (loadingViews.length == 0) {\n if ((<any>loadingView).timer) {\n clearTimeout((<any>loadingView).timer);\n (<any>loadingView).timer = undefined;\n }\n loadingContainer.active = false;\n }\n if (!presenter) reject(error ? error : new Error());\n else resolve(presenter as T);\n }\n });\n }\n\n export function dismissModalPresenter(destroy?: boolean) {\n if (modalPresenter) {\n modalPresenter.view.close(destroy);\n modalPresenter = undefined;\n }\n }\n\n export function getModalPresenter() {\n return modalPresenter;\n }\n\n export function showToast(content: string | cc.Node) {\n ToastManager.addToast(toastRoot, content);\n }\n\n /**\n * 在场景最上层弱提示\n * @param parentNode toast的父节点\n * @param content 显示内容\n */\n export function showSceneToast(content: string | cc.Node, time: number = 2){\n ToastManager.addToast(toastParentNode,content, time);\n }\n\n /**\n * 展示特殊Toast\n * @param type 特殊Toast的类型\n */\n export function showSpecialToast(type: SpecialToastType) {\n ToastManager.addSpecialToast(toastRoot, type);\n }\n\n export function getPresenter(view: string): Presenter | undefined {\n return viewMap[view];\n }\n\n export function showAlert(nodeOrPrefab: cc.Node | string, animate = true) {\n return AlertManager.showAlert(rootNode, nodeOrPrefab, animate);\n }\n\n}"]}