a slight cleanup of the JoyPad.Set method to make it not so annoying to understand
This commit is contained in:
parent
00c243212d
commit
51f480901b
|
@ -102,57 +102,32 @@ namespace BizHawk.Client.Common
|
||||||
theValue = null;
|
theValue = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var toPress = button;
|
||||||
|
if (controller != null)
|
||||||
|
{
|
||||||
|
toPress = "P" + controller + " " + button;
|
||||||
|
}
|
||||||
|
|
||||||
if (!invert)
|
if (!invert)
|
||||||
{
|
{
|
||||||
if (theValue == true)
|
if (theValue == true) // Force On
|
||||||
{
|
{
|
||||||
if (controller == null) // Force On
|
Global.ClickyVirtualPadController.Click(button.ToString());
|
||||||
{
|
Global.ForceOffAdaptor.SetSticky(button.ToString(), false);
|
||||||
Global.ClickyVirtualPadController.Click(button.ToString());
|
|
||||||
Global.ForceOffAdaptor.SetSticky(button.ToString(), false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Global.ClickyVirtualPadController.Click("P" + controller + " " + button);
|
|
||||||
Global.ForceOffAdaptor.SetSticky("P" + controller + " " + button, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (theValue == false) // Force off
|
else if (theValue == false) // Force off
|
||||||
{
|
{
|
||||||
if (controller == null)
|
Global.ForceOffAdaptor.SetSticky(button.ToString(), true);
|
||||||
{
|
|
||||||
Global.ForceOffAdaptor.SetSticky(button.ToString(), true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Global.ForceOffAdaptor.SetSticky("P" + controller + " " + button, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Turn everything off
|
Global.ForceOffAdaptor.SetSticky(button.ToString(), false);
|
||||||
if (controller == null)
|
|
||||||
{
|
|
||||||
Global.ForceOffAdaptor.SetSticky(button.ToString(), false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Global.ForceOffAdaptor.SetSticky("P" + controller + " " + button, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // Inverse
|
else // Inverse
|
||||||
{
|
{
|
||||||
if (controller == null)
|
Global.StickyXORAdapter.SetSticky(button.ToString(), true);
|
||||||
{
|
Global.ForceOffAdaptor.SetSticky(button.ToString(), false);
|
||||||
Global.StickyXORAdapter.SetSticky(button.ToString(), true);
|
|
||||||
Global.ForceOffAdaptor.SetSticky(button.ToString(), false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Global.StickyXORAdapter.SetSticky("P" + controller + " " + button, true);
|
|
||||||
Global.ForceOffAdaptor.SetSticky("P" + controller + " " + button, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue