Fix errors when using multiple special actions

This commit is contained in:
Travis Nickles 2017-04-06 18:16:12 -07:00
parent 6ae80efad4
commit 91f36e4297
4 changed files with 80 additions and 71 deletions

View File

@ -2596,6 +2596,8 @@ namespace DS4Windows
else if (type == "BatteryCheck") else if (type == "BatteryCheck")
{ {
typeID = ActionTypeId.BatteryCheck; typeID = ActionTypeId.BatteryCheck;
string[] dets = details.Split('|');
this.details = string.Join(",", dets);
} }
else if (type == "MultiAction") else if (type == "MultiAction")
{ {

View File

@ -257,6 +257,10 @@
this.lbLSCurvePercent = new System.Windows.Forms.Label(); this.lbLSCurvePercent = new System.Windows.Forms.Label();
this.lbLSCurve = new System.Windows.Forms.Label(); this.lbLSCurve = new System.Windows.Forms.Label();
this.antiDeadzoneTabPage = new System.Windows.Forms.TabPage(); this.antiDeadzoneTabPage = new System.Windows.Forms.TabPage();
this.nUDR2AntiDead = new System.Windows.Forms.NumericUpDown();
this.label3 = new System.Windows.Forms.Label();
this.nUDL2AntiDead = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label();
this.nUDRSAntiDead = new System.Windows.Forms.NumericUpDown(); this.nUDRSAntiDead = new System.Windows.Forms.NumericUpDown();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.nUDLSAntiDead = new System.Windows.Forms.NumericUpDown(); this.nUDLSAntiDead = new System.Windows.Forms.NumericUpDown();
@ -307,10 +311,6 @@
this.shareToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.shareToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.alwaysOnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.alwaysOnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.nUDR2AntiDead = new System.Windows.Forms.NumericUpDown();
this.label3 = new System.Windows.Forms.Label();
this.nUDL2AntiDead = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label();
this.advColorDialog = new DS4Windows.AdvancedColorDialog(); this.advColorDialog = new DS4Windows.AdvancedColorDialog();
((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).BeginInit();
@ -372,6 +372,8 @@
((System.ComponentModel.ISupportInitialize)(this.nUDLSCurve)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSCurve)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDRSCurve)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSCurve)).BeginInit();
this.antiDeadzoneTabPage.SuspendLayout(); this.antiDeadzoneTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nUDR2AntiDead)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDL2AntiDead)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDRSAntiDead)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSAntiDead)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDLSAntiDead)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSAntiDead)).BeginInit();
this.fLPSettings.SuspendLayout(); this.fLPSettings.SuspendLayout();
@ -386,8 +388,6 @@
((System.ComponentModel.ISupportInitialize)(this.nUDSXS)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSXS)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).BeginInit();
this.cMGyroTriggers.SuspendLayout(); this.cMGyroTriggers.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nUDR2AntiDead)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDL2AntiDead)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// lowColorChooserButton // lowColorChooserButton
@ -2507,7 +2507,7 @@
this.lVActions.ShowItemToolTips = true; this.lVActions.ShowItemToolTips = true;
this.lVActions.UseCompatibleStateImageBehavior = false; this.lVActions.UseCompatibleStateImageBehavior = false;
this.lVActions.View = System.Windows.Forms.View.Details; this.lVActions.View = System.Windows.Forms.View.Details;
this.lVActions.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lVActions_ItemChecked); this.lVActions.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.lVActions_ItemCheck);
// //
// cHName // cHName
// //
@ -2657,6 +2657,50 @@
this.antiDeadzoneTabPage.Name = "antiDeadzoneTabPage"; this.antiDeadzoneTabPage.Name = "antiDeadzoneTabPage";
this.antiDeadzoneTabPage.UseVisualStyleBackColor = true; this.antiDeadzoneTabPage.UseVisualStyleBackColor = true;
// //
// nUDR2AntiDead
//
this.nUDR2AntiDead.DecimalPlaces = 2;
this.nUDR2AntiDead.Increment = new decimal(new int[] {
1,
0,
0,
65536});
resources.ApplyResources(this.nUDR2AntiDead, "nUDR2AntiDead");
this.nUDR2AntiDead.Maximum = new decimal(new int[] {
1,
0,
0,
0});
this.nUDR2AntiDead.Name = "nUDR2AntiDead";
this.nUDR2AntiDead.ValueChanged += new System.EventHandler(this.nUDR2AntiDead_ValueChanged);
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// nUDL2AntiDead
//
this.nUDL2AntiDead.DecimalPlaces = 2;
this.nUDL2AntiDead.Increment = new decimal(new int[] {
1,
0,
0,
65536});
resources.ApplyResources(this.nUDL2AntiDead, "nUDL2AntiDead");
this.nUDL2AntiDead.Maximum = new decimal(new int[] {
1,
0,
0,
0});
this.nUDL2AntiDead.Name = "nUDL2AntiDead";
this.nUDL2AntiDead.ValueChanged += new System.EventHandler(this.nUDL2AntiDead_ValueChanged);
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// nUDRSAntiDead // nUDRSAntiDead
// //
this.nUDRSAntiDead.DecimalPlaces = 2; this.nUDRSAntiDead.DecimalPlaces = 2;
@ -3204,50 +3248,6 @@
resources.ApplyResources(this.alwaysOnToolStripMenuItem, "alwaysOnToolStripMenuItem"); resources.ApplyResources(this.alwaysOnToolStripMenuItem, "alwaysOnToolStripMenuItem");
this.alwaysOnToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); this.alwaysOnToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged);
// //
// nUDR2AntiDead
//
this.nUDR2AntiDead.DecimalPlaces = 2;
this.nUDR2AntiDead.Increment = new decimal(new int[] {
1,
0,
0,
65536});
resources.ApplyResources(this.nUDR2AntiDead, "nUDR2AntiDead");
this.nUDR2AntiDead.Maximum = new decimal(new int[] {
1,
0,
0,
0});
this.nUDR2AntiDead.Name = "nUDR2AntiDead";
this.nUDR2AntiDead.ValueChanged += new System.EventHandler(this.nUDR2AntiDead_ValueChanged);
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// nUDL2AntiDead
//
this.nUDL2AntiDead.DecimalPlaces = 2;
this.nUDL2AntiDead.Increment = new decimal(new int[] {
1,
0,
0,
65536});
resources.ApplyResources(this.nUDL2AntiDead, "nUDL2AntiDead");
this.nUDL2AntiDead.Maximum = new decimal(new int[] {
1,
0,
0,
0});
this.nUDL2AntiDead.Name = "nUDL2AntiDead";
this.nUDL2AntiDead.ValueChanged += new System.EventHandler(this.nUDL2AntiDead_ValueChanged);
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// Options // Options
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
@ -3333,6 +3333,8 @@
((System.ComponentModel.ISupportInitialize)(this.nUDRSCurve)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSCurve)).EndInit();
this.antiDeadzoneTabPage.ResumeLayout(false); this.antiDeadzoneTabPage.ResumeLayout(false);
this.antiDeadzoneTabPage.PerformLayout(); this.antiDeadzoneTabPage.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nUDR2AntiDead)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDL2AntiDead)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDRSAntiDead)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSAntiDead)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDLSAntiDead)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSAntiDead)).EndInit();
this.fLPSettings.ResumeLayout(false); this.fLPSettings.ResumeLayout(false);
@ -3350,8 +3352,6 @@
((System.ComponentModel.ISupportInitialize)(this.nUDSXS)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSXS)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).EndInit();
this.cMGyroTriggers.ResumeLayout(false); this.cMGyroTriggers.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.nUDR2AntiDead)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDL2AntiDead)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }

View File

@ -27,6 +27,7 @@ namespace DS4Windows
private float dpiy; private float dpiy;
public Dictionary<string, string> defaults = new Dictionary<string, string>(); public Dictionary<string, string> defaults = new Dictionary<string, string>();
public bool saving, loading; public bool saving, loading;
public bool actionTabSeen = false;
public static Size mSize { get; private set; } public static Size mSize { get; private set; }
private Size settingsSize; private Size settingsSize;
public Options(DS4Form rt) public Options(DS4Form rt)
@ -1811,10 +1812,16 @@ namespace DS4Windows
private void tabControls_SelectedIndexChanged(object sender, EventArgs e) private void tabControls_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (tCControls.SelectedIndex == 2) int index = tCControls.SelectedIndex;
if (index == 2)
sixaxisTimer.Start(); sixaxisTimer.Start();
else else
sixaxisTimer.Stop(); sixaxisTimer.Stop();
if (index == 1)
{
actionTabSeen = true;
}
} }
private void DrawCircle(object sender, PaintEventArgs e) private void DrawCircle(object sender, PaintEventArgs e)
@ -2005,21 +2012,6 @@ namespace DS4Windows
} }
} }
private void lVActions_ItemChecked(object sender, ItemCheckedEventArgs e)
{
List<string> pactions = new List<string>();
foreach (ListViewItem lvi in lVActions.Items)
if (lvi != null && lvi.Checked)
pactions.Add(lvi.Text);
ProfileActions[device] = pactions;
calculateProfileActionCount(device);
calculateProfileActionDicts(device);
/*if (lVActions.Items.Count >= 50)
{
btnNewAction.Enabled = false;
}*/
}
private void nUDLSCurve_ValueChanged(object sender, EventArgs e) private void nUDLSCurve_ValueChanged(object sender, EventArgs e)
{ {
LSCurve[device] = (int)Math.Round(nUDLSCurve.Value, 0); LSCurve[device] = (int)Math.Round(nUDLSCurve.Value, 0);
@ -2401,6 +2393,21 @@ namespace DS4Windows
R2AntiDeadzone[device] = (int)(nUDR2AntiDead.Value * 100); R2AntiDeadzone[device] = (int)(nUDR2AntiDead.Value * 100);
} }
private void lVActions_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (actionTabSeen)
{
List<string> pactions = new List<string>();
foreach (ListViewItem lvi in lVActions.Items)
if (lvi != null && lvi.Checked)
pactions.Add(lvi.Text);
ProfileActions[device] = pactions;
calculateProfileActionCount(device);
calculateProfileActionDicts(device);
}
}
private void Options_Resize(object sender, EventArgs e) private void Options_Resize(object sender, EventArgs e)
{ {
fLPSettings.AutoScroll = false; fLPSettings.AutoScroll = false;

View File

@ -7514,7 +7514,7 @@ with profile</value>
<value>advColorDialog</value> <value>advColorDialog</value>
</data> </data>
<data name="&gt;&gt;advColorDialog.Type" xml:space="preserve"> <data name="&gt;&gt;advColorDialog.Type" xml:space="preserve">
<value>DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.55.0, Culture=neutral, PublicKeyToken=null</value> <value>DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.57.0, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;$this.Name" xml:space="preserve"> <data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>Options</value> <value>Options</value>