make the rom open filter remember its last option used in this bizhawk session, like how most other programs work.

This commit is contained in:
zeromus 2012-10-20 22:58:01 +00:00
parent ab46a076f2
commit 83a06c4f63
1 changed files with 5 additions and 1 deletions

View File

@ -2902,6 +2902,7 @@ namespace BizHawk.MultiClient
return str; return str;
} }
int LastOpenRomFilter = 0;
private void OpenROM() private void OpenROM()
{ {
var ofd = new OpenFileDialog(); var ofd = new OpenFileDialog();
@ -2946,8 +2947,10 @@ namespace BizHawk.MultiClient
"Genesis (experimental)", "*.gen;*.md;*.smd;*.bin;*.cue;%ARCH%", "Genesis (experimental)", "*.gen;*.md;*.smd;*.bin;*.cue;%ARCH%",
"All Files", "*.*"); "All Files", "*.*");
} }
ofd.RestoreDirectory = false; ofd.RestoreDirectory = false;
ofd.FilterIndex = LastOpenRomFilter;
Global.Sound.StopSound(); Global.Sound.StopSound();
var result = ofd.ShowDialog(); var result = ofd.ShowDialog();
Global.Sound.StartSound(); Global.Sound.StartSound();
@ -2955,6 +2958,7 @@ namespace BizHawk.MultiClient
return; return;
var file = new FileInfo(ofd.FileName); var file = new FileInfo(ofd.FileName);
Global.Config.LastRomPath = file.DirectoryName; Global.Config.LastRomPath = file.DirectoryName;
LastOpenRomFilter = ofd.FilterIndex;
LoadRom(file.FullName); LoadRom(file.FullName);
} }