fix(screenshot-mode): the toggle never wrote its change to disk
Screenshot mode is a persisted setting, but neither of the two toggles saved the config. Turning it on only stuck when some unrelated save happened to run afterwards -- and once it was stored, turning it off never reached the file at all, so it came back on with every plugin load. Both toggles save now. An install currently stuck on it needs one click.
This commit is contained in:
@@ -194,7 +194,10 @@ internal sealed class PayloadHandler
|
||||
return;
|
||||
}
|
||||
|
||||
ImGui.Checkbox(Language.Context_ScreenshotMode, ref Plugin.Config.ScreenshotMode);
|
||||
// The flag is persisted, so every toggle has to write it. Without the
|
||||
// write it only sticks when some unrelated save happens to run after.
|
||||
if (ImGui.Checkbox(Language.Context_ScreenshotMode, ref Plugin.Config.ScreenshotMode))
|
||||
Plugin.Instance.SaveConfig();
|
||||
|
||||
if (ImGui.Selectable(Language.Context_HideChat))
|
||||
Plugin.Config.HideChat = true;
|
||||
|
||||
@@ -901,7 +901,10 @@ internal sealed class InputBar
|
||||
)
|
||||
)
|
||||
{
|
||||
// Persisted flag -- write it here too, or turning it back off
|
||||
// never reaches the config file.
|
||||
Plugin.Config.ScreenshotMode = !Plugin.Config.ScreenshotMode;
|
||||
Plugin.Instance.SaveConfig();
|
||||
}
|
||||
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user