Make sure profile loading and saving works for X360Controls actions

This commit is contained in:
Travis Nickles 2017-04-11 14:56:37 -07:00
parent 24865da04b
commit 4ea9289a0d
2 changed files with 16 additions and 2 deletions

View File

@ -868,7 +868,16 @@ namespace DS4Windows
isAnalog = true; isAnalog = true;
} }
X360Controls xboxControl = getX360ControlsByName(action.ToString()); X360Controls xboxControl = X360Controls.None;
if (action is X360Controls)
{
xboxControl = (X360Controls)action;
}
else if (action is string)
{
xboxControl = getX360ControlsByName(action.ToString());
}
if (xboxControl >= X360Controls.X && xboxControl <= X360Controls.A) if (xboxControl >= X360Controls.X && xboxControl <= X360Controls.A)
{ {
switch (xboxControl) switch (xboxControl)

View File

@ -1036,11 +1036,16 @@ namespace DS4Windows
buttonNode.InnerText = dcs.action.ToString(); buttonNode.InnerText = dcs.action.ToString();
Key.AppendChild(buttonNode); Key.AppendChild(buttonNode);
} }
else if (dcs.action is string || dcs.action is X360Controls) else if (dcs.action is string)
{ {
buttonNode.InnerText = dcs.action.ToString(); buttonNode.InnerText = dcs.action.ToString();
Button.AppendChild(buttonNode); Button.AppendChild(buttonNode);
} }
else if (dcs.action is X360Controls)
{
buttonNode.InnerText = getX360ControlString((X360Controls)dcs.action);
Button.AppendChild(buttonNode);
}
} }
bool hasvalue = false; bool hasvalue = false;