Re-add an assignment in `InputManager.SyncControls` (fixes #3458)

partially reverts 781c152bf
also removed now-unused method `Controller.ForceType`
This commit is contained in:
YoshiRulz 2022-11-23 15:24:29 +10:00
parent 3f352792a6
commit 52acda9a02
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 6 additions and 4 deletions

View File

@ -22,7 +22,7 @@ namespace BizHawk.Client.Common
foreach (var channel in Definition.HapticsChannels) _haptics[channel] = 0;
}
public ControllerDefinition Definition { get; private set; }
public ControllerDefinition Definition { get; }
public bool IsPressed(string button) => _buttons[button];
@ -41,9 +41,6 @@ namespace BizHawk.Client.Common
private readonly Dictionary<string, int> _haptics = new WorkingDictionary<string, int>();
private readonly Dictionary<string, FeedbackBind> _feedbackBindings = new Dictionary<string, FeedbackBind>();
/// <summary>don't do this</summary>
public void ForceType(ControllerDefinition newType) => Definition = newType;
public bool this[string button] => IsPressed(button);
// Looks for bindings which are activated by the supplied physical button.

View File

@ -64,6 +64,11 @@ namespace BizHawk.Client.Common
ActiveController = BindToDefinition(def, config.AllTrollers, config.AllTrollersAnalog, config.AllTrollersFeedbacks);
AutoFireController = BindToDefinitionAF(emulator, config.AllTrollersAutoFire, config.AutofireOn, config.AutofireOff);
// 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? --natt 2013
// they were mostly not required, see #3458 --yoshi 2022
ClickyVirtualPadController.Definition = def;
// Wire up input chain
UdLRControllerAdapter.Source = ActiveController.Or(AutoFireController);