mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-13 16:49:08 +01:00
Check for valid trigger names. Check for null value
This commit is contained in:
parent
694af58154
commit
be93e16da6
@ -124,28 +124,44 @@ namespace DS4WinWPF.DS4Forms
|
||||
private void LoadAction(DS4Windows.SpecialAction specialAction)
|
||||
{
|
||||
specialActVM.LoadAction(specialAction);
|
||||
foreach(string control in specialActVM.ControlTriggerList)
|
||||
string[] tempTriggers = specialActVM.ControlTriggerList.ToArray();
|
||||
foreach (string control in tempTriggers)
|
||||
{
|
||||
foreach(CheckBox box in triggerBoxes)
|
||||
bool found = false;
|
||||
foreach (CheckBox box in triggerBoxes)
|
||||
{
|
||||
if (box.Tag.ToString() == control)
|
||||
{
|
||||
box.IsChecked = true;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
specialActVM.ControlTriggerList.Remove(control);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (string control in specialActVM.ControlUnloadTriggerList)
|
||||
tempTriggers = specialActVM.ControlUnloadTriggerList.ToArray();
|
||||
foreach (string control in tempTriggers)
|
||||
{
|
||||
bool found = false;
|
||||
foreach (CheckBox box in unloadTriggerBoxes)
|
||||
{
|
||||
if (box.Tag.ToString() == control)
|
||||
{
|
||||
box.IsChecked = true;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
specialActVM.ControlUnloadTriggerList.Remove(control);
|
||||
}
|
||||
}
|
||||
|
||||
switch (specialAction.typeID)
|
||||
|
@ -63,6 +63,11 @@ namespace DS4WinWPF.DS4Forms.ViewModels.SpecialActions
|
||||
if (profileIndex > 0)
|
||||
{
|
||||
string profilename = profileList.ProfileListCol[profileIndex - 1].Name;
|
||||
if (action.ucontrols == null)
|
||||
{
|
||||
action.ucontrols = string.Empty;
|
||||
}
|
||||
|
||||
Global.SaveAction(action.name, action.controls, 3, profilename, edit,
|
||||
action.ucontrols +
|
||||
(autoUntrigger ? ((action.ucontrols?.Length ?? 0) > 0 ? "/" : "") + "AutomaticUntrigger" : ""));
|
||||
|
Loading…
x
Reference in New Issue
Block a user