From 52acda9a02181e4a616ddaaafc529b73bbc62bb2 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Wed, 23 Nov 2022 15:24:29 +1000 Subject: [PATCH] Re-add an assignment in `InputManager.SyncControls` (fixes #3458) partially reverts 781c152bf also removed now-unused method `Controller.ForceType` --- src/BizHawk.Client.Common/Controller.cs | 5 +---- src/BizHawk.Client.Common/inputAdapters/InputManager.cs | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/BizHawk.Client.Common/Controller.cs b/src/BizHawk.Client.Common/Controller.cs index 1a5533b1b9..331745d73c 100644 --- a/src/BizHawk.Client.Common/Controller.cs +++ b/src/BizHawk.Client.Common/Controller.cs @@ -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 _haptics = new WorkingDictionary(); private readonly Dictionary _feedbackBindings = new Dictionary(); - /// don't do this - 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. diff --git a/src/BizHawk.Client.Common/inputAdapters/InputManager.cs b/src/BizHawk.Client.Common/inputAdapters/InputManager.cs index 3b1884e47d..edf2174518 100644 --- a/src/BizHawk.Client.Common/inputAdapters/InputManager.cs +++ b/src/BizHawk.Client.Common/inputAdapters/InputManager.cs @@ -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);