From 90e5090e0ef13dafa314fef430ec6a7df7ec7040 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 21 May 2011 19:31:00 +0000 Subject: [PATCH] change HawkFile.CanonicalName to CanonicalFullPath, and add a new HawkFile.CanonicalName which returns the archive|member where CanonicalFullPath would be c:\path\to\archive|member --- BizHawk.MultiClient/HawkFile.cs | 11 ++++++++--- BizHawk.MultiClient/MainForm.cs | 2 +- BizHawk.MultiClient/RomGame.cs | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/BizHawk.MultiClient/HawkFile.cs b/BizHawk.MultiClient/HawkFile.cs index 7c9c507a29..f75522c0b6 100644 --- a/BizHawk.MultiClient/HawkFile.cs +++ b/BizHawk.MultiClient/HawkFile.cs @@ -36,10 +36,15 @@ namespace BizHawk.MultiClient /// public bool IsBound { get { return boundStream != null; } } + /// + /// returns the complete canonical full path ("c:\path\to\archive|member") of the bound file + /// + public string CanonicalFullPath { get { return MakeCanonicalName(rootPath,memberPath); } } + /// /// returns the complete canonical name ("archive|member") of the bound file /// - public string CanonicalName { get { return MakeCanonicalName(rootPath,memberPath); } } + public string CanonicalName { get { return MakeCanonicalName(Path.GetFileName(rootPath), memberPath); } } /// /// returns the virtual name of the bound file (disregarding the archive) @@ -168,7 +173,7 @@ namespace BizHawk.MultiClient extractor.ExtractFile(archiveIndex, boundStream); boundStream.Position = 0; memberPath = FixArchiveFilename(extractor.ArchiveFileNames[archiveIndex]); //TODO - maybe go through our own list of names? maybe not, its indexes dont match.. - Console.WriteLine("bound " + CanonicalName); + Console.WriteLine("bound " + CanonicalFullPath); return this; } @@ -189,7 +194,7 @@ namespace BizHawk.MultiClient void BindRoot() { boundStream = rootStream; - Console.WriteLine("bound " + CanonicalName); + Console.WriteLine("bound " + CanonicalFullPath); } /// diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index f88df28763..4f6d4c9b69 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -675,7 +675,7 @@ namespace BizHawk.MultiClient Text = DisplayNameForSystem(game.System) + " - " + game.Name; ResetRewindBuffer(); - Global.Config.RecentRoms.Add(file.CanonicalName); + Global.Config.RecentRoms.Add(file.CanonicalFullPath); if (File.Exists(game.SaveRamPath)) LoadSaveRam(); diff --git a/BizHawk.MultiClient/RomGame.cs b/BizHawk.MultiClient/RomGame.cs index 215807277a..c04dac6baa 100644 --- a/BizHawk.MultiClient/RomGame.cs +++ b/BizHawk.MultiClient/RomGame.cs @@ -36,7 +36,7 @@ namespace BizHawk.MultiClient if (file.Extension == "SMD") RomData = DeInterleaveSMD(RomData); - var info = Database.GetGameInfo(RomData, file.Name); + var info = Database.GetGameInfo(RomData, file.Name); name = info.Name; System = info.System; options = new List(info.GetOptions());