move InputManager from Global to GlobalWin
This commit is contained in:
parent
71cb4fbdb0
commit
acd928afa5
|
@ -2,6 +2,6 @@
|
|||
{
|
||||
public static class Global
|
||||
{
|
||||
public static InputManager InputManager { get; } = new InputManager();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -243,13 +243,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
if (joypad.Inputs == 0)
|
||||
{
|
||||
Global.InputManager.AutofireStickyXorAdapter.ClearStickies();
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.ClearStickies();
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var button in JoypadButtonsArray.Where(button => joypad.Inputs.HasFlag(button)))
|
||||
{
|
||||
Global.InputManager.AutofireStickyXorAdapter.SetSticky(
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.SetSticky(
|
||||
RunningSystem == SystemInfo.GB
|
||||
? $"{JoypadConverter.ConvertBack(button, RunningSystem)}"
|
||||
: $"P{player} {JoypadConverter.ConvertBack(button, RunningSystem)}",
|
||||
|
@ -263,8 +263,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
for (var i = 1; i <= RunningSystem.MaxControllers; i++)
|
||||
{
|
||||
Global.InputManager.AutofireStickyXorAdapter.SetAxis($"P{i} X Axis", _allJoyPads[i - 1].AnalogX);
|
||||
Global.InputManager.AutofireStickyXorAdapter.SetAxis($"P{i} Y Axis", _allJoyPads[i - 1].AnalogY);
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.SetAxis($"P{i} X Axis", _allJoyPads[i - 1].AnalogX);
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.SetAxis($"P{i} Y Axis", _allJoyPads[i - 1].AnalogY);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -281,7 +281,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// </summary>
|
||||
private static void GetAllInputs()
|
||||
{
|
||||
var joypadAdapter = Global.InputManager.AutofireStickyXorAdapter;
|
||||
var joypadAdapter = GlobalWin.InputManager.AutofireStickyXorAdapter;
|
||||
|
||||
var pressedButtons = joypadAdapter.Definition.BoolButtons.Where(b => joypadAdapter.IsPressed(b));
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
public Dictionary<string, bool> Get()
|
||||
{
|
||||
var buttons = new Dictionary<string, bool>();
|
||||
foreach (var kvp in Global.InputManager.ControllerInputCoalescer.BoolButtons().Where(kvp => kvp.Value)) buttons[kvp.Key] = true;
|
||||
foreach (var kvp in GlobalWin.InputManager.ControllerInputCoalescer.BoolButtons().Where(kvp => kvp.Value)) buttons[kvp.Key] = true;
|
||||
return buttons;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,12 +18,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public IDictionary<string, object> Get(int? controller = null)
|
||||
{
|
||||
return Global.InputManager.AutofireStickyXorAdapter.ToDictionary(controller);
|
||||
return GlobalWin.InputManager.AutofireStickyXorAdapter.ToDictionary(controller);
|
||||
}
|
||||
|
||||
public IDictionary<string, object> GetImmediate(int? controller = null)
|
||||
{
|
||||
return Global.InputManager.ActiveController.ToDictionary(controller);
|
||||
return GlobalWin.InputManager.ActiveController.ToDictionary(controller);
|
||||
}
|
||||
|
||||
public void SetFromMnemonicStr(string inputLogEntry)
|
||||
|
@ -38,15 +38,15 @@ namespace BizHawk.Client.EmuHawk
|
|||
LogCallback($"invalid mnemonic string: {inputLogEntry}");
|
||||
return;
|
||||
}
|
||||
foreach (var button in controller.Definition.BoolButtons) Global.InputManager.ButtonOverrideAdapter.SetButton(button, controller.IsPressed(button));
|
||||
foreach (var axis in controller.Definition.AxisControls) Global.InputManager.ButtonOverrideAdapter.SetAxis(axis, controller.AxisValue(axis));
|
||||
foreach (var button in controller.Definition.BoolButtons) GlobalWin.InputManager.ButtonOverrideAdapter.SetButton(button, controller.IsPressed(button));
|
||||
foreach (var axis in controller.Definition.AxisControls) GlobalWin.InputManager.ButtonOverrideAdapter.SetAxis(axis, controller.AxisValue(axis));
|
||||
}
|
||||
|
||||
public void Set(Dictionary<string, bool> buttons, int? controller = null)
|
||||
{
|
||||
// If a controller is specified, we need to iterate over unique button names. If not, we iterate over
|
||||
// ALL button names with P{controller} prefixes
|
||||
foreach (var button in Global.InputManager.ActiveController.ToBoolButtonNameList(controller))
|
||||
foreach (var button in GlobalWin.InputManager.ActiveController.ToBoolButtonNameList(controller))
|
||||
{
|
||||
Set(button, buttons.TryGetValue(button, out var state) ? state : (bool?) null, controller);
|
||||
}
|
||||
|
@ -57,9 +57,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
try
|
||||
{
|
||||
var buttonToSet = controller == null ? button : $"P{controller} {button}";
|
||||
if (state == null) Global.InputManager.ButtonOverrideAdapter.UnSet(buttonToSet);
|
||||
else Global.InputManager.ButtonOverrideAdapter.SetButton(buttonToSet, state.Value);
|
||||
Global.InputManager.ActiveController.Overrides(Global.InputManager.ButtonOverrideAdapter);
|
||||
if (state == null) GlobalWin.InputManager.ButtonOverrideAdapter.UnSet(buttonToSet);
|
||||
else GlobalWin.InputManager.ButtonOverrideAdapter.SetButton(buttonToSet, state.Value);
|
||||
GlobalWin.InputManager.ActiveController.Overrides(GlobalWin.InputManager.ButtonOverrideAdapter);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
try
|
||||
{
|
||||
Global.InputManager.StickyXorAdapter.SetAxis(controller == null ? control : $"P{controller} {control}", value == null ? (int?) null : (int) value.Value); // the time for changing the API will come --yoshi
|
||||
GlobalWin.InputManager.StickyXorAdapter.SetAxis(controller == null ? control : $"P{controller} {control}", value == null ? (int?) null : (int) value.Value); // the time for changing the API will come --yoshi
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
@ -193,7 +193,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public string InputStrImmediate()
|
||||
{
|
||||
return MakeStringFor(Global.InputManager.AutofireStickyXorAdapter);
|
||||
return MakeStringFor(GlobalWin.InputManager.AutofireStickyXorAdapter);
|
||||
}
|
||||
|
||||
public string InputPrevious()
|
||||
|
@ -212,7 +212,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public string InputStrOrAll()
|
||||
{
|
||||
IController m = Global.InputManager.AutofireStickyXorAdapter;
|
||||
IController m = GlobalWin.InputManager.AutofireStickyXorAdapter;
|
||||
|
||||
if (GlobalWin.MovieSession.Movie.IsPlayingOrRecording() && GlobalWin.Emulator.Frame > 0)
|
||||
{
|
||||
|
@ -235,7 +235,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
? GlobalWin.MovieSession.Movie.GetInputState(GlobalWin.Emulator.Frame - 1)
|
||||
: GlobalWin.MovieSession.MovieController;
|
||||
|
||||
return MakeStringFor(Global.InputManager.AutofireStickyXorAdapter.And(m));
|
||||
return MakeStringFor(GlobalWin.InputManager.AutofireStickyXorAdapter.And(m));
|
||||
}
|
||||
|
||||
return "";
|
||||
|
@ -311,7 +311,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
// basically we're tinting whatever is pressed because it's sticky specially
|
||||
// in order to achieve this we want to avoid drawing anything pink that isn't actually held down right now
|
||||
// so we make an AND adapter and combine it using immediate & sticky
|
||||
var autoString = MakeStringFor(Global.InputManager.StickyXorAdapter.Source.Xor(Global.InputManager.AutofireStickyXorAdapter).And(Global.InputManager.AutofireStickyXorAdapter));
|
||||
var autoString = MakeStringFor(GlobalWin.InputManager.StickyXorAdapter.Source.Xor(GlobalWin.InputManager.AutofireStickyXorAdapter).And(GlobalWin.InputManager.AutofireStickyXorAdapter));
|
||||
g.DrawString(autoString, MessageFont, autoColor, point.X, point.Y);
|
||||
|
||||
//recolor everything that's changed from the previous input
|
||||
|
@ -346,16 +346,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
DrawOsdMessage(g, rerecordCount, FixedMessagesColor, point.X, point.Y);
|
||||
}
|
||||
|
||||
if (Global.InputManager.ClientControls["Autohold"] || Global.InputManager.ClientControls["Autofire"])
|
||||
if (GlobalWin.InputManager.ClientControls["Autohold"] || GlobalWin.InputManager.ClientControls["Autofire"])
|
||||
{
|
||||
var sb = new StringBuilder("Held: ");
|
||||
|
||||
foreach (string sticky in Global.InputManager.StickyXorAdapter.CurrentStickies)
|
||||
foreach (string sticky in GlobalWin.InputManager.StickyXorAdapter.CurrentStickies)
|
||||
{
|
||||
sb.Append(sticky).Append(' ');
|
||||
}
|
||||
|
||||
foreach (string autoSticky in Global.InputManager.AutofireStickyXorAdapter.CurrentStickies)
|
||||
foreach (string autoSticky in GlobalWin.InputManager.AutofireStickyXorAdapter.CurrentStickies)
|
||||
{
|
||||
sb
|
||||
.Append("Auto-")
|
||||
|
|
|
@ -46,5 +46,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
public static FirmwareManager FirmwareManager { get; set; }
|
||||
public static GameInfo Game { get; set; }
|
||||
public static IMovieSession MovieSession { get; set; }
|
||||
public static InputManager InputManager { get; } = new InputManager();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -278,7 +278,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
GlobalWin.MainForm = this;
|
||||
Rewinder = new Rewinder();
|
||||
|
||||
Global.InputManager.ControllerInputCoalescer = new ControllerInputCoalescer();
|
||||
GlobalWin.InputManager.ControllerInputCoalescer = new ControllerInputCoalescer();
|
||||
GlobalWin.FirmwareManager = new FirmwareManager();
|
||||
MovieSession = new MovieSession(
|
||||
Config.Movies,
|
||||
|
@ -391,9 +391,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
Input.Instance.Adapter.FirstInitAll(Handle);
|
||||
InitControls();
|
||||
|
||||
Global.InputManager.ActiveController = new Controller(NullController.Instance.Definition);
|
||||
Global.InputManager.AutoFireController = _autofireNullControls;
|
||||
Global.InputManager.AutofireStickyXorAdapter.SetOnOffPatternFromConfig(Config.AutofireOn, Config.AutofireOff);
|
||||
GlobalWin.InputManager.ActiveController = new Controller(NullController.Instance.Definition);
|
||||
GlobalWin.InputManager.AutoFireController = _autofireNullControls;
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.SetOnOffPatternFromConfig(Config.AutofireOn, Config.AutofireOff);
|
||||
try
|
||||
{
|
||||
GlobalWin.Sound = new Sound(Handle);
|
||||
|
@ -633,26 +633,26 @@ namespace BizHawk.Client.EmuHawk
|
|||
ProcessInput();
|
||||
InputManager.ClientControls.LatchFromPhysical(_hotkeyCoalescer);
|
||||
|
||||
Global.InputManager.ActiveController.LatchFromPhysical(Global.InputManager.ControllerInputCoalescer);
|
||||
GlobalWin.InputManager.ActiveController.LatchFromPhysical(GlobalWin.InputManager.ControllerInputCoalescer);
|
||||
|
||||
Global.InputManager.ActiveController.ApplyAxisConstraints(
|
||||
GlobalWin.InputManager.ActiveController.ApplyAxisConstraints(
|
||||
(Emulator is N64 && Config.N64UseCircularAnalogConstraint) ? "Natural Circle" : null);
|
||||
|
||||
Global.InputManager.ActiveController.OR_FromLogical(InputManager.ClickyVirtualPadController);
|
||||
InputManager.AutoFireController.LatchFromPhysical(Global.InputManager.ControllerInputCoalescer);
|
||||
GlobalWin.InputManager.ActiveController.OR_FromLogical(InputManager.ClickyVirtualPadController);
|
||||
InputManager.AutoFireController.LatchFromPhysical(GlobalWin.InputManager.ControllerInputCoalescer);
|
||||
|
||||
if (InputManager.ClientControls["Autohold"])
|
||||
{
|
||||
Global.InputManager.StickyXorAdapter.MassToggleStickyState(Global.InputManager.ActiveController.PressedButtons);
|
||||
Global.InputManager.AutofireStickyXorAdapter.MassToggleStickyState(InputManager.AutoFireController.PressedButtons);
|
||||
GlobalWin.InputManager.StickyXorAdapter.MassToggleStickyState(GlobalWin.InputManager.ActiveController.PressedButtons);
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.MassToggleStickyState(InputManager.AutoFireController.PressedButtons);
|
||||
}
|
||||
else if (InputManager.ClientControls["Autofire"])
|
||||
{
|
||||
Global.InputManager.AutofireStickyXorAdapter.MassToggleStickyState(Global.InputManager.ActiveController.PressedButtons);
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.MassToggleStickyState(GlobalWin.InputManager.ActiveController.PressedButtons);
|
||||
}
|
||||
|
||||
// autohold/autofire must not be affected by the following inputs
|
||||
Global.InputManager.ActiveController.Overrides(Global.InputManager.ButtonOverrideAdapter);
|
||||
GlobalWin.InputManager.ActiveController.Overrides(GlobalWin.InputManager.ButtonOverrideAdapter);
|
||||
|
||||
if (Tools.Has<LuaConsole>())
|
||||
{
|
||||
|
@ -799,8 +799,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public void ClearHolds()
|
||||
{
|
||||
Global.InputManager.StickyXorAdapter.ClearStickies();
|
||||
Global.InputManager.AutofireStickyXorAdapter.ClearStickies();
|
||||
GlobalWin.InputManager.StickyXorAdapter.ClearStickies();
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.ClearStickies();
|
||||
|
||||
if (Tools.Has<VirtualpadTool>())
|
||||
{
|
||||
|
@ -867,7 +867,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
private InputManager InputManager => Global.InputManager;
|
||||
private InputManager InputManager => GlobalWin.InputManager;
|
||||
|
||||
private IVideoProvider _currentVideoProvider = NullVideo.Instance;
|
||||
|
||||
|
@ -915,7 +915,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void ProcessInput()
|
||||
{
|
||||
var conInput = (ControllerInputCoalescer)Global.InputManager.ControllerInputCoalescer;
|
||||
var conInput = (ControllerInputCoalescer)GlobalWin.InputManager.ControllerInputCoalescer;
|
||||
|
||||
for (; ; )
|
||||
{
|
||||
|
@ -981,7 +981,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
break;
|
||||
case 1: // Input overrides Hotkeys
|
||||
conInput.Receive(ie);
|
||||
if (!Global.InputManager.ActiveController.HasBinding(ie.LogicalButton.ToString()))
|
||||
if (!GlobalWin.InputManager.ActiveController.HasBinding(ie.LogicalButton.ToString()))
|
||||
{
|
||||
handled = false;
|
||||
if (ie.EventType == Input.InputEventType.Press)
|
||||
|
@ -1225,7 +1225,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
// prohibit this operation if the current controls include LMouse
|
||||
if (allowSuppress)
|
||||
{
|
||||
if (Global.InputManager.ActiveController.HasBinding("WMouse L"))
|
||||
if (GlobalWin.InputManager.ActiveController.HasBinding("WMouse L"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -2023,7 +2023,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
controls.BindMulti(b.DisplayName, b.Bindings);
|
||||
}
|
||||
|
||||
Global.InputManager.ClientControls = controls;
|
||||
GlobalWin.InputManager.ClientControls = controls;
|
||||
_autofireNullControls = new AutofireController(
|
||||
Emulator,
|
||||
Config.AutofireOn,
|
||||
|
@ -2949,7 +2949,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
// zero 03-may-2014 - moved this before call to UpdateToolsBefore(), since it seems to clear the state which a lua event.framestart is going to want to alter
|
||||
InputManager.ClickyVirtualPadController.FrameTick();
|
||||
Global.InputManager.ButtonOverrideAdapter.FrameTick();
|
||||
GlobalWin.InputManager.ButtonOverrideAdapter.FrameTick();
|
||||
|
||||
if (IsTurboing)
|
||||
{
|
||||
|
@ -3007,7 +3007,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
bool render = !InvisibleEmulation && (!_throttle.skipNextFrame || (_currAviWriter?.UsesVideo ?? false));
|
||||
bool newFrame = Emulator.FrameAdvance(Global.InputManager.ControllerOutput, render, renderSound);
|
||||
bool newFrame = Emulator.FrameAdvance(GlobalWin.InputManager.ControllerOutput, render, renderSound);
|
||||
|
||||
MovieSession.HandleFrameAfter();
|
||||
|
||||
|
@ -3028,7 +3028,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
InputManager.AutoFireController.IncrementStarts();
|
||||
}
|
||||
|
||||
Global.InputManager.AutofireStickyXorAdapter.IncrementLoops(IsLagFrame);
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.IncrementLoops(IsLagFrame);
|
||||
|
||||
PressFrameAdvance = false;
|
||||
|
||||
|
@ -3826,9 +3826,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
Rewinder.Initialize(Emulator.AsStatable(), Config.Rewind);
|
||||
}
|
||||
|
||||
Global.InputManager.StickyXorAdapter.ClearStickies();
|
||||
Global.InputManager.StickyXorAdapter.ClearStickyAxes();
|
||||
Global.InputManager.AutofireStickyXorAdapter.ClearStickies();
|
||||
GlobalWin.InputManager.StickyXorAdapter.ClearStickies();
|
||||
GlobalWin.InputManager.StickyXorAdapter.ClearStickyAxes();
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.ClearStickies();
|
||||
|
||||
RewireSound();
|
||||
Tools.UpdateCheatRelatedTools(null, null);
|
||||
|
@ -3950,8 +3950,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
Emulator.Dispose();
|
||||
Emulator = new NullEmulator();
|
||||
ClientApi.UpdateEmulatorAndVP(Emulator);
|
||||
Global.InputManager.ActiveController = new Controller(NullController.Instance.Definition);
|
||||
Global.InputManager.AutoFireController = _autofireNullControls;
|
||||
GlobalWin.InputManager.ActiveController = new Controller(NullController.Instance.Definition);
|
||||
GlobalWin.InputManager.AutoFireController = _autofireNullControls;
|
||||
RewireSound();
|
||||
RebootStatusBarIcon.Visible = false;
|
||||
GameIsClosing = false;
|
||||
|
|
|
@ -740,7 +740,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
foreach (var button in controller.Definition.BoolButtons)
|
||||
{
|
||||
// TODO: make an input adapter specifically for the bot?
|
||||
Global.InputManager.ButtonOverrideAdapter.SetButton(button, controller.IsPressed(button));
|
||||
GlobalWin.InputManager.ButtonOverrideAdapter.SetButton(button, controller.IsPressed(button));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -878,7 +878,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
double probability = _cachedControlProbabilities[button];
|
||||
bool pressed = !(rand.Next(100) < probability);
|
||||
|
||||
Global.InputManager.ClickyVirtualPadController.SetBool(button, pressed);
|
||||
GlobalWin.InputManager.ClickyVirtualPadController.SetBool(button, pressed);
|
||||
}
|
||||
|
||||
_currentBotAttempt.Log.Add(_logGenerator.GenerateLogEntry());
|
||||
|
@ -931,7 +931,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
UpdateBotStatusIcon();
|
||||
MessageLabel.Text = "Running...";
|
||||
_cachedControlProbabilities = ControlProbabilities;
|
||||
_logGenerator = MovieSession.Movie.LogGeneratorInstance(Global.InputManager.ClickyVirtualPadController);
|
||||
_logGenerator = MovieSession.Movie.LogGeneratorInstance(GlobalWin.InputManager.ClickyVirtualPadController);
|
||||
}
|
||||
|
||||
private string CanStart()
|
||||
|
|
|
@ -460,7 +460,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
AutoPatternBool p = BoolPatterns[index];
|
||||
Global.InputManager.AutofireStickyXorAdapter.SetSticky(button, isOn.Value, p);
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.SetSticky(button, isOn.Value, p);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -480,7 +480,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
AutoPatternAxis p = AxisPatterns[index];
|
||||
Global.InputManager.AutofireStickyXorAdapter.SetAxis(button, value, p);
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.SetAxis(button, value, p);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -471,7 +471,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
foreach (var column in TasView.VisibleColumns)
|
||||
{
|
||||
if (Global.InputManager.StickyXorAdapter.IsSticky(column.Name))
|
||||
if (GlobalWin.InputManager.StickyXorAdapter.IsSticky(column.Name))
|
||||
{
|
||||
column.Emphasis = true;
|
||||
}
|
||||
|
|
|
@ -32,12 +32,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
foreach (var button in controller.Definition.BoolButtons)
|
||||
{
|
||||
Global.InputManager.ButtonOverrideAdapter.SetButton(button, controller.IsPressed(button));
|
||||
GlobalWin.InputManager.ButtonOverrideAdapter.SetButton(button, controller.IsPressed(button));
|
||||
}
|
||||
|
||||
foreach (var floatButton in controller.Definition.AxisControls)
|
||||
{
|
||||
Global.InputManager.ButtonOverrideAdapter.SetAxis(floatButton, controller.AxisValue(floatButton));
|
||||
GlobalWin.InputManager.ButtonOverrideAdapter.SetAxis(floatButton, controller.AxisValue(floatButton));
|
||||
}
|
||||
|
||||
return controller;
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void KeyClick(string name)
|
||||
{
|
||||
Global.InputManager.ClickyVirtualPadController.Click(name);
|
||||
GlobalWin.InputManager.ClickyVirtualPadController.Click(name);
|
||||
}
|
||||
|
||||
public void Restart()
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public void UpdateValues()
|
||||
{
|
||||
if (AnalogTrackBar.Value != (int)Global.InputManager.StickyXorAdapter.AxisValue(Name))
|
||||
if (AnalogTrackBar.Value != (int)GlobalWin.InputManager.StickyXorAdapter.AxisValue(Name))
|
||||
{
|
||||
RefreshWidgets();
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public void Clear()
|
||||
{
|
||||
Global.InputManager.StickyXorAdapter.Unset(Name);
|
||||
GlobalWin.InputManager.StickyXorAdapter.Unset(Name);
|
||||
IsSet = false;
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (!_programmaticallyChangingValue)
|
||||
{
|
||||
CurrentValue = AnalogTrackBar.Value;
|
||||
Global.InputManager.StickyXorAdapter.SetAxis(Name, AnalogTrackBar.Value);
|
||||
GlobalWin.InputManager.StickyXorAdapter.SetAxis(Name, AnalogTrackBar.Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (!_isSet)
|
||||
{
|
||||
_programmaticallyChangingValue = true;
|
||||
AnalogTrackBar.Value = (int)Global.InputManager.StickyXorAdapter.AxisValue(Name);
|
||||
AnalogTrackBar.Value = (int)GlobalWin.InputManager.StickyXorAdapter.AxisValue(Name);
|
||||
ValueLabel.Text = AnalogTrackBar.Value.ToString();
|
||||
_programmaticallyChangingValue = false;
|
||||
}
|
||||
|
|
|
@ -78,10 +78,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
manualR.Value = 0;
|
||||
manualTheta.Value = 0;
|
||||
//see HOOMOO
|
||||
Global.InputManager.AutofireStickyXorAdapter.SetSticky(AnalogStick.XName, false);
|
||||
Global.InputManager.StickyXorAdapter.Unset(AnalogStick.XName);
|
||||
Global.InputManager.AutofireStickyXorAdapter.SetSticky(AnalogStick.YName, false);
|
||||
Global.InputManager.StickyXorAdapter.Unset(AnalogStick.YName);
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.SetSticky(AnalogStick.XName, false);
|
||||
GlobalWin.InputManager.StickyXorAdapter.Unset(AnalogStick.XName);
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.SetSticky(AnalogStick.YName, false);
|
||||
GlobalWin.InputManager.StickyXorAdapter.Unset(AnalogStick.YName);
|
||||
AnalogStick.HasValue = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
RightClicked = false;
|
||||
Checked = false;
|
||||
//HOOMOO
|
||||
Global.InputManager.AutofireStickyXorAdapter.SetSticky(Name, false);
|
||||
Global.InputManager.StickyXorAdapter.SetSticky(Name, false);
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.SetSticky(Name, false);
|
||||
GlobalWin.InputManager.StickyXorAdapter.SetSticky(Name, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (RightClicked)
|
||||
{
|
||||
Global.InputManager.AutofireStickyXorAdapter.SetSticky(Name, Checked);
|
||||
GlobalWin.InputManager.AutofireStickyXorAdapter.SetSticky(Name, Checked);
|
||||
|
||||
if (Checked == false)
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
else
|
||||
{
|
||||
Global.InputManager.StickyXorAdapter.SetSticky(Name, Checked);
|
||||
GlobalWin.InputManager.StickyXorAdapter.SetSticky(Name, Checked);
|
||||
|
||||
if (Checked == false)
|
||||
{
|
||||
|
|
|
@ -133,7 +133,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private void lvDiscs_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// emergency measure: if no selection, set no disc
|
||||
Global.InputManager.StickyXorAdapter.SetAxis(_discSelectName, lvDiscs.SelectedIndices.Count == 0 ? 0 : lvDiscs.SelectedIndices[0]);
|
||||
GlobalWin.InputManager.StickyXorAdapter.SetAxis(_discSelectName, lvDiscs.SelectedIndices.Count == 0 ? 0 : lvDiscs.SelectedIndices[0]);
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -39,8 +39,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public void Clear()
|
||||
{
|
||||
Global.InputManager.StickyXorAdapter.Unset(XName);
|
||||
Global.InputManager.StickyXorAdapter.Unset(YName);
|
||||
GlobalWin.InputManager.StickyXorAdapter.Unset(XName);
|
||||
GlobalWin.InputManager.StickyXorAdapter.Unset(YName);
|
||||
_overrideX = null;
|
||||
_overrideY = null;
|
||||
_isSet = false;
|
||||
|
@ -160,7 +160,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public int X
|
||||
{
|
||||
get => _overrideX ?? (int)(Global.InputManager.StickyXorAdapter.AxisValue(XName) / MultiplierX);
|
||||
get => _overrideX ?? (int)(GlobalWin.InputManager.StickyXorAdapter.AxisValue(XName) / MultiplierX);
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
|
@ -177,13 +177,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
XNumeric.Value = XNumeric.Maximum;
|
||||
}
|
||||
|
||||
Global.InputManager.StickyXorAdapter.SetAxis(XName, (int)((float)XNumeric.Value * MultiplierX));
|
||||
GlobalWin.InputManager.StickyXorAdapter.SetAxis(XName, (int)((float)XNumeric.Value * MultiplierX));
|
||||
_isSet = true;
|
||||
}
|
||||
}
|
||||
public int Y
|
||||
{
|
||||
get => _overrideY ?? (int)(Global.InputManager.StickyXorAdapter.AxisValue(YName) / MultiplierY);
|
||||
get => _overrideY ?? (int)(GlobalWin.InputManager.StickyXorAdapter.AxisValue(YName) / MultiplierY);
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
|
@ -199,7 +199,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
YNumeric.Value = YNumeric.Maximum;
|
||||
}
|
||||
|
||||
Global.InputManager.StickyXorAdapter.SetAxis(YName, (int)((float)YNumeric.Value * MultiplierY));
|
||||
GlobalWin.InputManager.StickyXorAdapter.SetAxis(YName, (int)((float)YNumeric.Value * MultiplierY));
|
||||
_isSet = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -164,8 +164,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void SetAnalog()
|
||||
{
|
||||
Global.InputManager.StickyXorAdapter.SetAxis(XName, HasValue ? X : (int?)null);
|
||||
Global.InputManager.StickyXorAdapter.SetAxis(YName, HasValue ? Y : (int?)null);
|
||||
GlobalWin.InputManager.StickyXorAdapter.SetAxis(XName, HasValue ? X : (int?)null);
|
||||
GlobalWin.InputManager.StickyXorAdapter.SetAxis(YName, HasValue ? Y : (int?)null);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue