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C,iBAAiB,EAAE,CAAC;YAC1D,IAAI,yBAAW,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,yBAAa,CAAC,aAAa,EAAE;gBACrE,wCAAgB,EAAE,CAAC;aACtB;QACL,CAAC;KA0BJ,CAAA;IA5FU,sBAAI,GAAG,mBAAmB,CAAC;IADjB,iBAAiB;QADrC,qCAAY,CAAC,uBAAY,CAAC;OACN,iBAAiB,CA6FrC;IAAD,wBAAC;KAAA;kBA7FoB,iBAAiB","file":"","sourceRoot":"/","sourcesContent":["import { GameRecord } from \"../../../avg/game-data/GameRecord\";\nimport { ReadonlyPlots, SpecialPlotId } from \"../../../avg/model/PlotModel\";\nimport { PlotManager } from \"../../../avg/PlotManager\";\nimport { createPresenter, Presenter } from \"../../../common/classbase/PresenterBase\";\nimport { View } from \"../../../common/classbase/ViewBase\";\nimport { GameTextData } from \"../../../common/gameplay/gamedata/GameTextData\";\nimport { UIManager } from \"../../../common/gameplay/managers/UIManager\";\nimport { PlotSceneType } from \"../../Enums\";\nimport { GameModelManager } from \"../../model/GameModelManager\";\nimport { RegPresenter } from \"../PresenterCCViewFactory\";\nimport { showToBeContinue } from \"../view/impl/AlertToBeContinueImpl\";\nimport { MainView, MainViewProps, MainViewType } from \"../view/type/MainView\";\nimport DatingEventViewPresenter from \"./DatingEventViewPresenter\";\nimport MessageViewPresenter from \"./MessageViewPresenter\";\n\nconst enum Tabs {\n messageTab = 0,\n datingEventTab = 1,\n}\n\nconst TabPresenterFactory: ({ new(): Presenter } & { uuid: string })[] = [MessageViewPresenter, DatingEventViewPresenter];\n\n@RegPresenter(MainViewType)\nexport default class MainViewPresenter extends Presenter<undefined, MainView> {\n static uuid = \"MainViewPresenter\";\n private _subPresenters: Presenter<any, View>[] = [];\n private _currentTab = 0;\n private _viewProps: MainViewProps;\n private _loadingTab = false;\n\n constructor() {\n super();\n this._viewProps = {\n selectedTab: 0,\n messageRedDot: false,\n datingEventRedDot: false,\n onTabClick: this.onTabClick\n };\n\n }\n\n checkRedDot = (plots: ReadonlyPlots) => {\n if (plots[0].plotSceneType === PlotSceneType.Message || plots[0].plotSceneType === PlotSceneType.PhoneCall) {\n this._viewProps.messageRedDot = true;\n } else {\n this._viewProps.messageRedDot = false;\n }\n this._viewProps.datingEventRedDot = false;\n for (let plot of plots) {\n if (plot.plotSceneType === PlotSceneType.DatingEvent) {\n this._viewProps.datingEventRedDot = true;\n }\n }\n this.view.setProps(this._viewProps);\n }\n\n async start() { \n // 开始游戏\n this._subPresenters[0] = await createPresenter(TabPresenterFactory[0]);\n this._subPresenters[0].open(this._view.getTabContentContainer(), undefined);\n\n this.checkRedDot(PlotManager.getCurrentPlots());\n PlotManager.PlotStartEvent.on(this.checkRedDot);\n\n\n if (PlotManager.getCurrentPlots()[0].id === SpecialPlotId.ToBeContinued) {\n showToBeContinue();\n }\n }\n\n onClose() {\n super.onClose();\n UIManager.popToPresenter(this);\n }\n\n onOpen() {\n super.onOpen(undefined);\n }\n\n onEnterBackground() {\n super.onEnterBackground();\n this._subPresenters[this._currentTab].onEnterBackground();\n }\n\n onEnterForeground() {\n super.onEnterForeground();\n this._subPresenters[this._currentTab].onEnterForeground();\n if (PlotManager.getCurrentPlots()[0].id === SpecialPlotId.ToBeContinued) {\n showToBeContinue();\n }\n }\n\n onTabClick = (index: number) => {\n if (!GameModelManager.checkFuncUnloced(TabPresenterFactory[index].uuid)) {\n UIManager.showToast(GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_FUNCTION_NOT_OPEN));\n return;\n }\n if (this._loadingTab) return;\n if (this._currentTab !== index) {\n this._subPresenters[this._currentTab].view.hide();\n this._currentTab = index;\n this._viewProps.selectedTab = index;\n\n this._view.setProps(this._viewProps);\n if (!this._subPresenters[this._currentTab]) {\n this._loadingTab = true;\n createPresenter(TabPresenterFactory[this._currentTab]).then((presenter) => {\n this._loadingTab = false;\n this._subPresenters[this._currentTab] = presenter;\n presenter.open(this.view.getTabContentContainer(), undefined);\n });\n } else {\n this._subPresenters[this._currentTab].view.show();\n }\n }\n }\n}"]}