Resolve TODO re: encapsulation of r/w InputManager props
This commit is contained in:
parent
778098e8b7
commit
25da1153b6
|
@ -14,10 +14,10 @@ namespace BizHawk.Client.Common
|
|||
public class InputManager
|
||||
{
|
||||
// the original source controller, bound to the user, sort of the "input" port for the chain, i think
|
||||
public Controller ActiveController { get; set; } // TODO: private setter, add a method that takes both controllers in
|
||||
public Controller ActiveController { get; private set; }
|
||||
|
||||
// rapid fire version on the user controller, has its own key bindings and is OR'ed against ActiveController
|
||||
public AutofireController AutoFireController { get; set; } // TODO: private setter, add a method that takes both controllers in
|
||||
public AutofireController AutoFireController { get; private set; }
|
||||
|
||||
// the "output" port for the controller chain.
|
||||
public CopyControllerAdapter ControllerOutput { get; } = new CopyControllerAdapter();
|
||||
|
@ -49,6 +49,12 @@ namespace BizHawk.Client.Common
|
|||
|
||||
public Func<(Point Pos, long Scroll, bool LMB, bool MMB, bool RMB, bool X1MB, bool X2MB)> GetMainFormMouseInfo { get; set; }
|
||||
|
||||
public void ResetMainControllers(AutofireController nullAutofireController)
|
||||
{
|
||||
ActiveController = new(NullController.Instance.Definition);
|
||||
AutoFireController = nullAutofireController;
|
||||
}
|
||||
|
||||
public void SyncControls(IEmulator emulator, IMovieSession session, Config config)
|
||||
{
|
||||
var def = emulator.ControllerDefinition;
|
||||
|
|
|
@ -459,8 +459,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
);
|
||||
InitControls();
|
||||
|
||||
InputManager.ActiveController = new Controller(NullController.Instance.Definition);
|
||||
InputManager.AutoFireController = _autofireNullControls;
|
||||
InputManager.ResetMainControllers(_autofireNullControls);
|
||||
InputManager.AutofireStickyXorAdapter.SetOnOffPatternFromConfig(Config.AutofireOn, Config.AutofireOff);
|
||||
try
|
||||
{
|
||||
|
@ -4036,8 +4035,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
CheatList.SaveOnClose();
|
||||
Emulator.Dispose();
|
||||
Emulator = new NullEmulator();
|
||||
InputManager.ActiveController = new Controller(NullController.Instance.Definition);
|
||||
InputManager.AutoFireController = _autofireNullControls;
|
||||
InputManager.ResetMainControllers(_autofireNullControls);
|
||||
RewireSound();
|
||||
RebootStatusBarIcon.Visible = false;
|
||||
GameIsClosing = false;
|
||||
|
|
Loading…
Reference in New Issue