void renameProfileButton_Click(object sender, EventArgs e) { updatePCSettings(); if (currentPCProfile == null) { return; } if (currentPCProfile.IsDefault) { Logger.LogDebug("Default profile cannot be renamed"); return; } using (Conf_NewProfile profileDlg = new Conf_NewProfile(selectedGame.ParentEmulator, currentPCProfile)) { if (profileDlg.ShowDialog() == DialogResult.OK) { profileDlg.EmulatorProfile.Save(); int index = pcProfileComboBox.SelectedIndex; pcProfileComboBox.Items.Remove(currentPCProfile); pcProfileComboBox.Items.Insert(index, profileDlg.EmulatorProfile); pcProfileComboBox.SelectedIndex = index; } } loadProfileDropdown(selectedGame); }
private void addProfileButton_Click(object sender, EventArgs e) { if (selectedEmulator == null) { return; } using (Conf_NewProfile profileDlg = new Conf_NewProfile(selectedEmulator, null)) { if (profileDlg.ShowDialog() != DialogResult.OK || profileDlg.EmulatorProfile == null) { return; } EmulatorProfile profile = profileDlg.EmulatorProfile; profile.Save(); profileComboBox.Items.Add(profile); profileComboBox.SelectedItem = profile; } }
void addProfileButton_Click(object sender, EventArgs e) { if (selectedGame == null) { return; } updatePCSettings(); using (Conf_NewProfile profileDlg = new Conf_NewProfile(selectedGame.ParentEmulator, null)) { if (profileDlg.ShowDialog() != DialogResult.OK || profileDlg.EmulatorProfile == null) { return; } EmulatorProfile profile = profileDlg.EmulatorProfile; profile.GameId = selectedGame.GameID; profile.SuspendMP = true; profile.Save(); pcProfileComboBox.Items.Add(profile); pcProfileComboBox.SelectedItem = profile; } loadProfileDropdown(selectedGame); }