Ram Watch - hook up auto-load feature

This commit is contained in:
andres.delikat 2011-01-19 04:18:33 +00:00
parent 255c272342
commit fadcd6c572
5 changed files with 34 additions and 4 deletions

View File

@ -8,6 +8,10 @@
public bool AutoLoadMostRecentRom = false; //TODO: eventually make a class or struct for all the auto-loads, which will include recent roms, movies, etc, as well as autoloading any modeless dialog
public RecentFiles RecentRoms = new RecentFiles(8);
// RamWatch Settings
public bool AutoLoadRamWatch = false;
public RecentFiles RecentWatches = new RecentFiles(8);
// Client Hotkey Bindings
public string HardResetBinding = "LeftShift+Tab";
public string FastForwardBinding = "J1 B6";

View File

@ -708,7 +708,7 @@
this.rAMWatchToolStripMenuItem.Name = "rAMWatchToolStripMenuItem";
this.rAMWatchToolStripMenuItem.Size = new System.Drawing.Size(139, 22);
this.rAMWatchToolStripMenuItem.Text = "RAM &Watch";
this.rAMWatchToolStripMenuItem.Click += new System.EventHandler(this.rAMWatchToolStripMenuItem_Click);
this.rAMWatchToolStripMenuItem.Click += new System.EventHandler(this.RAMWatchToolStripMenuItem_Click);
//
// rAMSearchToolStripMenuItem
//

View File

@ -1,4 +1,4 @@
using System;
 using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
@ -80,6 +80,9 @@ namespace BizHawk.MultiClient
LoadRom(args[0]);
else if (Global.Config.AutoLoadMostRecentRom && !Global.Config.RecentRoms.IsEmpty())
LoadRomFromRecent(Global.Config.RecentRoms.GetRecentFileByPosition(0));
if (Global.Config.AutoLoadRamWatch)
LoadRamWatch();
}
private void LoadRomFromRecent(string rom)
@ -778,10 +781,15 @@ namespace BizHawk.MultiClient
recentROMToolStripMenuItem.DropDownItems.Add(auto);
}
private void rAMWatchToolStripMenuItem_Click(object sender, EventArgs e)
private void LoadRamWatch() //TODO: accept a filename parameter and feed it to ram watch for loading
{
RamWatch RamWatch1 = new RamWatch();
RamWatch1.Show();
}
private void RAMWatchToolStripMenuItem_Click(object sender, EventArgs e)
{
LoadRamWatch();
}
}
}

View File

@ -92,6 +92,7 @@
this.filesToolStripMenuItem.Name = "filesToolStripMenuItem";
this.filesToolStripMenuItem.Size = new System.Drawing.Size(40, 20);
this.filesToolStripMenuItem.Text = "&Files";
this.filesToolStripMenuItem.DropDownOpened += new System.EventHandler(this.filesToolStripMenuItem_DropDownOpened);
//
// newListToolStripMenuItem
//

View File

@ -178,7 +178,16 @@ namespace BizHawk.MultiClient
private void autoLoadToolStripMenuItem_Click(object sender, EventArgs e)
{
if (Global.Config.AutoLoadRamWatch == true)
{
Global.Config.AutoLoadRamWatch = false;
autoLoadToolStripMenuItem.Checked = false;
}
else
{
Global.Config.AutoLoadRamWatch = true;
autoLoadToolStripMenuItem.Checked = true;
}
}
private void saveWindowPositionToolStripMenuItem_Click(object sender, EventArgs e)
@ -236,5 +245,13 @@ namespace BizHawk.MultiClient
for (int x = 0; x < watchList.Count; x++)
TempDisplayWatchInTempList(watchList[x]);
}
private void filesToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
{
if (Global.Config.AutoLoadRamWatch == true)
autoLoadToolStripMenuItem.Checked = true;
else
autoLoadToolStripMenuItem.Checked = false;
}
}
}