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IAFe,mBAAS,YAExB,CAAA;AAEL,CAAC,EA1UgB,SAAS,GAAT,iBAAS,KAAT,iBAAS,QA0UzB","file":"","sourceRoot":"/","sourcesContent":["import { ResUtils } from \"../../utils/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\";\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 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) {\n let promise = ToastManager.init();\n rootNode = uiRoot;\n rootView = rootNode.addComponent(CCView);\n\n modalRoot = new cc.Node();\n modalRoot.zIndex = MODAL_Z;\n rootNode.addChild(modalRoot);\n modalRootView = modalRoot.addComponent(CCView);\n\n alertRoot = new cc.Node();\n alertRoot.zIndex = ALERT_Z;\n rootNode.addChild(alertRoot);\n\n toastRoot = new cc.Node();\n toastRoot.zIndex = TOAST_Z;\n rootNode.addChild(toastRoot);\n\n loadingContainer = new cc.Node();\n loadingContainer.zIndex = 99;\n loadingContainer.active = false;\n rootNode.addChild(loadingContainer);\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 let ret = await ResUtils.loadRes(\"prefab/ui/ViewLoading\", cc.Prefab);\n loadingView = cc.instantiate(ret);\n loadingView.active = false;\n loadingContainer.addChild(loadingView);\n ResUtils.releaseAsset(ret);\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 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 });\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 export function popToPresenter(presenter: Presenter<any, any>) {\n while (presenterStack && presenterStack[presenterStack.length - 1] !== presenter) {\n popPresenter();\n }\n }\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 viewMap[i].view.show();\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 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(alertRoot, nodeOrPrefab, animate);\n }\n\n}"]}