Save cheats even if the cheat dialog was never opened (for instance, if the cheat were added via a game genie dialog or lua)
This commit is contained in:
parent
f3766249bf
commit
4fc81991d7
|
@ -101,9 +101,21 @@ namespace BizHawk.Client.Common
|
|||
return false;
|
||||
}
|
||||
|
||||
public void NewList(string defaultFileName)
|
||||
public void NewList(string defaultFileName, bool autosave = false)
|
||||
{
|
||||
_defaultFileName = defaultFileName;
|
||||
|
||||
if (_cheatList.Any() && _changes && autosave)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_currentFileName))
|
||||
{
|
||||
_currentFileName = _defaultFileName;
|
||||
}
|
||||
|
||||
Save();
|
||||
}
|
||||
|
||||
|
||||
_cheatList.Clear();
|
||||
_currentFileName = string.Empty;
|
||||
Changes = false;
|
||||
|
|
|
@ -128,7 +128,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
// If Cheat tool is loaded, restarting will restart the list too anyway
|
||||
if (!GlobalWin.Tools.Has<Cheats>())
|
||||
{
|
||||
Global.CheatList.NewList(GenerateDefaultCheatFilename());
|
||||
Global.CheatList.NewList(GenerateDefaultCheatFilename(), autosave: true);
|
||||
}
|
||||
|
||||
_tools.ForEach(x => x.Restart());
|
||||
|
|
Loading…
Reference in New Issue