If User Opens A Script That Is Currently On The Session, It Will Toggle It On.

If User Deletes The Script From The Session, It Will Stop.
Script Counter Now Updates On More Circumstances.
This commit is contained in:
rolanmen1 2012-03-20 15:31:06 +00:00
parent 22feb43b78
commit 652fea7392
4 changed files with 2611 additions and 2588 deletions

File diff suppressed because it is too large Load Diff

View File

@ -69,6 +69,7 @@
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autoloadConsoleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.autoloadConsoleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autoloadSessionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.disableScriptsOnLoadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.disableScriptsOnLoadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.restoreWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.restoreWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -79,7 +80,6 @@
this.clearToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); this.clearToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.NumberOfScripts = new System.Windows.Forms.Label(); this.NumberOfScripts = new System.Windows.Forms.Label();
this.autoloadSessionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStrip1 = new ToolStripEx(); this.toolStrip1 = new ToolStripEx();
this.openToolStripButton = new System.Windows.Forms.ToolStripButton(); this.openToolStripButton = new System.Windows.Forms.ToolStripButton();
this.copyToolStripButton = new System.Windows.Forms.ToolStripButton(); this.copyToolStripButton = new System.Windows.Forms.ToolStripButton();
@ -272,18 +272,18 @@
// noneToolStripMenuItem // noneToolStripMenuItem
// //
this.noneToolStripMenuItem.Name = "noneToolStripMenuItem"; this.noneToolStripMenuItem.Name = "noneToolStripMenuItem";
this.noneToolStripMenuItem.Size = new System.Drawing.Size(103, 22); this.noneToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.noneToolStripMenuItem.Text = "None"; this.noneToolStripMenuItem.Text = "None";
// //
// toolStripSeparator3 // toolStripSeparator3
// //
this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(100, 6); this.toolStripSeparator3.Size = new System.Drawing.Size(149, 6);
// //
// clearToolStripMenuItem // clearToolStripMenuItem
// //
this.clearToolStripMenuItem.Name = "clearToolStripMenuItem"; this.clearToolStripMenuItem.Name = "clearToolStripMenuItem";
this.clearToolStripMenuItem.Size = new System.Drawing.Size(103, 22); this.clearToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.clearToolStripMenuItem.Text = "Clear"; this.clearToolStripMenuItem.Text = "Clear";
// //
// toolStripSeparator1 // toolStripSeparator1
@ -435,6 +435,13 @@
this.autoloadConsoleToolStripMenuItem.Text = "Autoload Console"; this.autoloadConsoleToolStripMenuItem.Text = "Autoload Console";
this.autoloadConsoleToolStripMenuItem.Click += new System.EventHandler(this.autoloadConsoleToolStripMenuItem_Click); this.autoloadConsoleToolStripMenuItem.Click += new System.EventHandler(this.autoloadConsoleToolStripMenuItem_Click);
// //
// autoloadSessionToolStripMenuItem
//
this.autoloadSessionToolStripMenuItem.Name = "autoloadSessionToolStripMenuItem";
this.autoloadSessionToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.autoloadSessionToolStripMenuItem.Text = "Autoload Session";
this.autoloadSessionToolStripMenuItem.Click += new System.EventHandler(this.autoloadSessionToolStripMenuItem_Click);
//
// disableScriptsOnLoadToolStripMenuItem // disableScriptsOnLoadToolStripMenuItem
// //
this.disableScriptsOnLoadToolStripMenuItem.Name = "disableScriptsOnLoadToolStripMenuItem"; this.disableScriptsOnLoadToolStripMenuItem.Name = "disableScriptsOnLoadToolStripMenuItem";
@ -513,13 +520,6 @@
this.NumberOfScripts.TabIndex = 4; this.NumberOfScripts.TabIndex = 4;
this.NumberOfScripts.Text = " 0 Scripts "; this.NumberOfScripts.Text = " 0 Scripts ";
// //
// autoloadSessionToolStripMenuItem
//
this.autoloadSessionToolStripMenuItem.Name = "autoloadSessionToolStripMenuItem";
this.autoloadSessionToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.autoloadSessionToolStripMenuItem.Text = "Autoload Session";
this.autoloadSessionToolStripMenuItem.Click += new System.EventHandler(this.autoloadSessionToolStripMenuItem_Click);
//
// toolStrip1 // toolStrip1
// //
this.toolStrip1.ClickThrough = true; this.toolStrip1.ClickThrough = true;
@ -632,8 +632,6 @@
this.LuaListView.UseCompatibleStateImageBehavior = false; this.LuaListView.UseCompatibleStateImageBehavior = false;
this.LuaListView.View = System.Windows.Forms.View.Details; this.LuaListView.View = System.Windows.Forms.View.Details;
this.LuaListView.ItemActivate += new System.EventHandler(this.LuaListView_ItemActivate); this.LuaListView.ItemActivate += new System.EventHandler(this.LuaListView_ItemActivate);
this.LuaListView.SelectedIndexChanged += new System.EventHandler(this.LuaListView_SelectedIndexChanged);
this.LuaListView.DoubleClick += new System.EventHandler(this.LuaListView_DoubleClick);
this.LuaListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.LuaListView_KeyDown); this.LuaListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.LuaListView_KeyDown);
// //
// Script // Script

View File

@ -97,6 +97,7 @@ namespace BizHawk.MultiClient
LuaImp.Close(); LuaImp.Close();
LuaImp = new LuaImplementation(this); LuaImp = new LuaImplementation(this);
changes = true; changes = true;
UpdateNumberOfScripts();
} }
public void Restart() public void Restart()
@ -161,6 +162,8 @@ namespace BizHawk.MultiClient
} }
private void LoadLuaFile(string path) private void LoadLuaFile(string path)
{
if (LuaAlreadyInSession(path) == false)
{ {
bool enabled = true; bool enabled = true;
if (Global.Config.DisableLuaScriptsOnLoad) if (Global.Config.DisableLuaScriptsOnLoad)
@ -175,6 +178,21 @@ namespace BizHawk.MultiClient
LuaImp.DoLuaFile(path); LuaImp.DoLuaFile(path);
changes = true; changes = true;
} }
else
{
for (int i = 0; i < luaList.Count; i++)
{
if (path == luaList[i].Path && luaList[i].Enabled == false)
{
luaList[i].Toggle();
LuaListView.Refresh();
RunLuaScripts();
changes = true;
break;
}
}
}
}
private void OpenLuaFile() private void OpenLuaFile()
{ {
@ -262,17 +280,6 @@ namespace BizHawk.MultiClient
NumberOfScripts.Text = message; NumberOfScripts.Text = message;
} }
private void LuaListView_DoubleClick(object sender, EventArgs e)
{
MessageBox.Show("");
//Toggle();
}
private void LuaListView_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void moveUpToolStripMenuItem_Click(object sender, EventArgs e) private void moveUpToolStripMenuItem_Click(object sender, EventArgs e)
{ {
MoveUp(); MoveUp();
@ -354,6 +361,7 @@ namespace BizHawk.MultiClient
indexes.Clear(); indexes.Clear();
DisplayLuaList(); DisplayLuaList();
} }
UpdateNumberOfScripts();
} }
private void removeScriptToolStripMenuItem_Click(object sender, EventArgs e) private void removeScriptToolStripMenuItem_Click(object sender, EventArgs e)
@ -491,6 +499,21 @@ namespace BizHawk.MultiClient
private void LoadLuaFromRecent(string path) private void LoadLuaFromRecent(string path)
{ {
LoadLuaFile(path); LoadLuaFile(path);
UpdateNumberOfScripts();
}
private bool LuaAlreadyInSession(string path)
{
bool Validated = false;
for (int i = 0; i < luaList.Count; i++)
{
if (path == luaList[i].Path)
{
Validated = true;
break;
}
}
return Validated;
} }
private void LuaConsole_DragDrop(object sender, DragEventArgs e) private void LuaConsole_DragDrop(object sender, DragEventArgs e)
@ -591,6 +614,7 @@ namespace BizHawk.MultiClient
private void cutToolStripButton_Click(object sender, EventArgs e) private void cutToolStripButton_Click(object sender, EventArgs e)
{ {
Toggle();
RemoveScript(); RemoveScript();
} }

View File

@ -133,17 +133,18 @@
<data name="openToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="openToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJQSURBVDhPlZNdSNNRGMb/F110ZZEVhVBgeeHNICiiuggp YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlpJREFUOE+tk21I
olAUyyxI0oSaH1QYC3N+tKnp5ubm1JUua5uuqdPKMgr7kApFItTUkWZqVhSVYmao5Nev/xyoQ4k88Nyc k1EYhif0oyA0sqIQCix/+GcQFFH9CCmiUBTLLEjShJofVBgL2fxoU9Pp5ubUlS5rU9f8rCyjsA+pUCRC
8z6/93nP4QjCfy6lwc4ltZVso4P/tMyXRcmMHqZ0EeY6jZQVInzuf0e1Tb9Ina3P/tkpLD6XkNg8BJe5 TR1ppmVFUSlmhq78unrnQF1KGHTg/nEOz30993PO+7qJFrmUeiv2n+Mij+XLRLLYULdF2pxlEVIDcw0p
u93C+HDVrP4M2ZkcMOOw5tLZ9nxJyJE4HSExBoKkBQhVpTrGhso9zNPfiph0JlB+U01ZcRbmwnRMeWlc AsyxD5fmI/rQ94pqi26eOlsfuZj+7BgSm01QdA4ih7m73Yx9qGpavwatjPebqCzOpr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/cOMVvFPvh6e7F+3SrWrHRnraf7Xz/xf/rJ/kvxb84I3U1y+9/W
AAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">