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import { AudioManager } from \"simba-cc-audio-manager\";\nimport { ResUtils } from \"simba-cc-resutils\";\nimport { ConfigManager } from \"simba-config-manager\";\nimport { CompositeDisposable, Emitter } from \"simba-eventkit\";\nimport { TimeManager } from \"simba-sdk\";\nimport { DeepReadonlyObject, shallowEqual } from \"simba-utils\";\nimport { ConditionExpression, GameRecord, getPlot, Language, PlotManager, ReadonlyPlot, ReadonlyPlots, richNodesToCocosString, SentenceType, SpecialPlotId } from \"../../avg/AVG\";\nimport { DateType, PageIndex } from \"../../avg/EditorEnums\";\nimport { EditorEvents } from \"../../avg/EditorEvents\";\nimport { GameConstData } from \"../../common/gameplay/gamedata/GameConstData\";\nimport { FuncStateEnum, RedPotStateEnum } from \"../../common/gameplay/gamedata/GameEnumData\";\nimport { bedroomItemConfig } from \"../../config/BedroomItemConfig\";\nimport { ICharacterVoiceConfig } from \"../../config/CharacterVoiceConfig\";\nimport { dateSceneConfig } from \"../../config/DateSceneConfig\";\nimport { i18nConfig } from \"../../config/I18nConfig\";\nimport { itemConfig } from \"../../config/ItemConfig\";\nimport { IItemTbl } from \"../../config/ItemTbl\";\nimport { relationLevelConfig } from \"../../config/RelationLevelConfig\";\nimport { IRole, role } from \"../../config/Role\";\nimport { taoBaoShopUrlConfig } from \"../../config/TaoBaoShopUrlConfig\";\nimport { channel } from \"../../GameConfig\";\nimport { AutoPopViewType, DiscoverItemType, FreeState, GuideState, PlotSceneType, PlotSessionState, TutorialState, TutorialType, WorkSpaceTaskState } from \"../Enums\";\nimport GameDotMgr from \"../GameDotMgr\";\nimport { SpecialToastType } from \"../ui/SpecialToast\";\nimport { DatingEventSceneModel, DatingEventStatus } from \"./DatingEventSceneModel\";\nimport GameRoleDataModel from \"./GameRoleDataModel\";\nimport { MessageSceneModel } from \"./MessageSceneModel\";\nimport { UnlockSpecialPlotModelManager } from \"./UnlockSpecialPlotModelManager\";\n\n/**\n * 游戏model管理类\n */\nexport namespace GameModelManager {\n    let emitter = new Emitter;\n\n    export const MessageSceneChanged = emitter.createEvent<(scenes: MessageSceneModel[]) => void>();\n    export const MainDatingEventChanged = emitter.createEvent<(scenes: DatingEventSceneModel[]) => void>();\n\n    export const ApplicaitonGameChanged = emitter.createEvent<(force: boolean) => void>();//进程发生切换\n\n    export const MainTabForceClick = emitter.createEvent<(param: { index: number, pureClick: boolean, propId?: number }) => void>();//主界面tab点击\n    export const GiftItemForceClick = emitter.createEvent<(param: any) => void>();//商城界面指定item点击\n    export const SininItemClick = emitter.createEvent<(param: any) => void>();//签到界面指定item点击\n\n\n    export const CheckMainTabGuide = emitter.createEvent<() => void>();//主界面检测tab栏引导\n    export const CheckDateGuide = emitter.createEvent<() => void>();//约会界面检测引导\n    export const CheckMsgGuide = emitter.createEvent<() => void>();//消息列表界面检测引导\n    export const UpdatePlayerData = emitter.createEvent<() => void>();//更新主角数据\n    export const PlayerOptionSkin = emitter.createEvent<() => void>();//玩家操作了皮肤数据\n    export const NeedAddCoin = emitter.createEvent<(location?: string) => void>();//需要增加金币或者皮肤币\n    export const RefreshDiscoverTabRed = emitter.createEvent<() => void>();//刷新发现页红点展示\n    export const RefreshDateCostTipInfo = emitter.createEvent<(show: boolean, costNum?: number, pos?: cc.Vec3) => void>();//刷新约会界面消耗信息节点数据\n    export const RefreshDateSceneProgress = emitter.createEvent<() => void>();//刷新约会进度\n    export const CheckDateSceneProgress = emitter.createEvent<() => void>();//检测约会进度\n    export const ForceClickSendGiftBtn = emitter.createEvent<() => void>();//强制点击聊天中送礼按钮\n    export const AutoPopView = emitter.createEvent<(view: AutoPopViewType) => void>();//展示自动弹出界面\n    export const NewPlayerReceiveBtn = emitter.createEvent<() => void>();//新人七天乐点击领取按钮\n\n    export const ShowDatingEventArrowGuide = emitter.createEvent<(isShow: boolean, wordPos?: cc.Vec3) => void>();//约会列表界面展示箭头\n\n    export const ShowPlotBlocked = emitter.createEvent<() => void>();//展示剧情阻断弹窗\n\n    export const ForceEnterDiscoverSubView = emitter.createEvent<(itemType: DiscoverItemType) => void>();//强制进入发现页面子页面\n\n    export const PlotBlockedChanged = emitter.createEvent<() => void>();//剧情阻断改变\n\n    export const WorkSpaceShowItemDesc = emitter.createEvent<(isShow: boolean, itemId?: number, wPos?: cc.Vec3) => void>();//工作区界面展示物品描述\n\n    export const WorkSpaceSelectedStuff = emitter.createEvent<(spaceId: number, roleId: number) => void>();//工作区选定完员工\n\n    export const CheckMainTabWorkSpaceRedDot = emitter.createEvent<(isForce?: boolean, forceShow?: boolean) => void>();//检测主界面tab栏下面工作区的红点\n\n    export const ForceSetSpaceState = emitter.createEvent<(spaceId: number, state: WorkSpaceTaskState) => void>();//强制改变指定工作区的状态\n\n    export const UpdateMainTabArrowGuide = emitter.createEvent<() => void>();//更新主界面tab栏,商城和办公区箭头引导\n\n    export const ForceClickMsgItem = emitter.createEvent<(id: number) => void>();\n    export const ForceClickDatingItem = emitter.createEvent<(id: number) => void>();\n\n    /**报幕数据准备就绪事件 */\n    export const ForceClickDataReady = emitter.createEvent<() => void>();\n\n    /**传输掉落物品数据 */\n    export const TransmitItemData = emitter.createEvent<(pid: number, spriteFrame: cc.SpriteFrame, cfg: DeepReadonlyObject<IItemTbl>) => void>();\n\n    export const UnlockItem = emitter.createEvent<(itemId: number) => void>();\n\n    /**卧室返回点击UI事件 */\n    export const BedroomViewBack = emitter.createEvent<(index: number) => void>();\n    /**返回到卧室界面 */\n    export const BackToBedRoom = emitter.createEvent<() => void>();\n\n    /**回滚数据到指定剧情 */\n    export const RollBackToPlot = emitter.createEvent<(pid: number) => void>();\n    /**回滚剧情数据完成刷新所有状态 */\n    export const RefreshAllStatus = emitter.createEvent<() => void>();\n    /**触发死亡选项之后的事件派发 */\n    export const DeadEvent = emitter.createEvent<(pid: number) => void>();\n    /**关闭约会界面 */\n    export const CloseDatingSceneView = emitter.createEvent<(id: number) => void>();\n    /**刷新对应类型的番外 */\n    export const RefreshExtraPlotByType = emitter.createEvent<(id: number) => void>();\n    /**关闭番外界面 */\n    export const CloseExtraSceneView = emitter.createEvent<() => void>();\n    /**触发剧情属性值变化之后弹起特殊Toast */\n    export const SpecialToast = emitter.createEvent<(type: SpecialToastType) => void>();\n    /**从主界面跳转到游戏页面 */\n    export const JumpToViewInGame = emitter.createEvent<(index: PageIndex) => void>();\n    /**打开番外界面 */\n    export const OpenExtraPlotView = emitter.createEvent<() => void>();\n    /**关闭设置界面 */\n    export const CloseSettingView = emitter.createEvent<(index: PageIndex) => void>();\n\n    let messageScenes: MessageSceneModel[] | undefined;\n    // let momentScenes: MomentSceneModel[] | undefined;\n    let mainDatingScenes: DatingEventSceneModel[] | undefined;\n    export let currPlots: ReadonlyPlot[] | undefined;\n    let phoneCallIndex: number = -1;\n\n    let unlockGift = false;\n\n    let defaultUnlockedGiftArr: number[] = [];\n    let plotUnlockedGiftArr: number[] = [];\n    let isChangPlotSceneType: boolean = false;\n    let isMainPlot: boolean = true;\n\n    let isNeedEnterCurDateChapter: boolean = true;\n\n    let progressSceneId: number | undefined = undefined;\n    let _autoPopView: AutoPopViewType[] = [];\n\n    let _timeTick: number = -1;\n\n    let _emap: Map<number, number> = new Map();\n    let _eLevelMax: number = 0;\n    let _expUpRole: number = -1;\n\n    export function isChangePlotSceneType() { return isChangPlotSceneType }\n\n    export function setIsChangePlotSceneType(isChange: boolean) {\n        isChangPlotSceneType = isChange;\n    }\n\n    export function isMainPlotSceneType() { return isMainPlot }\n\n    export function setIsMainPlotSceneType(isChange: boolean) {\n        isMainPlot = isChange;\n    }\n\n    export function isGiftUnlock() { return unlockGift; }\n\n    export async function rollbackPhoneCallIfNeeded() {\n        // if (phoneCallIndex < 0) {\n        //     console.error(\"Error: no phone call.\");\n        // }\n        if (phoneCallIndex >= 0 && phoneCallIndex < GameRecord.getCurrentRecordItems().length - 1) {\n            let ret = await PlotManager.rollbackToIndex(phoneCallIndex);\n            savePhoneCall();\n            return ret;\n        } else {\n            return PlotManager.getCurrentPlots();\n        }\n    }\n\n    //#region  //数据模块 \n    let roleDatasMap: Map<number, GameRoleDataModel> = new Map<number, GameRoleDataModel>();\n    let languagesMap: Map<number, string> = new Map<number, string>();       //语言\n    //#endregion\n\n    export function getCurrentChapterId() {\n        return currPlots![0].chapterId;\n    }\n\n    export function getMessageScenesModel() {\n        return messageScenes!;\n    }\n\n    export function getMessageSceneModel(id: number) {\n        return messageScenes!.find(v => v.id === id);\n    }\n\n    // export function getMomentScenesModel() {\n    //     return momentScenes!;\n    // }\n\n    // export function getMomentSceneModel(id: number) {\n    //     return momentScenes!.find(v => v.id === id);\n    // }\n\n    export function getMainDatingEventScenesModel() {\n        return mainDatingScenes!;\n    }\n\n    export function getMainDatingEventSceneModel(id: number) {\n        return mainDatingScenes!.find(v => v.id === id);\n    }\n\n    export function getMainDatingEventScenesModelByChapterindex(chapterIndex: number): DatingEventSceneModel[] {\n        let scenes: DatingEventSceneModel[] = [];\n        if (!mainDatingScenes) {\n            return [];\n        }\n        for (let i = 0; i < mainDatingScenes.length; i++) {\n            if (ConfigManager.getConfig(dateSceneConfig, mainDatingScenes[i].id).chapter_index === chapterIndex) {\n                scenes.push(mainDatingScenes[i]);\n            }\n        }\n        return scenes;\n    }\n\n    let creating: boolean = false;\n    /**开启分支剧情,\n    * plots:如果需要同时开启多个分支剧情,则数组中存储这些分支中对应的起始剧情id\n    */\n    export async function startBranches(plots: number[]) {\n        if (creating) return;\n        creating = true;\n        if (0 === plots.length) {\n            // console.warn(\"no plots to mark as branch start plot id\");\n            return;\n        }\n        for (let i = 0; i < plots.length; i++) {\n            let pid = plots[i];\n            if (SpecialPlotId.ToBeContinued === pid || SpecialPlotId.End === pid) {\n                // console.error(\"you can not start a branch with SpecialPlotId, id is = \", pid);\n                continue;\n            }\n            let p = await getPlot(pid);\n            if (!p) {\n                // console.warn(\"no plot which plot id is = \", pid);\n                continue;\n            }\n            if (currPlots) {\n                currPlots.push(p);\n            }\n            let hasStarted: boolean = checkIsBranchStarted(pid);\n            if (hasStarted) {\n                // cc.warn(\"branch has been started which start plot id is = \", pid);\n                continue;\n            }\n            console.log('开启新分支pid', pid);\n            let index = await PlotManager.startNewPlotBranch(pid);\n            pushBranchToRecord(pid, index);\n        }\n        creating = false;\n    }\n\n\n    /**\n    * \n    * @param plotId 检测指定剧情下的分支是否已经开启\n    * @returns \n    */\n    function checkIsBranchStarted(plotId: number): boolean {\n        const branchRecordKey: string = \"BRANCH_INDEX_ENTRY\";\n        let ret: boolean = false;\n        let itemArr: { startPlot: number, index: number }[] = [];\n        let recordStr: string = GameRecord.globalVariables[branchRecordKey] as string;\n        if (recordStr && \"\" !== recordStr.trim()) {\n            itemArr = JSON.parse(recordStr) as { startPlot: number, index: number }[];\n        }\n        ret = itemArr.findIndex((v) => v.startPlot === plotId) >= 0;\n        return ret;\n    }\n\n    /**\n     * \n     * @param plotId 将分支计入存档\n     * @param index \n     */\n    function pushBranchToRecord(plotId: number, index: number) {\n        const branchRecordKey: string = \"BRANCH_INDEX_ENTRY\";\n        let exist: boolean = false;\n        let itemArr: { startPlot: number, index: number }[] = [];\n        let recordStr: string = GameRecord.globalVariables[branchRecordKey] as string;\n        if (recordStr && \"\" !== recordStr.trim()) {\n            itemArr = JSON.parse(recordStr) as { startPlot: number, index: number }[];\n        }\n        exist = itemArr.findIndex((v) => v.startPlot === plotId) >= 0;\n        if (!exist) {\n            itemArr.push({\n                startPlot: plotId,\n                index: index\n            });\n            GameRecord.globalVariables[branchRecordKey] = JSON.stringify(itemArr);\n            GameRecord.saveRecord();\n        }\n    }\n\n    /**\n     * 获取分支剧情状态(约会状态)\n     * @param plotSceneTypeId 剧情类型id\n     * @param start_plot_id 起始剧情id\n     * @returns 剧情状态\n     */\n    export function getBranchStatus(plotSceneTypeId: number, start_plot_id: number): DatingEventStatus {\n        let s = DatingEventStatus.New;\n        let curP = PlotManager.getCurrentPlots();\n        let progress = curP.findIndex((v) => v.plotSceneTypeId === plotSceneTypeId) >= 0;\n        let isNew = curP.findIndex((v) => v.plotSceneTypeId === plotSceneTypeId && v.id === start_plot_id) >= 0;\n        s = isNew ? DatingEventStatus.New : progress ? DatingEventStatus.InProgress : DatingEventStatus.Completed;\n        return s;\n    }\n\n    /**获取已开启的所有番外id */\n    export function getAllStartedBranches(): { startPlot: number, index: number }[] {\n        const branchRecordKey: string = \"BRANCH_INDEX_ENTRY\";\n        let itemArr: { startPlot: number, index: number }[] = [];\n        let recordStr: string = GameRecord.globalVariables[branchRecordKey] as string;\n        if (recordStr && \"\" !== recordStr.trim()) {\n            itemArr = JSON.parse(recordStr) as { startPlot: number, index: number }[];\n        }\n        return itemArr;\n    }\n\n    let branchCompleteRecordKey: string = \"branch_complete\";\n    /**设置分支完成 */\n    export function setBranchComplete(branchId: number) {\n        let rStr = GameRecord.globalVariables[branchCompleteRecordKey] as string;\n        let rArr: number[] = [];\n        if (rStr && \"\" !== rStr) {\n            rArr = JSON.parse(rStr) as number[];\n        }\n        let exist = rArr.findIndex((v) => v === branchId) !== (-1);\n        if (!exist) {\n            rArr.push(branchId);\n            GameRecord.globalVariables[branchCompleteRecordKey] = JSON.stringify(rArr);\n            GameRecord.saveRecord();\n        }\n    }\n\n    /**检测分支是否完成 */\n    export function checkBranchIsComplete(branchId: number): boolean {\n        let rStr = GameRecord.globalVariables[branchCompleteRecordKey] as string;\n        let rArr: number[] = [];\n        if (rStr && \"\" !== rStr) {\n            rArr = JSON.parse(rStr) as number[];\n        }\n        let exist = rArr.findIndex((v) => v === branchId) !== (-1);\n        return exist;\n    }\n\n    let branchInProgressRecordKey: string = \"branch_InProgress\";\n    /**设置分支完成 */\n    export function setBranchInProgress(branchId: number) {\n        let rStr = GameRecord.globalVariables[branchInProgressRecordKey] as string;\n        let rArr: number[] = [];\n        if (rStr && \"\" !== rStr) {\n            rArr = JSON.parse(rStr) as number[];\n        }\n        let exist = rArr.findIndex((v) => v === branchId) !== (-1);\n        if (!exist) {\n            rArr.push(branchId);\n            GameRecord.globalVariables[branchInProgressRecordKey] = JSON.stringify(rArr);\n            GameRecord.saveRecord();\n        }\n    }\n\n    /**检测分支是否完成 */\n    export function checkBranchIsInProgress(branchId: number): boolean {\n        let rStr = GameRecord.globalVariables[branchInProgressRecordKey] as string;\n        let rArr: number[] = [];\n        if (rStr && \"\" !== rStr) {\n            rArr = JSON.parse(rStr) as number[];\n        }\n        let exist = rArr.findIndex((v) => v === branchId) !== (-1);\n        return exist;\n    }\n\n    export interface EventResourcesState {\n        eventId: number,\n        bgm: string,\n        backgroud: string\n    }\n\n    export function setEventResources(eventId: number, bgm: string, backgroud: string) {\n        let eventResources = GameRecord.globalVariables[\"EventResources\"] as EventResourcesState[];\n        eventResources = eventResources ? eventResources : [];\n        let isNewEventId = true;\n        for (let i = 0; i < eventResources.length; i++) {\n            if (eventResources[i].eventId == eventId) {\n                if (bgm) {\n                    eventResources[i].bgm = bgm;\n                }\n                if (backgroud) {\n                    eventResources[i].backgroud = backgroud;\n                }\n                isNewEventId = false;\n                break;\n            }\n        }\n        if (isNewEventId) {\n            eventResources.push({\n                eventId: eventId,\n                bgm: bgm,\n                backgroud: backgroud\n            });\n        }\n    }\n\n    export function getBranchResources(eventId: number): EventResourcesState {\n        let eventResources: EventResourcesState = undefined as unknown as EventResourcesState;\n        let allEventResources = GameRecord.globalVariables[\"EventResources\"] as EventResourcesState[];\n        if (allEventResources) {\n            for (let i = 0; i < allEventResources.length; i++) {\n                if (allEventResources[i].eventId == eventId) {\n                    eventResources = allEventResources[i];\n                    break;\n                } else {\n                    eventResources = undefined as unknown as EventResourcesState;\n                }\n            }\n        }\n        return eventResources;\n    }\n\n    async function initConfigData() {\n        await ConfigManager.initConfigData(false);\n        await initLanguageConfig();\n        initRoleConfig();\n    }\n\n\n    export function getI18LanguageTxt(id: number) {\n        let i18 = ConfigManager.getConfig(i18nConfig, id);\n        return i18.cn;\n    }\n\n    function initRoleConfig() {\n        let cfg = ConfigManager.getAllConfig(role);\n        for (let id in cfg) {\n            let element = cfg[id] as IRole;\n            if (element) {\n                let data = new GameRoleDataModel();\n                data.setConfig(element);\n                roleDatasMap.set(element.id, data);\n            }\n        }\n    }\n\n    function getLanguagePath() {\n        return \"userdata/language/chinese\"\n    }\n    async function initLanguageConfig() {\n        let cfgFile = await ResUtils.loadRes<any>(getLanguagePath(), cc.JsonAsset);\n        if (cfgFile) {\n            let lans: Language[] = cfgFile as Language[];\n            for (let i = 0; i < lans.length; ++i) {\n                let element = lans[i] as Language;\n                if (element) {\n                    languagesMap.set(element.id, element.value);\n                }\n            }\n        }\n    }\n\n    export function getLanguageTxt(id: number): string {\n        if (languagesMap.has(id)) {\n            return languagesMap.get(id) as string;\n        } else {\n            // console.log(\"current language id is miss \" + id);\n            return \"\";\n        }\n    }\n\n    export function getConfigLanguageTxt(id: number): string {\n        return ConfigManager.getConfig(i18nConfig, id).cn;\n    }\n\n    export function getItemConfig(id: number) {\n        return ConfigManager.getConfig(itemConfig, id);\n    }\n\n    export function getItemConfigs() {\n        return ConfigManager.getAllConfig(itemConfig);\n    }\n\n    // export function getDailyQuestConfigs() {\n    //     return ConfigManager.getAllConfig(dailyQuestConfig)\n    // }\n\n    // export function getDailyQuestConfig(id: number) {\n    //     return ConfigManager.getConfig(dailyQuestConfig, id);\n    // }\n\n    // export function getAchievementConfigs() {\n    //     return ConfigManager.getAllConfig(achievementConfig)\n    // }\n\n    // export function getAchievementConfig(id: number) {\n    //     return ConfigManager.getConfig(achievementConfig, id);\n    // }\n\n    export function getRoleData(id: number) {\n        if (!roleDatasMap.has(id)) {\n            return undefined;\n        }\n        return roleDatasMap.get(id);\n    }\n\n    export function getPlayerData() {\n        return GameModelManager.getRoleData(GameConstData.GAME_CONST_PLAYER_ROLE_VALUE)!;\n    }\n\n    // export function addDailyTasks(dailyType: DailyQuestType, count: number) {//每日任务的信息存储\n    //     let dailyCount = GameRecord.globalVariables[\"DailyQuestType_\" + dailyType];\n    //     dailyCount = dailyCount === undefined ? 0 : dailyCount;\n    //     dailyCount += count;\n    //     dispatchCompleteTask(dailyType, dailyCount);\n    //     GameRecord.globalVariables[\"DailyQuestType_\" + dailyType] = dailyCount;\n    //     GameRecord.autoSave();\n    // }\n\n    // function dispatchCompleteTask(dailyType: DailyQuestType, count: number) {\n    //     let cfg = ConfigManager.getConfig(dailyQuestConfig, dailyType);\n    //     let isFinish = count >= cfg.daily_quest_finish_value;\n    //     if (isFinish) {\n    //         GameDotMgr.getInstance().dotTask(TaskDotType.CompleteTask, dailyType);\n    //     }\n    // }\n\n    // export function clearDailyTasks() {//清理每日任务\n    //     for (let index = DailyQuestType.Dq_AdsWatch; index <= DailyQuestType.Dq_MomentPraise; ++index) {\n    //         GameRecord.globalVariables[\"DailyQuestType_\" + index] = 0;\n    //     }\n    //     GameRecord.autoSave();\n    // }\n\n    // export function getDailyTasks(dailyType: DailyQuestType) {\n    //     let dailyCount = GameRecord.globalVariables[\"DailyQuestType_\" + dailyType];\n    //     dailyCount = dailyCount === undefined ? 0 : dailyCount;\n    //     return dailyCount;\n    // }\n\n    let disposable: CompositeDisposable;\n\n    export async function init(onProgress?: Function) {\n        await initConfigData();\n        if (onProgress) onProgress(0.92);\n        tipAddGracePlots = [];\n        phoneCallIndex = GameRecord.recordVariables[\"gm.pci\"] as number;\n        unlockGift = !!GameRecord.recordVariables[\"gm.unlockGift\"];\n        if (phoneCallIndex === undefined) phoneCallIndex = -1;\n        let initRet: Promise<any>[] = [];\n        { // init message models\n            let ids = GameRecord.recordVariables[\"gm.ms\"] as any;\n            if (ids !== undefined) {\n                messageScenes = [];\n                messageScenes = ids.map((id: number) => new MessageSceneModel(id));\n                initRet.push(...messageScenes!.map((s) => s.initFromRecords()));\n            } else {\n                messageScenes = [];\n            }\n        }\n        // { // init moment models\n        //     let ids = GameRecord.recordVariables[\"gm.mm\"] as any;\n        //     if (ids !== undefined) {\n        //         momentScenes = ids.map((id: number) => new MomentSceneModel(id));\n        //         initRet.push(...momentScenes!.map((s) => s.initFromRecords()));\n        //     }\n        // }\n        { // init main dating models\n            let ids = GameRecord.recordVariables[\"gm.md\"] as any;\n            if (ids !== undefined) {\n                mainDatingScenes = [];\n                mainDatingScenes = ids.map((id: number) => new DatingEventSceneModel(id));\n                initRet.push(...mainDatingScenes!.map((s) => s.initFromRecords()));\n            } else {\n                mainDatingScenes = [];\n            }\n        }\n\n        {//init application\n            cc.game.on(cc.game.EVENT_HIDE, () => {\n                // console.log(\"enter game background\");\n                AudioManager.pauseMusic();\n                //ApplicaitonGameChanged.emit(false);\n            });\n\n            cc.game.on(cc.game.EVENT_SHOW, () => {\n                // console.log(\"enter game force\");\n                AudioManager.resumeMusic();\n                // ApplicaitonGameChanged.emit(true);\n            });\n        }\n\n        if (initRet.length) {\n            await Promise.all(initRet);\n        }\n        if (onProgress) onProgress(0.94);\n        if (!disposable) {\n            disposable = new CompositeDisposable;\n            disposable.add(PlotManager.PlotWillStart.on(handlePlotWillStart));\n            disposable.add(PlotManager.PlotsRollbackEvent.on(handlePlotsRollback));\n            disposable.add(EditorEvents.UNLOCK_ITEM.on(onUnlockItem));\n            disposable.add(EditorEvents.UNLOCK_SPECIAL_PLOT.on(onUnlockSpecialPlot));\n            disposable.add(EditorEvents.DEAD_EVENT.on(onDeadEvevt));\n            disposable.add(EditorEvents.SPECIAL_TOAST.on(onSpecialToast));\n        }\n        initPlots();\n        if (onProgress) onProgress(0.96);\n\n        for (let scene of mainDatingScenes!) { // 检查主线剧情状态\n            if (currPlots![0].plotSceneType !== PlotSceneType.DatingEvent ||\n                (scene.id !== currPlots![0].plotSceneTypeId && scene.status !== DatingEventStatus.Completed)) {\n                scene.status = DatingEventStatus.Completed;\n            }\n        }\n        //guide listener\n        // disposable.add(EditorEvents.GUIDE_TAB_MSG.on((param: string) => {\n        //     setGuideMainTabRecord(MainTabs.messageTab, GuideState.Open);\n        // }));\n        // disposable.add(EditorEvents.GUIDE_TAB_DATE.on((param: string) => {\n        //     setGuideMainTabRecord(MainTabs.datingEventTab, GuideState.Open);\n        // }));\n        // disposable.add(EditorEvents.GUIDE_VIEW_DATE.on((param: string) => {\n        //     setGuideEventItemRecord(param, GuideState.Open);\n        // }));\n        // disposable.add(EditorEvents.GUIDE_VIEW_MSG.on((param) => {\n        //     setGuideMsgItemRecord(param, GuideState.Open);\n        // }));\n        if (onProgress) onProgress(0.98);\n\n    }\n\n    function onUnlockItem(itemId: string) {\n        let s = itemId;\n        if (s && \"\" !== s.trim()) {\n            let n = parseInt(s);\n            UnlockItem.emit(n);\n        }\n    }\n\n    function onDeadEvevt(pid: string) {\n        let s = pid;\n        if (s && \"\" !== s.trim()) {\n            let n = parseInt(s);\n            DeadEvent.emit(n);\n        }\n    }\n\n    function onSpecialToast(type: string) {\n        let s = type;\n        if (s && \"\" !== s.trim()) {\n            let n = parseInt(s) as SpecialToastType;\n            SpecialToast.emit(n);\n        }\n    }\n\n    export function onUnlockSpecialPlot(specialPlotId: string) {\n        let s = specialPlotId;\n        if (s && \"\" !== s.trim()) {\n            let n = parseInt(s);\n            UnlockSpecialPlotModelManager.saveUnlockedSpecialPlotIdByItemIdToGameRecord(n);\n        }\n    }\n\n    /**\n     * set main tab guide record value\n     * @param index \n     * @param record \n     */\n    export function setGuideMainTabRecord(index: number, record: GuideState) {\n        let r = GameRecord.globalVariables[\"guide_main_tab\" + index] as number;\n        if (r && record <= r) {\n            return;\n        }\n        GameRecord.globalVariables[\"guide_main_tab\" + index] = record;\n        GameRecord.saveRecord();\n    }\n\n    /**\n     * get main tab guide index\n     */\n    export function getMainTabGuideIndex(): number {\n        let index = -1;\n        const MAX = 4;\n        for (let i = 0; i < MAX; i++) {\n            let r = GameRecord.globalVariables[\"guide_main_tab\" + i] as number;\n            r = r === undefined ? GuideState.close : r;\n            if (r === GuideState.Open) {\n                index = i;\n            }\n        }\n        return index;\n    }\n\n    /**\n     * set event item guide record value\n     * @param itemKey \n     * @param record \n     */\n    export function setGuideEventItemRecord(itemKey: string, record: GuideState) {\n        let r = GameRecord.globalVariables[\"guide_evt_item\"] as number;\n        r = r === undefined ? GuideState.close : r;\n        if (record <= r) {\n            return;\n        }\n        GameRecord.globalVariables[\"guide_evt_item_key\"] = itemKey;\n        GameRecord.globalVariables[\"guide_evt_item\"] = record;\n        GameRecord.saveRecord();\n    }\n\n    /**\n     * get event item guide key\n     */\n    export function getEventItemGuideKey(): string {\n        let key: string = \"\";\n        let r = GameRecord.globalVariables[\"guide_evt_item\"] as number;\n        r = r === undefined ? GuideState.close : r;\n        let k = GameRecord.globalVariables[\"guide_evt_item_key\"] as string;\n        if (r && r === GuideState.Open) {\n            key = k;\n        }\n        return key;\n    }\n\n    /**\n     * set msg guide item record value\n     * @param itemKey \n     * @param record \n     */\n    export function setGuideMsgItemRecord(itemKey: string, record: GuideState) {\n        let r = GameRecord.globalVariables[\"guide_msg_item\"] as number;\n        r = r === undefined ? GuideState.close : r;\n        if (record <= r) {\n            return;\n        }\n        GameRecord.globalVariables[\"guide_msg_item_key\"] = itemKey;\n        GameRecord.globalVariables[\"guide_msg_item\"] = record;\n        GameRecord.saveRecord();\n    }\n\n    /**\n     * get msg item guide key\n     */\n    export function getMsgItemGuideKey(): string {\n        let key: string = \"\";\n        let r = GameRecord.globalVariables[\"guide_msg_item\"] as number;\n        r = r === undefined ? GuideState.close : r;\n        let k = GameRecord.globalVariables[\"guide_msg_item_key\"] as string;\n        if (r && r === GuideState.Open) {\n            key = k;\n        }\n        return key;\n    }\n\n    /**\n     * checkHasGuide , deal layer problem between guide view and sinin view\n     */\n    export function checkHasGuide(): boolean {\n        let ret: boolean = false;\n        // let hasMsgGuide = getMsgItemGuideKey() !== \"\";\n        // let hasEventGuide = getEventItemGuideKey() !== \"\";\n        // let hasGuideTab = getMainTabGuideIndex() !== -1;\n        // ret = hasGuideTab || hasMsgGuide || hasEventGuide;\n        return ret;\n    }\n\n\n    function save() {\n        let oldValue = GameRecord.recordVariables[\"gm.ms\"];\n        let newValue = messageScenes!.map(v => v.id) as any;\n        if (!shallowEqual(oldValue, newValue)) {\n            GameRecord.recordVariables[\"gm.ms\"] = newValue;\n        }\n        // oldValue = GameRecord.recordVariables[\"gm.mm\"];\n        // newValue = momentScenes!.map(v => v.id) as any;\n        // if (!shallowEqual(oldValue, newValue)) {\n        //     GameRecord.recordVariables[\"gm.mm\"] = newValue;\n        // }\n        oldValue = GameRecord.recordVariables[\"gm.md\"];\n        newValue = mainDatingScenes!.map(v => v.id) as any;\n        if (!shallowEqual(oldValue, newValue)) {\n            GameRecord.recordVariables[\"gm.md\"] = newValue;\n        }\n    }\n\n    function savePhoneCall() {\n        GameRecord.recordVariables[\"gm.pci\"] = phoneCallIndex;\n        GameRecord.saveRecord();\n    }\n\n    async function initPlots() {\n        let plots = PlotManager.getCurrentPlots();\n        if (true) {\n            currPlots = [...plots];\n            if (!messageScenes) { // 第一次进游戏,根据剧情初始化数据\n                messageScenes = [];\n            }\n            // if (!momentScenes) {\n            //     momentScenes = [];\n            // }\n            if (!mainDatingScenes) {\n                mainDatingScenes = [];\n            }\n            for (let i = 0; i < plots.length; i++) {\n                let plot = plots[i];\n                if (plot.plotSceneType === PlotSceneType.Message) {\n                    let index = messageScenes.findIndex(v => v.id === plot.plotSceneTypeId);\n                    if (index < 0) {\n                        index = 0;\n                        let model = new MessageSceneModel(plot.plotSceneTypeId);\n                        model.firstPlot = plot;\n                        messageScenes.unshift(model);\n                    }\n                    // if (plot.sentences[0].content && plot.sentences[0].content.type !== SentenceType.SELECT) {\n                    // messageScenes[index].lastPlot = plot;\n                    // }\n                } else if (plot.plotSceneType === PlotSceneType.Moment) {\n                    // if (momentScenes.findIndex(v => v.id === plot.plotSceneTypeId) < 0) {\n                    //     let model = new MomentSceneModel(plot.plotSceneTypeId);\n                    //     model.recordIndex = GameRecord.getCurrentRecordItems().length - 1;\n                    //     momentScenes.unshift(model);\n                    // }\n                } else if (plot.plotSceneType === PlotSceneType.DatingEvent) {\n                    let cfg = ConfigManager.getConfig(dateSceneConfig, plot.plotSceneTypeId);\n                    if (cfg.DateType === DateType.Date_Normal) { // 主线约会剧情\n                        if (plots[0] !== plot) { console.error(\"主线约会剧情应在主线开启\"); continue; }\n                        if (mainDatingScenes.findIndex(v => v.id === plot.plotSceneTypeId) < 0) {\n                            let model = new DatingEventSceneModel(plot.plotSceneTypeId);\n                            model.firstPlot = plot;\n                            model.status = DatingEventStatus.New;\n                            mainDatingScenes.push(model);\n                        }\n                    }\n                }\n            }\n            save();\n        }\n    }\n\n    async function handlePlotWillStart(plot: ReadonlyPlot, branch: number) {\n        handleNewPlot(currPlots![branch], plot, branch);\n        currPlots![branch] = plot;\n    }\n\n    async function handlePlotsRollback(plots: ReadonlyPlots) {\n        // messageScenes = undefined;\n        // let oldMomentScenes = momentScenes;\n        // momentScenes = undefined;\n        // currPlots = undefined;\n        // disposable.dispose();\n        // await init();\n        // GameRecord.startTransaction();\n        // if (oldMomentScenes) {\n        //     for (let s of oldMomentScenes) {\n        //         if (!momentScenes) {\n        //             s.clearRecords();\n        //         } else {\n        //             if ((momentScenes as MomentSceneModel[]).findIndex(v => v.id === s.id) < 0) {\n        //                 s.clearRecords();\n        //             }\n        //         }\n        //     }\n        // }\n        // GameRecord.endTransaction(true);\n    }\n\n    async function handleNewPlot(prevPlot: ReadonlyPlot | undefined, plot: ReadonlyPlot, branch: number) {\n        if (plot.plotSceneType === PlotSceneType.Message) {\n            let idx = messageScenes!.findIndex(v => v.id === plot.plotSceneTypeId);\n            if (idx >= 0) { // 原会话中有新消息\n                let model = messageScenes![idx];\n                if (idx > 0) {\n                    let reorderIdx = 0;\n                    if (branch > 0 && currPlots && currPlots[0].plotSceneType === PlotSceneType.Message) {\n                        reorderIdx = 1;\n                    }\n                    for (let i = idx; i > reorderIdx; i--) {\n                        messageScenes![i] = messageScenes![i - 1];\n                    }\n                    messageScenes![reorderIdx] = model;\n                }\n                if (plot.sentences[0].content && plot.sentences[0].content.type !== SentenceType.SELECT) {\n                    // model.lastPlot = plot;\n                }\n            } else { // 新会话\n                let model = new MessageSceneModel(plot.plotSceneTypeId);\n                model.firstPlot = plot;\n                if (plot.sentences[0].content && plot.sentences[0].content.type !== SentenceType.SELECT) {\n                    // model.lastPlot = plot;\n                }\n                // 新会话不可能是送礼\n                // if (branch > 0 && currPlots && currPlots[0].plotSceneType === PlotSceneType.Message) {\n                //     messageScenes!.splice(1, 0, model);\n                // } else {\n                messageScenes!.unshift(model);\n                // }\n            }\n            MessageSceneChanged.emit(messageScenes!);\n            save();\n        } else if (plot.plotSceneType === PlotSceneType.Moment) {\n            // let idx = momentScenes!.findIndex(v => v.id === plot.plotSceneTypeId);\n            // if (idx >= 0) { // 原会话中有新消息\n            //     let model = momentScenes![idx];\n            //     if (idx > 0) {\n            //         for (let i = idx; i > 0; i--) {\n            //             momentScenes![i] = momentScenes![i - 1];\n            //         }\n            //         momentScenes![0] = model;\n            //     }\n            // } else { // 新会话\n            //     let model = new MomentSceneModel(plot.plotSceneTypeId);\n            //     model.recordIndex = GameRecord.getCurrentRecordItems().length; // 当前存档还没生成,不需要减1\n            //     momentScenes!.unshift(model);\n            // }\n            // save();\n        } else if (plot.plotSceneType === PlotSceneType.PhoneCall) {\n            if (!prevPlot || prevPlot.plotSceneType !== PlotSceneType.PhoneCall) {\n                phoneCallIndex = GameRecord.getCurrentRecordItems().length; // 当前存档还没生成,不需要减1\n                savePhoneCall();\n            }\n        } else if (plot.plotSceneType === PlotSceneType.DatingEvent) {\n            let cfg = ConfigManager.getConfig(dateSceneConfig, plot.plotSceneTypeId);\n            if (cfg.DateType === DateType.Date_Normal) { // 主线约会剧情\n                if (branch !== 0) { console.error(\"主线约会剧情应在主线开启\"); return; }\n                let idx = mainDatingScenes!.findIndex(v => v.id === plot.plotSceneTypeId);\n                if (idx < 0) { // 新开启\n                    let model = new DatingEventSceneModel(plot.plotSceneTypeId);\n                    model.firstPlot = plot;\n                    model.status = DatingEventStatus.New;\n                    mainDatingScenes!.push(model);\n                    MainDatingEventChanged.emit(mainDatingScenes!);\n                }\n                save();\n            }\n        }\n\n        if (prevPlot && prevPlot.plotSceneType === PlotSceneType.PhoneCall && plot.plotSceneType !== PlotSceneType.PhoneCall) {\n            phoneCallIndex = -1;\n            savePhoneCall();\n        }\n\n        if (prevPlot && (prevPlot.plotSceneType !== plot.plotSceneType || prevPlot.plotSceneTypeId !== plot.plotSceneTypeId)) { // 切换场景\n            if (prevPlot.plotSceneType === PlotSceneType.Message) { // 最后一个是选项的情况下,此时已做选择,记录最后一条剧情\n                // let model = messageScenes!.find(v => v.id === prevPlot.plotSceneTypeId);\n                // model!.lastPlot = prevPlot;\n            }\n            if (prevPlot.plotSceneType === PlotSceneType.DatingEvent) {\n                let model = mainDatingScenes!.find(v => v.id === prevPlot.plotSceneTypeId);\n                if (model) model.status = DatingEventStatus.Completed;\n            }\n        }\n\n        // //main plot line progress and change plot scene (for BI dot);\n        // let mainPlotLineSession = GameRecord.recordVariables[\"m_p_l_s\"] as number;\n        // if (0 === branch && (!mainPlotLineSession || !prevPlot || (prevPlot.plotSceneType !== plot.plotSceneType || prevPlot.plotSceneTypeId !== plot.plotSceneTypeId))) {\n        //     mainPlotLineSession = mainPlotLineSession ? mainPlotLineSession : 0;\n        //     if (0 === mainPlotLineSession) {\n        //         GameDotMgr.getInstance().dotPlot(mainPlotLineSession + 1, PlotSessionState.Start);\n        //     } else {\n        //         GameDotMgr.getInstance().dotPlot(mainPlotLineSession, PlotSessionState.End);\n        //         GameDotMgr.getInstance().dotPlot(mainPlotLineSession + 1, PlotSessionState.Start);\n        //     }\n        //     mainPlotLineSession++;\n        //     GameRecord.recordVariables[\"m_p_l_s\"] = mainPlotLineSession;\n\n        //     let plotScenTypeSession = GameRecord.recordVariables[\"p_s_t_s\" + plot.plotSceneType] as number;\n        //     plotScenTypeSession = plotScenTypeSession ? plotScenTypeSession : 0;\n        //     plotScenTypeSession++;\n        //     GameRecord.recordVariables[\"p_s_t_s\" + plot.plotSceneType] = plotScenTypeSession;\n        // }\n        // //main plot line progress\n        // if (0 === branch && checkIsDotTutorial()) {\n        //     let plotScenTypeSession = GameRecord.recordVariables[\"p_s_t_s\" + plot.plotSceneType] as number;\n        //     plotScenTypeSession = plotScenTypeSession ? plotScenTypeSession : 1;\n        //     let r = GameRecord.recordVariables[\"p_s_t_i_p\"] as number;\n        //     r = r ? r : 0;\n        //     if (!prevPlot || (prevPlot.plotSceneType !== plot.plotSceneType || prevPlot.plotSceneTypeId !== plot.plotSceneTypeId)) {\n        //         r = 1;\n        //     } else {\n        //         r++;\n        //     }\n        //     GameRecord.recordVariables[\"p_s_t_i_p\"] = r;\n        // }\n\n        isChangPlotSceneType = !prevPlot || (prevPlot.plotSceneType !== plot.plotSceneType || prevPlot.plotSceneTypeId !== plot.plotSceneTypeId);\n        //main plot line progress\n        if (0 === branch && checkIsDotTutorial()) {\n            stepMainLinePlotProgress();\n        }\n    }\n\n    function stepMainLinePlotProgress() {\n        let r = GameRecord.recordVariables[\"p_s_t_i_p\"] as number;\n        r = r ? r : 0;\n        if (isChangPlotSceneType) {\n            r = 1;\n        } else {\n            r++;\n        }\n        GameRecord.recordVariables[\"p_s_t_i_p\"] = r;\n    }\n\n    export function dotMainLinePlotStart() {\n        // main plot line progress and change plot scene (for BI dot);\n        let plot = PlotManager.getCurrentPlots()[0];\n\n        let mainPlotLineSession = GameRecord.globalVariables[\"m_p_l_s\"] as number;//主线总session计数\n        mainPlotLineSession = mainPlotLineSession ? mainPlotLineSession : 1;\n        let sKey = \"m_l_p_s_started\";\n        let startedSession = GameRecord.globalVariables[sKey] as number;\n        startedSession = startedSession ? startedSession : 0;\n        if (startedSession >= mainPlotLineSession) {//max is equal\n            return;\n        }\n        GameDotMgr.getInstance().dotPlot(mainPlotLineSession, PlotSessionState.Start);\n        GameRecord.globalVariables[\"m_p_l_s\"] = mainPlotLineSession;\n\n        let plotScenTypeSession = GameRecord.globalVariables[\"p_s_t_s\" + plot.plotSceneType] as number;\n        plotScenTypeSession = plotScenTypeSession ? plotScenTypeSession : 0;\n        plotScenTypeSession++;\n        GameRecord.globalVariables[\"p_s_t_s\" + plot.plotSceneType] = plotScenTypeSession;//不同场景类型分别session计数\n\n        if (checkIsDotTutorial()) {\n            GameRecord.recordVariables[\"p_s_t_i_p\"] = 1;//主线剧情中,当前场景类型progress进度计数\n        }\n        GameRecord.globalVariables[sKey] = mainPlotLineSession;\n        GameRecord.saveRecord();\n    }\n\n    /**\n     * 主线剧情结束打点\n     */\n    export function dotMainLinePlotEnd() {\n        let mainPlotLineSession = GameRecord.globalVariables[\"m_p_l_s\"] as number;\n        GameDotMgr.getInstance().dotPlot(mainPlotLineSession, PlotSessionState.End);\n        GameRecord.globalVariables[\"m_p_l_s\"] = mainPlotLineSession + 1;\n        GameRecord.saveRecord();\n    }\n\n    /**剧情进度打点 */\n    export function dotPlotProgress() {\n        let plot = PlotManager.getCurrentPlots()[0];\n        let plotScenTypeSession = GameRecord.globalVariables[\"p_s_t_s\" + plot.plotSceneType] as number;\n        let r = GameRecord.recordVariables[\"p_s_t_i_p\"] as number;\n        let tt = TutorialType.Message;\n        switch (plot.plotSceneType) {\n            case PlotSceneType.Message:\n                {\n                    tt = TutorialType.Message;\n                }\n                break;\n            case PlotSceneType.DatingEvent:\n                {\n                    tt = TutorialType.Event;\n                }\n                break;\n            case PlotSceneType.PhoneCall:\n                {\n                    tt = TutorialType.Phone;\n                }\n                break;\n        }\n        if (r % 5 === 0 || r < 5) {\n            GameDotMgr.getInstance().dotTutorial(tt, TutorialState.Progress, { session: plotScenTypeSession, progress: r });\n        }\n    }\n\n    export function checkFuncUnloced(key: string) {\n        return GameRecord.recordVariables[key] === FuncStateEnum.locked ? false : true;\n    }\n\n    export function checkRedPot(key: string) {\n        return GameRecord.globalVariables[\"red_pot_\" + key] === RedPotStateEnum.Show;\n    }\n\n    export function setRedPotState(key: string, state: RedPotStateEnum) {\n        GameRecord.globalVariables[\"red_pot_\" + key] = state;\n        GameRecord.autoSave();\n    }\n\n    /**\n     * return:1.return all of the plot-unlocked-gifts ids arr;\n     */\n    export function getRecordAlreadyUnlockedGifts(): number[] {\n        // let r = GameRecord.getPlotsInfo();\n        // let a: number[] = [];\n        // if (r) {\n        //     for (let i = 0; i < plotUnlockedGiftArr.length; i++) {\n        //         let id = plotUnlockedGiftArr[i];\n        //         let pid = ConfigManager.getConfig(itemConfig, id).unlock_plot;\n        //         if (r[pid.toString()]) {\n        //             a.push(id);\n        //         }\n        //     }\n        // }\n        let rStr = GameRecord.recordVariables[\"plot_unlocked_gifts\"] as string;\n        let a: number[] = [];\n        if (rStr && \"\" !== rStr.trim()) {\n            a = JSON.parse(rStr) as number[];\n        }\n        return a;\n    }\n\n    /**\n     * return: 1.return the new unlocked gifts ids ;\n     *         2.if you has showed this ids, you'd use function resumPlotUnlockedGifts to resume the data;\n     */\n    export function getNewPlotUnlockedGifts(): number[] {\n        let items = GameRecord.globalVariables[\"plotunlockgifts\"] as number[];\n        items = items === undefined ? [] : items;\n        return items;\n    }\n\n    /**\n     * resumPlotUnlockedGifts \n     */\n    export function resumPlotUnlockedGifts() {\n        GameRecord.globalVariables[\"plotunlockgifts\"] = [];\n        GameRecord.autoSave();\n    }\n\n    /**\n     * checkHasNewGiftUnlocked \n     */\n    export function checkHasNewGiftUnlocked(): boolean {\n        let g = getNewPlotUnlockedGifts();\n        return g && g.length > 0;\n    }\n\n    // function analysisGiftConfigArr() {\n    //     if (defaultUnlockedGiftArr.length === 0) {\n    //         defaultUnlockedGiftArr = [];\n    //         plotUnlockedGiftArr = [];\n    //         let tComp = ItemType.Item_Gift;\n    //         let tbl = ConfigManager.getAllConfig(itemConfig);\n    //         let uComp = ItemUnlockType.ItemUnlock_Default;\n    //         for (let id in tbl) {\n    //             let cfg = tbl[id];\n    //             if (cfg && cfg.ItemType === tComp) {\n    //                 if (cfg.ItemUnlockType === uComp) {\n    //                     defaultUnlockedGiftArr.push(cfg.id);\n    //                 } else if (cfg.ItemUnlockType === ItemUnlockType.ItemUnlock_Plot) {\n    //                     plotUnlockedGiftArr.push(cfg.id);\n    //                 }\n    //             }\n    //         }\n    //     }\n    // }\n\n    function pushNewPlotUnlockedGifts(gifts: number[]): number[] {\n        let items = GameRecord.globalVariables[\"plotunlockgifts\"] as number[];\n        items = items === undefined ? [] : items;\n        for (let i = gifts.length - 1; i >= 0; i--) {\n            let g = gifts[i];\n            let index = items.findIndex((v) => v === g);\n            if (index < 0) {\n                continue;\n            } else {\n                gifts.splice(i, 1);\n            }\n        }\n        items = items.concat(gifts);\n        GameRecord.globalVariables[\"plotunlockgifts\"] = items;\n        GameRecord.autoSave();\n        return items;\n    }\n\n    // function refreshPlotUnlockedGifts(plotId: number) {\n    //     analysisGiftConfigArr();\n    //     let a: number[] = [];\n    //     for (let i = 0; i < plotUnlockedGiftArr.length; i++) {\n    //         let id = plotUnlockedGiftArr[i];\n    //         let pid = ConfigManager.getConfig(itemConfig, id).unlock_plot;\n    //         if (plotId === pid) {\n    //             a.push(id);\n    //         }\n    //     }\n    //     pushNewPlotUnlockedGifts(a);\n    // }\n\n    //voice\n\n    export function checkVoiceNeedShowAD(vCfg: ICharacterVoiceConfig) {\n        let ret = false;\n        if (vCfg) {\n            if (vCfg.ads === 0) {\n                return ret;\n            }\n            let voiceAdRecord = GameRecord.globalVariables[\"voice_ad\"] as string;\n            let arr: number[] = [];\n            if (voiceAdRecord) {\n                arr = JSON.parse(voiceAdRecord) as number[];\n            }\n            let set = new Set(arr);\n            ret = !set.has(vCfg.id);\n        }\n        return ret;\n    }\n\n    export function pushVoiceShowAdToRecord(voiceId: number) {\n        let voiceAdRecord = GameRecord.globalVariables[\"voice_ad\"] as string;\n        let arr: number[] = [];\n        if (voiceAdRecord) {\n            arr = JSON.parse(voiceAdRecord) as number[];\n        }\n        let set = new Set(arr);\n        if (!set.has(voiceId)) {\n            arr.push(voiceId);\n        }\n        GameRecord.globalVariables[\"voice_ad\"] = JSON.stringify(arr);\n        GameRecord.autoSave();\n    }\n\n    export function getCurDayStr(): string {\n        let t = TimeManager.getTime();\n        let time = new Date(t);\n        let y = time.getFullYear();\n        let m = time.getMonth() + 1;\n        let d = time.getDate();\n        let timeStr = y + \"_\" + m + \"_\" + d;\n        return timeStr;\n    }\n\n    export function checkIsDotTutorial(): boolean {\n        let curPlot = PlotManager.getCurrentPlots()[0];\n        return curPlot && curPlot.chapterId === GameConstData.GAME_CONST_FIRST_CHAPTER_ID;\n    }\n\n    export function getRolesByRoleType(roleType: number) {\n        let cfg = ConfigManager.getAllConfig(role);\n        let roleList: DeepReadonlyObject<IRole>[] = [];\n        for (const key in cfg) {\n            let _roleData = cfg[key];\n            if (roleType == _roleData.RoleType) {\n                roleList.push(_roleData);\n            }\n        }\n        return roleList;\n    }\n\n    //about lucky draw begin\n\n    export function getLastFreeTime(): number {\n        let time: number = 0;\n        let recordKey: string = \"luck_draw_free_time\";\n        let record = GameRecord.globalVariables[recordKey] as number;\n        time = record ? record : 0;\n        return time;\n    }\n\n    export function checkOverdue(time: number, refreshhour: number = 4) {//检测是否过期\n        let checkTime = new Date(time);\n        let currentTime = new Date(TimeManager.getTime());\n        let year = checkTime.getFullYear();\n        let month = checkTime.getMonth() + 1;\n        let day = checkTime.getDate();\n        let hour = checkTime.getHours();\n        if (currentTime.getFullYear() > year) {\n            return true;\n        } else if (currentTime.getMonth() + 1 > month) {\n            return true;\n        } if (currentTime.getDate() == day) {\n            if (hour > 0 && hour < refreshhour) {\n                if (currentTime.getHours() >= refreshhour) {\n                    return true;\n                }\n            }\n        } else if (currentTime.getDate() > day && currentTime.getHours() >= refreshhour) {\n            return true;\n        }\n        return false;\n    }\n\n    export function setFreeState(state: FreeState) {\n        GameRecord.globalVariables[\"free_luckyDraw\"] = state;\n        GameRecord.saveRecord();\n    }\n\n    export function getFreeState(): FreeState {\n        let r = GameRecord.globalVariables[\"free_luckyDraw\"] as number;\n        r = r === FreeState.Cost ? FreeState.Cost : FreeState.Free;\n        return r;\n    }\n\n    export function checkLuckyDrawIsFree(): boolean {\n        let ret = false;\n        let lastFreeTime = getLastFreeTime();\n        let isNewDay: boolean = checkOverdue(lastFreeTime);\n        let freeState: FreeState = getFreeState();\n        if (isNewDay) {\n            ret = true;\n            setFreeState(FreeState.Free);\n        } else {\n            ret = freeState === FreeState.Free;\n        }\n        return ret;\n    }\n\n    export function setLastFreeTime(time?: number) {\n        let recordKey: string = \"luck_draw_free_time\";\n        GameRecord.globalVariables[recordKey] = time ? time : TimeManager.getTime();\n        GameRecord.saveRecord();\n    }\n\n    // export function getRewardPoolConfig(): DeepReadonlyObject<IRewardsPoolConfig> | undefined {\n    //     let ret: DeepReadonlyObject<IRewardsPoolConfig> | undefined = undefined;\n    //     let cfg = ConfigManager.getAllConfig(rewardsPoolConfig);\n    //     for (let id in cfg) {\n    //         let item = cfg[id];\n    //         if (item.pool_active === 1) {\n    //             ret = item;\n    //             break;\n    //         }\n    //     }\n    //     return ret;\n    // }\n\n    export function addSkinItemToRecord(itemId: number) {\n        let recordKey = \"own_skins\";\n        let exist = false;\n        let recordStr = GameRecord.globalVariables[recordKey] as string;\n        let skinItemIds: number[] = [];\n        if (recordStr) {\n            skinItemIds = JSON.parse(recordStr) as number[];\n            exist = skinItemIds.findIndex((v) => v === itemId) !== -1;\n        }\n        if (!exist) {\n            skinItemIds.push(itemId);\n            GameRecord.globalVariables[recordKey] = JSON.stringify(skinItemIds);\n            GameRecord.saveRecord();\n            RefreshDiscoverTabRed.emit();\n        }\n    }\n\n    export function checkHasOwnedSkin(itemId: number): boolean {\n        let recordKey = \"own_skins\";\n        let ret = false;\n        let recordStr = GameRecord.globalVariables[recordKey] as string;\n        if (recordStr) {\n            let skinItemIds: number[] = [];\n            skinItemIds = JSON.parse(recordStr) as number[];\n            ret = skinItemIds.findIndex((v) => v === itemId) !== -1;\n        }\n        return ret;\n    }\n\n    // export function checkHasGotLuckyDrawSkin(): boolean {\n    //     let ret = false;\n    //     let curPoolCfg = getRewardPoolConfig();\n    //     if (curPoolCfg) {\n    //         ret = checkHasOwnedSkin(curPoolCfg.pool_skin_include[0]);\n    //     }\n    //     return ret;\n    // }\n\n    // export function checkSkinNeedDressGuide(skinId: number): boolean {\n    //     let needGuide: boolean = false;\n    //     if (skinId !== undefined && skinId !== NaN && skinId >= 0) {\n    //         let itemCfg = ConfigManager.getConfig(itemConfig, skinId);\n    //         if (itemCfg) {\n    //             if (itemCfg.ItemType === ItemType.Item_Skin) {\n    //                 let r = GameRecord.globalVariables[\"dressed_skins\"] as string;\n    //                 if (r && \"\" !== r.trim()) {\n    //                     let arr = JSON.parse(r) as number[];\n    //                     needGuide = arr.findIndex((v) => v === skinId) === (-1);\n    //                 } else {\n    //                     needGuide = true;\n    //                 }\n    //             } else {\n    //                 throw \"id =>\" + skinId + \"is not a skin item id\";\n    //             }\n    //         } else {\n    //             throw \"invalid skinId\";\n    //         }\n    //     }\n    //     return needGuide;\n    // }\n\n    // export function checkHasSkinNeedDressGuide(): boolean {\n    //     let recordKey = \"own_skins\";\n    //     let ret = false;\n    //     let skinIds: number[] = [];\n    //     let recordStr = GameRecord.globalVariables[recordKey] as string;\n    //     if (!recordStr || \"\" === recordStr.trim()) {\n    //         return false;\n    //     } else {\n    //         skinIds = JSON.parse(recordStr) as number[];\n    //         if (skinIds && skinIds.length !== 0) {\n    //             for (let i = 0; i < skinIds.length; i++) {\n    //                 let need = checkSkinNeedDressGuide(skinIds[i]);\n    //                 if (need) {\n    //                     ret = true;\n    //                     break;\n    //                 }\n    //             }\n    //         }\n    //     }\n    //     return ret;\n    // }\n\n    // export function completeSkinDressGuide(skinId: number) {\n    //     if (skinId !== undefined && skinId !== NaN && skinId >= 0) {\n    //         let itemCfg = ConfigManager.getConfig(itemConfig, skinId);\n    //         if (itemCfg) {\n    //             if (itemCfg.ItemType === ItemType.Item_Skin) {\n    //                 let r = GameRecord.globalVariables[\"dressed_skins\"] as string;\n    //                 let exist = false;\n    //                 let arr: number[] = [];\n    //                 if (r && \"\" !== r.trim()) {\n    //                     arr = JSON.parse(r) as number[];\n    //                     exist = arr.findIndex((v) => v === skinId) !== (-1);\n    //                 }\n    //                 if (!exist) {\n    //                     arr.push(skinId);\n    //                     GameRecord.globalVariables[\"dressed_skins\"] = JSON.stringify(arr);\n    //                     GameRecord.saveRecord();\n    //                     GameModelManager.RefreshDiscoverTabRed.emit();\n    //                 }\n    //             } else {\n    //                 throw \"id =>\" + skinId + \"is not a skin item id\";\n    //             }\n    //         } else {\n    //             throw \"invalid skinId\";\n    //         }\n    //     }\n    // }\n\n    export function checkSkinAndGraceCondition(condition: DeepReadonlyObject<ConditionExpression>): boolean {\n        let ret: boolean = false;\n        if (condition.groups && condition.groups.length > 0\n            && condition.groups[0].items\n            && condition.groups[0].items.length > 0\n            && condition.groups[0].items[0].target) {\n            if (condition.groups[0].items[0].target.startsWith(\"r.like\")) {\n                let roleIdStr = condition.groups[0].items[0].target.replace(\"r.like\", \"\");\n                let role = getRoleData(parseInt(roleIdStr));\n                if (role && role.getRoleLike() >= parseInt(condition.groups[0].items[0].oprand.value)) {\n                    ret = true;\n                }\n            }\n            if (condition.groups[0].items[0].target.startsWith(\"r.skin\")) {\n                let roleIdStr = condition.groups[0].items[0].target.replace(\"r.skin\", \"\");\n                let role = getRoleData(parseInt(roleIdStr));\n                let v = parseInt(condition.groups[0].items[0].oprand.value);\n                if (role && role.hasSkin(v) && role.getCurSkin() === v) {\n                    ret = true;\n                }\n            }\n        }\n        return ret;\n    }\n\n    export function getGraceLevelByGraceValue(value: number): number {\n        let level = 0;\n        let cfgs = ConfigManager.getAllConfig(relationLevelConfig);\n        let gCount = 0;\n        for (let id in cfgs) {\n            let cfg = cfgs[id];\n            gCount += cfg.relation_value;\n            if (value >= gCount) {\n                level = cfg.id;\n            }\n        }\n        return level;\n    }\n\n    export function checkIsNeedEnterCurDateChapter(): boolean {\n        return isNeedEnterCurDateChapter;\n    }\n\n    export function setNotNeedEnterCurDateChapter() {\n        isNeedEnterCurDateChapter = false;\n    }\n\n    // export function setProgressDateScene(sceneId: number | undefined) {\n    //     let allCfg = ConfigManager.getAllConfig(dateAniConfig);\n    //     let content = false;\n    //     for (let id in allCfg) {\n    //         let cfg = allCfg[id];\n    //         if (cfg && cfg.date_id === sceneId) {sss\n    //             content = true;\n    //         }\n    //     }\n    //     if (content) {\n    //         progressSceneId = sceneId;\n    //     }\n    // }\n\n    // function checkIsGiveSkin(): boolean {\n    //     let ret = false;\n    //     if (progressSceneId) {\n    //         let giveSceneId: number = 0;\n    //         let allCfg = ConfigManager.getAllConfig(dateAniConfig);\n    //         for (let id in allCfg) {\n    //             let cfg = allCfg[id];\n    //             if (cfg && cfg.date_id) {\n    //                 giveSceneId = cfg.date_id > giveSceneId ? cfg.date_id : giveSceneId;\n    //             }\n    //         }\n    //         ret = giveSceneId === progressSceneId;\n    //     }\n    //     return ret;\n    // }\n\n    // export function getShowDateProgressInfo(): { isSkin: boolean, sceneId: number | undefined } {\n    //     let isSkin = checkIsGiveSkin();\n    //     return { isSkin: isSkin, sceneId: progressSceneId };\n    // }\n\n    export function setUnShowDateProgress() {\n        progressSceneId = undefined;\n    }\n\n    export function isDiscountAll(): boolean {\n        return false;\n    }\n\n    // export function checkHasGift(): { hasGift: boolean, gifts?: { id: GamePropType, num: number }[] } {\n    //     let ret: { hasGift: boolean, gifts?: { id: GamePropType, num: number }[] } = { hasGift: false };\n    //     let tbl = ConfigManager.getAllConfig(itemConfig);\n    //     let role = getPlayerData();\n    //     let gifts: { id: GamePropType, num: number }[] = [];\n    //     for (let id in tbl) {\n    //         let cfg = tbl[id];\n    //         if (cfg && ItemType.Item_Gift === cfg.ItemType) {\n    //             if (role) {\n    //                 let num = role.getProps(cfg.id);\n    //                 num = num ? num : 0;\n    //                 if (num > 0) {\n    //                     let gift: { id: GamePropType, num: number } = { id: cfg.id, num: num };\n    //                     gifts.push(gift);\n    //                 }\n    //             }\n    //         }\n    //     }\n    //     ret.hasGift = gifts.length !== 0;\n    //     if (ret.hasGift) {\n    //         ret.gifts = gifts;\n    //     }\n    //     return ret;\n    // }\n\n    export function stepGetNewPlayerGift(isFirst: boolean, time?: number, step?: number) {\n        let timeRecord = GameRecord.globalVariables[\"n_p_r_g_s_t\"] as number;\n        timeRecord = timeRecord ? timeRecord : TimeManager.getTime();\n        time = time ? time : 0;\n        time = time ? time : timeRecord;\n        const stepMax: number = 7;\n        step = step ? step : 1;\n        let recordKey = \"n_p_r_g_s_p\";\n        let record = GameRecord.globalVariables[recordKey] as number;\n        record = record ? record : 0;\n        record += step;\n        let overTime: boolean = checkOverdue(time);\n        if (record <= stepMax && (overTime || isFirst)) {\n            GameRecord.globalVariables[recordKey] = record;\n            GameRecord.globalVariables[\"n_p_r_g_s_t\"] = TimeManager.getTime();\n            GameRecord.saveRecord();\n        }\n    }\n\n    export function registerAutoPopView(viewType: AutoPopViewType) {\n        if (_autoPopView.length === 0) {\n            _autoPopView.push(viewType);\n        } else {\n            if (_autoPopView.findIndex((v) => v === viewType) === (-1)) {\n                _autoPopView.push(viewType);\n            }\n        }\n    }\n\n    export function checkAutoPopView() {\n        if (_autoPopView.length === 0) {\n            return;\n        }\n        _autoPopView = _autoPopView.sort((v1: AutoPopViewType, v2: AutoPopViewType) => {\n            return v1 - v2;\n        });\n        let v = _autoPopView.pop();\n        if (v) {\n            AutoPopView.emit(v);\n        }\n    }\n\n    export function checkWelfareNeedGuide() {\n        let time = GameRecord.globalVariables[\"sininsevendaydatetime\"];\n        time = time === undefined ? 0 : time;\n        if (checkOverdue(time)) {\n            return true;\n        }\n        return false;\n    }\n\n    export function markResumeFullEnergy() {\n        let marked = checkResumeFullEnergyMarked();\n        if (marked) {\n            return;\n        }\n        let timeKeyStr: string = \"resume_full_energy_time\";\n        GameRecord.globalVariables[timeKeyStr] = TimeManager.getTime();\n        GameRecord.saveRecord();\n    }\n\n    export function checkResumeFullEnergyMarked(): boolean {\n        let mark: boolean = false;\n        let timeKeyStr: string = \"resume_full_energy_time\";\n        let timeRecord = GameRecord.globalVariables[timeKeyStr] as number;\n        if (timeRecord) {\n            let over = checkOverdue(timeRecord);\n            if (!over) {\n                mark = true;\n            }\n        }\n        return mark;\n    }\n\n    export function checkIsOverPlotLimitTime() {\n        let isOver: boolean = false;\n        let timeKeyStr: string = \"plot_limit_time\";\n        let recordTime = GameRecord.globalVariables[timeKeyStr] as number;\n        if (recordTime) {\n            isOver = checkOverdue(recordTime);\n        } else {\n            let timeKeyStr: string = \"plot_limit_time\";\n            GameRecord.globalVariables[timeKeyStr] = TimeManager.getTime();\n        }\n        return isOver;\n    }\n\n    export async function dealBlockedPlot(isAdForce?: boolean) {\n        let over = checkIsOverPlotLimitTime();\n        let curPlot = PlotManager.getCurrentPlots()[0];\n        if (curPlot && curPlot.plotSceneType === PlotSceneType.BlockPlot) {\n            if (over || isAdForce) {\n                await PlotManager.completePlot(curPlot);\n                let timeKeyStr: string = \"plot_limit_time\";\n                GameRecord.globalVariables[timeKeyStr] = TimeManager.getTime();\n                PlotBlockedChanged.emit();\n            } else {\n                ShowPlotBlocked.emit();\n            }\n        }\n    }\n\n    export function checkIsPlotBlocked(): boolean {\n        let blocked: boolean = false;\n        let curPlot = PlotManager.getCurrentPlots()[0];\n        if (curPlot && curPlot.plotSceneType === PlotSceneType.BlockPlot) {\n            blocked = true;\n        }\n        return blocked;\n    }\n\n    export function getCurPlotBlockedId(): number {\n        let id = PlotManager.getCurrentPlots()[0].id;\n        return id;\n    }\n\n    export function checkIsNeedShowPlotBlocked(): boolean {\n        let show: boolean = false;\n        let curPlot = PlotManager.getCurrentPlots()[0];\n        if (curPlot && curPlot.plotSceneType === PlotSceneType.BlockPlot) {\n            let over = checkIsOverPlotLimitTime();\n            if (!over) {\n                show = true;\n            }\n        }\n        return show;\n    }\n\n    export function isPlotBlockedOrToBeContinued(): boolean {\n        let isPlotBolcked = checkIsPlotBlocked();\n        let p = PlotManager.getCurrentPlots()[0];\n        let isToBeContinued = p && p.id === SpecialPlotId.ToBeContinued;\n        let preConditionFlag = isPlotBolcked || isToBeContinued;\n        return preConditionFlag;\n    }\n\n    export function getCurMainLinePlotId(): number {\n        let p = PlotManager.getCurrentPlots()[0];\n        return p ? p.id : 0;\n    }\n\n\n    let tipAddGracePlots: number[] = [];\n\n    export function checkPlotTipAddGraceAlready(plotId: number): boolean {\n        let ret = tipAddGracePlots.findIndex((v) => v === plotId) !== (-1);\n        return ret;\n    }\n\n    export function pushTipAddGracePlot(plotId: number) {\n        let exist = tipAddGracePlots.findIndex((v) => v === plotId) !== (-1);\n        if (!exist) {\n            tipAddGracePlots.push(plotId);\n        }\n    }\n\n    /**\n     * 根据卧室物品Id获取对应的淘宝商品类型\n     * @param itemId 卧室物品Id\n     * @returns 返回值为卧室物品对应的淘宝商品类型\n     */\n    export function getTypeByBedroomItemId(itemId: number): number {\n        let type: number = -1;\n        let cfg = ConfigManager.getAllConfig(bedroomItemConfig);\n        if (cfg) {\n            for (const id in cfg) {\n                if (cfg[id].bedroomItemId == itemId) {\n                    type = cfg[id].itemType;\n                }\n            }\n        }\n        return type;\n    }\n\n    /**\n     * 根据商品类型获得该商品对应的淘宝地址链接\n     * @param type 商品类型\n     * @returns 返回值为商品类型对应的商品地址\n     */\n    export function getTaoBaoShopUrlByType(type: number): string {\n        let link: string = \"\";\n        let cfg = ConfigManager.getAllConfig(taoBaoShopUrlConfig);\n        if (cfg) {\n            for (const id in cfg) {\n                if (cfg[id].type == type) {\n                    link = cfg[id].websiteUrl;\n                }\n            }\n        }\n        return link;\n    }\n\n    /**\n     * 根据商品类型获得该商品对应的有赞地址链接\n     * @param type 商品类型\n     * @returns 返回值为商品类型对应的商品地址\n     */\n    export function getYouZanShopUrlByType(type: number): string {\n        let link: string = \"\";\n        let cfg = ConfigManager.getAllConfig(taoBaoShopUrlConfig);\n        if (cfg) {\n            for (const id in cfg) {\n                if (cfg[id].type == type) {\n                    link = cfg[id].youZanUrl;\n                }\n            }\n        }\n        return link;\n    }\n\n    /**\n     * 根据网页链接跳转网页\n     * @param url 要跳转的网页链接\n     */\n    export function jumpToTaobaoShop(url: string) {\n        if (channel == \"dummy\") {\n            let mUrl = url.replace(\"taobao:\", \"https:\");\n            window.open(mUrl);\n        } else {\n            let packageName: string = \"com.taobao.taobao\";\n            let errorTips: string = \"您还没有安装淘宝客户端!\";\n            jsb.reflection.callStaticMethod('org/cocos2dx/javascript/AppActivity', 'jumpToTaobaoShop', \"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V\", packageName, url, errorTips);\n        }\n    }\n\n    /**特殊剧情id数组 */\n    const SpecialPlotIdArr: number[] = [SpecialPlotId.CustomPlotStart, SpecialPlotId.End, SpecialPlotId.ToBeContinued];\n    /**根据剧情id获取剧情的内容 */\n    export async function getPlotContent(plotId: number): Promise<IPlotContent | undefined> {\n        let plotContent: IPlotContent | undefined = undefined;\n        let isSpecialPlot = SpecialPlotIdArr.findIndex((v) => v === plotId) !== (-1);\n        if (isSpecialPlot) {\n            cc.error(\"can not get special plot content, plotId = \", plotId);\n            return undefined;\n        }\n        try {\n            let plot = await getPlot(plotId);\n            if (plot && plot.sentences && plot.sentences.length !== 0) {\n                const sentence = plot.sentences[0];\n                const content = sentence.content;\n                if (content) {\n                    plotContent = {\n                        plotId: plotId,\n                        roleId: sentence.roleId,\n                        content: []\n                    };\n                    if (content.type === SentenceType.TEXT) {\n                        plotContent.content.push(richNodesToCocosString(content.value));\n                    } else if (content.type === SentenceType.SELECT) {\n                        for (let i = 0; i < content.value.length; i++) {\n                            let value = content.value[i];\n                            if (value.content && value.content.type === SentenceType.TEXT) {\n                                plotContent.content.push(richNodesToCocosString(value.content.value));\n                            } else {\n                                plotContent.content.push(value.summary);\n                            }\n                        }\n                    }\n                } else {\n                    cc.error(\"plot has no content , plotId = \", plotId);\n                }\n            } else {\n                cc.warn(\"plot has no sentence or no such plot , plotId = \", plotId);\n            }\n        } catch (error) {\n            cc.error(\"getPlotContent error plotId = \" + plotId + \" error info = \", error);\n            return undefined;\n        }\n        return plotContent;\n    }\n\n    /**\n     * 设置是否自动弹出公告界面\n     * @param autoShow 是否自动弹出公告界面\n     */\n    export function setAutoShowNotice(autoShow: boolean) {\n        let autoShowNoticeInfo: AutoShowNoticeInfo = {\n            time: TimeManager.getTime(),\n            autoShow: autoShow,\n        };\n        GameRecord.globalVariables[\"AutoShowNoticeInfo\"] = autoShowNoticeInfo;\n        GameRecord.saveRecord();\n    }\n\n    /**\n     * 获取是否自动弹出公告界面\n     * @returns 返回值为是否自动弹出公告界面\n     */\n    export function getAutoShowNotice(): boolean {\n        let autoShowNoticeInfo = GameRecord.globalVariables[\"AutoShowNoticeInfo\"] as AutoShowNoticeInfo;\n        let autoShow = true;\n        if (autoShowNoticeInfo == undefined) {\n            autoShow = true;\n        } else {\n            autoShow = autoShowNoticeInfo.autoShow;\n            let isOver = checkOverdue(autoShowNoticeInfo.time);\n            if (isOver) {\n                autoShow = true;\n                setAutoShowNotice(autoShow);\n            }\n        }\n        return autoShow;\n    }\n\n    /**\n     * 设置是否自动弹出紧急公告界面\n     * @param autoShow 是否自动弹出紧急公告界面\n     */\n    export function setUrgentNoticeInfo(noticeInfo: UrgentNoticeInfo) {\n        GameRecord.globalVariables[\"UrgentNoticeInfo\"] = noticeInfo;\n        GameRecord.saveRecord();\n    }\n\n    /**\n     * 获取是否自动弹出紧急公告界面\n     * @returns 返回值为是否自动弹出紧急公告界面\n     */\n    export function getUrgentNoticeInfo(): UrgentNoticeInfo {\n        let noticeInfo = GameRecord.globalVariables[\"UrgentNoticeInfo\"] as UrgentNoticeInfo;\n        noticeInfo = noticeInfo ? noticeInfo : { readed: false, autoShow: true };\n        return noticeInfo;\n    }\n\n    /**\n     * 设置是否自动弹出紧急公告界面\n     * @param autoShow 是否自动弹出紧急公告界面\n     */\n    export function setNoticeReaded(readed: boolean) {\n        GameRecord.globalVariables[\"NoticeReaded\"] = readed;\n        GameRecord.saveRecord();\n    }\n\n    /**\n     * 获取是否自动弹出紧急公告界面\n     * @returns 返回值为是否自动弹出紧急公告界面\n     */\n    export function getNoticeReaded(): boolean {\n        let readed = GameRecord.globalVariables[\"NoticeReaded\"] as boolean;\n        readed = readed ? readed : false;\n        return readed;\n    }\n}\n\nexport interface IPlotContent {\n    plotId: number;\n    roleId: number;\n    content: string[];\n}\n\nexport interface AutoShowNoticeInfo {\n    time: number;\n    autoShow: boolean;\n}\n\nexport interface UrgentNoticeInfo {\n    readed: boolean;\n    autoShow: boolean;\n}"]}