geode/loader/src/hooks/save.cpp
2023-11-11 19:45:18 +03:00

24 lines
689 B
C++

#include <Geode/loader/Loader.hpp>
using namespace geode::prelude;
#include <Geode/modify/AppDelegate.hpp>
struct SaveLoader : Modify<SaveLoader, AppDelegate> {
void trySaveGame() {
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<std::chrono::milliseconds>(end - begin).count();
log::info("Took {}s", static_cast<float>(time) / 1000.f);
log::popNest();
return AppDelegate::trySaveGame();
}
};