private void MefinoGUI_FormClosed(object sender, FormClosedEventArgs e) { TemporaryFile.CleanupAllFiles(); AppDataManager.SaveConfig(); ProfileManager.SavePrompt(); }
internal static void Cmd_SetOutwardPath(params string[] args) { if (args == null || args.Length < 1 || string.IsNullOrEmpty(args[0])) { Console.WriteLine("Invalid outward path!"); } else { if (!Folders.SetOutwardFolderPath(args[0])) { Console.WriteLine($"Invalid Outward path '{args[0]}'"); } else { AppDataManager.SaveConfig(); } } }
private void _otwPathSelectBtn_Click(object sender, EventArgs e) { using (OpenFileDialog openFileDialog = new OpenFileDialog()) { openFileDialog.Filter = "Outward Game (Outward.exe)|Outward.exe"; openFileDialog.RestoreDirectory = true; if (openFileDialog.ShowDialog() == DialogResult.OK) { string filePath = Path.GetDirectoryName(openFileDialog.FileName); if (!string.IsNullOrEmpty(filePath)) { this._otwPathInputField.Text = filePath; Folders.SetOutwardFolderPath(filePath, out InstallState state); SetOtwPathResult(state); AppDataManager.SaveConfig(); } } } }
/// <summary> /// Set the current profile to the provided profile. /// </summary> /// <param name="profile">The profile to activate</param> /// <param name="skipSavePrompt">Skip saving the current profile?</param> /// <returns><see langword="true"/> if successful, otherwise <see langword="false"/></returns> public static bool SetActiveProfile(MefinoProfile profile, bool skipSavePrompt) { if (!skipSavePrompt && !string.IsNullOrEmpty(s_activeProfile)) { SavePrompt(); } try { s_activeProfile = profile.name; profile.EnableProfile(); AppDataManager.SaveConfig(); LauncherPage.SendRebuildPackageList(); return(true); } catch (Exception ex) { Console.WriteLine(ex); return(false); } }