Basic functionality of the Tool Box, binded to the T key

This commit is contained in:
andres.delikat 2011-04-07 01:30:42 +00:00
parent e111915462
commit ae8b4a3576
6 changed files with 134 additions and 5 deletions

View File

@ -285,6 +285,12 @@
<Compile Include="RomGame.cs" />
<Compile Include="ScreenSaver.cs" />
<Compile Include="Sound.cs" />
<Compile Include="tools\ToolBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="tools\ToolBox.Designer.cs">
<DependentUpon>ToolBox.cs</DependentUpon>
</Compile>
<Compile Include="tools\Watch.cs" />
</ItemGroup>
<ItemGroup>
@ -379,6 +385,10 @@
<DependentUpon>RamSearch.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="tools\ToolBox.resx">
<DependentUpon>ToolBox.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="images\FindHS.png" />

View File

@ -183,6 +183,7 @@
public string LoadSlot7 = "F7";
public string LoadSlot8 = "F8";
public string LoadSlot9 = "F9";
public string ToolBox = "T";
// SMS / GameGear Settings

View File

@ -51,6 +51,7 @@ namespace BizHawk.MultiClient
public NESPPU NESPPU1 = new NESPPU();
public NESDebugger NESDebug1 = new NESDebugger();
public Cheats Cheats1 = new Cheats();
public ToolBox ToolBox1 = new ToolBox();
public MainForm(string[] args)
{
@ -259,7 +260,7 @@ namespace BizHawk.MultiClient
"Emulator Pause", "Frame Advance", "Screenshot", "Toggle Fullscreen", "SelectSlot0", "SelectSlot1", "SelectSlot2", "SelectSlot3", "SelectSlot4",
"SelectSlot5", "SelectSlot6", "SelectSlot7", "SelectSlot8", "SelectSlot9", "SaveSlot0", "SaveSlot1", "SaveSlot2", "SaveSlot3", "SaveSlot4",
"SaveSlot5","SaveSlot6","SaveSlot7","SaveSlot8","SaveSlot9","LoadSlot0","LoadSlot1","LoadSlot2","LoadSlot3","LoadSlot4","LoadSlot5","LoadSlot6",
"LoadSlot7","LoadSlot8","LoadSlot9"}
"LoadSlot7","LoadSlot8","LoadSlot9", "ToolBox"}
};
private void InitControls()
@ -305,6 +306,7 @@ namespace BizHawk.MultiClient
controls.BindMulti("LoadSlot7", Global.Config.LoadSlot7);
controls.BindMulti("LoadSlot8", Global.Config.LoadSlot8);
controls.BindMulti("LoadSlot9", Global.Config.LoadSlot9);
controls.BindMulti("ToolBox", Global.Config.ToolBox);
Global.ClientControls = controls;
var smsControls = new Controller(SMS.SmsController);
@ -632,7 +634,13 @@ namespace BizHawk.MultiClient
public void CheckHotkeys()
{
if (Global.ClientControls["Quick Save State"])
if (Global.ClientControls["ToolBox"])
{
LoadToolBox();
Global.ClientControls.UnpressButton("ToolBox");
}
if (Global.ClientControls["Quick Save State"])
{
if (!IsNullEmulator())
SaveState("QuickSave" + SaveSlot.ToString());
@ -1095,6 +1103,17 @@ namespace BizHawk.MultiClient
HexEditor1.Focus();
}
public void LoadToolBox()
{
if (!ToolBox1.IsHandleCreated || ToolBox1.IsDisposed)
{
ToolBox1 = new ToolBox();
ToolBox1.Show();
}
else
ToolBox1.Close();
}
public void LoadNESPPU()
{
if (!NESPPU1.IsHandleCreated || NESPPU1.IsDisposed)

View File

@ -1,4 +1,4 @@
namespace BizHawk.MultiClient.tools
namespace BizHawk.MultiClient
{
partial class ToolBox
{
@ -29,20 +29,88 @@
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ToolBox));
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
//
// toolStrip1
//
this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButton1,
this.toolStripButton2,
this.toolStripButton3,
this.toolStripButton4});
this.toolStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Table;
this.toolStrip1.Location = new System.Drawing.Point(9, 27);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(85, 111);
this.toolStrip1.TabIndex = 0;
//
// toolStripButton1
//
this.toolStripButton1.Image = global::BizHawk.MultiClient.Properties.Resources.cheat;
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(74, 20);
this.toolStripButton1.Text = "Debugger";
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
//
// toolStripButton2
//
this.toolStripButton2.Image = global::BizHawk.MultiClient.Properties.Resources.FindHS;
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Size = new System.Drawing.Size(82, 20);
this.toolStripButton2.Text = "Ram Watch";
this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click);
//
// toolStripButton3
//
this.toolStripButton3.Image = global::BizHawk.MultiClient.Properties.Resources.search;
this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton3.Name = "toolStripButton3";
this.toolStripButton3.Size = new System.Drawing.Size(84, 20);
this.toolStripButton3.Text = "Ram Search";
this.toolStripButton3.Click += new System.EventHandler(this.toolStripButton3_Click);
//
// toolStripButton4
//
this.toolStripButton4.Image = global::BizHawk.MultiClient.Properties.Resources.poke;
this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton4.Name = "toolStripButton4";
this.toolStripButton4.Size = new System.Drawing.Size(74, 20);
this.toolStripButton4.Text = "Ram Poke";
this.toolStripButton4.Click += new System.EventHandler(this.toolStripButton4_Click);
//
// ToolBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 273);
this.ClientSize = new System.Drawing.Size(123, 297);
this.Controls.Add(this.toolStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ToolBox";
this.Text = "Tool Box";
this.Load += new System.EventHandler(this.ToolBox_Load);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripButton toolStripButton1;
private System.Windows.Forms.ToolStripButton toolStripButton2;
private System.Windows.Forms.ToolStripButton toolStripButton3;
private System.Windows.Forms.ToolStripButton toolStripButton4;
}
}

View File

@ -7,7 +7,7 @@ using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace BizHawk.MultiClient.tools
namespace BizHawk.MultiClient
{
public partial class ToolBox : Form
{
@ -15,5 +15,33 @@ namespace BizHawk.MultiClient.tools
{
InitializeComponent();
}
private void ToolBox_Load(object sender, EventArgs e)
{
int x = Global.MainForm.Location.X + Global.MainForm.Size.Width;
int y = Global.MainForm.Location.Y;
Location = new Point(x, y);
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
Global.MainForm.LoadCheatsWindow();
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
Global.MainForm.LoadRamWatch();
}
private void toolStripButton3_Click(object sender, EventArgs e)
{
Global.MainForm.LoadRamSearch();
}
private void toolStripButton4_Click(object sender, EventArgs e)
{
RamPoke r = new RamPoke();
r.Show();
}
}
}

View File

@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>