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A+ElC;IAAD,6BAAC;KAAA;AA/EY,wDAAsB","file":"","sourceRoot":"/","sourcesContent":["import { ConfigManager } from \"simba-config-manager\";\nimport { DeepReadonly } from \"simba-utils\";\nimport { PlotManager, ReadonlyPlots, SentenceSelectContent } from \"../../../avg/AVG\";\nimport { Presenter } from \"../../../common/classbase/PresenterBase\";\nimport { UIManager } from \"../../../common/gameplay/managers/UIManager\";\nimport { role } from \"../../../config/Role\";\nimport { PlotSceneType } from \"../../Enums\";\nimport { GameModelManager } from \"../../model/GameModelManager\";\nimport { RegPresenter } from \"../PresenterCCViewFactory\";\nimport { PhoneCallItemProps, PhoneCallView, PhoneCallViewProps, PhoneCallViewType } from \"../view/type/PhoneCallView\";\nimport { SentenceSelectorViewProps } from \"../view/type/SentenceSelectorView\";\nimport SentenceSelectorViewPresenter from \"./SentenceSelectorViewPresenter\";\n\n@RegPresenter(PhoneCallViewType)\nexport class PhoneCallViewPresenter extends Presenter<undefined, PhoneCallView> {\n static uuid = \"PhoneCallViewPresenter\";\n private _items: PhoneCallItemProps[] = [];\n private _viewProps: PhoneCallViewProps;\n\n onSetContent = (content: DeepReadonly<SentenceSelectContent> | undefined) => {\n let props: SentenceSelectorViewProps =\n {\n sentence: content,\n backgroundpath: \"\",\n clickcausehide: false,\n onSelectIndexCallback: this.onSelectIndexCallback\n\n };\n UIManager.pushPresenter(SentenceSelectorViewPresenter, props);\n }\n\n\n onSelectIndexCallback = (index: number) => {\n this.view.select(index);\n }\n\n isSentenceSelectVisible = (): boolean => {\n let preset = UIManager.getTopPresenter();\n if (preset instanceof SentenceSelectorViewPresenter) {\n let selectorPresenter = preset as SentenceSelectorViewPresenter;\n return !selectorPresenter.view.isHidden;\n }\n return false;\n }\n\n onGameChangedClickCallback = (ret: boolean) => {\n this.view.applicationChange(ret);\n }\n\n async onOpen() {\n super.onOpen(undefined);\n this._disposable.add(GameModelManager.ApplicaitonGameChanged.on(this.onGameChangedClickCallback));\n let plots = await GameModelManager.rollbackPhoneCallIfNeeded();\n this.analysisPlots(plots);\n }\n\n analysisPlots(plots: ReadonlyPlots) {\n this._items = [];\n let plot = plots[0];\n if (plot.plotSceneType !== PlotSceneType.PhoneCall) {\n console.error(\"Phone call plot data error.\");\n } else {\n let roleData = ConfigManager.getConfig(role, plot.plotSceneTypeId);\n this._items = [{ key: plot.id + \"\", isSelf: plot.sentences[0].roleId === 2, sentence: plot.sentences[0] }];\n this._viewProps =\n {\n name: roleData.name, // TODO i18n\n icon: GameModelManager.getRoleData(plot.plotSceneTypeId)!.getHeadIcon(),\n items: this._items,\n onCompletePlot: (index?: number) => PlotManager.completePlot(plot, index),\n onSetContent: this.onSetContent,\n isSentenceSelectVisible: this.isSentenceSelectVisible\n };\n this._view.setProps(this._viewProps);\n\n this._disposable.clear();\n this._disposable.add(PlotManager.PlotStartEvent.on((plots) => {\n plot = plots[0];\n if (plot.plotSceneType !== PlotSceneType.PhoneCall) {\n GameModelManager.dotMainLinePlotEnd();\n this._view.close();\n } else {\n let item = { key: plot.id + \"\", isSelf: plot.sentences[0].roleId === 2, sentence: plot.sentences[0] };\n let index = this._items.findIndex((v) => v.key === item.key);\n if (index === -1) {\n this._items = [...this._items, item];\n }\n this._view.updateProps({ items: this._items });\n }\n }));\n }\n }\n\n}"]}