Esempio n. 1
0
        private void MefinoGUI_FormClosed(object sender, FormClosedEventArgs e)
        {
            TemporaryFile.CleanupAllFiles();

            AppDataManager.SaveConfig();
            ProfileManager.SavePrompt();
        }
Esempio n. 2
0
 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();
         }
     }
 }
Esempio n. 3
0
        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();
                    }
                }
            }
        }
Esempio n. 4
0
        /// <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);
            }
        }