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;KAAA;AAzDY,oEAA4B","file":"","sourceRoot":"/","sourcesContent":["import { RegPresenter } from \"../../PresenterCCViewFactory\";\nimport { DiscoverSettingViewType, DiscoverSettingView } from \"../../view/type/discover/DiscoverSettingView\";\nimport { Presenter } from \"../../../../common/classbase/PresenterBase\";\nimport { GameBasicSettings } from \"../../../../common/gameplay/settings/GameBasicSettings\";\nimport { HttpRequests } from \"../../../network/HttpRequests\";\nimport { GameModelManager } from \"../../../model/GameModelManager\";\nimport { GameTextData } from \"../../../../common/gameplay/gamedata/GameTextData\";\nimport { UIManager } from \"../../../../common/gameplay/managers/UIManager\";\nimport NoticeViewPresenter from \"../NoticeViewPresenter\";\nimport { GameConfig } from \"../../../../GameConfig\";\nimport ExchangeCodeViewPresenter from \"../ExchangeCodeViewPresenter\";\n\n@RegPresenter(DiscoverSettingViewType)\nexport class DiscoverSettingViewPresenter extends Presenter<undefined, DiscoverSettingView> {\n static uuid = \"DiscoverSettingViewPresenter\";\n\n onOpen() {\n super.onOpen(undefined);\n this.view.setProps({\n soundEnabled: GameBasicSettings.soundVolume > 0,\n musicEnabled: GameBasicSettings.musicVolume > 0,\n onToggleSound: this.toggleSound,\n onToggleMusic: this.toggleMusic,\n onToggleNotice: this.toggleNotice,\n onToggleExchangeCode: this.toggleExchangeCode\n })\n }\n\n toggleSound = () => {\n GameBasicSettings.soundVolume = GameBasicSettings.soundVolume > 0 ? 0 : 1;\n this.view.updateProps({\n soundEnabled: GameBasicSettings.soundVolume > 0\n });\n }\n\n toggleMusic = () => {\n GameBasicSettings.musicVolume = GameBasicSettings.musicVolume > 0 ? 0 : 1;\n this.view.updateProps({\n musicEnabled: GameBasicSettings.musicVolume > 0\n });\n }\n\n toggleNotice = () => {//公告\n HttpRequests.getNotice().then((ret) => {\n if (ret != null && ret.length > 0) {\n let titleTxt = GameModelManager.getLanguageTxt(GameTextData.TEXT_NOTICETITLE_VALUE);\n let contentTxt = ret[0].msg;\n UIManager.pushPresenter(NoticeViewPresenter, {\n title: titleTxt,\n content: contentTxt\n });\n } else {\n console.log(\"notice is not setting:\" + `notice_${GameConfig.gameVersion}.json`);\n }\n });\n }\n\n toggleExchangeCode = () => {//兑换码 \n let title = GameModelManager.getLanguageTxt(GameTextData.TEXT_EXCHANGETITLE_VALUE);\n let content = \"\";\n UIManager.pushPresenter(ExchangeCodeViewPresenter, {\n titletxt: title,\n contenttxt: content\n });\n }\n\n onClose() {\n super.onClose();\n UIManager.popToPresenter(this);\n }\n}"]}