mirror of
https://github.com/geode-sdk/geode.git
synced 2024-12-02 12:17:10 -05:00
24 lines
689 B
C++
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();
|
|
}
|
|
};
|