Remove final reference to GlobalWin.Game by hacking an existing hack

This commit is contained in:
YoshiRulz 2020-11-29 19:15:01 +10:00
parent f7a7b722c5
commit 8bbd6b2d8b
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
4 changed files with 10 additions and 10 deletions

View File

@ -14,8 +14,6 @@ namespace BizHawk.Client.EmuHawk
public static Config Config { get; set; }
public static GameInfo Game => _mainForm.Game;
public static IMovieSession MovieSession => _mainForm.MovieSession;
public static InputManager InputManager { get; } = new InputManager();

View File

@ -3,6 +3,7 @@ using System.Windows.Forms;
using BizHawk.Bizware.BizwareGL;
using BizHawk.Client.Common;
using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk
{
@ -109,7 +110,7 @@ namespace BizHawk.Client.EmuHawk
void Unthrottle();
/// <remarks>only referenced from <see cref="LogWindow"/></remarks>
void UpdateDumpIcon();
void UpdateDumpInfo(RomStatus? newStatus = null);
/// <remarks>only referenced from <see cref="BookmarksBranchesBox"/></remarks>
void UpdateStatusSlots();

View File

@ -154,10 +154,9 @@ namespace BizHawk.Client.EmuHawk
if (result.IsOk())
{
var gameDbEntry = Emulator.AsGameDBEntryGenerator().GenerateGameDbEntry();
var userDb = Path.Combine(PathUtils.ExeDirectoryPath, "gamedb", "gamedb_user.txt");
GlobalWin.Game.Status = gameDbEntry.Status = picker.PickedStatus;
Database.SaveDatabaseEntry(userDb, gameDbEntry);
MainForm.UpdateDumpIcon();
gameDbEntry.Status = picker.PickedStatus;
Database.SaveDatabaseEntry(Path.Combine(PathUtils.ExeDirectoryPath, "gamedb", "gamedb_user.txt"), gameDbEntry);
MainForm.UpdateDumpInfo(gameDbEntry.Status);
HideShowGameDbButton();
}
}

View File

@ -1651,7 +1651,7 @@ namespace BizHawk.Client.EmuHawk
HandleToggleLightAndLink();
}
public void UpdateDumpIcon()
public void UpdateDumpInfo(RomStatus? newStatus = null)
{
DumpStatusButton.Image = Properties.Resources.Blank;
DumpStatusButton.ToolTipText = "";
@ -1661,7 +1661,9 @@ namespace BizHawk.Client.EmuHawk
return;
}
var status = Game.Status;
var status = newStatus == null
? Game.Status
: (Game.Status = newStatus.Value);
if (status == RomStatus.BadDump)
{
DumpStatusButton.Image = Properties.Resources.ExclamationRed;
@ -3830,7 +3832,7 @@ namespace BizHawk.Client.EmuHawk
_stateSlots.ClearRedoList();
UpdateStatusSlots();
UpdateCoreStatusBarButton();
UpdateDumpIcon();
UpdateDumpInfo();
SetMainformMovieInfo();
}