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AAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;yBACnE;6BAAM;4BACH,IAAI,kBAAkB,EAAE;gCACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oCAC7C,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;iCAC3C;6BACJ;yBACJ;qBACJ;yBAAM;wBACH,QAAQ,GAAG,iBAAiB,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,GAAG,SAAS,CAAA;wBACpE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;qBAC3C;oBACD,OAAO,IAAI,QAAQ,GAAG,WAAW,CAAC;iBACrC;aACJ;YACD,OAAO,OAAO,CAAC;QACnB,CAAC;KAKJ,CAAA;IA1GU,4BAAI,GAAG,yBAAyB,CAAC;IADvB,uBAAuB;QAD3C,qCAAY,CAAC,mCAAkB,CAAC;OACZ,uBAAuB,CA2G3C;IAAD,8BAAC;KAAA;kBA3GoB,uBAAuB","file":"","sourceRoot":"/","sourcesContent":["import { PlotManager } from \"simba-avg-core\";\nimport { GameRecord } from \"../../../avg/AVG\";\nimport { Presenter } from \"../../../common/classbase/PresenterBase\";\nimport { GameModelManager } from \"../../model/GameModelManager\";\nimport { RegPresenter } from \"../PresenterCCViewFactory\";\nimport { ReviewPlotViewType, ReviewPlotViewProps, ReviewPlotView } from \"../view/type/ReviewPlotView\";\n\nexport interface ReviewPlotViewParam {\n isReview: boolean,\n plotString: string,\n startPlotId: number,\n currentPlotId: number,\n}\n\n@RegPresenter(ReviewPlotViewType)\nexport default class ReviewPlotViewPresenter extends Presenter<ReviewPlotViewParam, ReviewPlotView>{\n static uuid = \"ReviewPlotViewPresenter\";\n private _viewProps: ReviewPlotViewProps;\n private _param: ReviewPlotViewParam;\n\n constructor() {\n super();\n this._viewProps = {\n onCloseButtonClickCallback: this.onCloseButtonClickCallback,\n }\n }\n\n onOpen(param: ReviewPlotViewParam) {\n super.onOpen(param);\n this._param = param;\n this.view.setProps(this._viewProps);\n this.onShow();\n }\n\n onShow() {\n super.onShow();\n this.initViewDate();\n }\n\n onEnterBackground() {\n super.onEnterBackground();\n }\n\n onEnterForeground() {\n super.onEnterForeground();\n }\n\n onClose() {\n super.onClose();\n }\n\n initViewDate() {\n this.view.getPlotRichText().string = \"\";\n this.view.getLoadingNode().active = true;\n this.view.getPlotRichText().scheduleOnce(async () => {\n if (this._param.isReview) {\n this.view.getPlotRichText().string = this._param.plotString;\n } else {\n this.view.getPlotRichText().string = await this.getReviewPlotContent();\n }\n if (this.view.getPlotRichText().node.height >= this.view.getPlotScrollView().node.height) {\n this.view.getPlotScrollView().scrollToBottom();\n }\n this.view.getLoadingNode().active = false;\n });\n }\n\n async getReviewPlotContent(): Promise<string> {\n let showWhileNotSelect: boolean = false;//未选择时是否展示选项列表\n let showCurrentPlot: boolean = true;//是否展示当前剧情内容\n let plotStr = \"\";\n let startPlotId = this._param.startPlotId;\n let currentPlotId = this._param.currentPlotId;\n let currentRecordIndex = PlotManager.getCurrentRecordIndex();\n let currentRecord = GameRecord.getRecords()[currentRecordIndex].d;\n let startPlotIdIndex = 0;\n let currentPlotIdIndex = 0;\n for (let i = 0; i < currentRecord.length; i++) {\n if (startPlotId == currentRecord[i].p[0]) {\n startPlotIdIndex = i;\n }\n if (currentPlotId == currentRecord[i].p[0]) {\n currentPlotIdIndex = i;\n }\n }\n if (showCurrentPlot) {\n currentPlotIdIndex += 1;\n }\n let newCurrentRecord = currentRecord.slice(startPlotIdIndex, currentPlotIdIndex);\n for (let i = 0; i < newCurrentRecord.length; i++) {\n let content = await GameModelManager.getPlotContent(newCurrentRecord[i].p[0]);\n if (content) {\n let roleData = GameModelManager.getRoleData(content.roleId)!;\n let plotName = \"\";\n let plotContent = \"\";\n if (content.content.length === 0) {\n continue;\n }\n if (content.content.length > 1) {\n if (newCurrentRecord[i].s && newCurrentRecord[i].s?.length !== 0) {\n plotName = \"<color=#D36777>\" + \"选项\" + \":</c>\\n\"\n plotContent = content.content[newCurrentRecord[i].s![0]] + \"\\n\";\n } else {\n if (showWhileNotSelect) {\n for (let j = 0; j < content.content.length; j++) {\n plotContent = content.content[j] + \"\\n\";\n }\n }\n }\n } else {\n plotName = \"<color=#EFDA91>\" + roleData.getConfig().name + \":</c>\\n\"\n plotContent = content.content[0] + \"\\n\";\n }\n plotStr += plotName + plotContent;\n }\n }\n return plotStr;\n }\n\n onCloseButtonClickCallback = async () => {\n this.view.close();\n }\n}"]}