Make default filename in Open/SaveFile dialogs on Ram Watch, Ram Search, and Cheats window
This commit is contained in:
parent
77841c0c47
commit
f9256f5cd1
|
@ -334,6 +334,10 @@ namespace BizHawk.MultiClient
|
|||
private FileInfo GetSaveFileFromUser()
|
||||
{
|
||||
var sfd = new SaveFileDialog();
|
||||
if (currentCheatFile.Length > 0)
|
||||
sfd.FileName = Path.GetFileNameWithoutExtension(currentCheatFile);
|
||||
else if (!(Global.Emulator is NullEmulator))
|
||||
sfd.FileName = Global.Game.Name;
|
||||
sfd.InitialDirectory = Global.Config.LastRomPath;
|
||||
sfd.Filter = "Cheat Files (*.cht)|*.cht|All Files|*.*";
|
||||
sfd.RestoreDirectory = true;
|
||||
|
@ -462,6 +466,8 @@ namespace BizHawk.MultiClient
|
|||
private FileInfo GetFileFromUser()
|
||||
{
|
||||
var ofd = new OpenFileDialog();
|
||||
if (currentCheatFile.Length > 0)
|
||||
ofd.FileName = Path.GetFileNameWithoutExtension(currentCheatFile);
|
||||
ofd.InitialDirectory = Global.Config.LastRomPath;
|
||||
ofd.Filter = "Cheat Files (*.cht)|*.cht|All Files|*.*";
|
||||
ofd.RestoreDirectory = true;
|
||||
|
|
|
@ -1232,6 +1232,10 @@ namespace BizHawk.MultiClient
|
|||
private FileInfo GetSaveFileFromUser()
|
||||
{
|
||||
var sfd = new SaveFileDialog();
|
||||
if (currentSearchFile.Length > 0)
|
||||
sfd.FileName = Path.GetFileNameWithoutExtension(currentSearchFile);
|
||||
else if (!(Global.Emulator is NullEmulator))
|
||||
sfd.FileName = Global.Game.Name;
|
||||
sfd.InitialDirectory = Global.Config.LastRomPath;
|
||||
sfd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*";
|
||||
sfd.RestoreDirectory = true;
|
||||
|
@ -1422,10 +1426,13 @@ namespace BizHawk.MultiClient
|
|||
private FileInfo GetFileFromUser()
|
||||
{
|
||||
var ofd = new OpenFileDialog();
|
||||
if (currentSearchFile.Length > 0)
|
||||
ofd.FileName = Path.GetFileNameWithoutExtension(currentSearchFile);
|
||||
ofd.InitialDirectory = Global.Config.LastRomPath;
|
||||
ofd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*";
|
||||
ofd.RestoreDirectory = true;
|
||||
|
||||
if (currentSearchFile.Length > 0)
|
||||
ofd.FileName = Path.GetFileNameWithoutExtension(currentSearchFile);
|
||||
Global.Sound.StopSound();
|
||||
var result = ofd.ShowDialog();
|
||||
Global.Sound.StartSound();
|
||||
|
|
|
@ -17,7 +17,6 @@ namespace BizHawk.MultiClient
|
|||
public partial class RamWatch : Form
|
||||
{
|
||||
//TODO:
|
||||
//Make default .wch filename based on Rom, ditto for Ram Search & Cheat Search
|
||||
//address num digits based on domain size
|
||||
//Restore window size should restore column order as well
|
||||
//When receiving a watch from a different domain, should something be done?
|
||||
|
@ -579,6 +578,8 @@ namespace BizHawk.MultiClient
|
|||
private FileInfo GetFileFromUser()
|
||||
{
|
||||
var ofd = new OpenFileDialog();
|
||||
if (currentWatchFile.Length > 0)
|
||||
ofd.FileName = Path.GetFileNameWithoutExtension(currentWatchFile);
|
||||
ofd.InitialDirectory = Global.Config.LastRomPath;
|
||||
ofd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*";
|
||||
ofd.RestoreDirectory = true;
|
||||
|
@ -624,6 +625,10 @@ namespace BizHawk.MultiClient
|
|||
private FileInfo GetSaveFileFromUser()
|
||||
{
|
||||
var sfd = new SaveFileDialog();
|
||||
if (currentWatchFile.Length > 0)
|
||||
sfd.FileName = Path.GetFileNameWithoutExtension(currentWatchFile);
|
||||
else if (!(Global.Emulator is NullEmulator))
|
||||
sfd.FileName = Global.Game.Name;
|
||||
sfd.InitialDirectory = Global.Config.LastRomPath;
|
||||
sfd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*";
|
||||
sfd.RestoreDirectory = true;
|
||||
|
|
Loading…
Reference in New Issue