fix: Settings onChange handlers not being called correctly

This commit is contained in:
WerWolv
2025-07-31 20:38:23 +02:00
parent 7b6d5d2686
commit 1594c712a8

View File

@@ -118,14 +118,11 @@ namespace hex::plugin::builtin {
auto newValue = widget->store();
// Write new value to settings
ContentRegistry::Settings::impl::getSetting(category.unlocalizedName, setting.unlocalizedName, newValue) = newValue;
ContentRegistry::Settings::write<nlohmann::json>(category.unlocalizedName, setting.unlocalizedName, newValue);
// Print a debug message
log::debug("Setting [{} / {}]: Value was changed to {}", category.unlocalizedName.get(), setting.unlocalizedName.get(), nlohmann::to_string(newValue));
// Signal that the setting was changed
widget->onChanged();
// Request a restart if the setting requires it
if (widget->doesRequireRestart()) {
m_restartRequested = true;