Add null extras detection when opening button mapping window

This commit is contained in:
Travis Nickles 2017-03-28 18:41:17 -07:00
parent ac4017fea2
commit 5ad4e83b58
2 changed files with 56 additions and 46 deletions

View File

@ -716,7 +716,7 @@ namespace DS4Windows
static int[] oldmouse = new int[4] { -1, -1, -1, -1 };
public static void MapCustom(int device, DS4State cState, DS4State MappedState, DS4StateExposed eState, Mouse tp, ControlService ctrl)
{
/* TODO: This method is slow sauce. Find ways to speed up action execution */
MappedState.LX = 127;
MappedState.LY = 127;
MappedState.RX = 127;

View File

@ -509,7 +509,15 @@ namespace DS4Windows
}
}
}
string[] extras = Global.GetDS4Extra(device, button.Name, rBShiftModifer.Checked).Split(',');
string dcExtras = Global.GetDS4Extra(device, button.Name, rBShiftModifer.Checked);
string[] extras = null;
if (!string.IsNullOrEmpty(dcExtras))
{
extras = dcExtras.Split(',');
}
if (extras != null)
{
int b;
try
{
@ -558,6 +566,8 @@ namespace DS4Windows
nUDMouse.Value = 25;
cBMouse.Checked = false;
}
}
extraChanged = false;
}