Fix mainform text property when you have a movie loaded and a rom not in the gamedb, this was a quick and dirty fix
This commit is contained in:
parent
cffa2dd6dc
commit
ac7ed11835
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using BizHawk.Client.Common;
|
||||
|
@ -124,23 +125,34 @@ 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) + " - " + Global.Game.Name + " - " + Path.GetFileName(Global.MovieSession.Movie.Filename);
|
||||
Text = DisplayNameForSystem(Global.Game.System) + " - " + gamename + " - " + 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) + " - " + Global.Game.Name + " - " + Path.GetFileName(Global.MovieSession.Movie.Filename);
|
||||
Text = DisplayNameForSystem(Global.Game.System) + " - " + gamename + " - " + 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) + " - " + Global.Game.Name;
|
||||
Text = DisplayNameForSystem(Global.Game.System) + " - " + gamename;
|
||||
PlayRecordStatusButton.Image = Properties.Resources.Blank;
|
||||
PlayRecordStatusButton.ToolTipText = "No movie is active";
|
||||
PlayRecordStatusButton.Visible = false;
|
||||
|
|
Loading…
Reference in New Issue