diff --git a/BizHawk.MultiClient/Config.cs b/BizHawk.MultiClient/Config.cs index bcc9fd38c7..8d63191dc2 100644 --- a/BizHawk.MultiClient/Config.cs +++ b/BizHawk.MultiClient/Config.cs @@ -220,6 +220,7 @@ namespace BizHawk.MultiClient public int LuaConsoleWndy = -1; public int LuaConsoleWidth = -1; public int LuaConsoleHeight = -1; + public bool DisableLuaScriptsOnLoad = false; // RamWatch Settings public bool AutoLoadRamWatch = false; diff --git a/BizHawk.MultiClient/tools/LuaConsole.Designer.cs b/BizHawk.MultiClient/tools/LuaConsole.Designer.cs index ef922b4a05..c50a9aebc4 100644 --- a/BizHawk.MultiClient/tools/LuaConsole.Designer.cs +++ b/BizHawk.MultiClient/tools/LuaConsole.Designer.cs @@ -74,10 +74,10 @@ this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.luaFunctionsListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.OutputBox = new System.Windows.Forms.RichTextBox(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.NumberOfScripts = new System.Windows.Forms.Label(); this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components); this.clearToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.NumberOfScripts = new System.Windows.Forms.Label(); this.toolStrip1 = new ToolStripEx(); this.openToolStripButton = new System.Windows.Forms.ToolStripButton(); this.copyToolStripButton = new System.Windows.Forms.ToolStripButton(); @@ -90,10 +90,11 @@ 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.disableScriptsOnLoadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.contextMenuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); - this.groupBox1.SuspendLayout(); this.contextMenuStrip2.SuspendLayout(); + this.groupBox1.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -410,6 +411,7 @@ this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.saveWindowPositionToolStripMenuItem, this.autoloadConsoleToolStripMenuItem, + this.disableScriptsOnLoadToolStripMenuItem, this.toolStripSeparator5, this.restoreWindowSizeToolStripMenuItem}); this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; @@ -468,6 +470,20 @@ this.OutputBox.TabIndex = 2; this.OutputBox.Text = ""; // + // contextMenuStrip2 + // + this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.clearToolStripMenuItem2}); + this.contextMenuStrip2.Name = "contextMenuStrip2"; + this.contextMenuStrip2.Size = new System.Drawing.Size(102, 26); + // + // clearToolStripMenuItem2 + // + this.clearToolStripMenuItem2.Name = "clearToolStripMenuItem2"; + this.clearToolStripMenuItem2.Size = new System.Drawing.Size(101, 22); + this.clearToolStripMenuItem2.Text = "&Clear"; + this.clearToolStripMenuItem2.Click += new System.EventHandler(this.clearToolStripMenuItem2_Click); + // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -488,20 +504,6 @@ this.NumberOfScripts.TabIndex = 4; this.NumberOfScripts.Text = " 0 Scripts "; // - // contextMenuStrip2 - // - this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.clearToolStripMenuItem2}); - this.contextMenuStrip2.Name = "contextMenuStrip2"; - this.contextMenuStrip2.Size = new System.Drawing.Size(102, 26); - // - // clearToolStripMenuItem2 - // - this.clearToolStripMenuItem2.Name = "clearToolStripMenuItem2"; - this.clearToolStripMenuItem2.Size = new System.Drawing.Size(101, 22); - this.clearToolStripMenuItem2.Text = "&Clear"; - this.clearToolStripMenuItem2.Click += new System.EventHandler(this.clearToolStripMenuItem2_Click); - // // toolStrip1 // this.toolStrip1.ClickThrough = true; @@ -628,6 +630,13 @@ this.PathName.Text = "Path"; this.PathName.Width = 195; // + // disableScriptsOnLoadToolStripMenuItem + // + this.disableScriptsOnLoadToolStripMenuItem.Name = "disableScriptsOnLoadToolStripMenuItem"; + this.disableScriptsOnLoadToolStripMenuItem.Size = new System.Drawing.Size(199, 22); + this.disableScriptsOnLoadToolStripMenuItem.Text = "Disable Scripts on Load"; + this.disableScriptsOnLoadToolStripMenuItem.Click += new System.EventHandler(this.disableScriptsOnLoadToolStripMenuItem_Click); + // // LuaConsole // this.AllowDrop = true; @@ -650,8 +659,8 @@ this.contextMenuStrip1.ResumeLayout(false); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); - this.groupBox1.ResumeLayout(false); this.contextMenuStrip2.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.ResumeLayout(false); @@ -721,5 +730,6 @@ private System.Windows.Forms.ToolStripMenuItem luaFunctionsListToolStripMenuItem; private System.Windows.Forms.ContextMenuStrip contextMenuStrip2; private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem disableScriptsOnLoadToolStripMenuItem; } } \ No newline at end of file diff --git a/BizHawk.MultiClient/tools/LuaConsole.cs b/BizHawk.MultiClient/tools/LuaConsole.cs index b7396c5f77..a012943720 100644 --- a/BizHawk.MultiClient/tools/LuaConsole.cs +++ b/BizHawk.MultiClient/tools/LuaConsole.cs @@ -14,7 +14,6 @@ namespace BizHawk.MultiClient public partial class LuaConsole : Form { //options - autoload session - //options - disable scripts on load //TODO: remember column widths //TODO: restore column width on restore default settings @@ -161,12 +160,17 @@ namespace BizHawk.MultiClient private void LoadLuaFile(string path) { - LuaFiles l = new LuaFiles("", path, true); + bool enabled = true; + if (Global.Config.DisableLuaScriptsOnLoad) + enabled = false; + LuaFiles l = new LuaFiles("", path, enabled); luaList.Add(l); LuaListView.ItemCount = luaList.Count; LuaListView.Refresh(); Global.Config.RecentLua.Add(path); - LuaImp.DoLuaFile(path); + + if (!Global.Config.DisableLuaScriptsOnLoad) + LuaImp.DoLuaFile(path); changes = true; } @@ -195,6 +199,7 @@ namespace BizHawk.MultiClient { saveWindowPositionToolStripMenuItem.Checked = Global.Config.LuaConsoleSaveWindowPosition; autoloadConsoleToolStripMenuItem.Checked = Global.Config.AutoLoadLuaConsole; + disableScriptsOnLoadToolStripMenuItem.Checked = Global.Config.DisableLuaScriptsOnLoad; } private void saveWindowPositionToolStripMenuItem_Click(object sender, EventArgs e) @@ -658,7 +663,11 @@ namespace BizHawk.MultiClient s = s.Substring(2, s.Length - 2); //Get path LuaFiles l = new LuaFiles(s); - l.Enabled = enabled; + + if (!Global.Config.DisableLuaScriptsOnLoad) + l.Enabled = enabled; + else + l.Enabled = false; luaList.Add(l); } } @@ -991,5 +1000,10 @@ namespace BizHawk.MultiClient contextMenuStrip1.Items[5].Visible = false; } } + + private void disableScriptsOnLoadToolStripMenuItem_Click(object sender, EventArgs e) + { + Global.Config.DisableLuaScriptsOnLoad ^= true; + } } }