This commit is contained in:
mika-n 2019-10-06 19:08:01 +03:00
commit fe06f24399
6 changed files with 5245 additions and 1748 deletions

View File

@ -359,7 +359,7 @@ namespace DS4Windows
tempBool = true; tempBool = true;
for (int i = 0, arlen = disArray.Length; tempBool && i < arlen; i++) for (int i = 0, arlen = disArray.Length; tempBool && i < arlen; i++)
{ {
if (getDS4ControlsByName(disArray[i]) == false) if (disArray[i] == -1 || getDS4ControlsByName(disArray[i]) == false)
tempBool = false; tempBool = false;
} }

View File

@ -1895,8 +1895,8 @@ namespace DS4Windows
public bool[] useSAforMouse = new bool[5] { false, false, false, false, false }; public bool[] useSAforMouse = new bool[5] { false, false, false, false, false };
public GyroOutMode[] gyroOutMode = new GyroOutMode[5] { GyroOutMode.Controls, GyroOutMode.Controls, public GyroOutMode[] gyroOutMode = new GyroOutMode[5] { GyroOutMode.Controls, GyroOutMode.Controls,
GyroOutMode.Controls, GyroOutMode.Controls, GyroOutMode.Controls }; GyroOutMode.Controls, GyroOutMode.Controls, GyroOutMode.Controls };
public string[] sATriggers = new string[5] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; public string[] sATriggers = new string[5] { "-1", "-1", "-1", "-1", "-1" };
public string[] sAMouseStickTriggers = new string[5] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; public string[] sAMouseStickTriggers = new string[5] { "-1", "-1", "-1", "-1", "-1" };
public bool[] sATriggerCond = new bool[5] { true, true, true, true, true }; public bool[] sATriggerCond = new bool[5] { true, true, true, true, true };
public bool[] sAMouseStickTriggerCond = new bool[5] { true, true, true, true, true }; public bool[] sAMouseStickTriggerCond = new bool[5] { true, true, true, true, true };
public bool[] gyroMouseStickTriggerTurns = new bool[5] { true, true, true, true, true }; public bool[] gyroMouseStickTriggerTurns = new bool[5] { true, true, true, true, true };
@ -3148,7 +3148,7 @@ namespace DS4Windows
catch { gyroOutMode[device] = GyroOutMode.Controls; missingSetting = true; } catch { gyroOutMode[device] = GyroOutMode.Controls; missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SATriggers"); sATriggers[device] = Item.InnerText; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SATriggers"); sATriggers[device] = Item.InnerText; }
catch { sATriggers[device] = ""; missingSetting = true; } catch { sATriggers[device] = "-1"; missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SATriggerCond"); sATriggerCond[device] = SaTriggerCondValue(Item.InnerText); } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SATriggerCond"); sATriggerCond[device] = SaTriggerCondValue(Item.InnerText); }
catch { sATriggerCond[device] = true; missingSetting = true; } catch { sATriggerCond[device] = true; missingSetting = true; }
@ -3164,7 +3164,7 @@ namespace DS4Windows
catch { PortOldGyroSettings(device); missingSetting = true; } catch { PortOldGyroSettings(device); missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroMouseStickTriggers"); sAMouseStickTriggers[device] = Item.InnerText; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroMouseStickTriggers"); sAMouseStickTriggers[device] = Item.InnerText; }
catch { sAMouseStickTriggers[device] = ""; missingSetting = true; } catch { sAMouseStickTriggers[device] = "-1"; missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroMouseStickTriggerCond"); sAMouseStickTriggerCond[device] = SaTriggerCondValue(Item.InnerText); } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroMouseStickTriggerCond"); sAMouseStickTriggerCond[device] = SaTriggerCondValue(Item.InnerText); }
catch { sAMouseStickTriggerCond[device] = true; missingSetting = true; } catch { sAMouseStickTriggerCond[device] = true; missingSetting = true; }
@ -4613,10 +4613,10 @@ namespace DS4Windows
startTouchpadOff[device] = false; startTouchpadOff[device] = false;
useTPforControls[device] = false; useTPforControls[device] = false;
useSAforMouse[device] = false; useSAforMouse[device] = false;
sATriggers[device] = string.Empty; sATriggers[device] = "-1";
sATriggerCond[device] = true; sATriggerCond[device] = true;
gyroOutMode[device] = GyroOutMode.Controls; gyroOutMode[device] = GyroOutMode.Controls;
sAMouseStickTriggers[device] = string.Empty; sAMouseStickTriggers[device] = "-1";
sAMouseStickTriggerCond[device] = true; sAMouseStickTriggerCond[device] = true;
gyroMStickInfo[device].deadZone = 30; gyroMStickInfo[device].maxZone = 830; gyroMStickInfo[device].deadZone = 30; gyroMStickInfo[device].maxZone = 830;
gyroMStickInfo[device].antiDeadX = 0.4; gyroMStickInfo[device].antiDeadY = 0.4; gyroMStickInfo[device].antiDeadX = 0.4; gyroMStickInfo[device].antiDeadY = 0.4;

View File

@ -103,6 +103,7 @@ namespace DS4Windows.Forms
{ {
Global.FindConfigLocation(); Global.FindConfigLocation();
bool firstRun = Global.firstRun;
if (Global.firstRun) if (Global.firstRun)
{ {
new SaveWhere(Global.multisavespots).ShowDialog(); new SaveWhere(Global.multisavespots).ShowDialog();
@ -183,7 +184,7 @@ namespace DS4Windows.Forms
blankControllerTab(); blankControllerTab();
Directory.CreateDirectory(appdatapath); Directory.CreateDirectory(appdatapath);
if (!Save()) //if can't write to file if (firstRun && !Save()) //if can't write to file
{ {
if (MessageBox.Show("Cannot write at current location\nCopy Settings to appdata?", "DS4Windows", if (MessageBox.Show("Cannot write at current location\nCopy Settings to appdata?", "DS4Windows",
MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
@ -396,10 +397,14 @@ namespace DS4Windows.Forms
} }
} }
Form_Resize(null, null);
if (!(StartMinimized || mini))
{
Show();
}
this.Resize += Form_Resize; this.Resize += Form_Resize;
this.LocationChanged += TrackLocationChanged; this.LocationChanged += TrackLocationChanged;
if (!(StartMinimized || mini))
Form_Resize(null, null);
Program.CreateIPCClassNameMMF(this.Handle); Program.CreateIPCClassNameMMF(this.Handle);

View File

@ -644,6 +644,7 @@ namespace DS4Windows.Forms
cBTouchpadJitterCompensation.Checked = TouchpadJitterCompensation[device]; cBTouchpadJitterCompensation.Checked = TouchpadJitterCompensation[device];
tempInt = TouchpadInvert[device]; tempInt = TouchpadInvert[device];
// Array values are set up so Array.IndexOf call is not necessary
touchpadInvertComboBox.SelectedIndex = touchpadInvertToValue[tempInt]; touchpadInvertComboBox.SelectedIndex = touchpadInvertToValue[tempInt];
cBlowerRCOn.Checked = LowerRCOn[device]; cBlowerRCOn.Checked = LowerRCOn[device];
@ -2222,10 +2223,10 @@ namespace DS4Windows.Forms
lbGyroXP.Text = UpdateButtonList(bnGyroXP); lbGyroXP.Text = UpdateButtonList(bnGyroXP);
} }
private string UpdateButtonList(Button button, bool shift =false) private string UpdateButtonList(Button button, bool shift = false)
{ {
object tagO = GetDS4Action(device, button.Name, shift); object tagO = GetDS4Action(device, button.Name, shift);
bool SC = GetDS4KeyType(device, button.Name, false).HasFlag(DS4KeyType.ScanCode); bool SC = GetDS4KeyType(device, button.Name, shift).HasFlag(DS4KeyType.ScanCode);
bool extracontrol = button.Name.Contains("Gyro") || button.Name.Contains("Swipe"); bool extracontrol = button.Name.Contains("Gyro") || button.Name.Contains("Swipe");
if (tagO != null) if (tagO != null)
{ {

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,7 @@
# TODO # TODO
* Check Options save
* ~~Check TouchpadInvert setting~~
* Add cross dead zone (per axis) for sticks * Add cross dead zone (per axis) for sticks
* ~~Add more curve options~~ * ~~Add more curve options~~
* ~~Transition to use Visual Studio 2019~~ * ~~Transition to use Visual Studio 2019~~