TAStudio: Columns menu set up during initialization; toggling visibility of a player's input keeps individual column selections; toggling a button's visibility leaves the menu open.
This commit is contained in:
parent
3b078522a6
commit
36c7d50528
|
@ -816,7 +816,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
this.ColumnsSubMenu.Name = "ColumnsSubMenu";
|
||||
this.ColumnsSubMenu.Size = new System.Drawing.Size(67, 20);
|
||||
this.ColumnsSubMenu.Text = "&Columns";
|
||||
this.ColumnsSubMenu.DropDownOpened += new System.EventHandler(this.ColumnsSubMenu_DropDownOpened);
|
||||
//
|
||||
// toolStripSeparator19
|
||||
//
|
||||
|
|
|
@ -756,7 +756,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
#region Columns
|
||||
|
||||
private void ColumnsSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
private void SetUpToolStripColumns()
|
||||
{
|
||||
ColumnsSubMenu.DropDownItems.Clear();
|
||||
|
||||
|
@ -774,21 +774,23 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
foreach (var column in columns)
|
||||
{
|
||||
var dummyColumnObject = column;
|
||||
|
||||
var menuItem = new ToolStripMenuItem
|
||||
{
|
||||
Text = column.Text + " (" + column.Name + ")",
|
||||
Checked = column.Visible,
|
||||
CheckOnClick = true
|
||||
CheckOnClick = true,
|
||||
Tag = column
|
||||
};
|
||||
|
||||
menuItem.CheckedChanged += (o, ev) =>
|
||||
{
|
||||
dummyColumnObject.Visible = (o as ToolStripMenuItem).Checked;
|
||||
var sender = o as ToolStripMenuItem;
|
||||
(sender.Tag as InputRoll.RollColumn).Visible = sender.Checked;
|
||||
TasView.AllColumns.ColumnsChanged();
|
||||
CurrentTasMovie.FlagChanges();
|
||||
RefreshTasView();
|
||||
ColumnsSubMenu.ShowDropDown();
|
||||
(sender.OwnerItem as ToolStripMenuItem).ShowDropDown();
|
||||
};
|
||||
|
||||
if (column.Name.StartsWith("P" + (player + 1)))
|
||||
|
@ -804,21 +806,17 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
ToolStripMenuItem item = new ToolStripMenuItem("Show Player " + i);
|
||||
item.CheckOnClick = true;
|
||||
item.Checked = false;
|
||||
for (int j = 1; j < playerMenus[i].DropDownItems.Count; j++)
|
||||
{
|
||||
if ((playerMenus[i].DropDownItems[j] as ToolStripMenuItem).Checked)
|
||||
{
|
||||
item.Checked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
item.Checked = true;
|
||||
|
||||
var dummyObject = playerMenus[i];
|
||||
int dummyInt = i;
|
||||
ToolStripMenuItem dummyObject = playerMenus[i];
|
||||
item.CheckedChanged += (o, ev) =>
|
||||
{
|
||||
foreach (ToolStripMenuItem subItem in dummyObject.DropDownItems)
|
||||
subItem.Checked = item.Checked;
|
||||
foreach (ToolStripMenuItem menuItem in dummyObject.DropDownItems)
|
||||
{
|
||||
(menuItem.Tag as InputRoll.RollColumn).Visible =
|
||||
(o as ToolStripMenuItem).Checked && menuItem.Checked;
|
||||
}
|
||||
|
||||
CurrentTasMovie.FlagChanges();
|
||||
RefreshTasView();
|
||||
|
|
|
@ -350,6 +350,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
AddColumn(kvp.Key, kvp.Value, 20 * kvp.Value.Length);
|
||||
}
|
||||
|
||||
// Patterns
|
||||
int bStart = 0;
|
||||
int fStart = 0;
|
||||
if (BoolPatterns == null)
|
||||
|
@ -376,6 +377,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
FloatPatterns[FloatPatterns.Length - 2] = new AutoPatternFloat(new float[] { 1f });
|
||||
FloatPatterns[FloatPatterns.Length - 1] = new AutoPatternFloat(
|
||||
1f, Global.Config.AutofireOn, 0f, Global.Config.AutofireOff);
|
||||
|
||||
SetUpToolStripColumns();
|
||||
}
|
||||
|
||||
public void AddColumn(string columnName, string columnText, int columnWidth)
|
||||
|
|
Loading…
Reference in New Issue