rip out hacks that I put in to work around Game.Name being null

This commit is contained in:
adelikat 2014-05-23 16:22:24 +00:00
parent 2f7ad6a676
commit 33d847e8ac
3 changed files with 5 additions and 32 deletions

View File

@ -106,34 +106,23 @@ namespace BizHawk.Client.EmuHawk
public void SetMainformMovieInfo()
{
// TODO: this shoudln't be here it is copy paste from MainForm LoadRom
string gamename = string.Empty;
if (!string.IsNullOrWhiteSpace(Global.Game.Name)) // Prefer Game db name, else use the path
{
gamename = Global.Game.Name;
}
else
{
gamename = Path.GetFileNameWithoutExtension(GlobalWin.MainForm.CurrentlyOpenRom.Split('|').Last());
}
if (Global.MovieSession.Movie.IsPlaying)
{
Text = DisplayNameForSystem(Global.Game.System) + " - " + gamename + " - " + Path.GetFileName(Global.MovieSession.Movie.Filename);
Text = DisplayNameForSystem(Global.Game.System) + " - " + Global.Game.Name + " - " + Path.GetFileName(Global.MovieSession.Movie.Filename);
PlayRecordStatusButton.Image = Properties.Resources.Play;
PlayRecordStatusButton.ToolTipText = "Movie is in playback mode";
PlayRecordStatusButton.Visible = true;
}
else if (Global.MovieSession.Movie.IsRecording)
{
Text = DisplayNameForSystem(Global.Game.System) + " - " + gamename + " - " + Path.GetFileName(Global.MovieSession.Movie.Filename);
Text = DisplayNameForSystem(Global.Game.System) + " - " + Global.Game.Name + " - " + Path.GetFileName(Global.MovieSession.Movie.Filename);
PlayRecordStatusButton.Image = Properties.Resources.RecordHS;
PlayRecordStatusButton.ToolTipText = "Movie is in record mode";
PlayRecordStatusButton.Visible = true;
}
else if (!Global.MovieSession.Movie.IsActive)
{
Text = DisplayNameForSystem(Global.Game.System) + " - " + gamename;
Text = DisplayNameForSystem(Global.Game.System) + " - " + Global.Game.Name;
PlayRecordStatusButton.Image = Properties.Resources.Blank;
PlayRecordStatusButton.ToolTipText = "No movie is active";
PlayRecordStatusButton.Visible = false;

View File

@ -3012,17 +3012,7 @@ namespace BizHawk.Client.EmuHawk
Global.Game.Status = nes.RomStatus;
}
string gamename = string.Empty;
if (!string.IsNullOrWhiteSpace(loader.Game.Name)) // Prefer Game db name, else use the path
{
gamename = loader.Game.Name;
}
else
{
gamename = Path.GetFileNameWithoutExtension(path.Split('|').Last());
}
Text = DisplayNameForSystem(loader.Game.System) + " - " + gamename;
Text = DisplayNameForSystem(loader.Game.System) + " - " + Global.Game.Name;
Global.Rewinder.ResetRewindBuffer();

View File

@ -186,13 +186,7 @@ namespace BizHawk.Client.EmuHawk
private void RecordMovie_Load(object sender, EventArgs e)
{
var name = PathManager.FilesystemSafeName(Global.Game);
if (string.IsNullOrEmpty(name))
{
name = Path.GetFileNameWithoutExtension(GlobalWin.MainForm.CurrentlyOpenRom.Split('|').Last());
}
RecordBox.Text = name;
RecordBox.Text = PathManager.FilesystemSafeName(Global.Game);
StartFromCombo.SelectedIndex = 0;
DefaultAuthorCheckBox.Checked = Global.Config.UseDefaultAuthor;
if (Global.Config.UseDefaultAuthor)