Fix behavior when loading a new rom when a cheat is loaded, fixes #550

This commit is contained in:
adelikat 2016-10-06 13:57:39 -05:00
parent db194c8360
commit ef6c9131c6
2 changed files with 10 additions and 0 deletions

View File

@ -707,6 +707,11 @@ namespace BizHawk.Client.Common
}
}
public void SetDefaultFileName(string defaultFileName)
{
_defaultFileName = defaultFileName;
}
private void CheatChanged(object sender)
{
if (Changed != null)

View File

@ -3486,10 +3486,15 @@ namespace BizHawk.Client.EmuHawk
if (Global.Config.LoadCheatFileByGame)
{
Global.CheatList.SetDefaultFileName(ToolManager.GenerateDefaultCheatFilename());
if (Global.CheatList.AttemptToLoadCheatFile())
{
GlobalWin.OSD.AddMessage("Cheats file loaded");
}
else if (Global.CheatList.Any())
{
Global.CheatList.Clear();
}
}
SetWindowText();