diff --git a/BizHawk.MultiClient/Config.cs b/BizHawk.MultiClient/Config.cs index b8d70a3c9a..d8655e8988 100644 --- a/BizHawk.MultiClient/Config.cs +++ b/BizHawk.MultiClient/Config.cs @@ -18,10 +18,20 @@ TI83Controller[0] = new TI83ControllerTemplate(true); } + // Directories + public string LastRomPath = "."; + public string BasePath = "."; + public string BaseNES = ".\\NES"; + public string BaseSMS = ".\\SMS"; + public string BaseGenesis = ".\\Genesis"; + public string BasePCE = ".\\PCE"; + public string BaseGameboy = ".\\Gameboy"; + public string BaseTI83 = ".\\TI83"; + public string WatchPath = "."; + // General Client Settings public int TargetZoomFactor = 2; - public string LastRomPath = "."; - 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 bool AutoLoadMostRecentRom = false; public RecentFiles RecentRoms = new RecentFiles(8); public bool PauseWhenMenuActivated = true; public bool SaveWindowPosition = true; diff --git a/BizHawk.MultiClient/config/PathConfig.Designer.cs b/BizHawk.MultiClient/config/PathConfig.Designer.cs index 9588a645ab..86dd39771f 100644 --- a/BizHawk.MultiClient/config/PathConfig.Designer.cs +++ b/BizHawk.MultiClient/config/PathConfig.Designer.cs @@ -219,6 +219,7 @@ this.BrowseWatch.TabIndex = 15; this.BrowseWatch.Text = "Browse"; this.BrowseWatch.UseVisualStyleBackColor = true; + this.BrowseWatch.Click += new System.EventHandler(this.BrowseWatch_Click); // // MoviesBox // diff --git a/BizHawk.MultiClient/config/PathConfig.cs b/BizHawk.MultiClient/config/PathConfig.cs index f222f2baf1..c481eb07ce 100644 --- a/BizHawk.MultiClient/config/PathConfig.cs +++ b/BizHawk.MultiClient/config/PathConfig.cs @@ -6,6 +6,8 @@ using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; +using System.IO; +using System.Reflection; namespace BizHawk.MultiClient { @@ -19,6 +21,7 @@ namespace BizHawk.MultiClient //Path text boxes shoudl be anchored L + R and the remaining widgets anchored R //Alight everything in each tab the same + string EXEPath; public PathConfig() { @@ -27,12 +30,24 @@ namespace BizHawk.MultiClient private void PathConfig_Load(object sender, EventArgs e) { + EXEPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase); + WatchBox.Text = Global.Config.WatchPath; + } + private string ProcessPath(string path) + { + //if (path == "`recent`") + if (path == "%base%") + return BasePathBox.Text; + if (path == "%exe%") + return EXEPath; + + return path; } private void SaveSettings() { - + Global.Config.WatchPath = WatchBox.Text; } private void Cancel_Click(object sender, EventArgs e) @@ -85,5 +100,15 @@ namespace BizHawk.MultiClient TI83BrowseROMs.Enabled = true; } } + + private void BrowseWatch_Click(object sender, EventArgs e) + { + FolderBrowserDialog f = new FolderBrowserDialog(); + f.Description = "Set the directory for Watch (.wch) files"; + //TODO: find a way to set root folder to base + DialogResult result = f.ShowDialog(); + if (result == DialogResult.OK) + WatchBox.Text = f.SelectedPath; + } } } diff --git a/BizHawk.MultiClient/tools/RamWatch.cs b/BizHawk.MultiClient/tools/RamWatch.cs index aab39ba63c..ae0597820d 100644 --- a/BizHawk.MultiClient/tools/RamWatch.cs +++ b/BizHawk.MultiClient/tools/RamWatch.cs @@ -586,7 +586,7 @@ namespace BizHawk.MultiClient var ofd = new OpenFileDialog(); if (currentWatchFile.Length > 0) ofd.FileName = Path.GetFileNameWithoutExtension(currentWatchFile); - ofd.InitialDirectory = Global.Config.LastRomPath; + ofd.InitialDirectory = Global.Config.WatchPath; ofd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*"; ofd.RestoreDirectory = true; @@ -635,7 +635,7 @@ namespace BizHawk.MultiClient sfd.FileName = Path.GetFileNameWithoutExtension(currentWatchFile); else if (!(Global.Emulator is NullEmulator)) sfd.FileName = Global.Game.Name; - sfd.InitialDirectory = Global.Config.LastRomPath; + sfd.InitialDirectory = Global.Config.WatchPath; sfd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*"; sfd.RestoreDirectory = true; Global.Sound.StopSound();