Minor tweaks

This commit is contained in:
Travis Nickles 2019-01-24 06:20:55 -06:00
parent 1a6327ecdc
commit 0d89170d9c

View File

@ -3475,15 +3475,12 @@ namespace DS4Windows
else
dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true);
List<DS4ControlSettings> ds4settingsList = ds4settings[deviceNum];
for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++)
int temp = (int)dc;
if (temp > 0)
{
DS4ControlSettings dcs = ds4settingsList[i];
if (dcs.control == dc)
{
dcs.UpdateSettings(shift, action, exts, kt, trigger);
break;
}
int index = temp - 1;
DS4ControlSettings dcs = ds4settings[deviceNum][index];
dcs.UpdateSettings(shift, action, exts, kt, trigger);
}
}
@ -3495,19 +3492,15 @@ namespace DS4Windows
else
dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true);
List<DS4ControlSettings> ds4settingsList = ds4settings[deviceNum];
for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++)
int temp = (int)dc;
if (temp > 0)
{
DS4ControlSettings dcs = ds4settingsList[i];
if (dcs.control == dc)
{
if (shift)
dcs.shiftExtras = exts;
else
dcs.extras = exts;
break;
}
int index = temp - 1;
DS4ControlSettings dcs = ds4settings[deviceNum][index];
if (shift)
dcs.shiftExtras = exts;
else
dcs.extras = exts;
}
}
@ -3519,19 +3512,15 @@ namespace DS4Windows
else
dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true);
List<DS4ControlSettings> ds4settingsList = ds4settings[deviceNum];
for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++)
int temp = (int)dc;
if (temp > 0)
{
DS4ControlSettings dcs = ds4settingsList[i];
if (dcs.control == dc)
{
if (shift)
dcs.shiftKeyType = keyType;
else
dcs.keyType = keyType;
break;
}
int index = temp - 1;
DS4ControlSettings dcs = ds4settings[deviceNum][index];
if (shift)
dcs.shiftKeyType = keyType;
else
dcs.keyType = keyType;
}
}
@ -3589,17 +3578,15 @@ namespace DS4Windows
else
dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true);
List<DS4ControlSettings> ds4settingsList = ds4settings[deviceNum];
for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++)
int temp = (int)dc;
if (temp > 0)
{
DS4ControlSettings dcs = ds4settingsList[i];
if (dcs.control == dc)
{
if (shift)
return dcs.shiftExtras;
else
return dcs.extras;
}
int index = temp - 1;
DS4ControlSettings dcs = ds4settings[deviceNum][index];
if (shift)
return dcs.shiftExtras;
else
return dcs.extras;
}
return null;
@ -3613,17 +3600,15 @@ namespace DS4Windows
else
dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true);
List<DS4ControlSettings> ds4settingsList = ds4settings[deviceNum];
for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++)
int temp = (int)dc;
if (temp > 0)
{
DS4ControlSettings dcs = ds4settingsList[i];
if (dcs.control == dc)
{
if (shift)
return dcs.shiftKeyType;
else
return dcs.keyType;
}
int index = temp - 1;
DS4ControlSettings dcs = ds4settings[deviceNum][index];
if (shift)
return dcs.shiftKeyType;
else
return dcs.keyType;
}
return DS4KeyType.None;
@ -3637,12 +3622,12 @@ namespace DS4Windows
else
dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true);
List<DS4ControlSettings> ds4settingsList = ds4settings[deviceNum];
for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++)
int temp = (int)dc;
if (temp > 0)
{
DS4ControlSettings dcs = ds4settingsList[i];
if (dcs.control == dc)
return dcs.shiftTrigger;
int index = temp - 1;
DS4ControlSettings dcs = ds4settings[deviceNum][index];
return dcs.shiftTrigger;
}
return 0;
@ -3669,12 +3654,12 @@ namespace DS4Windows
else
dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true);
List<DS4ControlSettings> ds4settingsList = ds4settings[deviceNum];
for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++)
int temp = (int)dc;
if (temp > 0)
{
DS4ControlSettings dcs = ds4settingsList[i];
if (dcs.control == dc)
return dcs;
int index = temp - 1;
DS4ControlSettings dcs = ds4settings[deviceNum][index];
return dcs;
}
return null;