From 12d6b5f202e7bb1f45abbb15ba1a15bc358d178b Mon Sep 17 00:00:00 2001 From: Miepee Date: Sun, 13 Feb 2022 22:26:44 +0100 Subject: [PATCH] only write profileIndex on launcher close --- AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs index b30a6fe..6f87feb 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs @@ -739,11 +739,9 @@ namespace AM2RLauncher profileAuthorLabel.Text = Language.Text.Author + " " + profileList[profileDropDown.SelectedIndex].Author; profileVersionLabel.Text = Language.Text.VersionLabel + " " + profileList[profileDropDown.SelectedIndex].Version; - // TODO: only write this on application quit - CrossPlatformOperations.WriteToConfig("ProfileIndex", profileIndex.ToString()); if (profileDropDown.SelectedIndex != 0 && (profileList[profileDropDown.SelectedIndex].SaveLocation == "%localappdata%/AM2R" || - profileList[profileDropDown.SelectedIndex].SaveLocation == "default")) + profileList[profileDropDown.SelectedIndex].SaveLocation == "default")) saveWarningLabel.Visible = true; else saveWarningLabel.Visible = false; @@ -1054,6 +1052,7 @@ namespace AM2RLauncher CrossPlatformOperations.WriteToConfig("Width", ClientSize.Width); CrossPlatformOperations.WriteToConfig("Height", ClientSize.Height); CrossPlatformOperations.WriteToConfig("IsMaximized", this.WindowState == WindowState.Maximized); + CrossPlatformOperations.WriteToConfig("ProfileIndex", profileIndex.ToString()); switch (updateState) {