Refactored plugin settings handling for maintainability (#515)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2025-06-27 22:52:34 +02:00
1 parent 1b8ed286e7
commit 7df0b3e6e0
3 files changed
+20 -1

No files matched your search

@@ -48,7 +48,7 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT
return false;
}
if (settingsTable.TryGetValue("DataApp.UpdateBehavior", out var updateBehaviorValue) && updateBehaviorValue.TryRead<string>(out var updateBehaviorText) && Enum.TryParse<UpdateBehavior>(updateBehaviorText, true, out var updateBehavior))
if (settingsTable.TryGetValue(SettingsManager.ToSettingName<DataApp>(x => x.UpdateBehavior), out var updateBehaviorValue) && updateBehaviorValue.TryRead<string>(out var updateBehaviorText) && Enum.TryParse<UpdateBehavior>(updateBehaviorText, true, out var updateBehavior))
{
SETTINGS_LOCKER.Register<DataApp>(x => x.UpdateBehavior, this.Id);
SETTINGS_MANAGER.ConfigurationData.App.UpdateBehavior = updateBehavior;