mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-25 22:41:16 +01:00
Minor code tweaks. Change event handler usage for lVActions.
This commit is contained in:
parent
4be1829c91
commit
59d30bcf3a
1
DS4Windows/DS4Forms/Options.Designer.cs
generated
1
DS4Windows/DS4Forms/Options.Designer.cs
generated
@ -2556,7 +2556,6 @@
|
|||||||
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.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.lVActions_ItemCheck);
|
|
||||||
//
|
//
|
||||||
// cHName
|
// cHName
|
||||||
//
|
//
|
||||||
|
@ -3,10 +3,7 @@ using System.Drawing;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
|
||||||
using System.Xml;
|
|
||||||
using static DS4Windows.Global;
|
using static DS4Windows.Global;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace DS4Windows
|
namespace DS4Windows
|
||||||
{
|
{
|
||||||
@ -272,6 +269,8 @@ namespace DS4Windows
|
|||||||
if (device < 4)
|
if (device < 4)
|
||||||
nUDSixaxis.Value = deviceNum + 1;
|
nUDSixaxis.Value = deviceNum + 1;
|
||||||
|
|
||||||
|
lVActions.ItemCheck -= this.lVActions_ItemCheck;
|
||||||
|
|
||||||
if (filename != "")
|
if (filename != "")
|
||||||
{
|
{
|
||||||
if (device == 4) //if temp device is called
|
if (device == 4) //if temp device is called
|
||||||
@ -664,6 +663,7 @@ namespace DS4Windows
|
|||||||
|
|
||||||
UpdateLists();
|
UpdateLists();
|
||||||
LoadActions(string.IsNullOrEmpty(filename));
|
LoadActions(string.IsNullOrEmpty(filename));
|
||||||
|
lVActions.ItemCheck += new ItemCheckEventHandler(this.lVActions_ItemCheck);
|
||||||
loading = false;
|
loading = false;
|
||||||
saving = false;
|
saving = false;
|
||||||
}
|
}
|
||||||
@ -1304,6 +1304,7 @@ namespace DS4Windows
|
|||||||
ProfileActions[device] = pactions;
|
ProfileActions[device] = pactions;
|
||||||
calculateProfileActionCount(device);
|
calculateProfileActionCount(device);
|
||||||
calculateProfileActionDicts(device);
|
calculateProfileActionDicts(device);
|
||||||
|
cacheProfileCustomsFlags(device);
|
||||||
pnlTPMouse.Visible = rBTPMouse.Checked;
|
pnlTPMouse.Visible = rBTPMouse.Checked;
|
||||||
pnlSAMouse.Visible = rBSAMouse.Checked;
|
pnlSAMouse.Visible = rBSAMouse.Checked;
|
||||||
fLPTiltControls.Visible = rBSAControls.Checked;
|
fLPTiltControls.Visible = rBSAControls.Checked;
|
||||||
@ -1530,6 +1531,7 @@ namespace DS4Windows
|
|||||||
else if (300 <= hue && hue < 360) { R = C; B = X; }
|
else if (300 <= hue && hue < 360) { R = C; B = X; }
|
||||||
return Color.FromArgb((int)((R + m) * 255), (int)((G + m) * 255), (int)((B + m) * 255));
|
return Color.FromArgb((int)((R + m) * 255), (int)((G + m) * 255), (int)((B + m) * 255));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void rumbleBoostBar_ValueChanged(object sender, EventArgs e)
|
private void rumbleBoostBar_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (!loading)
|
if (!loading)
|
||||||
@ -1545,17 +1547,18 @@ namespace DS4Windows
|
|||||||
|
|
||||||
private void btnRumbleHeavyTest_Click(object sender, EventArgs e)
|
private void btnRumbleHeavyTest_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
DS4Device d = Program.rootHub.DS4Controllers[(int)nUDSixaxis.Value - 1];
|
int tempDeviceNum = (int)nUDSixaxis.Value - 1;
|
||||||
|
DS4Device d = Program.rootHub.DS4Controllers[tempDeviceNum];
|
||||||
if (d != null)
|
if (d != null)
|
||||||
{
|
{
|
||||||
if (((Button)sender).Text == Properties.Resources.TestHText)
|
if (((Button)sender).Text == Properties.Resources.TestHText)
|
||||||
{
|
{
|
||||||
Program.rootHub.setRumble((byte)Math.Min(255, (255 * nUDRumbleBoost.Value / 100)), d.RightLightFastRumble, (int)nUDSixaxis.Value - 1);
|
Program.rootHub.setRumble((byte)Math.Min(255, (255 * nUDRumbleBoost.Value / 100)), d.RightLightFastRumble, tempDeviceNum);
|
||||||
((Button)sender).Text = Properties.Resources.StopHText;
|
((Button)sender).Text = Properties.Resources.StopHText;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Program.rootHub.setRumble(0, d.RightLightFastRumble, (int)nUDSixaxis.Value - 1);
|
Program.rootHub.setRumble(0, d.RightLightFastRumble, tempDeviceNum);
|
||||||
((Button)sender).Text = Properties.Resources.TestHText;
|
((Button)sender).Text = Properties.Resources.TestHText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1563,17 +1566,18 @@ namespace DS4Windows
|
|||||||
|
|
||||||
private void btnRumbleLightTest_Click(object sender, EventArgs e)
|
private void btnRumbleLightTest_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
DS4Device d = Program.rootHub.DS4Controllers[(int)nUDSixaxis.Value - 1];
|
int tempDeviceNum = (int)nUDSixaxis.Value - 1;
|
||||||
|
DS4Device d = Program.rootHub.DS4Controllers[tempDeviceNum];
|
||||||
if (d != null)
|
if (d != null)
|
||||||
{
|
{
|
||||||
if (((Button)sender).Text == Properties.Resources.TestLText)
|
if (((Button)sender).Text == Properties.Resources.TestLText)
|
||||||
{
|
{
|
||||||
Program.rootHub.setRumble(d.LeftHeavySlowRumble, (byte)Math.Min(255, (255 * nUDRumbleBoost.Value / 100)), (int)nUDSixaxis.Value - 1);
|
Program.rootHub.setRumble(d.LeftHeavySlowRumble, (byte)Math.Min(255, (255 * nUDRumbleBoost.Value / 100)), tempDeviceNum);
|
||||||
((Button)sender).Text = Properties.Resources.StopLText;
|
((Button)sender).Text = Properties.Resources.StopLText;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Program.rootHub.setRumble(d.LeftHeavySlowRumble, 0, (int)nUDSixaxis.Value - 1);
|
Program.rootHub.setRumble(d.LeftHeavySlowRumble, 0, tempDeviceNum);
|
||||||
((Button)sender).Text = Properties.Resources.TestLText;
|
((Button)sender).Text = Properties.Resources.TestLText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1621,8 +1625,6 @@ namespace DS4Windows
|
|||||||
private void nUDIdleDisconnect_ValueChanged(object sender, EventArgs e)
|
private void nUDIdleDisconnect_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
IdleDisconnectTimeout[device] = (int)(nUDIdleDisconnect.Value * 60);
|
IdleDisconnectTimeout[device] = (int)(nUDIdleDisconnect.Value * 60);
|
||||||
//if (nUDIdleDisconnect.Value == 0)
|
|
||||||
//cBIdleDisconnect.Checked = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cBIdleDisconnect_CheckedChanged(object sender, EventArgs e)
|
private void cBIdleDisconnect_CheckedChanged(object sender, EventArgs e)
|
||||||
@ -1674,6 +1676,7 @@ namespace DS4Windows
|
|||||||
inputtimer.Stop();
|
inputtimer.Stop();
|
||||||
sixaxisTimer.Stop();
|
sixaxisTimer.Stop();
|
||||||
root.OptionsClosed();
|
root.OptionsClosed();
|
||||||
|
lVActions.ItemCheck -= this.lVActions_ItemCheck;
|
||||||
Visible = false;
|
Visible = false;
|
||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
}
|
}
|
||||||
@ -1870,8 +1873,9 @@ namespace DS4Windows
|
|||||||
|
|
||||||
private void numUDRainbow_ValueChanged(object sender, EventArgs e)
|
private void numUDRainbow_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Rainbow[device]= (double)nUDRainbow.Value;
|
double tempRainbow = (double)nUDRainbow.Value;
|
||||||
if ((double)nUDRainbow.Value <= 0.5)
|
Rainbow[device] = tempRainbow;
|
||||||
|
if (tempRainbow <= 0.5)
|
||||||
{
|
{
|
||||||
btnRainbow.Image = greyscale;
|
btnRainbow.Image = greyscale;
|
||||||
ToggleRainbow(false);
|
ToggleRainbow(false);
|
||||||
@ -2056,7 +2060,6 @@ namespace DS4Windows
|
|||||||
private void numUDMouseSens_ValueChanged(object sender, EventArgs e)
|
private void numUDMouseSens_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ButtonMouseSensitivity[device] = (int)numUDMouseSens.Value;
|
ButtonMouseSensitivity[device] = (int)numUDMouseSens.Value;
|
||||||
//ButtonMouseSensitivity(device, (int)numUDMouseSens.Value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LightBar_MouseDown(object sender, MouseEventArgs e)
|
private void LightBar_MouseDown(object sender, MouseEventArgs e)
|
||||||
@ -2139,7 +2142,7 @@ namespace DS4Windows
|
|||||||
|
|
||||||
private void btnBrowse_Click(object sender, EventArgs e)
|
private void btnBrowse_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if( openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
if (openFileDialog1.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
cBLaunchProgram.Checked = true;
|
cBLaunchProgram.Checked = true;
|
||||||
LaunchProgram[device] = openFileDialog1.FileName;
|
LaunchProgram[device] = openFileDialog1.FileName;
|
||||||
@ -2259,7 +2262,7 @@ namespace DS4Windows
|
|||||||
|
|
||||||
private void cBControllerInput_CheckedChanged(object sender, EventArgs e)
|
private void cBControllerInput_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
DS4Mapping=cBControllerInput.Checked;
|
DS4Mapping = cBControllerInput.Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnAddAction_Click(object sender, EventArgs e)
|
private void btnAddAction_Click(object sender, EventArgs e)
|
||||||
@ -2680,9 +2683,7 @@ namespace DS4Windows
|
|||||||
|
|
||||||
private void lVActions_ItemCheck(object sender, ItemCheckEventArgs e)
|
private void lVActions_ItemCheck(object sender, ItemCheckEventArgs e)
|
||||||
{
|
{
|
||||||
// Code can get executed even when control is not visible.
|
if (actionTabSeen)
|
||||||
// Should not be happening
|
|
||||||
if (lVActions.Visible && actionTabSeen)
|
|
||||||
{
|
{
|
||||||
List<string> pactions = new List<string>();
|
List<string> pactions = new List<string>();
|
||||||
foreach (ListViewItem lvi in lVActions.Items)
|
foreach (ListViewItem lvi in lVActions.Items)
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user