InputManager - pass some dependencies into SyncControls

This commit is contained in:
adelikat 2020-03-15 17:13:56 -05:00
parent edd8349dde
commit 5617950f50
3 changed files with 7 additions and 7 deletions

View File

@ -35,12 +35,12 @@ namespace BizHawk.Client.Common
}
}
public static void SyncControls()
public static void SyncControls(IEmulator emulator, Config config)
{
var def = Global.Emulator.ControllerDefinition;
var def = emulator.ControllerDefinition;
Global.ActiveController = BindToDefinition(def, Global.Config.AllTrollers, Global.Config.AllTrollersAnalog);
Global.AutoFireController = BindToDefinitionAF(def, Global.Emulator, Global.Config.AllTrollersAutoFire);
Global.ActiveController = BindToDefinition(def, config.AllTrollers, config.AllTrollersAnalog);
Global.AutoFireController = BindToDefinitionAF(def, emulator, config.AllTrollersAutoFire);
// allow propagating controls that are in the current controller definition but not in the prebaked one
// these two lines shouldn't be required anymore under the new system?

View File

@ -941,7 +941,7 @@ namespace BizHawk.Client.EmuHawk
{
AddOnScreenMessage("Controller settings saved");
InitControls();
InputManager.SyncControls();
InputManager.SyncControls(Emulator, Config);
}
else
{
@ -956,7 +956,7 @@ namespace BizHawk.Client.EmuHawk
{
AddOnScreenMessage("Hotkey settings saved");
InitControls();
InputManager.SyncControls();
InputManager.SyncControls(Emulator, Config);
}
else
{

View File

@ -3696,7 +3696,7 @@ namespace BizHawk.Client.EmuHawk
string openAdvancedArgs = $"*{OpenAdvancedSerializer.Serialize(ioa)}";
Emulator = loader.LoadedEmulator;
Global.Game = loader.Game;
InputManager.SyncControls();
InputManager.SyncControls(Emulator, Config);
if (oaOpenrom != null && Path.GetExtension(oaOpenrom.Path.Replace("|", "")).ToLowerInvariant() == ".xml" && !(Emulator is LibsnesCore))
{