2022-07-30 19:24:03 +03:00
|
|
|
#include <Geode/loader/Loader.hpp>
|
|
|
|
|
2023-03-10 11:33:24 -08:00
|
|
|
using namespace geode::prelude;
|
2022-07-30 19:24:03 +03:00
|
|
|
|
2022-10-13 14:00:41 +03:00
|
|
|
#include <Geode/modify/AppDelegate.hpp>
|
2022-11-09 21:03:53 +03:00
|
|
|
|
|
|
|
struct SaveLoader : Modify<SaveLoader, AppDelegate> {
|
2022-07-30 19:24:03 +03:00
|
|
|
void trySaveGame() {
|
2022-12-10 19:30:14 +03:00
|
|
|
log::info("Saving...");
|
2022-07-30 19:24:03 +03:00
|
|
|
|
2022-10-25 21:49:50 +03:00
|
|
|
auto r = Loader::get()->saveData();
|
2022-07-30 19:24:03 +03:00
|
|
|
if (!r) {
|
2022-12-10 19:30:14 +03:00
|
|
|
log::info("{}", r.unwrapErr());
|
2022-07-30 19:24:03 +03:00
|
|
|
}
|
|
|
|
|
2022-12-10 19:30:14 +03:00
|
|
|
log::info("Saved");
|
2022-11-09 21:03:53 +03:00
|
|
|
|
2022-07-30 19:24:03 +03:00
|
|
|
return AppDelegate::trySaveGame();
|
|
|
|
}
|
2022-11-30 00:48:06 +02:00
|
|
|
};
|