geode/loader/src/hooks/save.cpp

22 lines
577 B
C++
Raw Normal View History

2022-07-30 19:24:03 +03:00
#include <Geode/loader/Loader.hpp>
USE_GEODE_NAMESPACE();
2022-10-30 21:56:36 +03:00
// clang-format off
#include <Geode/modify/AppDelegate.hpp>
2022-07-30 19:24:03 +03:00
class $modify(AppDelegate) {
void trySaveGame() {
2022-10-06 16:08:44 -05:00
log::log(Severity::Info, Loader::getInternalMod(), "Saving...");
2022-07-30 19:24:03 +03:00
auto r = Loader::get()->saveSettings();
if (!r) {
2022-10-12 21:31:33 +03:00
log::log(Severity::Error, Loader::getInternalMod(), "{}", r.error());
2022-07-30 19:24:03 +03:00
}
2022-10-06 16:08:44 -05:00
log::log(Severity::Info, Loader::getInternalMod(), "Saved");
2022-07-30 19:24:03 +03:00
return AppDelegate::trySaveGame();
}
};
2022-10-30 21:56:36 +03:00
// clang-format on