1234567891011121314151617181920 |
- {
- "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\nimport { BaoXiangWindow } from \"./BaoXiangWindow\";\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[\"BaoXiangWindow\"] = 2] = \"BaoXiangWindow\";\r\n WindowType[WindowType[\"CheatWindow\"] = 3] = \"CheatWindow\";\r\n WindowType[WindowType[\"SettlementWindow\"] = 4] = \"SettlementWindow\";\r\n WindowType[WindowType[\"SkinWindow\"] = 5] = \"SkinWindow\";\r\n WindowType[WindowType[\"ResurrectionWindow\"] = 6] = \"ResurrectionWindow\";\r\n WindowType[WindowType[\"PlaneGiftWindow\"] = 7] = \"PlaneGiftWindow\";\r\n WindowType[WindowType[\"SignWindow\"] = 8] = \"SignWindow\";\r\n WindowType[WindowType[\"LotteryWindow\"] = 9] = \"LotteryWindow\";\r\n WindowType[WindowType[\"TryOutWindow\"] = 10] = \"TryOutWindow\";\r\n WindowType[WindowType[\"RewardWindow\"] = 11] = \"RewardWindow\";\r\n WindowType[WindowType[\"ShareVideoWindow\"] = 12] = \"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 this.ViewDic[WindowType.BaoXiangWindow] = BaoXiangWindow;\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//# sourceMappingURL=WindowManager.js.map",
- "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",
- "D:/Work/samurai2-laya/laya/samuraiflash-tt/src/Window/BaoXiangWindow.ts"
- ],
- "map": "{\"version\":3,\"file\":\"WindowManager.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/Window/WindowManager.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC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