コード例 #1
0
        private void _profileDropdown_OnSelectionChanged(object sender, EventArgs e)
        {
            if (OutwardHelper.IsOutwardRunning())
            {
                if (prevProfileIndex != -1)
                {
                    _profileDropdown.SelectedIndex = prevProfileIndex;
                }
                return;
            }

            var value = _profileDropdown.SelectedIndex;

            prevProfileIndex = value;

            if (value < 0 || value >= ProfileManager.AllProfiles.Count)
            {
                Console.WriteLine("index out of range: " + value);
                return;
            }

            var profile = ProfileManager.AllProfiles.ElementAt(value);

            if (ProfileManager.s_activeProfile == profile.Key)
            {
                return;
            }

            ProfileManager.SavePrompt(true, true);

            ProfileManager.SetActiveProfile(profile.Value, true);
        }
コード例 #2
0
        private void _reloadProfileButton_Click(object sender, EventArgs e)
        {
            if (OutwardHelper.IsOutwardRunning())
            {
                MessageBox.Show("You need to close Outward to do that.");
                return;
            }
            //if (ProfileManager.s_changesSinceLastSave)
            //{
            //    var result = MessageBox.Show("You have unsaved changes, really revert them and load the last save?", "Warning", MessageBoxButtons.OKCancel);
            //}

            ProfileManager.LoadProfiles(false);
        }
コード例 #3
0
        private void _uninstallButton_Click(object sender, EventArgs e)
        {
            ProfileManager.SavePrompt(false);

            var result = OutwardHelper.UninstallFromOutward();

            if (result == DialogResult.Cancel)
            {
                return;
            }

            Folders.IsCurrentOutwardPathValid(out InstallState state);
            SetOtwPathResult(state);

            LocalPackageManager.RefreshInstalledPackages();
            LauncherPage.Instance.RebuildPackageList();
        }
コード例 #4
0
        private void _newProfileButton_Click(object sender, EventArgs e)
        {
            if (OutwardHelper.IsOutwardRunning())
            {
                MessageBox.Show("You need to close Outward to do that.");
                return;
            }

            using (var creation = new ProfileCreationForm())
            {
                if (creation.ShowDialog(this) == DialogResult.OK)
                {
                    var input = creation._enterNameField.Text;

                    ProfileManager.CreateProfile(input);

                    RefreshProfileDropdown();
                }
            }
        }
コード例 #5
0
        private void _deleteProfileButton_Click(object sender, EventArgs e)
        {
            if (OutwardHelper.IsOutwardRunning())
            {
                MessageBox.Show("You need to close Outward to do that.");
                return;
            }

            var profile = ProfileManager.s_activeProfile;

            if (string.IsNullOrEmpty(profile))
            {
                return;
            }

            var msg = MessageBox.Show($"Really delete profile '{profile}'?", "Delete profile?", MessageBoxButtons.OKCancel);

            if (msg == DialogResult.OK)
            {
                ProfileManager.DeleteProfile(profile);
                RefreshProfileDropdown();
            }
        }
コード例 #6
0
 private void _launchOutwardButton_Click(object sender, EventArgs e)
 {
     OutwardHelper.TryLaunchOutward();
 }