mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-29 04:24:19 +01:00
Clicking on the selected profile in the context menu now lets you edit it
This commit is contained in:
parent
6fcba28093
commit
56a39414ed
@ -427,19 +427,10 @@ namespace ScpServer
|
||||
{
|
||||
ToolStripMenuItem tS = (ToolStripMenuItem)sender;
|
||||
int tdevice = Int32.Parse(tS.Tag.ToString());
|
||||
if (e.ClickedItem != tS.DropDownItems[tS.DropDownItems.Count - 1])
|
||||
if (e.ClickedItem != tS.DropDownItems[tS.DropDownItems.Count - 1])
|
||||
if (((ToolStripMenuItem)e.ClickedItem).Checked)
|
||||
{
|
||||
for (int i = 0; i < tS.DropDownItems.Count; i++)
|
||||
((ToolStripMenuItem)tS.DropDownItems[i]).Checked = false;
|
||||
((ToolStripMenuItem)e.ClickedItem).Checked = true;
|
||||
cbs[tdevice].SelectedIndex = tS.DropDownItems.IndexOf(e.ClickedItem);
|
||||
Global.setAProfile(tdevice, e.ClickedItem.Text);
|
||||
Global.Save();
|
||||
Global.LoadProfile(tdevice);
|
||||
}
|
||||
else if (e.ClickedItem.Text == "+New Profile") //if +New Profile selected
|
||||
{
|
||||
Options opt = OptionsDialog[tdevice] = new Options(rootHub, tdevice, "", this);
|
||||
Options opt = OptionsDialog[tdevice] = new Options(rootHub, tdevice, e.ClickedItem.Text, this);
|
||||
opt.Text = "Options for Controller " + (tdevice + 1);
|
||||
opt.Icon = this.Icon;
|
||||
int i = tdevice;
|
||||
@ -451,6 +442,30 @@ namespace ScpServer
|
||||
opt.Show();
|
||||
Enable_Controls(i, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < tS.DropDownItems.Count; i++)
|
||||
((ToolStripMenuItem)tS.DropDownItems[i]).Checked = false;
|
||||
((ToolStripMenuItem)e.ClickedItem).Checked = true;
|
||||
cbs[tdevice].SelectedIndex = tS.DropDownItems.IndexOf(e.ClickedItem);
|
||||
Global.setAProfile(tdevice, e.ClickedItem.Text);
|
||||
Global.Save();
|
||||
Global.LoadProfile(tdevice);
|
||||
}
|
||||
else if (e.ClickedItem.Text == "+New Profile") //if +New Profile selected
|
||||
{
|
||||
Options opt = OptionsDialog[tdevice] = new Options(rootHub, tdevice, "", this);
|
||||
opt.Text = "Options for Controller " + (tdevice + 1);
|
||||
opt.Icon = this.Icon;
|
||||
int i = tdevice;
|
||||
opt.FormClosed += delegate
|
||||
{
|
||||
OptionsDialog[i] = null;
|
||||
Enable_Controls(i, true);
|
||||
};
|
||||
opt.Show();
|
||||
Enable_Controls(i, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
Loading…
Reference in New Issue
Block a user