Make sure extra flags are populated in more places for special actions

This commit is contained in:
Travis Nickles 2017-05-08 07:29:38 -07:00
parent 4980cd01dc
commit 22ebca3e01
3 changed files with 18 additions and 4 deletions

View File

@ -689,7 +689,7 @@ namespace DS4Windows
public static List<DS4ControlSettings> getDS4CSettings(int device) => m_Config.ds4settings[device]; public static List<DS4ControlSettings> getDS4CSettings(int device) => m_Config.ds4settings[device];
public static DS4ControlSettings getDS4CSetting(int deviceNum, string control) => m_Config.getDS4CSetting(deviceNum, control); public static DS4ControlSettings getDS4CSetting(int deviceNum, string control) => m_Config.getDS4CSetting(deviceNum, control);
public static DS4ControlSettings getDS4CSetting(int deviceNum, DS4Controls control) => m_Config.getDS4CSetting(deviceNum, control); public static DS4ControlSettings getDS4CSetting(int deviceNum, DS4Controls control) => m_Config.getDS4CSetting(deviceNum, control);
public static bool HasCustomAction(int deviceNum) => m_Config.HasCustomActions(deviceNum); public static bool HasCustomActions(int deviceNum) => m_Config.HasCustomActions(deviceNum);
public static bool HasCustomExtras(int deviceNum) => m_Config.HasCustomExtras(deviceNum); public static bool HasCustomExtras(int deviceNum) => m_Config.HasCustomExtras(deviceNum);
public static bool containsCustomAction(int deviceNum) public static bool containsCustomAction(int deviceNum)
{ {
@ -760,6 +760,12 @@ namespace DS4Windows
} }
} }
public static void cacheProfileCustomsFlags(int device)
{
m_Config.containsCustomAction[device] = HasCustomActions(device);
m_Config.containsCustomExtras[device] = HasCustomExtras(device);
}
public static X360Controls getX360ControlsByName(string key) public static X360Controls getX360ControlsByName(string key)
{ {
return m_Config.getX360ControlsByName(key); return m_Config.getX360ControlsByName(key);

View File

@ -332,8 +332,8 @@ namespace DS4Windows
btnStartStop_Clicked(); btnStartStop_Clicked();
startToolStripMenuItem.Text = btnStartStop.Text; startToolStripMenuItem.Text = btnStartStop.Text;
if (!tLPControllers.Visible) //if (!tLPControllers.Visible)
tabMain.SelectedIndex = 1; // tabMain.SelectedIndex = 1;
//cBNotifications.Checked = Notifications; //cBNotifications.Checked = Notifications;
cBoxNotifications.SelectedIndex = Notifications; cBoxNotifications.SelectedIndex = Notifications;
@ -1447,6 +1447,9 @@ namespace DS4Windows
{ {
lbLastMessage.Text = lvDebug.Items[lvDebugItemCount - 1].SubItems[1].Text; lbLastMessage.Text = lvDebug.Items[lvDebugItemCount - 1].SubItems[1].Text;
} }
if (!lbNoControllers.Visible)
tabMain.SelectedIndex = 0;
} }
private void editButtons_Click(object sender, EventArgs e) private void editButtons_Click(object sender, EventArgs e)
@ -1839,9 +1842,10 @@ namespace DS4Windows
if (tSTBProfile.Text != null && tSTBProfile.Text != "" && !tSTBProfile.Text.Contains("\\") && !tSTBProfile.Text.Contains("/") && !tSTBProfile.Text.Contains(":") && !tSTBProfile.Text.Contains("*") && !tSTBProfile.Text.Contains("?") && !tSTBProfile.Text.Contains("\"") && !tSTBProfile.Text.Contains("<") && !tSTBProfile.Text.Contains(">") && !tSTBProfile.Text.Contains("|")) if (tSTBProfile.Text != null && tSTBProfile.Text != "" && !tSTBProfile.Text.Contains("\\") && !tSTBProfile.Text.Contains("/") && !tSTBProfile.Text.Contains(":") && !tSTBProfile.Text.Contains("*") && !tSTBProfile.Text.Contains("?") && !tSTBProfile.Text.Contains("\"") && !tSTBProfile.Text.Contains("<") && !tSTBProfile.Text.Contains(">") && !tSTBProfile.Text.Contains("|"))
{ {
System.IO.File.Delete(appdatapath + @"\Profiles\" + opt.filename + ".xml"); File.Delete(appdatapath + @"\Profiles\" + opt.filename + ".xml");
ProfilePath[opt.device] = tSTBProfile.Text; ProfilePath[opt.device] = tSTBProfile.Text;
SaveProfile(opt.device, tSTBProfile.Text); SaveProfile(opt.device, tSTBProfile.Text);
cacheProfileCustomsFlags(opt.device);
Save(); Save();
opt.Close(); opt.Close();
} }

View File

@ -2319,6 +2319,9 @@ namespace DS4Windows
{ {
RemoveAction(lVActions.SelectedItems[0].Text); RemoveAction(lVActions.SelectedItems[0].Text);
lVActions.Items.Remove(lVActions.SelectedItems[0]); lVActions.Items.Remove(lVActions.SelectedItems[0]);
calculateProfileActionCount(device);
calculateProfileActionDicts(device);
cacheProfileCustomsFlags(device);
} }
} }
@ -2730,6 +2733,7 @@ namespace DS4Windows
ProfileActions[device] = pactions; ProfileActions[device] = pactions;
calculateProfileActionCount(device); calculateProfileActionCount(device);
calculateProfileActionDicts(device); calculateProfileActionDicts(device);
cacheProfileCustomsFlags(device);
} }
} }