diff --git a/loader/src/loader/ModSettingsManager.cpp b/loader/src/loader/ModSettingsManager.cpp index 6c68b12a..6d43ca58 100644 --- a/loader/src/loader/ModSettingsManager.cpp +++ b/loader/src/loader/ModSettingsManager.cpp @@ -30,6 +30,8 @@ ModSettingsManager::ModSettingsManager(ModMetadata const& metadata) } ModSettingsManager::~ModSettingsManager() {} +ModSettingsManager::ModSettingsManager(ModSettingsManager&&) = default; + Result<> ModSettingsManager::registerCustomSetting(std::string_view key, std::shared_ptr ptr) { if (!ptr) { return Err("Custom settings must not be null!"); diff --git a/loader/src/loader/ModSettingsManager.hpp b/loader/src/loader/ModSettingsManager.hpp index 5f78c340..a1593f91 100644 --- a/loader/src/loader/ModSettingsManager.hpp +++ b/loader/src/loader/ModSettingsManager.hpp @@ -14,10 +14,28 @@ public: ModSettingsManager(ModMetadata const& metadata); ~ModSettingsManager(); + ModSettingsManager(ModSettingsManager&&); + ModSettingsManager(ModSettingsManager const&) = delete; + + /** + * Load setting values from savedata. + * The format of the savedata should be an object with the keys being + * setting IDs and then the values the values of the saved settings + * @returns Ok if no horrible errors happened. Note that a setting value + * missing is not considered a horrible error, but will instead just log a + * warning into the console! + */ Result<> load(matjson::Value const& json); + /** + * Save setting values to savedata. + * The format of the savedata will be an object with the keys being + * setting IDs and then the values the values of the saved settings + * @note If saving a setting fails, it will log a warning to the console + */ void save(matjson::Value& json); Result<> registerCustomSetting(std::string_view key, std::shared_ptr ptr); + // remove in v4 Result<> registerLegacyCustomSetting(std::string_view key, std::unique_ptr&& ptr); std::shared_ptr get(std::string_view key);