make virtual pad control clearing autoholds

ClearStickies clears buttons and axes, but the virtualpad tool wants to control whether only buttons are cleared.
also contains minor cleanups regarding related function calls.
This commit is contained in:
Morilli 2024-09-20 13:06:31 +02:00
parent 5b3daed6e8
commit b1eebd9abb
1 changed files with 7 additions and 8 deletions

View File

@ -571,8 +571,6 @@ namespace BizHawk.Client.EmuHawk
);
InitControls();
InputManager.ResetMainControllers(_autofireNullControls);
InputManager.AutofireStickyXorAdapter.SetOnOffPatternFromConfig(Config.AutofireOn, Config.AutofireOff);
var savedOutputMethod = Config.SoundOutputMethod;
if (savedOutputMethod is ESoundOutputMethod.Dummy) Config.SoundOutputMethod = HostCapabilityDetector.HasXAudio2 ? ESoundOutputMethod.XAudio2 : ESoundOutputMethod.OpenAL;
try
@ -594,6 +592,7 @@ namespace BizHawk.Client.EmuHawk
}
Sound.StartSound();
InputManager.AutofireStickyXorAdapter.SetOnOffPatternFromConfig(Config.AutofireOn, Config.AutofireOff);
InputManager.SyncControls(Emulator, MovieSession, Config);
CheatList = new CheatCollection(this, Config.Cheats);
CheatList.Changed += Tools.UpdateCheatRelatedTools;
@ -1032,13 +1031,15 @@ namespace BizHawk.Client.EmuHawk
public void ClearHolds()
{
InputManager.StickyXorAdapter.ClearStickies();
InputManager.AutofireStickyXorAdapter.ClearStickies();
if (Tools.Has<VirtualpadTool>())
{
Tools.VirtualPad.ClearVirtualPadHolds();
}
else
{
InputManager.StickyXorAdapter.ClearStickies();
InputManager.AutofireStickyXorAdapter.ClearStickies();
}
}
public void FlagNeedsReboot()
@ -3822,9 +3823,7 @@ namespace BizHawk.Client.EmuHawk
DisplayManager.Blank();
CreateRewinder();
InputManager.StickyXorAdapter.ClearStickies();
InputManager.StickyXorAdapter.ClearStickyAxes();
InputManager.AutofireStickyXorAdapter.ClearStickies();
ClearHolds();
RewireSound();
Tools.UpdateCheatRelatedTools(null, null);