diff --git a/BizHawk.Client.Common/lua/LuaFile.cs b/BizHawk.Client.Common/lua/LuaFile.cs index 3397b5dc73..33631723d6 100644 --- a/BizHawk.Client.Common/lua/LuaFile.cs +++ b/BizHawk.Client.Common/lua/LuaFile.cs @@ -52,6 +52,11 @@ namespace BizHawk.Client.Common CurrentDirectory = file.CurrentDirectory; } + public static LuaFile SeparatorInstance + { + get { return new LuaFile(true); } + } + public void Stop() { Enabled = false; diff --git a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.cs b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.cs index 4228cdf14b..8e65a0697a 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.cs @@ -100,11 +100,10 @@ namespace BizHawk.Client.EmuHawk public Lua SpawnCoroutine(string File) { - var t = _lua.NewThread(); - //LuaRegister(t); //adelikat: Not sure why this was here but it was causing the entire luaimplmeentaiton to be duplicated each time, eventually resulting in crashes - var main = t.LoadFile(File); - t.Push(main); //push main function on to stack for subsequent resuming - return t; + Lua lua = _lua.NewThread(); + var main = lua.LoadFile(File); + lua.Push(main); //push main function on to stack for subsequent resuming + return lua; } public class ResumeResult diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs index a262a9ee12..e33571667b 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs @@ -30,244 +30,244 @@ { this.components = new System.ComponentModel.Container(); 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(); - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.stopAllScriptsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ScriptListContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.ToggleScriptContextItem = new System.Windows.Forms.ToolStripMenuItem(); + this.PauseScriptContextItem = new System.Windows.Forms.ToolStripMenuItem(); + this.EditScriptContextItem = new System.Windows.Forms.ToolStripMenuItem(); + this.RemoveScriptContextItem = new System.Windows.Forms.ToolStripMenuItem(); + this.InsertSeperatorContextItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ScriptContextSeparator = new System.Windows.Forms.ToolStripSeparator(); + this.StopAllScriptsContextItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1 = new MenuStripEx(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openSessionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.FileSubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.NewSessionMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.OpenSessionMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SaveSessionMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SaveSessionAsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); - this.recentSessionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.RecentSessionsSubMenu = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); - this.recentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.RecentScriptsSubMenu = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.scriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newScriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toggleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.pauseResumeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.removeScriptToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.insertSeparatorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ScriptSubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.NewScriptMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.OpenScriptMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ToggleScriptMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.PauseScriptMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.EditScriptMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.RemoveScriptMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.InsertSeparatorMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); - this.moveUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.moveDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.MoveUpMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.MoveDownMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SelectAllMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); - this.turnOffAllScriptsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.showRegisteredFunctionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveWindowPositionToolStripMenuItem = 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.StopAllScriptsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.RegisteredFunctionsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.OptionsSubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.SaveWindowPositionMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.AutoloadConsoleMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.AutoloadSessionMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.DisableScriptsOnLoadMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); - this.restoreWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.luaFunctionsListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.onlineDocumentationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.RestoreDefaultSettingsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.HelpSubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.FunctionsListMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.OnlineDocsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.OutputBox = new System.Windows.Forms.RichTextBox(); - this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components); - this.clearToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); - this.registeredFunctionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ConsoleContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.ClearConsoleContextItem = new System.Windows.Forms.ToolStripMenuItem(); + this.RegisteredFunctionsContextItem = new System.Windows.Forms.ToolStripMenuItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.NumberOfScripts = new System.Windows.Forms.Label(); this.OutputMessages = new System.Windows.Forms.Label(); this.toolStrip1 = new ToolStripEx(); - this.newStripButton1 = new System.Windows.Forms.ToolStripButton(); - 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(); + this.NewScriptToolbarItem = new System.Windows.Forms.ToolStripButton(); + this.OpenScriptToolbarItem = new System.Windows.Forms.ToolStripButton(); + this.ToggleScriptToolbarItem = new System.Windows.Forms.ToolStripButton(); + this.PauseToolbarItem = new System.Windows.Forms.ToolStripButton(); + this.EditToolbarItem = new System.Windows.Forms.ToolStripButton(); + this.RemoveScriptToolbarItem = new System.Windows.Forms.ToolStripButton(); + this.InsertSeparatorToolbarItem = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripButtonMoveUp = new System.Windows.Forms.ToolStripButton(); + this.MoveUpToolbarItem = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonMoveDown = new System.Windows.Forms.ToolStripButton(); this.LuaListView = new BizHawk.Client.EmuHawk.VirtualListView(); this.Script = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.PathName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.contextMenuStrip1.SuspendLayout(); + this.ScriptListContextMenu.SuspendLayout(); this.menuStrip1.SuspendLayout(); - this.contextMenuStrip2.SuspendLayout(); + this.ConsoleContextMenu.SuspendLayout(); this.groupBox1.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.SuspendLayout(); // - // contextMenuStrip1 + // ScriptListContextMenu // - this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toggleScriptToolStripMenuItem, - this.resumePauseToolStripMenuItem, - this.editScriptToolStripMenuItem, - this.removeScriptToolStripMenuItem, - this.insertSeperatorToolStripMenuItem1, - this.toolStripSeparator4, - this.stopAllScriptsToolStripMenuItem}); - this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(175, 142); - this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening); + this.ScriptListContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.ToggleScriptContextItem, + this.PauseScriptContextItem, + this.EditScriptContextItem, + this.RemoveScriptContextItem, + this.InsertSeperatorContextItem, + this.ScriptContextSeparator, + this.StopAllScriptsContextItem}); + this.ScriptListContextMenu.Name = "contextMenuStrip1"; + this.ScriptListContextMenu.Size = new System.Drawing.Size(165, 164); + this.ScriptListContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ScriptListContextMenu_Opening); // - // toggleScriptToolStripMenuItem + // ToggleScriptContextItem // - this.toggleScriptToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh1; - this.toggleScriptToolStripMenuItem.Name = "toggleScriptToolStripMenuItem"; - this.toggleScriptToolStripMenuItem.Size = new System.Drawing.Size(174, 22); - this.toggleScriptToolStripMenuItem.Text = "&Toggle"; - this.toggleScriptToolStripMenuItem.Click += new System.EventHandler(this.toggleScriptToolStripMenuItem_Click); + this.ToggleScriptContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh1; + this.ToggleScriptContextItem.Name = "ToggleScriptContextItem"; + this.ToggleScriptContextItem.Size = new System.Drawing.Size(164, 22); + this.ToggleScriptContextItem.Text = "&Toggle"; + this.ToggleScriptContextItem.Click += new System.EventHandler(this.ToggleScriptMenuItem_Click); // - // resumePauseToolStripMenuItem + // PauseScriptContextItem // - this.resumePauseToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.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); + this.PauseScriptContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Pause; + this.PauseScriptContextItem.Name = "PauseScriptContextItem"; + this.PauseScriptContextItem.Size = new System.Drawing.Size(164, 22); + this.PauseScriptContextItem.Text = "Pause or Resume"; + this.PauseScriptContextItem.Click += new System.EventHandler(this.PauseScriptMenuItem_Click); // - // editScriptToolStripMenuItem + // EditScriptContextItem // - this.editScriptToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS; - this.editScriptToolStripMenuItem.Name = "editScriptToolStripMenuItem"; - this.editScriptToolStripMenuItem.Size = new System.Drawing.Size(174, 22); - this.editScriptToolStripMenuItem.Text = "&Edit"; - this.editScriptToolStripMenuItem.Click += new System.EventHandler(this.editScriptToolStripMenuItem_Click); + this.EditScriptContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS; + this.EditScriptContextItem.Name = "EditScriptContextItem"; + this.EditScriptContextItem.Size = new System.Drawing.Size(164, 22); + this.EditScriptContextItem.Text = "&Edit"; + this.EditScriptContextItem.Click += new System.EventHandler(this.EditScriptMenuItem_Click); // - // removeScriptToolStripMenuItem + // RemoveScriptContextItem // - this.removeScriptToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Close; - this.removeScriptToolStripMenuItem.Name = "removeScriptToolStripMenuItem"; - this.removeScriptToolStripMenuItem.Size = new System.Drawing.Size(174, 22); - this.removeScriptToolStripMenuItem.Text = "&Remove"; - this.removeScriptToolStripMenuItem.Click += new System.EventHandler(this.removeScriptToolStripMenuItem_Click); + this.RemoveScriptContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Close; + this.RemoveScriptContextItem.Name = "RemoveScriptContextItem"; + this.RemoveScriptContextItem.Size = new System.Drawing.Size(164, 22); + this.RemoveScriptContextItem.Text = "&Remove"; + this.RemoveScriptContextItem.Click += new System.EventHandler(this.RemoveScriptMenuItem_Click); // - // insertSeperatorToolStripMenuItem1 + // InsertSeperatorContextItem // - this.insertSeperatorToolStripMenuItem1.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator; - this.insertSeperatorToolStripMenuItem1.Name = "insertSeperatorToolStripMenuItem1"; - this.insertSeperatorToolStripMenuItem1.Size = new System.Drawing.Size(174, 22); - this.insertSeperatorToolStripMenuItem1.Text = "Insert Seperator"; - this.insertSeperatorToolStripMenuItem1.Click += new System.EventHandler(this.insertSeperatorToolStripMenuItem1_Click); + this.InsertSeperatorContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator; + this.InsertSeperatorContextItem.Name = "InsertSeperatorContextItem"; + this.InsertSeperatorContextItem.Size = new System.Drawing.Size(164, 22); + this.InsertSeperatorContextItem.Text = "Insert Seperator"; + this.InsertSeperatorContextItem.Click += new System.EventHandler(this.InsertSeparatorMenuItem_Click); // - // toolStripSeparator4 + // ScriptContextSeparator // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(171, 6); + this.ScriptContextSeparator.Name = "ScriptContextSeparator"; + this.ScriptContextSeparator.Size = new System.Drawing.Size(161, 6); // - // stopAllScriptsToolStripMenuItem + // StopAllScriptsContextItem // - this.stopAllScriptsToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Stop; - this.stopAllScriptsToolStripMenuItem.Name = "stopAllScriptsToolStripMenuItem"; - this.stopAllScriptsToolStripMenuItem.Size = new System.Drawing.Size(174, 22); - this.stopAllScriptsToolStripMenuItem.Text = "Turn Off All Scripts"; - this.stopAllScriptsToolStripMenuItem.Click += new System.EventHandler(this.stopAllScriptsToolStripMenuItem_Click); + this.StopAllScriptsContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Stop; + this.StopAllScriptsContextItem.Name = "StopAllScriptsContextItem"; + this.StopAllScriptsContextItem.Size = new System.Drawing.Size(164, 22); + this.StopAllScriptsContextItem.Text = "Stop All Scripts"; + this.StopAllScriptsContextItem.Click += new System.EventHandler(this.StopAllScriptsMenuItem_Click); // // menuStrip1 // this.menuStrip1.ClickThrough = true; this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.scriptToolStripMenuItem, - this.optionsToolStripMenuItem, - this.helpToolStripMenuItem}); + this.FileSubMenu, + this.ScriptSubMenu, + this.OptionsSubMenu, + this.HelpSubMenu}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(584, 24); this.menuStrip1.TabIndex = 1; this.menuStrip1.Text = "menuStrip1"; // - // fileToolStripMenuItem + // FileSubMenu // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newToolStripMenuItem, - this.openSessionToolStripMenuItem, - this.saveToolStripMenuItem, - this.saveAsToolStripMenuItem, + this.FileSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.NewSessionMenuItem, + this.OpenSessionMenuItem, + this.SaveSessionMenuItem, + this.SaveSessionAsMenuItem, this.toolStripSeparator9, - this.recentSessionsToolStripMenuItem, - this.recentToolStripMenuItem, + this.RecentSessionsSubMenu, + this.RecentScriptsSubMenu, this.toolStripSeparator1, - this.exitToolStripMenuItem}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); - this.fileToolStripMenuItem.Text = "&File"; - this.fileToolStripMenuItem.DropDownOpened += new System.EventHandler(this.fileToolStripMenuItem_DropDownOpened); + this.ExitMenuItem}); + this.FileSubMenu.Name = "FileSubMenu"; + this.FileSubMenu.Size = new System.Drawing.Size(37, 20); + this.FileSubMenu.Text = "&File"; + this.FileSubMenu.DropDownOpened += new System.EventHandler(this.FileSubMenu_DropDownOpened); // - // newToolStripMenuItem + // NewSessionMenuItem // - this.newToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.NewFile; - this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + this.NewSessionMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.NewFile; + this.NewSessionMenuItem.Name = "NewSessionMenuItem"; + this.NewSessionMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.N))); - this.newToolStripMenuItem.Size = new System.Drawing.Size(237, 22); - this.newToolStripMenuItem.Text = "&New Session"; - this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); + this.NewSessionMenuItem.Size = new System.Drawing.Size(237, 22); + this.NewSessionMenuItem.Text = "&New Session"; + this.NewSessionMenuItem.Click += new System.EventHandler(this.NewSessionMenuItem_Click); // - // openSessionToolStripMenuItem + // OpenSessionMenuItem // - this.openSessionToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile; - this.openSessionToolStripMenuItem.Name = "openSessionToolStripMenuItem"; - this.openSessionToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + this.OpenSessionMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile; + this.OpenSessionMenuItem.Name = "OpenSessionMenuItem"; + this.OpenSessionMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.O))); - this.openSessionToolStripMenuItem.Size = new System.Drawing.Size(237, 22); - this.openSessionToolStripMenuItem.Text = "&Open Session..."; - this.openSessionToolStripMenuItem.Click += new System.EventHandler(this.openSessionToolStripMenuItem_Click); + this.OpenSessionMenuItem.Size = new System.Drawing.Size(237, 22); + this.OpenSessionMenuItem.Text = "&Open Session..."; + this.OpenSessionMenuItem.Click += new System.EventHandler(this.OpenSessionMenuItem_Click); // - // saveToolStripMenuItem + // SaveSessionMenuItem // - this.saveToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.SaveAs; - this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveToolStripMenuItem.Size = new System.Drawing.Size(237, 22); - this.saveToolStripMenuItem.Text = "&Save Session"; - this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); + this.SaveSessionMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.SaveAs; + this.SaveSessionMenuItem.Name = "SaveSessionMenuItem"; + this.SaveSessionMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.SaveSessionMenuItem.Size = new System.Drawing.Size(237, 22); + this.SaveSessionMenuItem.Text = "&Save Session"; + this.SaveSessionMenuItem.Click += new System.EventHandler(this.SaveSessionMenuItem_Click); // - // saveAsToolStripMenuItem + // SaveSessionAsMenuItem // - this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + this.SaveSessionAsMenuItem.Name = "SaveSessionAsMenuItem"; + this.SaveSessionAsMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.S))); - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(237, 22); - this.saveAsToolStripMenuItem.Text = "Save Session &As..."; - this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); + this.SaveSessionAsMenuItem.Size = new System.Drawing.Size(237, 22); + this.SaveSessionAsMenuItem.Text = "Save Session &As..."; + this.SaveSessionAsMenuItem.Click += new System.EventHandler(this.SaveSessionAsMenuItem_Click); // // toolStripSeparator9 // this.toolStripSeparator9.Name = "toolStripSeparator9"; this.toolStripSeparator9.Size = new System.Drawing.Size(234, 6); // - // recentSessionsToolStripMenuItem + // RecentSessionsSubMenu // - this.recentSessionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.RecentSessionsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripSeparator8}); - this.recentSessionsToolStripMenuItem.Name = "recentSessionsToolStripMenuItem"; - this.recentSessionsToolStripMenuItem.Size = new System.Drawing.Size(237, 22); - this.recentSessionsToolStripMenuItem.Text = "Recent Sessions"; - this.recentSessionsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.recentSessionsToolStripMenuItem_DropDownOpened); + this.RecentSessionsSubMenu.Name = "RecentSessionsSubMenu"; + this.RecentSessionsSubMenu.Size = new System.Drawing.Size(237, 22); + this.RecentSessionsSubMenu.Text = "Recent Sessions"; + this.RecentSessionsSubMenu.DropDownOpened += new System.EventHandler(this.RecentSessionsSubMenu_DropDownOpened); // // toolStripSeparator8 // this.toolStripSeparator8.Name = "toolStripSeparator8"; this.toolStripSeparator8.Size = new System.Drawing.Size(57, 6); // - // recentToolStripMenuItem + // RecentScriptsSubMenu // - this.recentToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.RecentScriptsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripSeparator3}); - this.recentToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Recent; - this.recentToolStripMenuItem.Name = "recentToolStripMenuItem"; - this.recentToolStripMenuItem.Size = new System.Drawing.Size(237, 22); - this.recentToolStripMenuItem.Text = "Recent Scripts"; - this.recentToolStripMenuItem.DropDownOpened += new System.EventHandler(this.recentToolStripMenuItem_DropDownOpened); + this.RecentScriptsSubMenu.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Recent; + this.RecentScriptsSubMenu.Name = "RecentScriptsSubMenu"; + this.RecentScriptsSubMenu.Size = new System.Drawing.Size(237, 22); + this.RecentScriptsSubMenu.Text = "Recent Scripts"; + this.RecentScriptsSubMenu.DropDownOpened += new System.EventHandler(this.RecentScriptsSubMenu_DropDownOpened); // // toolStripSeparator3 // @@ -279,233 +279,233 @@ this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size(234, 6); // - // exitToolStripMenuItem + // ExitMenuItem // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); - this.exitToolStripMenuItem.Size = new System.Drawing.Size(237, 22); - this.exitToolStripMenuItem.Text = "E&xit"; - this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + this.ExitMenuItem.Name = "ExitMenuItem"; + this.ExitMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); + this.ExitMenuItem.Size = new System.Drawing.Size(237, 22); + this.ExitMenuItem.Text = "E&xit"; + this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click); // - // scriptToolStripMenuItem + // ScriptSubMenu // - this.scriptToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newScriptToolStripMenuItem, - this.openToolStripMenuItem, - this.toggleToolStripMenuItem, - this.pauseResumeToolStripMenuItem, - this.editToolStripMenuItem, - this.removeScriptToolStripMenuItem1, - this.insertSeparatorToolStripMenuItem, + this.ScriptSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.NewScriptMenuItem, + this.OpenScriptMenuItem, + this.ToggleScriptMenuItem, + this.PauseScriptMenuItem, + this.EditScriptMenuItem, + this.RemoveScriptMenuItem, + this.InsertSeparatorMenuItem, this.toolStripSeparator7, - this.moveUpToolStripMenuItem, - this.moveDownToolStripMenuItem, - this.selectAllToolStripMenuItem, + this.MoveUpMenuItem, + this.MoveDownMenuItem, + this.SelectAllMenuItem, this.toolStripSeparator6, - this.turnOffAllScriptsToolStripMenuItem, - this.showRegisteredFunctionsToolStripMenuItem}); - this.scriptToolStripMenuItem.Name = "scriptToolStripMenuItem"; - this.scriptToolStripMenuItem.Size = new System.Drawing.Size(49, 20); - this.scriptToolStripMenuItem.Text = "&Script"; - this.scriptToolStripMenuItem.DropDownOpened += new System.EventHandler(this.scriptToolStripMenuItem_DropDownOpened); + this.StopAllScriptsMenuItem, + this.RegisteredFunctionsMenuItem}); + this.ScriptSubMenu.Name = "ScriptSubMenu"; + this.ScriptSubMenu.Size = new System.Drawing.Size(49, 20); + this.ScriptSubMenu.Text = "&Script"; + this.ScriptSubMenu.DropDownOpened += new System.EventHandler(this.ScriptSubMenu_DropDownOpened); // - // newScriptToolStripMenuItem + // NewScriptMenuItem // - this.newScriptToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.NewFile; - this.newScriptToolStripMenuItem.Name = "newScriptToolStripMenuItem"; - this.newScriptToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); - this.newScriptToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.newScriptToolStripMenuItem.Text = "New Script"; - this.newScriptToolStripMenuItem.Click += new System.EventHandler(this.newScriptToolStripMenuItem_Click); + this.NewScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.NewFile; + this.NewScriptMenuItem.Name = "NewScriptMenuItem"; + this.NewScriptMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); + this.NewScriptMenuItem.Size = new System.Drawing.Size(218, 22); + this.NewScriptMenuItem.Text = "New Script"; + this.NewScriptMenuItem.Click += new System.EventHandler(this.NewScriptMenuItem_Click); // - // openToolStripMenuItem + // OpenScriptMenuItem // - this.openToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile; - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.openToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.openToolStripMenuItem.Text = "&Open Script..."; - this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click_1); + this.OpenScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile; + this.OpenScriptMenuItem.Name = "OpenScriptMenuItem"; + this.OpenScriptMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); + this.OpenScriptMenuItem.Size = new System.Drawing.Size(218, 22); + this.OpenScriptMenuItem.Text = "&Open Script..."; + this.OpenScriptMenuItem.Click += new System.EventHandler(this.OpenScriptMenuItem_Click); // - // toggleToolStripMenuItem + // ToggleScriptMenuItem // - this.toggleToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh1; - this.toggleToolStripMenuItem.Name = "toggleToolStripMenuItem"; - this.toggleToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T))); - this.toggleToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.toggleToolStripMenuItem.Text = "&Toggle"; - this.toggleToolStripMenuItem.Click += new System.EventHandler(this.toggleToolStripMenuItem_Click); + this.ToggleScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh1; + this.ToggleScriptMenuItem.Name = "ToggleScriptMenuItem"; + this.ToggleScriptMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T))); + this.ToggleScriptMenuItem.Size = new System.Drawing.Size(218, 22); + this.ToggleScriptMenuItem.Text = "&Toggle"; + this.ToggleScriptMenuItem.Click += new System.EventHandler(this.ToggleScriptMenuItem_Click); // - // pauseResumeToolStripMenuItem + // PauseScriptMenuItem // - this.pauseResumeToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Pause; - this.pauseResumeToolStripMenuItem.Name = "pauseResumeToolStripMenuItem"; - this.pauseResumeToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.pauseResumeToolStripMenuItem.Text = "Pause or Resume"; - this.pauseResumeToolStripMenuItem.Click += new System.EventHandler(this.pauseResumeToolStripMenuItem_Click); + this.PauseScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Pause; + this.PauseScriptMenuItem.Name = "PauseScriptMenuItem"; + this.PauseScriptMenuItem.Size = new System.Drawing.Size(218, 22); + this.PauseScriptMenuItem.Text = "Pause or Resume"; + this.PauseScriptMenuItem.Click += new System.EventHandler(this.PauseScriptMenuItem_Click); // - // editToolStripMenuItem + // EditScriptMenuItem // - this.editToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS; - this.editToolStripMenuItem.Name = "editToolStripMenuItem"; - this.editToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); - this.editToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.editToolStripMenuItem.Text = "&Edit Script"; - this.editToolStripMenuItem.Click += new System.EventHandler(this.editToolStripMenuItem_Click); + this.EditScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS; + this.EditScriptMenuItem.Name = "EditScriptMenuItem"; + this.EditScriptMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); + this.EditScriptMenuItem.Size = new System.Drawing.Size(218, 22); + this.EditScriptMenuItem.Text = "&Edit Script"; + this.EditScriptMenuItem.Click += new System.EventHandler(this.EditScriptMenuItem_Click); // - // removeScriptToolStripMenuItem1 + // RemoveScriptMenuItem // - this.removeScriptToolStripMenuItem1.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete; - this.removeScriptToolStripMenuItem1.Name = "removeScriptToolStripMenuItem1"; - this.removeScriptToolStripMenuItem1.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R))); - this.removeScriptToolStripMenuItem1.Size = new System.Drawing.Size(218, 22); - this.removeScriptToolStripMenuItem1.Text = "&Remove Script"; - this.removeScriptToolStripMenuItem1.Click += new System.EventHandler(this.removeScriptToolStripMenuItem_Click); + this.RemoveScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete; + this.RemoveScriptMenuItem.Name = "RemoveScriptMenuItem"; + this.RemoveScriptMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R))); + this.RemoveScriptMenuItem.Size = new System.Drawing.Size(218, 22); + this.RemoveScriptMenuItem.Text = "&Remove Script"; + this.RemoveScriptMenuItem.Click += new System.EventHandler(this.RemoveScriptMenuItem_Click); // - // insertSeparatorToolStripMenuItem + // InsertSeparatorMenuItem // - this.insertSeparatorToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator; - this.insertSeparatorToolStripMenuItem.Name = "insertSeparatorToolStripMenuItem"; - this.insertSeparatorToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I))); - this.insertSeparatorToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.insertSeparatorToolStripMenuItem.Text = "Insert Separator"; - this.insertSeparatorToolStripMenuItem.Click += new System.EventHandler(this.insertSeperatorToolStripMenuItem_Click); + this.InsertSeparatorMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator; + this.InsertSeparatorMenuItem.Name = "InsertSeparatorMenuItem"; + this.InsertSeparatorMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I))); + this.InsertSeparatorMenuItem.Size = new System.Drawing.Size(218, 22); + this.InsertSeparatorMenuItem.Text = "Insert Separator"; + this.InsertSeparatorMenuItem.Click += new System.EventHandler(this.InsertSeparatorMenuItem_Click); // // toolStripSeparator7 // this.toolStripSeparator7.Name = "toolStripSeparator7"; this.toolStripSeparator7.Size = new System.Drawing.Size(215, 6); // - // moveUpToolStripMenuItem + // MoveUpMenuItem // - this.moveUpToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveUp; - this.moveUpToolStripMenuItem.Name = "moveUpToolStripMenuItem"; - this.moveUpToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.U))); - this.moveUpToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.moveUpToolStripMenuItem.Text = "Move &Up"; - this.moveUpToolStripMenuItem.Click += new System.EventHandler(this.moveUpToolStripMenuItem_Click_1); + this.MoveUpMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveUp; + this.MoveUpMenuItem.Name = "MoveUpMenuItem"; + this.MoveUpMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.U))); + this.MoveUpMenuItem.Size = new System.Drawing.Size(218, 22); + this.MoveUpMenuItem.Text = "Move &Up"; + this.MoveUpMenuItem.Click += new System.EventHandler(this.MoveUpMenuItem_Click); // - // moveDownToolStripMenuItem + // MoveDownMenuItem // - this.moveDownToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveDown; - this.moveDownToolStripMenuItem.Name = "moveDownToolStripMenuItem"; - this.moveDownToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D))); - this.moveDownToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.moveDownToolStripMenuItem.Text = "Move &Down"; - this.moveDownToolStripMenuItem.Click += new System.EventHandler(this.moveDownToolStripMenuItem_Click_1); + this.MoveDownMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveDown; + this.MoveDownMenuItem.Name = "MoveDownMenuItem"; + this.MoveDownMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D))); + this.MoveDownMenuItem.Size = new System.Drawing.Size(218, 22); + this.MoveDownMenuItem.Text = "Move &Down"; + this.MoveDownMenuItem.Click += new System.EventHandler(this.MoveDownMenuItem_Click); // - // selectAllToolStripMenuItem + // SelectAllMenuItem // - this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; - this.selectAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); - this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.selectAllToolStripMenuItem.Text = "Select &All"; - this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click); + this.SelectAllMenuItem.Name = "SelectAllMenuItem"; + this.SelectAllMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); + this.SelectAllMenuItem.Size = new System.Drawing.Size(218, 22); + this.SelectAllMenuItem.Text = "Select &All"; + this.SelectAllMenuItem.Click += new System.EventHandler(this.SelectAllMenuItem_Click); // // toolStripSeparator6 // this.toolStripSeparator6.Name = "toolStripSeparator6"; this.toolStripSeparator6.Size = new System.Drawing.Size(215, 6); // - // turnOffAllScriptsToolStripMenuItem + // StopAllScriptsMenuItem // - this.turnOffAllScriptsToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Stop; - this.turnOffAllScriptsToolStripMenuItem.Name = "turnOffAllScriptsToolStripMenuItem"; - this.turnOffAllScriptsToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.turnOffAllScriptsToolStripMenuItem.Text = "Turn Off All Scripts"; - this.turnOffAllScriptsToolStripMenuItem.Click += new System.EventHandler(this.turnOffAllScriptsToolStripMenuItem_Click); + this.StopAllScriptsMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Stop; + this.StopAllScriptsMenuItem.Name = "StopAllScriptsMenuItem"; + this.StopAllScriptsMenuItem.Size = new System.Drawing.Size(218, 22); + this.StopAllScriptsMenuItem.Text = "Stop All Scripts"; + this.StopAllScriptsMenuItem.Click += new System.EventHandler(this.StopAllScriptsMenuItem_Click); // - // showRegisteredFunctionsToolStripMenuItem + // RegisteredFunctionsMenuItem // - this.showRegisteredFunctionsToolStripMenuItem.Name = "showRegisteredFunctionsToolStripMenuItem"; - this.showRegisteredFunctionsToolStripMenuItem.ShortcutKeyDisplayString = "F12"; - this.showRegisteredFunctionsToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.showRegisteredFunctionsToolStripMenuItem.Text = "&Registered Functions..."; - this.showRegisteredFunctionsToolStripMenuItem.Click += new System.EventHandler(this.showRegisteredFunctionsToolStripMenuItem_Click); + this.RegisteredFunctionsMenuItem.Name = "RegisteredFunctionsMenuItem"; + this.RegisteredFunctionsMenuItem.ShortcutKeyDisplayString = "F12"; + this.RegisteredFunctionsMenuItem.Size = new System.Drawing.Size(218, 22); + this.RegisteredFunctionsMenuItem.Text = "&Registered Functions..."; + this.RegisteredFunctionsMenuItem.Click += new System.EventHandler(this.RegisteredFunctionsMenuItem_Click); // - // optionsToolStripMenuItem + // OptionsSubMenu // - this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.saveWindowPositionToolStripMenuItem, - this.autoloadConsoleToolStripMenuItem, - this.autoloadSessionToolStripMenuItem, - this.disableScriptsOnLoadToolStripMenuItem, + this.OptionsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.SaveWindowPositionMenuItem, + this.AutoloadConsoleMenuItem, + this.AutoloadSessionMenuItem, + this.DisableScriptsOnLoadMenuItem, this.toolStripSeparator5, - this.restoreWindowSizeToolStripMenuItem}); - this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; - this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20); - this.optionsToolStripMenuItem.Text = "&Options"; - this.optionsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.optionsToolStripMenuItem_DropDownOpened); + this.RestoreDefaultSettingsMenuItem}); + this.OptionsSubMenu.Name = "OptionsSubMenu"; + this.OptionsSubMenu.Size = new System.Drawing.Size(61, 20); + this.OptionsSubMenu.Text = "&Options"; + this.OptionsSubMenu.DropDownOpened += new System.EventHandler(this.OptionsSubMenu_DropDownOpened); // - // saveWindowPositionToolStripMenuItem + // SaveWindowPositionMenuItem // - this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem"; - this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(199, 22); - this.saveWindowPositionToolStripMenuItem.Text = "Save Window Position"; - this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click); + this.SaveWindowPositionMenuItem.Name = "SaveWindowPositionMenuItem"; + this.SaveWindowPositionMenuItem.Size = new System.Drawing.Size(199, 22); + this.SaveWindowPositionMenuItem.Text = "Save Window Position"; + this.SaveWindowPositionMenuItem.Click += new System.EventHandler(this.SaveWindowPositionMenuItem_Click); // - // autoloadConsoleToolStripMenuItem + // AutoloadConsoleMenuItem // - this.autoloadConsoleToolStripMenuItem.Name = "autoloadConsoleToolStripMenuItem"; - this.autoloadConsoleToolStripMenuItem.Size = new System.Drawing.Size(199, 22); - this.autoloadConsoleToolStripMenuItem.Text = "Autoload Console"; - this.autoloadConsoleToolStripMenuItem.Click += new System.EventHandler(this.autoloadConsoleToolStripMenuItem_Click); + this.AutoloadConsoleMenuItem.Name = "AutoloadConsoleMenuItem"; + this.AutoloadConsoleMenuItem.Size = new System.Drawing.Size(199, 22); + this.AutoloadConsoleMenuItem.Text = "Autoload Console"; + this.AutoloadConsoleMenuItem.Click += new System.EventHandler(this.AutoloadConsoleMenuItem_Click); // - // autoloadSessionToolStripMenuItem + // AutoloadSessionMenuItem // - 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); + this.AutoloadSessionMenuItem.Name = "AutoloadSessionMenuItem"; + this.AutoloadSessionMenuItem.Size = new System.Drawing.Size(199, 22); + this.AutoloadSessionMenuItem.Text = "Autoload Session"; + this.AutoloadSessionMenuItem.Click += new System.EventHandler(this.AutoloadSessionMenuItem_Click); // - // disableScriptsOnLoadToolStripMenuItem + // DisableScriptsOnLoadMenuItem // - 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); + this.DisableScriptsOnLoadMenuItem.Name = "DisableScriptsOnLoadMenuItem"; + this.DisableScriptsOnLoadMenuItem.Size = new System.Drawing.Size(199, 22); + this.DisableScriptsOnLoadMenuItem.Text = "Disable Scripts on Load"; + this.DisableScriptsOnLoadMenuItem.Click += new System.EventHandler(this.DisableScriptsOnLoadMenuItem_Click); // // toolStripSeparator5 // this.toolStripSeparator5.Name = "toolStripSeparator5"; this.toolStripSeparator5.Size = new System.Drawing.Size(196, 6); // - // restoreWindowSizeToolStripMenuItem + // RestoreDefaultSettingsMenuItem // - this.restoreWindowSizeToolStripMenuItem.Name = "restoreWindowSizeToolStripMenuItem"; - this.restoreWindowSizeToolStripMenuItem.Size = new System.Drawing.Size(199, 22); - this.restoreWindowSizeToolStripMenuItem.Text = "Restore Default Settings"; - this.restoreWindowSizeToolStripMenuItem.Click += new System.EventHandler(this.restoreWindowSizeToolStripMenuItem_Click); + this.RestoreDefaultSettingsMenuItem.Name = "RestoreDefaultSettingsMenuItem"; + this.RestoreDefaultSettingsMenuItem.Size = new System.Drawing.Size(199, 22); + this.RestoreDefaultSettingsMenuItem.Text = "Restore Default Settings"; + this.RestoreDefaultSettingsMenuItem.Click += new System.EventHandler(this.RestoreDefaultSettingsMenuItem_Click); // - // helpToolStripMenuItem + // HelpSubMenu // - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.luaFunctionsListToolStripMenuItem, - this.onlineDocumentationToolStripMenuItem}); - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); - this.helpToolStripMenuItem.Text = "&Help"; + this.HelpSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.FunctionsListMenuItem, + this.OnlineDocsMenuItem}); + this.HelpSubMenu.Name = "HelpSubMenu"; + this.HelpSubMenu.Size = new System.Drawing.Size(44, 20); + this.HelpSubMenu.Text = "&Help"; // - // luaFunctionsListToolStripMenuItem + // FunctionsListMenuItem // - this.luaFunctionsListToolStripMenuItem.Name = "luaFunctionsListToolStripMenuItem"; - this.luaFunctionsListToolStripMenuItem.Size = new System.Drawing.Size(202, 22); - this.luaFunctionsListToolStripMenuItem.Text = "&Lua Functions List"; - this.luaFunctionsListToolStripMenuItem.Click += new System.EventHandler(this.luaFunctionsListToolStripMenuItem_Click); + this.FunctionsListMenuItem.Name = "FunctionsListMenuItem"; + this.FunctionsListMenuItem.Size = new System.Drawing.Size(202, 22); + this.FunctionsListMenuItem.Text = "&Lua Functions List"; + this.FunctionsListMenuItem.Click += new System.EventHandler(this.FunctionsListMenuItem_Click); // - // onlineDocumentationToolStripMenuItem + // OnlineDocsMenuItem // - this.onlineDocumentationToolStripMenuItem.Name = "onlineDocumentationToolStripMenuItem"; - this.onlineDocumentationToolStripMenuItem.Size = new System.Drawing.Size(202, 22); - this.onlineDocumentationToolStripMenuItem.Text = "Documentation online..."; - this.onlineDocumentationToolStripMenuItem.Click += new System.EventHandler(this.onlineDocumentationToolStripMenuItem_Click); + this.OnlineDocsMenuItem.Name = "OnlineDocsMenuItem"; + this.OnlineDocsMenuItem.Size = new System.Drawing.Size(202, 22); + this.OnlineDocsMenuItem.Text = "Documentation online..."; + this.OnlineDocsMenuItem.Click += new System.EventHandler(this.OnlineDocsMenuItem_Click); // // OutputBox // this.OutputBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.OutputBox.ContextMenuStrip = this.contextMenuStrip2; + this.OutputBox.ContextMenuStrip = this.ConsoleContextMenu; this.OutputBox.Location = new System.Drawing.Point(6, 17); this.OutputBox.Name = "OutputBox"; this.OutputBox.ReadOnly = true; @@ -514,28 +514,28 @@ this.OutputBox.Text = ""; this.OutputBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OutputBox_KeyDown); // - // contextMenuStrip2 + // ConsoleContextMenu // - this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.clearToolStripMenuItem2, - this.registeredFunctionsToolStripMenuItem}); - this.contextMenuStrip2.Name = "contextMenuStrip2"; - this.contextMenuStrip2.Size = new System.Drawing.Size(185, 48); - this.contextMenuStrip2.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip2_Opening); + this.ConsoleContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.ClearConsoleContextItem, + this.RegisteredFunctionsContextItem}); + this.ConsoleContextMenu.Name = "contextMenuStrip2"; + this.ConsoleContextMenu.Size = new System.Drawing.Size(185, 48); + this.ConsoleContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ConsoleContextMenu_Opening); // - // clearToolStripMenuItem2 + // ClearConsoleContextItem // - this.clearToolStripMenuItem2.Name = "clearToolStripMenuItem2"; - this.clearToolStripMenuItem2.Size = new System.Drawing.Size(184, 22); - this.clearToolStripMenuItem2.Text = "&Clear"; - this.clearToolStripMenuItem2.Click += new System.EventHandler(this.clearToolStripMenuItem2_Click); + this.ClearConsoleContextItem.Name = "ClearConsoleContextItem"; + this.ClearConsoleContextItem.Size = new System.Drawing.Size(184, 22); + this.ClearConsoleContextItem.Text = "&Clear"; + this.ClearConsoleContextItem.Click += new System.EventHandler(this.ClearConsoleContextItem_Click); // - // registeredFunctionsToolStripMenuItem + // RegisteredFunctionsContextItem // - this.registeredFunctionsToolStripMenuItem.Name = "registeredFunctionsToolStripMenuItem"; - this.registeredFunctionsToolStripMenuItem.Size = new System.Drawing.Size(184, 22); - this.registeredFunctionsToolStripMenuItem.Text = "&Registered Functions"; - this.registeredFunctionsToolStripMenuItem.Click += new System.EventHandler(this.showRegisteredFunctionsToolStripMenuItem_Click); + this.RegisteredFunctionsContextItem.Name = "RegisteredFunctionsContextItem"; + this.RegisteredFunctionsContextItem.Size = new System.Drawing.Size(184, 22); + this.RegisteredFunctionsContextItem.Text = "&Registered Functions"; + this.RegisteredFunctionsContextItem.Click += new System.EventHandler(this.RegisteredFunctionsMenuItem_Click); // // groupBox1 // @@ -572,15 +572,15 @@ // this.toolStrip1.ClickThrough = true; this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newStripButton1, - this.openToolStripButton, - this.copyToolStripButton, - this.resumePauseButton1, - this.EditToolstripButton, - this.cutToolStripButton, - this.toolStripButtonSeparator, + this.NewScriptToolbarItem, + this.OpenScriptToolbarItem, + this.ToggleScriptToolbarItem, + this.PauseToolbarItem, + this.EditToolbarItem, + this.RemoveScriptToolbarItem, + this.InsertSeparatorToolbarItem, this.toolStripSeparator2, - this.toolStripButtonMoveUp, + this.MoveUpToolbarItem, this.toolStripButtonMoveDown}); this.toolStrip1.Location = new System.Drawing.Point(0, 24); this.toolStrip1.Name = "toolStrip1"; @@ -588,90 +588,90 @@ this.toolStrip1.TabIndex = 5; this.toolStrip1.Text = "toolStrip1"; // - // newStripButton1 + // NewScriptToolbarItem // - this.newStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.newStripButton1.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.NewFile; - this.newStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.newStripButton1.Name = "newStripButton1"; - this.newStripButton1.Size = new System.Drawing.Size(23, 22); - this.newStripButton1.Text = "New Lua Script"; - this.newStripButton1.Click += new System.EventHandler(this.newStripButton1_Click); + this.NewScriptToolbarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.NewScriptToolbarItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.NewFile; + this.NewScriptToolbarItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.NewScriptToolbarItem.Name = "NewScriptToolbarItem"; + this.NewScriptToolbarItem.Size = new System.Drawing.Size(23, 22); + this.NewScriptToolbarItem.Text = "New Lua Script"; + this.NewScriptToolbarItem.Click += new System.EventHandler(this.NewScriptMenuItem_Click); // - // openToolStripButton + // OpenScriptToolbarItem // - this.openToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.openToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripButton.Image"))); - this.openToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.openToolStripButton.Name = "openToolStripButton"; - this.openToolStripButton.Size = new System.Drawing.Size(23, 22); - this.openToolStripButton.Text = "Open Script"; - this.openToolStripButton.Click += new System.EventHandler(this.openToolStripButton_Click); + this.OpenScriptToolbarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.OpenScriptToolbarItem.Image = ((System.Drawing.Image)(resources.GetObject("OpenScriptToolbarItem.Image"))); + this.OpenScriptToolbarItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.OpenScriptToolbarItem.Name = "OpenScriptToolbarItem"; + this.OpenScriptToolbarItem.Size = new System.Drawing.Size(23, 22); + this.OpenScriptToolbarItem.Text = "Open Script"; + this.OpenScriptToolbarItem.Click += new System.EventHandler(this.OpenScriptMenuItem_Click); // - // copyToolStripButton + // ToggleScriptToolbarItem // - this.copyToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.copyToolStripButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh1; - this.copyToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.copyToolStripButton.Name = "copyToolStripButton"; - this.copyToolStripButton.Size = new System.Drawing.Size(23, 22); - this.copyToolStripButton.Text = "Toggle Script"; - this.copyToolStripButton.Click += new System.EventHandler(this.copyToolStripButton_Click); + this.ToggleScriptToolbarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.ToggleScriptToolbarItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh1; + this.ToggleScriptToolbarItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.ToggleScriptToolbarItem.Name = "ToggleScriptToolbarItem"; + this.ToggleScriptToolbarItem.Size = new System.Drawing.Size(23, 22); + this.ToggleScriptToolbarItem.Text = "Toggle Script"; + this.ToggleScriptToolbarItem.Click += new System.EventHandler(this.ToggleScriptMenuItem_Click); // - // resumePauseButton1 + // PauseToolbarItem // - this.resumePauseButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.resumePauseButton1.Image = global::BizHawk.Client.EmuHawk.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); + this.PauseToolbarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.PauseToolbarItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Pause; + this.PauseToolbarItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.PauseToolbarItem.Name = "PauseToolbarItem"; + this.PauseToolbarItem.Size = new System.Drawing.Size(23, 22); + this.PauseToolbarItem.Text = "Pause or Resume"; + this.PauseToolbarItem.Click += new System.EventHandler(this.PauseScriptMenuItem_Click); // - // EditToolstripButton + // EditToolbarItem // - this.EditToolstripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.EditToolstripButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS; - this.EditToolstripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.EditToolstripButton.Name = "EditToolstripButton"; - this.EditToolstripButton.Size = new System.Drawing.Size(23, 22); - this.EditToolstripButton.Text = "Edit Script"; - this.EditToolstripButton.Click += new System.EventHandler(this.EditToolstripButton_Click); + this.EditToolbarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.EditToolbarItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS; + this.EditToolbarItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.EditToolbarItem.Name = "EditToolbarItem"; + this.EditToolbarItem.Size = new System.Drawing.Size(23, 22); + this.EditToolbarItem.Text = "Edit Script"; + this.EditToolbarItem.Click += new System.EventHandler(this.EditToolbarItem_Click); // - // cutToolStripButton + // RemoveScriptToolbarItem // - this.cutToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.cutToolStripButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete; - this.cutToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.cutToolStripButton.Name = "cutToolStripButton"; - this.cutToolStripButton.Size = new System.Drawing.Size(23, 22); - this.cutToolStripButton.Text = "Remove Script"; - this.cutToolStripButton.Click += new System.EventHandler(this.cutToolStripButton_Click); + this.RemoveScriptToolbarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.RemoveScriptToolbarItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete; + this.RemoveScriptToolbarItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.RemoveScriptToolbarItem.Name = "RemoveScriptToolbarItem"; + this.RemoveScriptToolbarItem.Size = new System.Drawing.Size(23, 22); + this.RemoveScriptToolbarItem.Text = "Remove Script"; + this.RemoveScriptToolbarItem.Click += new System.EventHandler(this.RemoveScriptMenuItem_Click); // - // toolStripButtonSeparator + // InsertSeparatorToolbarItem // - this.toolStripButtonSeparator.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonSeparator.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator; - this.toolStripButtonSeparator.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonSeparator.Name = "toolStripButtonSeparator"; - this.toolStripButtonSeparator.Size = new System.Drawing.Size(23, 22); - this.toolStripButtonSeparator.Text = "Insert Separator"; - this.toolStripButtonSeparator.Click += new System.EventHandler(this.toolStripButtonSeparator_Click); + this.InsertSeparatorToolbarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.InsertSeparatorToolbarItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator; + this.InsertSeparatorToolbarItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.InsertSeparatorToolbarItem.Name = "InsertSeparatorToolbarItem"; + this.InsertSeparatorToolbarItem.Size = new System.Drawing.Size(23, 22); + this.InsertSeparatorToolbarItem.Text = "Insert Separator"; + this.InsertSeparatorToolbarItem.Click += new System.EventHandler(this.InsertSeparatorMenuItem_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25); // - // toolStripButtonMoveUp + // MoveUpToolbarItem // - this.toolStripButtonMoveUp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonMoveUp.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveUp; - this.toolStripButtonMoveUp.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonMoveUp.Name = "toolStripButtonMoveUp"; - this.toolStripButtonMoveUp.Size = new System.Drawing.Size(23, 22); - this.toolStripButtonMoveUp.Text = "Move Up"; - this.toolStripButtonMoveUp.Click += new System.EventHandler(this.toolStripButtonMoveUp_Click); + this.MoveUpToolbarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.MoveUpToolbarItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveUp; + this.MoveUpToolbarItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.MoveUpToolbarItem.Name = "MoveUpToolbarItem"; + this.MoveUpToolbarItem.Size = new System.Drawing.Size(23, 22); + this.MoveUpToolbarItem.Text = "Move Up"; + this.MoveUpToolbarItem.Click += new System.EventHandler(this.MoveUpMenuItem_Click); // // toolStripButtonMoveDown // @@ -681,7 +681,7 @@ this.toolStripButtonMoveDown.Name = "toolStripButtonMoveDown"; this.toolStripButtonMoveDown.Size = new System.Drawing.Size(23, 22); this.toolStripButtonMoveDown.Text = "Move Down"; - this.toolStripButtonMoveDown.Click += new System.EventHandler(this.toolStripButtonMoveDown_Click); + this.toolStripButtonMoveDown.Click += new System.EventHandler(this.MoveDownMenuItem_Click); // // LuaListView // @@ -692,7 +692,7 @@ this.LuaListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.Script, this.PathName}); - this.LuaListView.ContextMenuStrip = this.contextMenuStrip1; + this.LuaListView.ContextMenuStrip = this.ScriptListContextMenu; this.LuaListView.FullRowSelect = true; this.LuaListView.GridLines = true; this.LuaListView.HideSelection = false; @@ -738,10 +738,10 @@ this.Load += new System.EventHandler(this.LuaConsole_Load); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.LuaConsole_DragDrop); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.LuaConsole_DragEnter); - this.contextMenuStrip1.ResumeLayout(false); + this.ScriptListContextMenu.ResumeLayout(false); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); - this.contextMenuStrip2.ResumeLayout(false); + this.ConsoleContextMenu.ResumeLayout(false); this.groupBox1.ResumeLayout(false); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); @@ -755,69 +755,69 @@ private VirtualListView LuaListView; private System.Windows.Forms.ColumnHeader PathName; private MenuStripEx menuStrip1; - private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem FileSubMenu; + private System.Windows.Forms.ToolStripMenuItem SaveSessionMenuItem; + private System.Windows.Forms.ToolStripMenuItem SaveSessionAsMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem scriptToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem toggleToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem ExitMenuItem; + private System.Windows.Forms.ToolStripMenuItem ScriptSubMenu; + private System.Windows.Forms.ToolStripMenuItem EditScriptMenuItem; + private System.Windows.Forms.ToolStripMenuItem ToggleScriptMenuItem; public System.Windows.Forms.ColumnHeader Script; private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem saveWindowPositionToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem restoreWindowSizeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem NewSessionMenuItem; + private System.Windows.Forms.ToolStripMenuItem OptionsSubMenu; + private System.Windows.Forms.ToolStripMenuItem SaveWindowPositionMenuItem; + private System.Windows.Forms.ToolStripMenuItem RestoreDefaultSettingsMenuItem; private System.Windows.Forms.Label NumberOfScripts; - private System.Windows.Forms.ToolStripMenuItem insertSeparatorToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem turnOffAllScriptsToolStripMenuItem; - private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; - private System.Windows.Forms.ToolStripMenuItem recentToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem InsertSeparatorMenuItem; + private System.Windows.Forms.ToolStripMenuItem StopAllScriptsMenuItem; + private System.Windows.Forms.ContextMenuStrip ScriptListContextMenu; + private System.Windows.Forms.ToolStripMenuItem RecentScriptsSubMenu; private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; - private System.Windows.Forms.ToolStripMenuItem stopAllScriptsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem autoloadConsoleToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem removeScriptToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem insertSeperatorToolStripMenuItem1; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; + private System.Windows.Forms.ToolStripMenuItem StopAllScriptsContextItem; + private System.Windows.Forms.ToolStripMenuItem AutoloadConsoleMenuItem; + private System.Windows.Forms.ToolStripMenuItem RemoveScriptContextItem; + private System.Windows.Forms.ToolStripMenuItem InsertSeperatorContextItem; + private System.Windows.Forms.ToolStripSeparator ScriptContextSeparator; private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; - private System.Windows.Forms.ToolStripMenuItem editScriptToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem toggleScriptToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem removeScriptToolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem EditScriptContextItem; + private System.Windows.Forms.ToolStripMenuItem ToggleScriptContextItem; + private System.Windows.Forms.ToolStripMenuItem RemoveScriptMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; - private System.Windows.Forms.ToolStripMenuItem moveUpToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem moveDownToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem MoveUpMenuItem; + private System.Windows.Forms.ToolStripMenuItem MoveDownMenuItem; + private System.Windows.Forms.ToolStripMenuItem SelectAllMenuItem; private ToolStripEx toolStrip1; - private System.Windows.Forms.ToolStripButton openToolStripButton; - private System.Windows.Forms.ToolStripButton cutToolStripButton; - private System.Windows.Forms.ToolStripButton copyToolStripButton; - private System.Windows.Forms.ToolStripButton toolStripButtonSeparator; + private System.Windows.Forms.ToolStripButton OpenScriptToolbarItem; + private System.Windows.Forms.ToolStripButton RemoveScriptToolbarItem; + private System.Windows.Forms.ToolStripButton ToggleScriptToolbarItem; + private System.Windows.Forms.ToolStripButton InsertSeparatorToolbarItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; - private System.Windows.Forms.ToolStripButton toolStripButtonMoveUp; + private System.Windows.Forms.ToolStripButton MoveUpToolbarItem; private System.Windows.Forms.ToolStripButton toolStripButtonMoveDown; - private System.Windows.Forms.ToolStripButton EditToolstripButton; - private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem openSessionToolStripMenuItem; + private System.Windows.Forms.ToolStripButton EditToolbarItem; + private System.Windows.Forms.ToolStripMenuItem OpenScriptMenuItem; + private System.Windows.Forms.ToolStripMenuItem OpenSessionMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; - private System.Windows.Forms.ToolStripMenuItem recentSessionsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem RecentSessionsSubMenu; private System.Windows.Forms.ToolStripSeparator toolStripSeparator8; - private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem luaFunctionsListToolStripMenuItem; - private System.Windows.Forms.ContextMenuStrip contextMenuStrip2; - private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem2; - private System.Windows.Forms.ToolStripMenuItem disableScriptsOnLoadToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem autoloadSessionToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem pauseResumeToolStripMenuItem; - private System.Windows.Forms.ToolStripButton resumePauseButton1; - private System.Windows.Forms.ToolStripMenuItem resumePauseToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem HelpSubMenu; + private System.Windows.Forms.ToolStripMenuItem FunctionsListMenuItem; + private System.Windows.Forms.ContextMenuStrip ConsoleContextMenu; + private System.Windows.Forms.ToolStripMenuItem ClearConsoleContextItem; + private System.Windows.Forms.ToolStripMenuItem DisableScriptsOnLoadMenuItem; + private System.Windows.Forms.ToolStripMenuItem AutoloadSessionMenuItem; + private System.Windows.Forms.ToolStripMenuItem PauseScriptMenuItem; + private System.Windows.Forms.ToolStripButton PauseToolbarItem; + private System.Windows.Forms.ToolStripMenuItem PauseScriptContextItem; public System.Windows.Forms.RichTextBox OutputBox; private System.Windows.Forms.Label OutputMessages; - private System.Windows.Forms.ToolStripMenuItem onlineDocumentationToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem newScriptToolStripMenuItem; - private System.Windows.Forms.ToolStripButton newStripButton1; - private System.Windows.Forms.ToolStripMenuItem showRegisteredFunctionsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem registeredFunctionsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem OnlineDocsMenuItem; + private System.Windows.Forms.ToolStripMenuItem NewScriptMenuItem; + private System.Windows.Forms.ToolStripButton NewScriptToolbarItem; + private System.Windows.Forms.ToolStripMenuItem RegisteredFunctionsMenuItem; + private System.Windows.Forms.ToolStripMenuItem RegisteredFunctionsContextItem; } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index e546beb85e..629fe06842 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -103,8 +103,8 @@ namespace BizHawk.Client.EmuHawk } } - newStripButton1.Visible = VersionInfo.INTERIM; - newScriptToolStripMenuItem.Visible = VersionInfo.INTERIM; + NewScriptToolbarItem.Visible = VersionInfo.INTERIM; + NewScriptMenuItem.Visible = VersionInfo.INTERIM; } private void StopScript(int x) @@ -150,16 +150,6 @@ namespace BizHawk.Client.EmuHawk } } - private void exitToolStripMenuItem_Click(object sender, EventArgs e) - { - Close(); - } - - private void restoreWindowSizeToolStripMenuItem_Click(object sender, EventArgs e) - { - Size = new Size(_defaultWidth, _defaultHeight); - } - private FileInfo GetFileFromUser(string filter) { var ofd = new OpenFileDialog(); @@ -186,8 +176,8 @@ namespace BizHawk.Client.EmuHawk { if (LuaAlreadyInSession(path) == false) { - LuaFile l = new LuaFile("", path); - _luaList.Add(l); + LuaFile luaFile = new LuaFile(String.Empty, path); + _luaList.Add(luaFile); LuaListView.ItemCount = _luaList.Count; LuaListView.Refresh(); Global.Config.RecentLua.Add(path); @@ -196,21 +186,21 @@ namespace BizHawk.Client.EmuHawk { try { - l.Thread = LuaImp.SpawnCoroutine(path); - l.Enabled = true; + luaFile.Thread = LuaImp.SpawnCoroutine(path); + luaFile.Enabled = true; } catch (Exception e) { if (e.ToString().Substring(0, 32) == "LuaInterface.LuaScriptException:") { - l.Enabled = false; + luaFile.Enabled = false; AddText(e.Message); } else MessageBox.Show(e.ToString()); } } - else l.Enabled = false; - l.Paused = false; + else luaFile.Enabled = false; + luaFile.Paused = false; Changes(true); } else @@ -229,68 +219,11 @@ namespace BizHawk.Client.EmuHawk } } - private void OpenLuaFile() - { - var file = GetFileFromUser("Lua Scripts (*.lua)|*.lua|Text (*.text)|*.txt|All Files|*.*"); - if (file != null) - { - LoadLuaFile(file.FullName); - DisplayLuaList(); - } - } - - public void DisplayLuaList() + public void UpdateDialog() { LuaListView.ItemCount = _luaList.Count; } - private void optionsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) - { - saveWindowPositionToolStripMenuItem.Checked = Global.Config.LuaConsoleSaveWindowPosition; - autoloadConsoleToolStripMenuItem.Checked = Global.Config.AutoLoadLuaConsole; - autoloadSessionToolStripMenuItem.Checked = Global.Config.RecentLuaSession.AutoLoad; - disableScriptsOnLoadToolStripMenuItem.Checked = Global.Config.DisableLuaScriptsOnLoad; - } - - private void saveWindowPositionToolStripMenuItem_Click(object sender, EventArgs e) - { - Global.Config.LuaConsoleSaveWindowPosition ^= true; - } - - private void Toggle() - { - ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices; - if (indexes.Count > 0) - { - for (int x = 0; x < indexes.Count; x++) - { - var item = _luaList[indexes[x]]; - if (!item.IsSeparator) - { - item.Toggle(); - } - if (item.Enabled && item.Thread == null) - try - { - item.Thread = LuaImp.SpawnCoroutine(item.Path); - } - catch (Exception e) - { - if (e.ToString().Substring(0, 32) == "LuaInterface.LuaScriptException:") - { - item.Enabled = false; - AddText(e.Message); - } - else MessageBox.Show(e.ToString()); - } - else if (!item.Enabled && item.Thread != null) - item.Stop(); - } - } - LuaListView.Refresh(); - Changes(true); - } - public void RunLuaScripts() { for (int x = 0; x < _luaList.Count; x++) @@ -340,202 +273,23 @@ namespace BizHawk.Client.EmuHawk } int L = _luaList.Count - separators; + if (L == 1) + { message += L.ToString() + " script (" + active.ToString() + " active, " + paused.ToString() + " paused)"; + } else if (L == 0) + { message += L.ToString() + " script"; + } else + { message += L.ToString() + " scripts (" + active.ToString() + " active, " + paused.ToString() + " paused)"; + } NumberOfScripts.Text = message; } - private void saveToolStripMenuItem_Click(object sender, EventArgs e) - { - if (_changes) - { - if (string.Compare(_currentSessionFile, "") == 0) - SaveAs(); - else SaveSession(_currentSessionFile); - Changes(false); - OutputMessages.Text = Path.GetFileName(_currentSessionFile) + " saved."; - } - } - - private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) - { - SaveAs(); - } - - private void newToolStripMenuItem_Click(object sender, EventArgs e) - { - NewLuaSession(false); - } - - private void NewLuaSession(bool suppressAsk) - { - bool result = true; - if (_changes) result = AskSave(); - - if (result || suppressAsk) - { - ClearOutput(); - StopAllScripts(); - _luaList.Clear(); - DisplayLuaList(); - _currentSessionFile = String.Empty; - Changes(false); - } - } - - private void turnOffAllScriptsToolStripMenuItem_Click(object sender, EventArgs e) - { - StopAllScripts(); - } - - private void stopAllScriptsToolStripMenuItem_Click(object sender, EventArgs e) - { - StopAllScripts(); - } - - private void autoloadConsoleToolStripMenuItem_Click(object sender, EventArgs e) - { - Global.Config.AutoLoadLuaConsole ^= true; - } - - private void RemoveScript() - { - if (_luaList.Count == 0) return; - - ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices; - if (indexes.Count > 0) - { - Changes(true); - - foreach (int index in indexes) - { - _luaList.Remove(_luaList[indexes[0]]); //index[0] used since each iteration will make this the correct list index - } - - indexes.Clear(); - DisplayLuaList(); - UpdateNumberOfScripts(); - } - } - - private void removeScriptToolStripMenuItem_Click(object sender, EventArgs e) - { - RemoveScript(); - } - - private void insertSeperatorToolStripMenuItem_Click(object sender, EventArgs e) - { - InsertSeparator(); - } - - private void InsertSeparator() - { - LuaFile f = new LuaFile(true) {IsSeparator = true}; - - ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices; - if (indexes.Count > 0) - { - if (indexes[0] > 0) - { - _luaList.Insert(indexes[0], f); - } - } - else - { - _luaList.Add(f); - } - DisplayLuaList(); - LuaListView.Refresh(); - Changes(true); - } - - private void insertSeperatorToolStripMenuItem1_Click(object sender, EventArgs e) - { - InsertSeparator(); - } - - private void MoveUp() - { - ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices; - if (indexes[0] == 0) - return; - - if (indexes.Count == 0) return; - foreach (int index in indexes) - { - LuaFile temp = _luaList[index]; - _luaList.Remove(_luaList[index]); - _luaList.Insert(index - 1, temp); - - //Note: here it will get flagged many times redundantly potentially, - //but this avoids it being flagged falsely when the user did not select an index - Changes(true); - } - List i = new List(); - for (int z = 0; z < indexes.Count; z++) - i.Add(indexes[z] - 1); - - LuaListView.SelectedIndices.Clear(); - foreach (int t in i) - { - LuaListView.SelectItem(t, true); - } - - DisplayLuaList(); - } - - private void MoveDown() - { - ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices; - if (indexes.Count == 0) return; - foreach (int index in indexes) - { - LuaFile temp = _luaList[index]; - - if (index < _luaList.Count - 1) - { - - _luaList.Remove(_luaList[index]); - _luaList.Insert(index + 1, temp); - - } - - //Note: here it will get flagged many times redundantly potnetially, - //but this avoids it being flagged falsely when the user did not select an index - Changes(true); - } - - List i = new List(); - for (int z = 0; z < indexes.Count; z++) - i.Add(indexes[z] + 1); - - LuaListView.SelectedIndices.Clear(); - foreach (int t in i) - { - LuaListView.SelectItem(t, true); - } - - DisplayLuaList(); - } - - private void toggleToolStripMenuItem_Click(object sender, EventArgs e) - { - Toggle(); - } - - private void recentToolStripMenuItem_DropDownOpened(object sender, EventArgs e) - { - recentToolStripMenuItem.DropDownItems.Clear(); - recentToolStripMenuItem.DropDownItems.AddRange( - ToolHelpers.GenerateRecentMenu(Global.Config.RecentLua, LoadLuaFromRecent) - ); - } - private void LoadLuaFromRecent(string path) { LoadLuaFile(path); @@ -546,139 +300,6 @@ namespace BizHawk.Client.EmuHawk return _luaList.Any(t => path == t.Path); } - private void LuaConsole_DragDrop(object sender, DragEventArgs e) - { - string[] filePaths = (string[])e.Data.GetData(DataFormats.FileDrop); - try - { - foreach (string path in filePaths) - { - if (Path.GetExtension(path) == (".lua") || Path.GetExtension(path) == (".txt")) - { - LoadLuaFile(path); - DisplayLuaList(); - } - else if (Path.GetExtension(path) == (".luases")) - { - LoadLuaSession(path); - RunLuaScripts(); - return; - } - } - } - catch (Exception ex) - { - if (ex.ToString().Substring(0, 32) == "LuaInterface.LuaScriptException:" || ex.ToString().Substring(0, 26) == "LuaInterface.LuaException:") - { - AddText(ex.Message); - } - else MessageBox.Show(ex.Message); - } - } - - private void LuaConsole_DragEnter(object sender, DragEventArgs e) - { - e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None; - } - - private void LuaListView_KeyDown(object sender, KeyEventArgs e) - { - if (e.KeyCode == Keys.Delete && !e.Control && !e.Alt && !e.Shift) - { - RemoveScript(); - } - else if (e.KeyCode == Keys.A && e.Control && !e.Alt && !e.Shift) //Select All - { - SelectAll(); - } - else if (e.KeyCode == Keys.F12 && !e.Control && !e.Alt && !e.Shift) //F12 - { - showRegisteredFunctionsToolStripMenuItem_Click(null, null); - } - } - - private void editScriptToolStripMenuItem_Click(object sender, EventArgs e) - { - EditScript(); - } - - private void editToolStripMenuItem_Click(object sender, EventArgs e) - { - EditScript(); - } - - private void EditScript() - { - ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices; - if (indexes.Count == 0) - return; - - 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) - { - Toggle(); - } - - private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) - { - SelectAll(); - } - - private void SelectAll() - { - for (int x = 0; x < _luaList.Count; x++) - { - LuaListView.SelectItem(x, true); - } - } - - private void toolStripButtonMoveDown_Click(object sender, EventArgs e) - { - MoveDown(); - } - - private void toolStripButtonMoveUp_Click(object sender, EventArgs e) - { - MoveUp(); - } - - private void toolStripButtonSeparator_Click(object sender, EventArgs e) - { - InsertSeparator(); - } - - private void copyToolStripButton_Click(object sender, EventArgs e) - { - Toggle(); - } - - private void EditToolstripButton_Click(object sender, EventArgs e) - { - if (VersionInfo.INTERIM) - { - DoLuaWriter(); - } - else - { - EditScript(); - } - } - - private void cutToolStripButton_Click(object sender, EventArgs e) - { - RemoveScript(); - } - public void WriteToOutputWindow(string message) { if (!OutputBox.IsHandleCreated || OutputBox.IsDisposed) @@ -704,18 +325,6 @@ namespace BizHawk.Client.EmuHawk }); } - private void openToolStripMenuItem_Click_1(object sender, EventArgs e) - { - OpenLuaFile(); - } - - private void luaFunctionsListToolStripMenuItem_Click(object sender, EventArgs e) - { - GlobalWin.Sound.StopSound(); - new LuaFunctionsForm().Show(); - GlobalWin.Sound.StartSound(); - } - public bool LoadLuaSession(string path) { var file = new FileInfo(path); @@ -777,22 +386,6 @@ namespace BizHawk.Client.EmuHawk return true; } - private void OpenLuaSession() - { - var file = GetFileFromUser("Lua Session Files (*.luases)|*.luases|All Files|*.*"); - if (file != null) - { - LoadLuaSession(file.FullName); - RunLuaScripts(); - DisplayLuaList(); - } - } - - private void openSessionToolStripMenuItem_Click(object sender, EventArgs e) - { - OpenLuaSession(); - } - /// /// resumes suspended coroutines /// @@ -879,21 +472,6 @@ namespace BizHawk.Client.EmuHawk return LuaImp.LuaWait.WaitOne(timeout); } - private void openToolStripButton_Click(object sender, EventArgs e) - { - OpenLuaFile(); - } - - private void LuaListView_ItemActivate(object sender, EventArgs e) - { - Toggle(); - } - - private void clearToolStripMenuItem2_Click(object sender, EventArgs e) - { - ClearOutput(); - } - public void ClearOutput() { OutputBox.Text = String.Empty; @@ -928,7 +506,7 @@ namespace BizHawk.Client.EmuHawk return file; } - private void SaveAs() + private void SaveSessionAs() { var file = GetSaveFileFromUser(); if (file != null) @@ -972,19 +550,6 @@ namespace BizHawk.Client.EmuHawk Changes(false); } - private void fileToolStripMenuItem_DropDownOpened(object sender, EventArgs e) - { - saveToolStripMenuItem.Enabled = _changes; - } - - private void recentSessionsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) - { - recentSessionsToolStripMenuItem.DropDownItems.Clear(); - recentSessionsToolStripMenuItem.DropDownItems.AddRange( - ToolHelpers.GenerateRecentMenu(Global.Config.RecentLuaSession, LoadSessionFromRecent) - ); - } - public void LoadSessionFromRecent(string path) { bool doload = true; @@ -999,7 +564,7 @@ namespace BizHawk.Client.EmuHawk else { RunLuaScripts(); - DisplayLuaList(); + UpdateDialog(); LuaListView.Refresh(); _currentSessionFile = path; Changes(false); @@ -1023,7 +588,7 @@ namespace BizHawk.Client.EmuHawk { if (String.IsNullOrWhiteSpace(_currentSessionFile)) { - SaveAs(); + SaveSessionAs(); } else { @@ -1044,163 +609,6 @@ namespace BizHawk.Client.EmuHawk return true; } - private void moveUpToolStripMenuItem_Click_1(object sender, EventArgs e) - { - MoveUp(); - } - - private void moveDownToolStripMenuItem_Click_1(object sender, EventArgs e) - { - MoveDown(); - } - - private void scriptToolStripMenuItem_DropDownOpened(object sender, EventArgs e) - { - bool luaRunning = false; - foreach (LuaFile t in _luaList) - { - if (t.Enabled) - { - luaRunning = true; - } - } - - ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices; - if (indexes.Count > 0) - { - scriptToolStripMenuItem.DropDownItems[1].Enabled = true; - scriptToolStripMenuItem.DropDownItems[2].Enabled = true; - scriptToolStripMenuItem.DropDownItems[3].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++) - { - if (!_luaList[indexes[i]].IsSeparator) - allSeparators = false; - } - if (allSeparators) - scriptToolStripMenuItem.DropDownItems[3].Enabled = false; - else - scriptToolStripMenuItem.DropDownItems[3].Enabled = true; - } - else - { - 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.Any()) - scriptToolStripMenuItem.DropDownItems[9].Enabled = true; - else - scriptToolStripMenuItem.DropDownItems[9].Enabled = false; - - - turnOffAllScriptsToolStripMenuItem.Enabled = luaRunning; - - - showRegisteredFunctionsToolStripMenuItem.Enabled = GlobalWin.Tools.LuaConsole.LuaImp.RegisteredFunctions.Any(); - } - - private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) - { - ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices; - bool luaRunning = false; - foreach (LuaFile t in _luaList) - { - if (t.Enabled) - luaRunning = true; - } - - if (indexes.Count > 0) - { - 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++) - { - if (!_luaList[indexes[i]].IsSeparator) - allSeparators = false; - } - if (allSeparators) - contextMenuStrip1.Items[2].Enabled = false; - else - 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[5].Visible = true; - contextMenuStrip1.Items[6].Visible = true; - } - else - { - contextMenuStrip1.Items[5].Visible = false; - contextMenuStrip1.Items[6].Visible = false; - } - } - - private void disableScriptsOnLoadToolStripMenuItem_Click(object sender, EventArgs e) - { - Global.Config.DisableLuaScriptsOnLoad ^= true; - } - - private void autoloadSessionToolStripMenuItem_Click(object sender, EventArgs e) - { - Global.Config.RecentLuaSession.AutoLoad ^= true; - } - - private void TogglePause() - { - ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices; - if (indexes.Count > 0) - { - for (int x = 0; x < indexes.Count; x++) - { - var item = _luaList[indexes[x]]; - if (!item.IsSeparator) - item.TogglePause(); - } - } - LuaListView.Refresh(); - } - - private void pauseResumeToolStripMenuItem_Click(object sender, EventArgs e) - { - TogglePause(); - } - - private void toolStripButton1_Click_1(object sender, EventArgs e) - { - TogglePause(); - } - - private void resumePauseToolStripMenuItem_Click(object sender, EventArgs e) - { - TogglePause(); - } - - private void onlineDocumentationToolStripMenuItem_Click(object sender, EventArgs e) - { - System.Diagnostics.Process.Start("http://tasvideos.org/BizHawk/LuaFunctions.html"); - } - private void DoLuaWriter() { ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices; @@ -1223,28 +631,293 @@ namespace BizHawk.Client.EmuHawk writer.Show(); } - private void newScriptToolStripMenuItem_Click(object sender, EventArgs e) - { - NewScript(); - } - - private void NewScript() - { - OpenLuaWriter(null); - } - - private void newStripButton1_Click(object sender, EventArgs e) - { - NewScript(); - } - private Point GetPromptPoint() { Point p = new Point(LuaListView.Location.X + 30, LuaListView.Location.Y + 30); return PointToScreen(p); } - private void showRegisteredFunctionsToolStripMenuItem_Click(object sender, EventArgs e) + private IEnumerable SelectedIndices + { + get { return LuaListView.SelectedIndices.Cast().ToList(); } + } + + private IEnumerable SelectedItems + { + get { return SelectedIndices.Select(index => _luaList[index]).ToList(); } + } + + private IEnumerable SelectedFiles + { + get { return SelectedItems.Where(x => !x.IsSeparator); } + } + + #region Events + + #region File Menu + + private void FileSubMenu_DropDownOpened(object sender, EventArgs e) + { + SaveSessionMenuItem.Enabled = _changes; + } + + private void RecentSessionsSubMenu_DropDownOpened(object sender, EventArgs e) + { + RecentSessionsSubMenu.DropDownItems.Clear(); + RecentSessionsSubMenu.DropDownItems.AddRange( + ToolHelpers.GenerateRecentMenu(Global.Config.RecentLuaSession, LoadSessionFromRecent) + ); + } + + private void RecentScriptsSubMenu_DropDownOpened(object sender, EventArgs e) + { + RecentScriptsSubMenu.DropDownItems.Clear(); + RecentScriptsSubMenu.DropDownItems.AddRange( + ToolHelpers.GenerateRecentMenu(Global.Config.RecentLua, LoadLuaFromRecent) + ); + } + + private void NewSessionMenuItem_Click(object sender, EventArgs e) + { + bool result = !_changes || AskSave(); + + if (result) + { + ClearOutput(); + StopAllScripts(); + _luaList.Clear(); + UpdateDialog(); + _currentSessionFile = String.Empty; + Changes(false); + } + } + + private void OpenSessionMenuItem_Click(object sender, EventArgs e) + { + var file = GetFileFromUser("Lua Session Files (*.luases)|*.luases|All Files|*.*"); + if (file != null) + { + LoadLuaSession(file.FullName); + RunLuaScripts(); + UpdateDialog(); + } + } + + private void SaveSessionMenuItem_Click(object sender, EventArgs e) + { + if (_changes) + { + if (String.IsNullOrWhiteSpace(_currentSessionFile)) + { + SaveSessionAs(); + } + else + { + SaveSession(_currentSessionFile); + } + + Changes(false); + OutputMessages.Text = Path.GetFileName(_currentSessionFile) + " saved."; + } + } + + private void SaveSessionAsMenuItem_Click(object sender, EventArgs e) + { + SaveSessionAs(); + } + + private void ExitMenuItem_Click(object sender, EventArgs e) + { + Close(); + } + + #endregion + + #region Script + + private void ScriptSubMenu_DropDownOpened(object sender, EventArgs e) + { + ToggleScriptMenuItem.Enabled = + PauseScriptMenuItem.Enabled = + EditScriptMenuItem.Enabled = + SelectedFiles.Any(); + + RemoveScriptMenuItem.Enabled = + MoveUpMenuItem.Enabled = + MoveDownMenuItem.Enabled = + SelectedIndices.Any(); + + SelectAllMenuItem.Enabled = _luaList.Any(); + StopAllScriptsMenuItem.Enabled = _luaList.Any(script => script.Enabled); + RegisteredFunctionsMenuItem.Enabled = GlobalWin.Tools.LuaConsole.LuaImp.RegisteredFunctions.Any(); + + NewScriptMenuItem.Visible = VersionInfo.INTERIM; + } + + private void NewScriptMenuItem_Click(object sender, EventArgs e) + { + OpenLuaWriter(null); + } + + private void OpenScriptMenuItem_Click(object sender, EventArgs e) + { + var file = GetFileFromUser("Lua Scripts (*.lua)|*.lua|Text (*.text)|*.txt|All Files|*.*"); + if (file != null) + { + LoadLuaFile(file.FullName); + UpdateDialog(); + } + } + + private void ToggleScriptMenuItem_Click(object sender, EventArgs e) + { + foreach(int index in SelectedIndices) + { + var item = _luaList[index]; + if (!item.IsSeparator) + { + item.Toggle(); + } + if (item.Enabled && item.Thread == null) + { + try + { + item.Thread = LuaImp.SpawnCoroutine(item.Path); + } + catch (Exception ex) + { + if (ex.ToString().Substring(0, 32) == "LuaInterface.LuaScriptException:") + { + item.Enabled = false; + AddText(ex.Message); + } + else + { + MessageBox.Show(ex.ToString()); + } + } + } + else if (!item.Enabled && item.Thread != null) + { + item.Stop(); + } + } + + LuaListView.Refresh(); + Changes(true); + } + + private void PauseScriptMenuItem_Click(object sender, EventArgs e) + { + SelectedFiles.ToList().ForEach(x => x.TogglePause()); + LuaListView.Refresh(); + } + + private void EditScriptMenuItem_Click(object sender, EventArgs e) + { + SelectedFiles.ToList().ForEach(file => System.Diagnostics.Process.Start(file.Path)); + } + + private void RemoveScriptMenuItem_Click(object sender, EventArgs e) + { + if (SelectedItems.Any()) + { + Changes(true); + + foreach (var item in SelectedItems) + { + _luaList.Remove(item); + } + + UpdateDialog(); + UpdateNumberOfScripts(); + } + } + + private void InsertSeparatorMenuItem_Click(object sender, EventArgs e) + { + var indices = SelectedIndices.ToList(); + if (indices.Any() && indices.Last() < _luaList.Count) + { + _luaList.Insert(indices.Last(), LuaFile.SeparatorInstance); + } + else + { + _luaList.Add(LuaFile.SeparatorInstance); + } + + UpdateDialog(); + LuaListView.Refresh(); + Changes(true); + } + + private void MoveUpMenuItem_Click(object sender, EventArgs e) + { + var indices = SelectedIndices.ToList(); + if (indices.Count == 0 || indices[0] == 0) + { + return; + } + + foreach (int index in indices) + { + var file = _luaList[index]; + _luaList.Remove(file); + _luaList.Insert(index - 1, file); + } + Changes(true); + + var newindices = indices.Select(t => t - 1).ToList(); + + LuaListView.SelectedIndices.Clear(); + foreach (int newi in newindices) + { + LuaListView.SelectItem(newi, true); + } + + UpdateDialog(); + } + + private void MoveDownMenuItem_Click(object sender, EventArgs e) + { + var indices = SelectedIndices.ToList(); + if (indices.Count == 0 || indices.Last() == _luaList.Count - 1) + { + return; + } + + foreach (int index in indices) + { + var file = _luaList[index]; + _luaList.Remove(file); + _luaList.Insert(index + 1, file); + } + + var newindices = indices.Select(t => t + 1).ToList(); + + LuaListView.SelectedIndices.Clear(); + foreach (int newi in newindices) + { + LuaListView.SelectItem(newi, true); + } + + UpdateDialog(); + } + + private void SelectAllMenuItem_Click(object sender, EventArgs e) + { + for (int x = 0; x < _luaList.Count; x++) + { + LuaListView.SelectItem(x, true); + } + } + + private void StopAllScriptsMenuItem_Click(object sender, EventArgs e) + { + StopAllScripts(); + } + + private void RegisteredFunctionsMenuItem_Click(object sender, EventArgs e) { if (LuaImp.RegisteredFunctions.Any()) { @@ -1260,24 +933,176 @@ namespace BizHawk.Client.EmuHawk if (!alreadyOpen) { - var form = new LuaRegisteredFunctionsList(); - form.StartLocation = GetPromptPoint(); + var form = new LuaRegisteredFunctionsList {StartLocation = GetPromptPoint()}; form.Show(); } } } - private void contextMenuStrip2_Opening(object sender, CancelEventArgs e) + #endregion + + #region Options + + private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e) { - registeredFunctionsToolStripMenuItem.Enabled = LuaImp.RegisteredFunctions.Any(); + SaveWindowPositionMenuItem.Checked = Global.Config.LuaConsoleSaveWindowPosition; + AutoloadConsoleMenuItem.Checked = Global.Config.AutoLoadLuaConsole; + AutoloadSessionMenuItem.Checked = Global.Config.RecentLuaSession.AutoLoad; + DisableScriptsOnLoadMenuItem.Checked = Global.Config.DisableLuaScriptsOnLoad; + } + + private void SaveWindowPositionMenuItem_Click(object sender, EventArgs e) + { + Global.Config.LuaConsoleSaveWindowPosition ^= true; + } + + private void AutoloadConsoleMenuItem_Click(object sender, EventArgs e) + { + Global.Config.AutoLoadLuaConsole ^= true; + } + + private void AutoloadSessionMenuItem_Click(object sender, EventArgs e) + { + Global.Config.RecentLuaSession.AutoLoad ^= true; + } + + private void DisableScriptsOnLoadMenuItem_Click(object sender, EventArgs e) + { + Global.Config.DisableLuaScriptsOnLoad ^= true; + } + + private void RestoreDefaultSettingsMenuItem_Click(object sender, EventArgs e) + { + Size = new Size(_defaultWidth, _defaultHeight); + } + + #endregion + + #region Help + + private void FunctionsListMenuItem_Click(object sender, EventArgs e) + { + GlobalWin.Sound.StopSound(); + new LuaFunctionsForm().Show(); + GlobalWin.Sound.StartSound(); + } + + private void OnlineDocsMenuItem_Click(object sender, EventArgs e) + { + System.Diagnostics.Process.Start("http://tasvideos.org/BizHawk/LuaFunctions.html"); + } + + #endregion + + #region Toolbar and Context Menu + + private void EditToolbarItem_Click(object sender, EventArgs e) + { + if (VersionInfo.INTERIM) + { + DoLuaWriter(); + } + else + { + EditScriptMenuItem_Click(sender, e); + } + } + + private void ScriptListContextMenu_Opening(object sender, CancelEventArgs e) + { + ToggleScriptContextItem.Enabled = + PauseScriptContextItem.Enabled = + EditScriptContextItem.Enabled = + SelectedFiles.Any(); + + StopAllScriptsContextItem.Visible = + ScriptContextSeparator.Visible = + _luaList.Any(file => file.Enabled); + } + + private void ConsoleContextMenu_Opening(object sender, CancelEventArgs e) + { + RegisteredFunctionsContextItem.Enabled = LuaImp.RegisteredFunctions.Any(); + } + + private void ClearConsoleContextItem_Click(object sender, EventArgs e) + { + ClearOutput(); + } + + #endregion + + #region Dialog, Listview, OutputBox + + private void LuaConsole_DragDrop(object sender, DragEventArgs e) + { + string[] filePaths = (string[])e.Data.GetData(DataFormats.FileDrop); + try + { + foreach (string path in filePaths) + { + if (Path.GetExtension(path) == (".lua") || Path.GetExtension(path) == (".txt")) + { + LoadLuaFile(path); + UpdateDialog(); + } + else if (Path.GetExtension(path) == (".luases")) + { + LoadLuaSession(path); + RunLuaScripts(); + return; + } + } + } + catch (Exception ex) + { + if (ex.ToString().Substring(0, 32) == "LuaInterface.LuaScriptException:" || ex.ToString().Substring(0, 26) == "LuaInterface.LuaException:") + { + AddText(ex.Message); + } + else + { + MessageBox.Show(ex.Message); + } + } + } + + private void LuaConsole_DragEnter(object sender, DragEventArgs e) + { + e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None; + } + + private void LuaListView_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Delete && !e.Control && !e.Alt && !e.Shift) + { + RemoveScriptMenuItem_Click(null, null); + } + else if (e.KeyCode == Keys.A && e.Control && !e.Alt && !e.Shift) //Select All + { + SelectAllMenuItem_Click(null, null); + } + else if (e.KeyCode == Keys.F12 && !e.Control && !e.Alt && !e.Shift) //F12 + { + RegisteredFunctionsMenuItem_Click(null, null); + } + } + + private void LuaListView_ItemActivate(object sender, EventArgs e) + { + ToggleScriptMenuItem_Click(sender, e); } private void OutputBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F12 && !e.Control && !e.Alt && !e.Shift) //F12 { - showRegisteredFunctionsToolStripMenuItem_Click(null, null); + RegisteredFunctionsMenuItem_Click(null, null); } } + + #endregion + + #endregion } } diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.resx b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.resx index a56f1e045f..4b0fdcdf07 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.resx +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.resx @@ -117,20 +117,20 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 126, 17 17, 17 - + 333, 17 228, 17 - + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJHSURBVDhPxZBdSNNhFMb/F110ZZEVhVBgeeHNICiiuggp