Sync controls when loading a config file, fixes #1965
This commit is contained in:
parent
e1f6c7afb1
commit
2254098b9c
|
@ -1376,10 +1376,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void LoadConfigMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Config = ConfigService.Load<Config>(Config.DefaultIniPath);
|
||||
Config.ResolveDefaults();
|
||||
InitControls(); // rebind hotkeys
|
||||
AddOnScreenMessage($"Config file loaded: {Config.DefaultIniPath}");
|
||||
LoadConfigFile(Config.DefaultIniPath);
|
||||
}
|
||||
|
||||
private void LoadConfigFromMenuItem_Click(object sender, EventArgs e)
|
||||
|
@ -1394,10 +1391,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
if (ofd.ShowHawkDialog().IsOk())
|
||||
{
|
||||
Config = ConfigService.Load<Config>(ofd.FileName);
|
||||
Config.ResolveDefaults();
|
||||
InitControls(); // rebind hotkeys
|
||||
AddOnScreenMessage($"Config file loaded: {ofd.FileName}");
|
||||
LoadConfigFile(ofd.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2798,6 +2798,15 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
private void LoadConfigFile(string iniPath)
|
||||
{
|
||||
Config = ConfigService.Load<Config>(iniPath);
|
||||
Config.ResolveDefaults();
|
||||
InitControls(); // rebind hotkeys
|
||||
InputManager.SyncControls(Emulator, Config);
|
||||
AddOnScreenMessage($"Config file loaded: {iniPath}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Frame Loop
|
||||
|
|
Loading…
Reference in New Issue