{ "code": "import { HomeWindow } from \"./HomeWindow\";\r\nimport { SettlementWindow } from \"./SettlementWindow\";\r\nimport { InGameWindow } from \"./InGameWindow\";\r\nimport { RewardWindow } from \"./RewardWindow\";\r\nimport { ReviveWindow } from \"./ReviveWindow\";\r\nimport { SkinWindow } from \"./SkinWindow\";\r\nimport { TryoutWindow } from \"./TryoutWindow\";\r\nimport { SignWindow } from \"./SignWindow\";\r\nimport { TtSdk } from \"../Util/TtSdk\";\r\nimport { ShareVideoWindow } from \"./ShareVideoWindow\";\r\nimport { CheatWindow } from \"./CheatWindow\";\r\nexport var WindowType;\r\n(function (WindowType) {\r\n WindowType[WindowType[\"HomeWindow\"] = 0] = \"HomeWindow\";\r\n WindowType[WindowType[\"InGameWindow\"] = 1] = \"InGameWindow\";\r\n WindowType[WindowType[\"CheatWindow\"] = 2] = \"CheatWindow\";\r\n WindowType[WindowType[\"SettlementWindow\"] = 3] = \"SettlementWindow\";\r\n WindowType[WindowType[\"SkinWindow\"] = 4] = \"SkinWindow\";\r\n WindowType[WindowType[\"ResurrectionWindow\"] = 5] = \"ResurrectionWindow\";\r\n WindowType[WindowType[\"PlaneGiftWindow\"] = 6] = \"PlaneGiftWindow\";\r\n WindowType[WindowType[\"SignWindow\"] = 7] = \"SignWindow\";\r\n WindowType[WindowType[\"LotteryWindow\"] = 8] = \"LotteryWindow\";\r\n WindowType[WindowType[\"TryOutWindow\"] = 9] = \"TryOutWindow\";\r\n WindowType[WindowType[\"RewardWindow\"] = 10] = \"RewardWindow\";\r\n WindowType[WindowType[\"ShareVideoWindow\"] = 11] = \"ShareVideoWindow\";\r\n})(WindowType || (WindowType = {}));\r\nexport class WindowManager {\r\n constructor() {\r\n this.ViewDic = [];\r\n this.popViewDic = [];\r\n this.viewCont = new Laya.Sprite;\r\n this.popCont = new Laya.Sprite;\r\n WindowManager.WindowManagerInstance = this;\r\n this.Init();\r\n }\r\n static get Instance() {\r\n if (WindowManager.WindowManagerInstance) {\r\n return WindowManager.WindowManagerInstance;\r\n }\r\n else {\r\n return new WindowManager();\r\n }\r\n }\r\n Init() {\r\n this.ViewDic[WindowType.HomeWindow] = HomeWindow;\r\n this.ViewDic[WindowType.InGameWindow] = InGameWindow;\r\n this.ViewDic[WindowType.SettlementWindow] = SettlementWindow;\r\n this.ViewDic[WindowType.ResurrectionWindow] = ReviveWindow;\r\n this.ViewDic[WindowType.SkinWindow] = SkinWindow;\r\n this.ViewDic[WindowType.RewardWindow] = RewardWindow;\r\n this.ViewDic[WindowType.TryOutWindow] = TryoutWindow;\r\n this.ViewDic[WindowType.SignWindow] = SignWindow;\r\n this.ViewDic[WindowType.ShareVideoWindow] = ShareVideoWindow;\r\n this.ViewDic[WindowType.CheatWindow] = CheatWindow;\r\n Laya.stage.addChild(this.viewCont);\r\n Laya.stage.addChild(this.popCont);\r\n }\r\n ShowWindow(_type, _data = null) {\r\n if (this.curOpenedView != null) {\r\n this.curOpenedView.OnHide();\r\n this.curOpenedView.destroy();\r\n this.curOpenedView.removeSelf();\r\n }\r\n TtSdk.Clear();\r\n this.ClearPopViews();\r\n console.log(WindowType[_type]);\r\n this.curOpenedView = new this.ViewDic[_type];\r\n this.curOpenedView.name = WindowType[_type];\r\n this.viewCont.addChild(this.curOpenedView);\r\n this.curOpenedView.OnOpen(_data);\r\n }\r\n OpenPopView(viewType, data = null) {\r\n var popView;\r\n if (this.popViewDic[viewType]) {\r\n popView = this.popViewDic[viewType];\r\n if (popView.visible)\r\n return;\r\n this.popCont.setChildIndex(popView, this.popCont.numChildren - 1);\r\n popView.visible = true;\r\n }\r\n else {\r\n popView = new this.ViewDic[viewType];\r\n this.popCont.addChild(popView);\r\n this.popViewDic[viewType] = popView;\r\n }\r\n TtSdk.Clear();\r\n popView.OnOpen(data);\r\n }\r\n ClosePopView(viewType) {\r\n var popView = this.popViewDic[viewType];\r\n if (popView == null || !popView.visible)\r\n return;\r\n popView.OnHide();\r\n TtSdk.Clear();\r\n popView.visible = false;\r\n }\r\n CloseCurrentWindow() {\r\n this.curOpenedView.OnHide();\r\n this.curOpenedView.destroy();\r\n this.curOpenedView.removeSelf();\r\n }\r\n ClearPopViews() {\r\n this.ClosePopView(WindowType.PlaneGiftWindow);\r\n this.ClosePopView(WindowType.ShareVideoWindow);\r\n }\r\n}\r\n", "references": [ "D:/Work/samurai2-laya/laya/samuraiflash-tt/src/Window/HomeWindow.ts", "D:/Work/samurai2-laya/laya/samuraiflash-tt/src/Window/SettlementWindow.ts", "D:/Work/samurai2-laya/laya/samuraiflash-tt/src/Window/InGameWindow.ts", "D:/Work/samurai2-laya/laya/samuraiflash-tt/src/Window/RewardWindow.ts", "D:/Work/samurai2-laya/laya/samuraiflash-tt/src/Main/AudioControl.ts", "D:/Work/samurai2-laya/laya/samuraiflash-tt/src/Window/ReviveWindow.ts", "D:/Work/samurai2-laya/laya/samuraiflash-tt/src/Window/SkinWindow.ts", "D:/Work/samurai2-laya/laya/samuraiflash-tt/src/Window/TryoutWindow.ts", "D:/Work/samurai2-laya/laya/samuraiflash-tt/src/Window/SignWindow.ts", "D:/Work/samurai2-laya/laya/samuraiflash-tt/src/Util/TtSdk.ts", "D:/Work/samurai2-laya/laya/samuraiflash-tt/src/Window/ShareVideoWindow.ts", "D:/Work/samurai2-laya/laya/samuraiflash-tt/src/Window/CheatWindow.ts" ] }