1bb72ec7-33c2-4677-9c00-c7f25632e28b.js.map
2.64 KB
{"version":3,"sources":["assets/script/game/ui/UIUtils.ts"],"names":[],"mappings":"","file":"","sourceRoot":"/","sourcesContent":["import { DeepReadonly } from \"simba-utils\";\nimport { DailyQuestType } from \"../../avg/EditorEnums\";\nimport { GameTextData } from \"../../common/gameplay/gamedata/GameTextData\";\nimport { UIManager } from \"../../common/gameplay/managers/UIManager\";\nimport { StringUtils } from \"../../common/utils/StringUtils\";\nimport { IItemConfig } from \"../../config/ItemConfig\";\nimport { CommonLocation, ExposureType, ShowLocationType, ShowType } from \"../Enums\";\nimport GameDotMgr from \"../GameDotMgr\";\nimport { GameModelManager } from \"../model/GameModelManager\";\nimport AlertDialogViewPresenter from \"./presenter/AlertDialogViewPresenter\";\nimport { AlertDialogViewProps } from \"./view/type/AlertDialogView\";\n\nexport namespace UIUtils {\n // export function showAddEnergy(itemConfig: DeepReadonly<IItemConfig>, itemCount?: number) {\n // return new Promise<boolean>((resolve) => {\n // itemCount = itemCount === undefined ? 0 : itemCount;\n // let isAd = itemCount <= 0;\n // let txt = \"\";\n // if (isAd) {\n // txt = StringUtils.format(GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_PLAYAD_VALUE));\n // } else {\n // txt = StringUtils.format(GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_USEDRINKS_VALUE), itemConfig.energy_recover, itemCount);\n // }\n // let temp: AlertDialogViewProps =\n // {\n // dataptr: {},\n // titlecontent: GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_NOTENOUGH_VALUE),\n // content: txt,\n // ishasad: isAd,\n // istwobtn: true,\n // adconfig: \"inject_fruit\",\n // location: CommonLocation.Energy,\n // hasBanner: !isAd,\n // callback: (type, ret) => {\n // if (ret && !isAd) {\n // let player = GameModelManager.getPlayerData();\n // player.addProps(itemConfig.id, -1);\n // }\n\n // if (ret && type === \"video\") {\n // GameModelManager.addDailyTasks(DailyQuestType.Dq_AdsWatch, 1);\n // }\n // resolve(ret);\n // }\n // };\n // UIManager.pushPresenter(AlertDialogViewPresenter, temp);\n // GameDotMgr.getInstance().dotExposure(ExposureType.Energy);\n // })\n // };\n}"]}