Lua Console - option to disable scripts on load
This commit is contained in:
parent
adda412369
commit
33383b533b
|
@ -220,6 +220,7 @@ namespace BizHawk.MultiClient
|
||||||
public int LuaConsoleWndy = -1;
|
public int LuaConsoleWndy = -1;
|
||||||
public int LuaConsoleWidth = -1;
|
public int LuaConsoleWidth = -1;
|
||||||
public int LuaConsoleHeight = -1;
|
public int LuaConsoleHeight = -1;
|
||||||
|
public bool DisableLuaScriptsOnLoad = false;
|
||||||
|
|
||||||
// RamWatch Settings
|
// RamWatch Settings
|
||||||
public bool AutoLoadRamWatch = false;
|
public bool AutoLoadRamWatch = false;
|
||||||
|
|
|
@ -74,10 +74,10 @@
|
||||||
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.luaFunctionsListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.luaFunctionsListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.OutputBox = new System.Windows.Forms.RichTextBox();
|
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.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||||
this.clearToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
|
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.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();
|
||||||
|
@ -90,10 +90,11 @@
|
||||||
this.LuaListView = new BizHawk.VirtualListView();
|
this.LuaListView = new BizHawk.VirtualListView();
|
||||||
this.Script = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.Script = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.PathName = ((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.contextMenuStrip1.SuspendLayout();
|
||||||
this.menuStrip1.SuspendLayout();
|
this.menuStrip1.SuspendLayout();
|
||||||
this.groupBox1.SuspendLayout();
|
|
||||||
this.contextMenuStrip2.SuspendLayout();
|
this.contextMenuStrip2.SuspendLayout();
|
||||||
|
this.groupBox1.SuspendLayout();
|
||||||
this.toolStrip1.SuspendLayout();
|
this.toolStrip1.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
|
@ -410,6 +411,7 @@
|
||||||
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.saveWindowPositionToolStripMenuItem,
|
this.saveWindowPositionToolStripMenuItem,
|
||||||
this.autoloadConsoleToolStripMenuItem,
|
this.autoloadConsoleToolStripMenuItem,
|
||||||
|
this.disableScriptsOnLoadToolStripMenuItem,
|
||||||
this.toolStripSeparator5,
|
this.toolStripSeparator5,
|
||||||
this.restoreWindowSizeToolStripMenuItem});
|
this.restoreWindowSizeToolStripMenuItem});
|
||||||
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
|
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
|
||||||
|
@ -468,6 +470,20 @@
|
||||||
this.OutputBox.TabIndex = 2;
|
this.OutputBox.TabIndex = 2;
|
||||||
this.OutputBox.Text = "";
|
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
|
// groupBox1
|
||||||
//
|
//
|
||||||
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
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.TabIndex = 4;
|
||||||
this.NumberOfScripts.Text = " 0 Scripts ";
|
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
|
// toolStrip1
|
||||||
//
|
//
|
||||||
this.toolStrip1.ClickThrough = true;
|
this.toolStrip1.ClickThrough = true;
|
||||||
|
@ -628,6 +630,13 @@
|
||||||
this.PathName.Text = "Path";
|
this.PathName.Text = "Path";
|
||||||
this.PathName.Width = 195;
|
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
|
// LuaConsole
|
||||||
//
|
//
|
||||||
this.AllowDrop = true;
|
this.AllowDrop = true;
|
||||||
|
@ -650,8 +659,8 @@
|
||||||
this.contextMenuStrip1.ResumeLayout(false);
|
this.contextMenuStrip1.ResumeLayout(false);
|
||||||
this.menuStrip1.ResumeLayout(false);
|
this.menuStrip1.ResumeLayout(false);
|
||||||
this.menuStrip1.PerformLayout();
|
this.menuStrip1.PerformLayout();
|
||||||
this.groupBox1.ResumeLayout(false);
|
|
||||||
this.contextMenuStrip2.ResumeLayout(false);
|
this.contextMenuStrip2.ResumeLayout(false);
|
||||||
|
this.groupBox1.ResumeLayout(false);
|
||||||
this.toolStrip1.ResumeLayout(false);
|
this.toolStrip1.ResumeLayout(false);
|
||||||
this.toolStrip1.PerformLayout();
|
this.toolStrip1.PerformLayout();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
@ -721,5 +730,6 @@
|
||||||
private System.Windows.Forms.ToolStripMenuItem luaFunctionsListToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem luaFunctionsListToolStripMenuItem;
|
||||||
private System.Windows.Forms.ContextMenuStrip contextMenuStrip2;
|
private System.Windows.Forms.ContextMenuStrip contextMenuStrip2;
|
||||||
private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem2;
|
private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem2;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem disableScriptsOnLoadToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -14,7 +14,6 @@ namespace BizHawk.MultiClient
|
||||||
public partial class LuaConsole : Form
|
public partial class LuaConsole : Form
|
||||||
{
|
{
|
||||||
//options - autoload session
|
//options - autoload session
|
||||||
//options - disable scripts on load
|
|
||||||
//TODO: remember column widths
|
//TODO: remember column widths
|
||||||
//TODO: restore column width on restore default settings
|
//TODO: restore column width on restore default settings
|
||||||
|
|
||||||
|
@ -161,12 +160,17 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
private void LoadLuaFile(string path)
|
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);
|
luaList.Add(l);
|
||||||
LuaListView.ItemCount = luaList.Count;
|
LuaListView.ItemCount = luaList.Count;
|
||||||
LuaListView.Refresh();
|
LuaListView.Refresh();
|
||||||
Global.Config.RecentLua.Add(path);
|
Global.Config.RecentLua.Add(path);
|
||||||
LuaImp.DoLuaFile(path);
|
|
||||||
|
if (!Global.Config.DisableLuaScriptsOnLoad)
|
||||||
|
LuaImp.DoLuaFile(path);
|
||||||
changes = true;
|
changes = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,6 +199,7 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
saveWindowPositionToolStripMenuItem.Checked = Global.Config.LuaConsoleSaveWindowPosition;
|
saveWindowPositionToolStripMenuItem.Checked = Global.Config.LuaConsoleSaveWindowPosition;
|
||||||
autoloadConsoleToolStripMenuItem.Checked = Global.Config.AutoLoadLuaConsole;
|
autoloadConsoleToolStripMenuItem.Checked = Global.Config.AutoLoadLuaConsole;
|
||||||
|
disableScriptsOnLoadToolStripMenuItem.Checked = Global.Config.DisableLuaScriptsOnLoad;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveWindowPositionToolStripMenuItem_Click(object sender, EventArgs e)
|
private void saveWindowPositionToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
@ -658,7 +663,11 @@ namespace BizHawk.MultiClient
|
||||||
s = s.Substring(2, s.Length - 2); //Get path
|
s = s.Substring(2, s.Length - 2); //Get path
|
||||||
|
|
||||||
LuaFiles l = new LuaFiles(s);
|
LuaFiles l = new LuaFiles(s);
|
||||||
l.Enabled = enabled;
|
|
||||||
|
if (!Global.Config.DisableLuaScriptsOnLoad)
|
||||||
|
l.Enabled = enabled;
|
||||||
|
else
|
||||||
|
l.Enabled = false;
|
||||||
luaList.Add(l);
|
luaList.Add(l);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -991,5 +1000,10 @@ namespace BizHawk.MultiClient
|
||||||
contextMenuStrip1.Items[5].Visible = false;
|
contextMenuStrip1.Items[5].Visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void disableScriptsOnLoadToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Global.Config.DisableLuaScriptsOnLoad ^= true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue