From ee440f140f3eb314652e5ef3b55f6e39fb77f69e Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Tue, 10 Jan 2012 01:30:17 +0000 Subject: [PATCH] Lua Console - hook up autoload, fix hotkey and toolbox to open lua console (not the old lua window dialog). Add TAStudio to the toolbox dialog. --- BizHawk.MultiClient/MainForm.MenuItems.cs | 5 +---- BizHawk.MultiClient/MainForm.cs | 11 +++++++++-- BizHawk.MultiClient/tools/ToolBox.Designer.cs | 16 ++++++++++++++-- BizHawk.MultiClient/tools/ToolBox.cs | 8 ++++++-- 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/BizHawk.MultiClient/MainForm.MenuItems.cs b/BizHawk.MultiClient/MainForm.MenuItems.cs index 7db3d4727f..06a12e12de 100644 --- a/BizHawk.MultiClient/MainForm.MenuItems.cs +++ b/BizHawk.MultiClient/MainForm.MenuItems.cs @@ -47,10 +47,7 @@ namespace BizHawk.MultiClient private void luaConsoleToolStripMenuItem_Click(object sender, EventArgs e) { - //var window = new BizHawk.MultiClient.tools.LuaWindow(); - //window.Show(); - LuaConsole l = new LuaConsole(); - l.Show(); + OpenLuaConsole(); } private void miLimitFramerate_Click(object sender, EventArgs e) diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 6e3b8e5592..607dbba0dc 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -220,6 +220,8 @@ namespace BizHawk.MultiClient LoadGameGenieEC(); if (Global.Config.AutoloadTAStudio) LoadTAStudio(); + if (Global.Config.AutoLoadLuaConsole) + OpenLuaConsole(); if (Global.Config.MainWndx >= 0 && Global.Config.MainWndy >= 0 && Global.Config.SaveWindowPosition) this.Location = new Point(Global.Config.MainWndx, Global.Config.MainWndy); @@ -1437,8 +1439,7 @@ namespace BizHawk.MultiClient case "Hex Editor": LoadHexEditor(); break; case "Lua Console": { - var window = new BizHawk.MultiClient.tools.LuaWindow(); - window.Show(); + OpenLuaConsole(); break; } case "Cheats": LoadCheatsWindow(); break; @@ -2456,5 +2457,11 @@ namespace BizHawk.MultiClient { MainMenuStrip.Visible ^= true; } + + public void OpenLuaConsole() + { + LuaConsole l = new LuaConsole(); + l.Show(); + } } } \ No newline at end of file diff --git a/BizHawk.MultiClient/tools/ToolBox.Designer.cs b/BizHawk.MultiClient/tools/ToolBox.Designer.cs index 9d2b6d149a..7ae4bba4ca 100644 --- a/BizHawk.MultiClient/tools/ToolBox.Designer.cs +++ b/BizHawk.MultiClient/tools/ToolBox.Designer.cs @@ -41,6 +41,7 @@ this.NESNameTable = new System.Windows.Forms.ToolStripButton(); this.NESGameGenie = new System.Windows.Forms.ToolStripButton(); this.KeypadTool = new System.Windows.Forms.ToolStripButton(); + this.TAStudioButton = new System.Windows.Forms.ToolStripButton(); this.toolStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -55,6 +56,7 @@ this.toolStripButton4, this.HexEditor, this.toolStripButton5, + this.TAStudioButton, this.NESDebugger, this.NESPPU, this.NESNameTable, @@ -63,7 +65,7 @@ this.toolStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Table; this.toolStrip1.Location = new System.Drawing.Point(9, 11); this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(86, 253); + this.toolStrip1.Size = new System.Drawing.Size(86, 295); this.toolStrip1.TabIndex = 0; this.toolStrip1.TabStop = true; // @@ -166,11 +168,20 @@ this.KeypadTool.Text = "Keypad"; this.KeypadTool.Click += new System.EventHandler(this.KeyPadTool_Click); // + // TAStudioButton + // + this.TAStudioButton.Image = global::BizHawk.MultiClient.Properties.Resources.TAStudio; + this.TAStudioButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.TAStudioButton.Name = "TAStudioButton"; + this.TAStudioButton.Size = new System.Drawing.Size(70, 20); + this.TAStudioButton.Text = "TAStudio"; + this.TAStudioButton.Click += new System.EventHandler(this.TAStudioButton_Click); + // // ToolBox // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(122, 274); + this.ClientSize = new System.Drawing.Size(122, 311); this.Controls.Add(this.toolStrip1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MinimumSize = new System.Drawing.Size(130, 64); @@ -198,6 +209,7 @@ private System.Windows.Forms.ToolStripButton NESGameGenie; private System.Windows.Forms.ToolStripButton NESNameTable; private System.Windows.Forms.ToolStripButton KeypadTool; + private System.Windows.Forms.ToolStripButton TAStudioButton; } } \ No newline at end of file diff --git a/BizHawk.MultiClient/tools/ToolBox.cs b/BizHawk.MultiClient/tools/ToolBox.cs index 34dcb62ae5..d92eeecfeb 100644 --- a/BizHawk.MultiClient/tools/ToolBox.cs +++ b/BizHawk.MultiClient/tools/ToolBox.cs @@ -75,8 +75,7 @@ namespace BizHawk.MultiClient private void toolStripButton5_Click(object sender, EventArgs e) { - var window = new BizHawk.MultiClient.tools.LuaWindow(); - window.Show(); + Global.MainForm.OpenLuaConsole(); } private void NESPPU_Click(object sender, EventArgs e) @@ -105,5 +104,10 @@ namespace BizHawk.MultiClient return; Global.MainForm.LoadTI83KeyPad(); } + + private void TAStudioButton_Click(object sender, EventArgs e) + { + Global.MainForm.LoadTAStudio(); + } } }