#include using namespace geode::prelude; #include #include namespace { void saveModData() { log::info("Saving mod data..."); log::pushNest(); auto begin = std::chrono::high_resolution_clock::now(); (void)Loader::get()->saveData(); auto end = std::chrono::high_resolution_clock::now(); auto time = std::chrono::duration_cast(end - begin).count(); log::info("Took {}s", static_cast(time) / 1000.f); log::popNest(); } } struct SaveLoader : Modify { GEODE_FORWARD_COMPAT_DISABLE_HOOKS("save moved to CCApplication::gameDidSave()") void trySaveGame(bool p0) { saveModData(); return AppDelegate::trySaveGame(p0); } }; struct FallbackSaveLoader : Modify { GEODE_FORWARD_COMPAT_ENABLE_HOOKS("") void gameDidSave() { saveModData(); return CCApplication::gameDidSave(); } };