From aaa615533b20981338f94a2f5dc24e8b8aa4b53b Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 8 Mar 2015 20:11:02 +0000 Subject: [PATCH] Start a Macro Input tool --- .../BizHawk.Client.EmuHawk.csproj | 9 ++ BizHawk.Client.EmuHawk/MainForm.Designer.cs | 10 ++ BizHawk.Client.EmuHawk/MainForm.Events.cs | 5 + .../tools/Macros/MacroInput.Designer.cs | 88 +++++++++++++ .../tools/Macros/MacroInput.cs | 59 +++++++++ .../tools/Macros/MacroInput.resx | 123 ++++++++++++++++++ 6 files changed, 294 insertions(+) create mode 100644 BizHawk.Client.EmuHawk/tools/Macros/MacroInput.Designer.cs create mode 100644 BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs create mode 100644 BizHawk.Client.EmuHawk/tools/Macros/MacroInput.resx diff --git a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj index 40ea65e64f..7de3d48746 100644 --- a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj +++ b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj @@ -810,6 +810,12 @@ Component + + Form + + + MacroInput.cs + Form @@ -1332,6 +1338,9 @@ LuaWinform.cs + + MacroInput.cs + BarcodeEntry.cs diff --git a/BizHawk.Client.EmuHawk/MainForm.Designer.cs b/BizHawk.Client.EmuHawk/MainForm.Designer.cs index bd0762cd73..7672af61a1 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Designer.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Designer.cs @@ -381,6 +381,7 @@ this.ClearSRAMContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ShowMenuContextMenuSeparator = new System.Windows.Forms.ToolStripSeparator(); this.ShowMenuContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.MacroToolMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.MainformMenu.SuspendLayout(); this.MainStatusBar.SuspendLayout(); this.MainFormContextMenu.SuspendLayout(); @@ -1752,6 +1753,7 @@ this.TraceLoggerMenuItem, this.DebuggerMenuItem, this.TAStudioMenuItem, + this.MacroToolMenuItem, this.VirtualPadMenuItem, this.toolStripSeparator11, this.CheatsMenuItem, @@ -3362,6 +3364,13 @@ this.ShowMenuContextMenuItem.Text = "Show Menu"; this.ShowMenuContextMenuItem.Click += new System.EventHandler(this.ShowMenuContextMenuItem_Click); // + // MacroToolMenuItem + // + this.MacroToolMenuItem.Name = "MacroToolMenuItem"; + this.MacroToolMenuItem.Size = new System.Drawing.Size(183, 22); + this.MacroToolMenuItem.Text = "&Macro Tool"; + this.MacroToolMenuItem.Click += new System.EventHandler(this.MacroToolMenuItem_Click); + // // MainForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -3753,6 +3762,7 @@ private System.Windows.Forms.ToolStripMenuItem GenesisGameGenieECDC; private System.Windows.Forms.ToolStripStatusLabel UpdateNotification; private System.Windows.Forms.ToolStripMenuItem PSXControllerSettingsMenuItem; + private System.Windows.Forms.ToolStripMenuItem MacroToolMenuItem; } } diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index 4b04a25f10..bc8e922b0a 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -1147,6 +1147,11 @@ namespace BizHawk.Client.EmuHawk GlobalWin.Tools.Load(); } + private void MacroToolMenuItem_Click(object sender, EventArgs e) + { + GlobalWin.Tools.Load(); + } + private void VirtualPadMenuItem_Click(object sender, EventArgs e) { GlobalWin.Tools.Load(); diff --git a/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.Designer.cs b/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.Designer.cs new file mode 100644 index 0000000000..491c766312 --- /dev/null +++ b/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.Designer.cs @@ -0,0 +1,88 @@ +namespace BizHawk.Client.EmuHawk +{ + partial class MacroInputTool + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.MacroMenu = new System.Windows.Forms.MenuStrip(); + this.FileSubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.MacroMenu.SuspendLayout(); + this.SuspendLayout(); + // + // MacroMenu + // + this.MacroMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.FileSubMenu}); + this.MacroMenu.Location = new System.Drawing.Point(0, 0); + this.MacroMenu.Name = "MacroMenu"; + this.MacroMenu.Size = new System.Drawing.Size(352, 24); + this.MacroMenu.TabIndex = 0; + this.MacroMenu.Text = "menuStrip1"; + // + // FileSubMenu + // + this.FileSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.ExitMenuItem}); + this.FileSubMenu.Name = "FileSubMenu"; + this.FileSubMenu.Size = new System.Drawing.Size(37, 20); + this.FileSubMenu.Text = "&File"; + // + // ExitMenuItem + // + this.ExitMenuItem.Name = "ExitMenuItem"; + this.ExitMenuItem.ShortcutKeyDisplayString = "Alt+F4"; + this.ExitMenuItem.Size = new System.Drawing.Size(152, 22); + this.ExitMenuItem.Text = "E&xit"; + this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click); + // + // MacroInputTool + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(352, 332); + this.Controls.Add(this.MacroMenu); + this.MainMenuStrip = this.MacroMenu; + this.Name = "MacroInputTool"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Macro Input"; + this.Load += new System.EventHandler(this.MacroInputTool_Load); + this.MacroMenu.ResumeLayout(false); + this.MacroMenu.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.MenuStrip MacroMenu; + private System.Windows.Forms.ToolStripMenuItem FileSubMenu; + private System.Windows.Forms.ToolStripMenuItem ExitMenuItem; + + } +} \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs b/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs new file mode 100644 index 0000000000..7b4453d867 --- /dev/null +++ b/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs @@ -0,0 +1,59 @@ +using BizHawk.Emulation.Common; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace BizHawk.Client.EmuHawk +{ + public partial class MacroInputTool : Form, IToolFormAutoConfig + { + [RequiredService] + private IEmulator Emulator { get; set; } + + public MacroInputTool() + { + InitializeComponent(); + } + + + private void MacroInputTool_Load(object sender, EventArgs e) + { + + } + + public void Restart() + { + + } + + public void UpdateValues() + { + + } + + public void FastUpdate() + { + + } + + public bool AskSaveChanges() + { + return true; + } + + public bool UpdateBefore + { + get { return true; } // TODO: think about this + } + + private void ExitMenuItem_Click(object sender, EventArgs e) + { + Close(); + } + } +} diff --git a/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.resx b/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.resx new file mode 100644 index 0000000000..27cb705e21 --- /dev/null +++ b/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file