fix: actually save config when toggling setting

This commit is contained in:
Anna 2023-11-14 16:12:44 -05:00
parent e0621f0a0f
commit fe65226598
Signed by: anna
GPG Key ID: D0943384CD9F87D1
1 changed files with 6 additions and 2 deletions

View File

@ -20,7 +20,9 @@ internal class SettingsTab {
ImGuiHelpers.CenteredText("Options");
ImGui.Checkbox("Open window when a new question is available", ref this.Plugin.Config.OpenWhenNew);
var anyChanged = false;
anyChanged |= ImGui.Checkbox("Open window when a new question is available", ref this.Plugin.Config.OpenWhenNew);
using (ImGuiHelper.WithDisabledColour()) {
ImGui.TextUnformatted("The window will not open until you are not busy in most cases (not in combat, not in instance, etc.).");
}
@ -31,7 +33,9 @@ internal class SettingsTab {
ImGui.TextUnformatted("These are optional questions that will be sent with every vote you cast. They are used to display breakdowns in the details window for each question.");
ImGui.Spacing();
if (this.Plugin.Ui.DrawOptionalQuestions()) {
anyChanged |= this.Plugin.Ui.DrawOptionalQuestions();
if (anyChanged) {
this.Plugin.SaveConfig();
}
}