User Can't Toggle, Edit Nor Pause Or Resume To Separators. Edit Buttons Now Opens Multiple Scripts Instead Of The First Selected.
This commit is contained in:
parent
87f9ace0d9
commit
d0995970fc
|
@ -32,6 +32,7 @@
|
|||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LuaConsole));
|
||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.toggleScriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.resumePauseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.editScriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.removeScriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.insertSeperatorToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
|
@ -84,6 +85,7 @@
|
|||
this.toolStrip1 = new ToolStripEx();
|
||||
this.openToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.copyToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.resumePauseButton1 = new System.Windows.Forms.ToolStripButton();
|
||||
this.EditToolstripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.cutToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButtonSeparator = new System.Windows.Forms.ToolStripButton();
|
||||
|
@ -93,8 +95,6 @@
|
|||
this.LuaListView = new BizHawk.VirtualListView();
|
||||
this.Script = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.PathName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
|
||||
this.resumePauseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.contextMenuStrip1.SuspendLayout();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.contextMenuStrip2.SuspendLayout();
|
||||
|
@ -113,7 +113,7 @@
|
|||
this.toolStripSeparator4,
|
||||
this.stopAllScriptsToolStripMenuItem});
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(175, 164);
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(175, 142);
|
||||
this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
|
||||
//
|
||||
// toggleScriptToolStripMenuItem
|
||||
|
@ -124,6 +124,14 @@
|
|||
this.toggleScriptToolStripMenuItem.Text = "&Toggle";
|
||||
this.toggleScriptToolStripMenuItem.Click += new System.EventHandler(this.toggleScriptToolStripMenuItem_Click);
|
||||
//
|
||||
// resumePauseToolStripMenuItem
|
||||
//
|
||||
this.resumePauseToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Pause;
|
||||
this.resumePauseToolStripMenuItem.Name = "resumePauseToolStripMenuItem";
|
||||
this.resumePauseToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
|
||||
this.resumePauseToolStripMenuItem.Text = "Pause or Resume";
|
||||
this.resumePauseToolStripMenuItem.Click += new System.EventHandler(this.resumePauseToolStripMenuItem_Click);
|
||||
//
|
||||
// editScriptToolStripMenuItem
|
||||
//
|
||||
this.editScriptToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.CutHS;
|
||||
|
@ -346,7 +354,7 @@
|
|||
this.pauseResumeToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Pause;
|
||||
this.pauseResumeToolStripMenuItem.Name = "pauseResumeToolStripMenuItem";
|
||||
this.pauseResumeToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
|
||||
this.pauseResumeToolStripMenuItem.Text = "Resume/Pause";
|
||||
this.pauseResumeToolStripMenuItem.Text = "Pause or Resume";
|
||||
this.pauseResumeToolStripMenuItem.Click += new System.EventHandler(this.pauseResumeToolStripMenuItem_Click);
|
||||
//
|
||||
// editToolStripMenuItem
|
||||
|
@ -527,11 +535,11 @@
|
|||
// NumberOfScripts
|
||||
//
|
||||
this.NumberOfScripts.AutoSize = true;
|
||||
this.NumberOfScripts.Location = new System.Drawing.Point(10, 53);
|
||||
this.NumberOfScripts.Location = new System.Drawing.Point(12, 53);
|
||||
this.NumberOfScripts.Name = "NumberOfScripts";
|
||||
this.NumberOfScripts.Size = new System.Drawing.Size(66, 13);
|
||||
this.NumberOfScripts.Size = new System.Drawing.Size(56, 13);
|
||||
this.NumberOfScripts.TabIndex = 4;
|
||||
this.NumberOfScripts.Text = " 0 Scripts ";
|
||||
this.NumberOfScripts.Text = "0 script ";
|
||||
//
|
||||
// toolStrip1
|
||||
//
|
||||
|
@ -539,7 +547,7 @@
|
|||
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.openToolStripButton,
|
||||
this.copyToolStripButton,
|
||||
this.toolStripButton1,
|
||||
this.resumePauseButton1,
|
||||
this.EditToolstripButton,
|
||||
this.cutToolStripButton,
|
||||
this.toolStripButtonSeparator,
|
||||
|
@ -572,6 +580,16 @@
|
|||
this.copyToolStripButton.Text = "Toggle Script";
|
||||
this.copyToolStripButton.Click += new System.EventHandler(this.copyToolStripButton_Click);
|
||||
//
|
||||
// resumePauseButton1
|
||||
//
|
||||
this.resumePauseButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.resumePauseButton1.Image = global::BizHawk.MultiClient.Properties.Resources.Pause;
|
||||
this.resumePauseButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.resumePauseButton1.Name = "resumePauseButton1";
|
||||
this.resumePauseButton1.Size = new System.Drawing.Size(23, 22);
|
||||
this.resumePauseButton1.Text = "Pause or Resume";
|
||||
this.resumePauseButton1.Click += new System.EventHandler(this.toolStripButton1_Click_1);
|
||||
//
|
||||
// EditToolstripButton
|
||||
//
|
||||
this.EditToolstripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
|
@ -658,24 +676,6 @@
|
|||
this.PathName.Text = "Path";
|
||||
this.PathName.Width = 195;
|
||||
//
|
||||
// toolStripButton1
|
||||
//
|
||||
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.toolStripButton1.Image = global::BizHawk.MultiClient.Properties.Resources.Pause;
|
||||
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton1.Name = "toolStripButton1";
|
||||
this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
|
||||
this.toolStripButton1.Text = "toolStripButton1";
|
||||
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click_1);
|
||||
//
|
||||
// resumePauseToolStripMenuItem
|
||||
//
|
||||
this.resumePauseToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Pause;
|
||||
this.resumePauseToolStripMenuItem.Name = "resumePauseToolStripMenuItem";
|
||||
this.resumePauseToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
|
||||
this.resumePauseToolStripMenuItem.Text = "Resume/Pause";
|
||||
this.resumePauseToolStripMenuItem.Click += new System.EventHandler(this.resumePauseToolStripMenuItem_Click);
|
||||
//
|
||||
// LuaConsole
|
||||
//
|
||||
this.AllowDrop = true;
|
||||
|
@ -772,7 +772,7 @@
|
|||
private System.Windows.Forms.ToolStripMenuItem disableScriptsOnLoadToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem autoloadSessionToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem pauseResumeToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton1;
|
||||
private System.Windows.Forms.ToolStripButton resumePauseButton1;
|
||||
private System.Windows.Forms.ToolStripMenuItem resumePauseToolStripMenuItem;
|
||||
}
|
||||
}
|
|
@ -240,7 +240,8 @@ namespace BizHawk.MultiClient
|
|||
for (int x = 0; x < indexes.Count; x++)
|
||||
{
|
||||
var item = luaList[indexes[x]];
|
||||
item.Toggle();
|
||||
if(!item.IsSeparator)
|
||||
item.Toggle();
|
||||
if (item.Enabled && item.Thread == null)
|
||||
item.Thread = LuaImp.SpawnCoroutine(item.Path);
|
||||
else if (!item.Enabled && item.Thread != null)
|
||||
|
@ -270,18 +271,25 @@ namespace BizHawk.MultiClient
|
|||
private void UpdateNumberOfScripts()
|
||||
{
|
||||
string message = "";
|
||||
int active = 0, paused = 0;
|
||||
int active = 0, paused = 0, separators = 0;
|
||||
for (int x = 0; x < luaList.Count; x++)
|
||||
{
|
||||
if (luaList[x].Enabled)
|
||||
if (!luaList[x].IsSeparator)
|
||||
{
|
||||
active++;
|
||||
if (luaList[x].Paused)
|
||||
paused++;
|
||||
if (luaList[x].Enabled)
|
||||
{
|
||||
active++;
|
||||
if (luaList[x].Paused)
|
||||
paused++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
separators++;
|
||||
}
|
||||
}
|
||||
|
||||
int L = luaList.Count;
|
||||
int L = luaList.Count - separators;
|
||||
if (L == 1)
|
||||
message += L.ToString() + " script (" + active.ToString() + " active, " + paused.ToString() + " paused)";
|
||||
else if (L == 0)
|
||||
|
@ -578,7 +586,16 @@ namespace BizHawk.MultiClient
|
|||
ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices;
|
||||
if (indexes.Count == 0)
|
||||
return;
|
||||
System.Diagnostics.Process.Start(luaList[indexes[0]].Path);
|
||||
|
||||
if (indexes.Count > 0)
|
||||
{
|
||||
for (int x = 0; x < indexes.Count; x++)
|
||||
{
|
||||
var item = luaList[indexes[x]];
|
||||
if (!item.IsSeparator)
|
||||
System.Diagnostics.Process.Start(luaList[indexes[x]].Path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void toggleScriptToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
@ -970,9 +987,11 @@ namespace BizHawk.MultiClient
|
|||
if (indexes.Count > 0)
|
||||
{
|
||||
scriptToolStripMenuItem.DropDownItems[1].Enabled = true;
|
||||
scriptToolStripMenuItem.DropDownItems[2].Enabled = true;
|
||||
scriptToolStripMenuItem.DropDownItems[3].Enabled = true;
|
||||
scriptToolStripMenuItem.DropDownItems[6].Enabled = true;
|
||||
scriptToolStripMenuItem.DropDownItems[4].Enabled = true;
|
||||
scriptToolStripMenuItem.DropDownItems[7].Enabled = true;
|
||||
scriptToolStripMenuItem.DropDownItems[8].Enabled = true;
|
||||
|
||||
bool allSeparators = true;
|
||||
for (int i = 0; i < indexes.Count; i++)
|
||||
|
@ -981,28 +1000,29 @@ namespace BizHawk.MultiClient
|
|||
allSeparators = false;
|
||||
}
|
||||
if (allSeparators)
|
||||
scriptToolStripMenuItem.DropDownItems[2].Enabled = false;
|
||||
scriptToolStripMenuItem.DropDownItems[3].Enabled = false;
|
||||
else
|
||||
scriptToolStripMenuItem.DropDownItems[2].Enabled = true;
|
||||
scriptToolStripMenuItem.DropDownItems[3].Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
scriptToolStripMenuItem.DropDownItems[1].Enabled = false;
|
||||
scriptToolStripMenuItem.DropDownItems[2].Enabled = false;
|
||||
scriptToolStripMenuItem.DropDownItems[3].Enabled = false;
|
||||
scriptToolStripMenuItem.DropDownItems[6].Enabled = false;
|
||||
scriptToolStripMenuItem.DropDownItems[7].Enabled = false;
|
||||
scriptToolStripMenuItem.DropDownItems[1].Enabled = false;
|
||||
scriptToolStripMenuItem.DropDownItems[2].Enabled = false;
|
||||
scriptToolStripMenuItem.DropDownItems[3].Enabled = false;
|
||||
scriptToolStripMenuItem.DropDownItems[4].Enabled = false;
|
||||
scriptToolStripMenuItem.DropDownItems[7].Enabled = false;
|
||||
scriptToolStripMenuItem.DropDownItems[8].Enabled = false;
|
||||
}
|
||||
|
||||
if (luaList.Count > 0)
|
||||
scriptToolStripMenuItem.DropDownItems[8].Enabled = true;
|
||||
scriptToolStripMenuItem.DropDownItems[9].Enabled = true;
|
||||
else
|
||||
scriptToolStripMenuItem.DropDownItems[8].Enabled = false;
|
||||
scriptToolStripMenuItem.DropDownItems[9].Enabled = false;
|
||||
|
||||
if (luaRunning)
|
||||
scriptToolStripMenuItem.DropDownItems[10].Enabled = true;
|
||||
scriptToolStripMenuItem.DropDownItems[11].Enabled = true;
|
||||
else
|
||||
scriptToolStripMenuItem.DropDownItems[10].Enabled = false;
|
||||
scriptToolStripMenuItem.DropDownItems[11].Enabled = false;
|
||||
}
|
||||
|
||||
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
|
||||
|
@ -1020,6 +1040,7 @@ namespace BizHawk.MultiClient
|
|||
contextMenuStrip1.Items[0].Enabled = true;
|
||||
contextMenuStrip1.Items[1].Enabled = true;
|
||||
contextMenuStrip1.Items[2].Enabled = true;
|
||||
contextMenuStrip1.Items[3].Enabled = true;
|
||||
|
||||
bool allSeparators = true;
|
||||
for (int i = 0; i < indexes.Count; i++)
|
||||
|
@ -1028,26 +1049,27 @@ namespace BizHawk.MultiClient
|
|||
allSeparators = false;
|
||||
}
|
||||
if (allSeparators)
|
||||
contextMenuStrip1.Items[1].Enabled = false;
|
||||
contextMenuStrip1.Items[2].Enabled = false;
|
||||
else
|
||||
contextMenuStrip1.Items[1].Enabled = true;
|
||||
contextMenuStrip1.Items[2].Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
contextMenuStrip1.Items[0].Enabled = false;
|
||||
contextMenuStrip1.Items[1].Enabled = false;
|
||||
contextMenuStrip1.Items[2].Enabled = false;
|
||||
contextMenuStrip1.Items[3].Enabled = true;
|
||||
}
|
||||
|
||||
if (luaRunning)
|
||||
{
|
||||
contextMenuStrip1.Items[4].Visible = true;
|
||||
contextMenuStrip1.Items[5].Visible = true;
|
||||
contextMenuStrip1.Items[6].Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
contextMenuStrip1.Items[4].Visible = false;
|
||||
contextMenuStrip1.Items[5].Visible = false;
|
||||
contextMenuStrip1.Items[6].Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1074,10 +1096,11 @@ namespace BizHawk.MultiClient
|
|||
for (int x = 0; x < indexes.Count; x++)
|
||||
{
|
||||
var item = luaList[indexes[x]];
|
||||
item.TogglePause();
|
||||
if(!item.IsSeparator)
|
||||
item.TogglePause();
|
||||
}
|
||||
}
|
||||
//LuaListView.Refresh();
|
||||
LuaListView.Refresh();
|
||||
UpdateNumberOfScripts();
|
||||
changes = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue