InputManager - pass some dependencies into SyncControls
This commit is contained in:
parent
edd8349dde
commit
5617950f50
|
@ -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?
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue