Hex Editor - fix Load .tbl file menu item when rom is in an archive
This commit is contained in:
parent
f3c29e5bc2
commit
2bc68b99c7
|
@ -1198,17 +1198,28 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void LoadTableFileMenuItem_Click(object sender, EventArgs e)
|
private void LoadTableFileMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
string romName;
|
||||||
|
string intialDirectory;
|
||||||
|
if (Global.Config.RecentRoms.MostRecent.Contains('|'))
|
||||||
|
{
|
||||||
|
romName = Global.Config.RecentRoms.MostRecent.Split('|').Last();
|
||||||
|
intialDirectory = Global.Config.RecentRoms.MostRecent.Split('|').First();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
romName = Global.Config.RecentRoms.MostRecent;
|
||||||
|
intialDirectory = Path.GetDirectoryName(PathManager.MakeAbsolutePath(romName, null));
|
||||||
|
}
|
||||||
|
|
||||||
var ofd = new OpenFileDialog
|
var ofd = new OpenFileDialog
|
||||||
{
|
{
|
||||||
FileName = Path.GetFileNameWithoutExtension(Global.Config.RecentRoms.MostRecent) + ".tbl",
|
FileName = Path.GetFileNameWithoutExtension(romName) + ".tbl",
|
||||||
InitialDirectory = Path.GetDirectoryName(PathManager.MakeAbsolutePath(Global.Config.RecentRoms.MostRecent, null)),
|
InitialDirectory = intialDirectory,
|
||||||
Filter = "Text Table files (*.tbl)|*.tbl|All Files|*.*",
|
Filter = "Text Table files (*.tbl)|*.tbl|All Files|*.*",
|
||||||
RestoreDirectory = false
|
RestoreDirectory = false
|
||||||
};
|
};
|
||||||
|
|
||||||
GlobalWin.Sound.StopSound();
|
var result = ofd.ShowHawkDialog();
|
||||||
var result = ofd.ShowDialog();
|
|
||||||
GlobalWin.Sound.StartSound();
|
|
||||||
|
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue