2022-07-30 12:24:03 -04:00
|
|
|
#include <Geode/loader/Loader.hpp>
|
|
|
|
|
|
|
|
USE_GEODE_NAMESPACE();
|
|
|
|
|
2022-10-13 07:00:41 -04:00
|
|
|
#include <Geode/modify/AppDelegate.hpp>
|
2022-11-09 13:03:53 -05:00
|
|
|
|
|
|
|
struct SaveLoader : Modify<SaveLoader, AppDelegate> {
|
2022-07-30 12:24:03 -04:00
|
|
|
void trySaveGame() {
|
2022-12-10 11:30:14 -05:00
|
|
|
log::info("Saving...");
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2022-10-25 14:49:50 -04:00
|
|
|
auto r = Loader::get()->saveData();
|
2022-07-30 12:24:03 -04:00
|
|
|
if (!r) {
|
2022-12-10 11:30:14 -05:00
|
|
|
log::info("{}", r.unwrapErr());
|
2022-07-30 12:24:03 -04:00
|
|
|
}
|
|
|
|
|
2022-12-10 11:30:14 -05:00
|
|
|
log::info("Saved");
|
2022-11-09 13:03:53 -05:00
|
|
|
|
2022-07-30 12:24:03 -04:00
|
|
|
return AppDelegate::trySaveGame();
|
|
|
|
}
|
2022-11-29 17:48:06 -05:00
|
|
|
};
|