Lua Console - make Registered Lua functions hotkey F12 instead of Shift+F12, make Registered Lua Functions dialog modeless

This commit is contained in:
adelikat 2013-11-10 22:05:03 +00:00
parent 2e51e7ad4f
commit 9feb4d0871
2 changed files with 670 additions and 654 deletions

View File

@ -314,7 +314,7 @@
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(245, 22);
this.newScriptToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
this.newScriptToolStripMenuItem.Text = "New Script";
this.newScriptToolStripMenuItem.Click += new System.EventHandler(this.newScriptToolStripMenuItem_Click);
//
@ -323,7 +323,7 @@
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(245, 22);
this.openToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
this.openToolStripMenuItem.Text = "&Open Script...";
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click_1);
//
@ -332,7 +332,7 @@
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(245, 22);
this.toggleToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
this.toggleToolStripMenuItem.Text = "&Toggle";
this.toggleToolStripMenuItem.Click += new System.EventHandler(this.toggleToolStripMenuItem_Click);
//
@ -340,7 +340,7 @@
//
this.pauseResumeToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Pause;
this.pauseResumeToolStripMenuItem.Name = "pauseResumeToolStripMenuItem";
this.pauseResumeToolStripMenuItem.Size = new System.Drawing.Size(245, 22);
this.pauseResumeToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
this.pauseResumeToolStripMenuItem.Text = "Pause or Resume";
this.pauseResumeToolStripMenuItem.Click += new System.EventHandler(this.pauseResumeToolStripMenuItem_Click);
//
@ -349,7 +349,7 @@
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(245, 22);
this.editToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
this.editToolStripMenuItem.Text = "&Edit Script";
this.editToolStripMenuItem.Click += new System.EventHandler(this.editToolStripMenuItem_Click);
//
@ -358,7 +358,7 @@
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(245, 22);
this.removeScriptToolStripMenuItem1.Size = new System.Drawing.Size(218, 22);
this.removeScriptToolStripMenuItem1.Text = "&Remove Script";
this.removeScriptToolStripMenuItem1.Click += new System.EventHandler(this.removeScriptToolStripMenuItem_Click);
//
@ -367,21 +367,21 @@
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(245, 22);
this.insertSeparatorToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
this.insertSeparatorToolStripMenuItem.Text = "Insert Separator";
this.insertSeparatorToolStripMenuItem.Click += new System.EventHandler(this.insertSeperatorToolStripMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(242, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(215, 6);
//
// moveUpToolStripMenuItem
//
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(245, 22);
this.moveUpToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
this.moveUpToolStripMenuItem.Text = "Move &Up";
this.moveUpToolStripMenuItem.Click += new System.EventHandler(this.moveUpToolStripMenuItem_Click_1);
//
@ -390,7 +390,7 @@
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(245, 22);
this.moveDownToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
this.moveDownToolStripMenuItem.Text = "Move &Down";
this.moveDownToolStripMenuItem.Click += new System.EventHandler(this.moveDownToolStripMenuItem_Click_1);
//
@ -398,28 +398,28 @@
//
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(245, 22);
this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
this.selectAllToolStripMenuItem.Text = "Select &All";
this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(242, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(215, 6);
//
// turnOffAllScriptsToolStripMenuItem
//
this.turnOffAllScriptsToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Stop;
this.turnOffAllScriptsToolStripMenuItem.Name = "turnOffAllScriptsToolStripMenuItem";
this.turnOffAllScriptsToolStripMenuItem.Size = new System.Drawing.Size(245, 22);
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);
//
// showRegisteredFunctionsToolStripMenuItem
//
this.showRegisteredFunctionsToolStripMenuItem.Name = "showRegisteredFunctionsToolStripMenuItem";
this.showRegisteredFunctionsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F12)));
this.showRegisteredFunctionsToolStripMenuItem.Size = new System.Drawing.Size(245, 22);
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);
//

View File

@ -597,6 +597,10 @@ namespace BizHawk.Client.EmuHawk
{
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)
@ -1248,8 +1252,20 @@ namespace BizHawk.Client.EmuHawk
{
if (LuaImp.RegisteredFunctions.Any())
{
LuaRegisteredFunctionsList dialog = new LuaRegisteredFunctionsList();
dialog.ShowDialog();
bool alreadyOpen = false;
foreach (Form form in Application.OpenForms)
{
if (form is LuaRegisteredFunctionsList)
{
alreadyOpen = true;
form.Focus();
}
}
if (!alreadyOpen)
{
new LuaRegisteredFunctionsList().Show();
}
}
}