mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-02-18 08:56:20 +01:00
Remove extras string from profile when reverted back to defaults
This commit is contained in:
parent
3d463ce7e8
commit
23b19689fd
@ -175,8 +175,14 @@ namespace DS4Windows
|
|||||||
keytag = bn.Tag;
|
keytag = bn.Tag;
|
||||||
|
|
||||||
lBMacroOn.Visible = false;
|
lBMacroOn.Visible = false;
|
||||||
string extras = GetExtras();
|
string extras = null;
|
||||||
|
if (IsUsingExtras())
|
||||||
|
{
|
||||||
|
extras = GetExtras();
|
||||||
|
}
|
||||||
|
|
||||||
KeyValuePair<object, string> tag = new KeyValuePair<object, string>(keytag, extras);
|
KeyValuePair<object, string> tag = new KeyValuePair<object, string>(keytag, extras);
|
||||||
|
|
||||||
newaction = true;
|
newaction = true;
|
||||||
int value;
|
int value;
|
||||||
bool tagisint = keytag != null && int.TryParse(keytag.ToString(), out value);
|
bool tagisint = keytag != null && int.TryParse(keytag.ToString(), out value);
|
||||||
@ -208,6 +214,22 @@ namespace DS4Windows
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool IsUsingExtras()
|
||||||
|
{
|
||||||
|
bool result = false;
|
||||||
|
result = result || (nUDHeavy.Value != 0);
|
||||||
|
result = result || (nUDLight.Value != 0);
|
||||||
|
result = result || (cBLightbar.Checked);
|
||||||
|
result = result ||
|
||||||
|
(tBRedBar.Value != 255 && tBGreenBar.Value != 255 &&
|
||||||
|
tBBlueBar.Value != 255);
|
||||||
|
|
||||||
|
result = result || (nUDLightFlash.Value != 0);
|
||||||
|
result = result || (cBMouse.Checked);
|
||||||
|
result = result || (nUDMouse.Value != 25);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private void finalMeasure(object sender, FormClosedEventArgs e)
|
private void finalMeasure(object sender, FormClosedEventArgs e)
|
||||||
{
|
{
|
||||||
if (ops != null)
|
if (ops != null)
|
||||||
@ -220,13 +242,23 @@ namespace DS4Windows
|
|||||||
}
|
}
|
||||||
if (lBMacroOn.Visible)
|
if (lBMacroOn.Visible)
|
||||||
{
|
{
|
||||||
string extras = GetExtras();
|
string extras = null;
|
||||||
|
if (IsUsingExtras())
|
||||||
|
{
|
||||||
|
extras = GetExtras();
|
||||||
|
}
|
||||||
|
|
||||||
KeyValuePair<object, string> tag = new KeyValuePair<object, string>(macrostag.ToArray(), extras);
|
KeyValuePair<object, string> tag = new KeyValuePair<object, string>(macrostag.ToArray(), extras);
|
||||||
ops.ChangeButtonText(button, rBShiftModifer.Checked, tag, cBScanCode.Checked, false, lBMacroOn.Visible, macrorepeat, cBShiftButton.SelectedIndex);
|
ops.ChangeButtonText(button, rBShiftModifer.Checked, tag, cBScanCode.Checked, false, lBMacroOn.Visible, macrorepeat, cBShiftButton.SelectedIndex);
|
||||||
}
|
}
|
||||||
else if (!newaction)
|
else if (!newaction)
|
||||||
{
|
{
|
||||||
string extras = GetExtras();
|
string extras = null;
|
||||||
|
if (IsUsingExtras())
|
||||||
|
{
|
||||||
|
extras = GetExtras();
|
||||||
|
}
|
||||||
|
|
||||||
int value;
|
int value;
|
||||||
object tt = Global.GetDS4Action(device, button.Name, rBShiftModifer.Checked);
|
object tt = Global.GetDS4Action(device, button.Name, rBShiftModifer.Checked);
|
||||||
bool tagisint = tt != null
|
bool tagisint = tt != null
|
||||||
@ -262,7 +294,12 @@ namespace DS4Windows
|
|||||||
if (rb == null && !(ActiveControl is NumericUpDown) && !(ActiveControl is TrackBar))
|
if (rb == null && !(ActiveControl is NumericUpDown) && !(ActiveControl is TrackBar))
|
||||||
{
|
{
|
||||||
lBMacroOn.Visible = false;
|
lBMacroOn.Visible = false;
|
||||||
string extras = GetExtras();
|
string extras = null;
|
||||||
|
if (IsUsingExtras())
|
||||||
|
{
|
||||||
|
extras = GetExtras();
|
||||||
|
}
|
||||||
|
|
||||||
KeyValuePair<object, string> tag = new KeyValuePair<object, string>(e.KeyValue, extras);
|
KeyValuePair<object, string> tag = new KeyValuePair<object, string>(e.KeyValue, extras);
|
||||||
newaction = true;
|
newaction = true;
|
||||||
if (ops != null)
|
if (ops != null)
|
||||||
@ -286,7 +323,12 @@ namespace DS4Windows
|
|||||||
if (rb == null && !(ActiveControl is NumericUpDown) && !(ActiveControl is TrackBar))
|
if (rb == null && !(ActiveControl is NumericUpDown) && !(ActiveControl is TrackBar))
|
||||||
{
|
{
|
||||||
lBMacroOn.Visible = false;
|
lBMacroOn.Visible = false;
|
||||||
string extras = GetExtras();
|
string extras = null;
|
||||||
|
if (IsUsingExtras())
|
||||||
|
{
|
||||||
|
extras = GetExtras();
|
||||||
|
}
|
||||||
|
|
||||||
KeyValuePair<object, string> tag = new KeyValuePair<object, string>(e.KeyValue, extras);
|
KeyValuePair<object, string> tag = new KeyValuePair<object, string>(e.KeyValue, extras);
|
||||||
newaction = true;
|
newaction = true;
|
||||||
if (ops != null)
|
if (ops != null)
|
||||||
@ -466,7 +508,15 @@ namespace DS4Windows
|
|||||||
private void rBShift_CheckedChanged(object sender, EventArgs e)
|
private void rBShift_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (!loading && extraChanged)
|
if (!loading && extraChanged)
|
||||||
Global.UpdateDS4Extra(device, button.Name, !rBShiftModifer.Checked, GetExtras());
|
{
|
||||||
|
string strextras = null;
|
||||||
|
if (IsUsingExtras())
|
||||||
|
{
|
||||||
|
strextras = GetExtras();
|
||||||
|
}
|
||||||
|
|
||||||
|
Global.UpdateDS4Extra(device, button.Name, !rBShiftModifer.Checked, strextras);
|
||||||
|
}
|
||||||
|
|
||||||
object tagO = Global.GetDS4Action(device, button.Name, rBShiftModifer.Checked);
|
object tagO = Global.GetDS4Action(device, button.Name, rBShiftModifer.Checked);
|
||||||
if (rBShiftModifer.Checked)
|
if (rBShiftModifer.Checked)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user