Profile config - save and load the selected profile

This commit is contained in:
adelikat 2014-07-15 00:50:42 +00:00
parent 0b35490b16
commit c6d679c382
2 changed files with 41 additions and 4 deletions

View File

@ -100,6 +100,17 @@ namespace BizHawk.Client.Common
public MovieEndAction MovieEndAction = MovieEndAction.Finish;
public enum ClientProfile
{
Unknown = 0,
Casual = 1,
Longplay = 2,
Tas = 3,
Custom = 99
}
public ClientProfile SelectedProfile = ClientProfile.Unknown;
// N64
public bool N64UseCircularAnalogConstraint = true;

View File

@ -20,10 +20,6 @@ namespace BizHawk.Client.EmuHawk
{
public partial class ProfileConfig : Form
{
// TODO:
// Save the profile selected to Global.Config (Casual is the default)
// Default the dropdown to the current profile selected instead of empty
public ProfileConfig()
{
InitializeComponent();
@ -35,6 +31,21 @@ namespace BizHawk.Client.EmuHawk
{
ProfileSelectComboBox.Items.Remove("Custom Profile");
}
switch (Global.Config.SelectedProfile)
{
default:
case Config.ClientProfile.Custom: // For now
case Config.ClientProfile.Casual:
ProfileSelectComboBox.SelectedItem = "Casual Gaming";
break;
case Config.ClientProfile.Longplay:
ProfileSelectComboBox.SelectedItem = "Longplays";
break;
case Config.ClientProfile.Tas:
ProfileSelectComboBox.SelectedItem = "Tool-assisted Speedruns";
break;
}
}
private void OkBtn_Click(object sender, EventArgs e)
@ -210,6 +221,21 @@ namespace BizHawk.Client.EmuHawk
//DisplayProfileSettingBoxes(true);
}
switch(ProfileSelectComboBox.SelectedItem.ToString())
{
default:
case "Custom Profile": // For now
case "Casual Gaming":
Global.Config.SelectedProfile = Config.ClientProfile.Casual;
break;
case "Longplays":
Global.Config.SelectedProfile = Config.ClientProfile.Longplay;
break;
case "Tool-assisted Speedruns":
Global.Config.SelectedProfile = Config.ClientProfile.Tas;
break;
}
DialogResult = DialogResult.OK;
Close();
}