Cheats - If cheat directory doesn't exist when saving, create it. Fix bug where PCE cheats were saved in GB folder, if adding a cheat from another dialog - flag Changes

This commit is contained in:
andres.delikat 2011-08-01 23:42:09 +00:00
parent 1c72c144af
commit 97ba81c95d
1 changed files with 4 additions and 1 deletions

View File

@ -166,6 +166,7 @@ namespace BizHawk.MultiClient
public void AddCheat(Cheat c)
{
Changes();
cheatList.Add(c);
DisplayCheatsList();
CheatListView.Refresh();
@ -409,6 +410,8 @@ namespace BizHawk.MultiClient
private bool SaveCheatFile(string path)
{
var file = new FileInfo(path);
if (!file.Directory.Exists)
file.Directory.Create();
using (StreamWriter sw = new StreamWriter(path))
{
@ -529,7 +532,7 @@ namespace BizHawk.MultiClient
break;
case "SFX":
case "PCE":
path = PathManager.MakeAbsolutePath(Global.Config.PathPCECheats, "GB");
path = PathManager.MakeAbsolutePath(Global.Config.PathPCECheats, "PCE");
break;
case "GB":
path = PathManager.MakeAbsolutePath(Global.Config.PathGBCheats, "GB");