From 0e1bf887b62445c00d01059ee1065d2f3303fae4 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 1 Sep 2012 19:29:41 +0000 Subject: [PATCH] Cheats Dialog - fix losing of values on restart, editing a cheat flags changes --- BizHawk.MultiClient/MainForm.cs | 1 + BizHawk.MultiClient/tools/Cheats.cs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 3606d20265..c0e3ddbec7 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -1401,6 +1401,7 @@ namespace BizHawk.MultiClient Global.OSD.AddMessage("Cheats file loaded"); } } + Cheats1.UpdateValues(); CurrentlyOpenRom = file.CanonicalFullPath; HandlePlatformMenus(); diff --git a/BizHawk.MultiClient/tools/Cheats.cs b/BizHawk.MultiClient/tools/Cheats.cs index cf3815fa43..4121957158 100644 --- a/BizHawk.MultiClient/tools/Cheats.cs +++ b/BizHawk.MultiClient/tools/Cheats.cs @@ -29,6 +29,7 @@ namespace BizHawk.MultiClient NameBox.Text = ""; AddressBox.Text = ""; ValueBox.Text = ""; + CompareBox.Text = ""; PopulateMemoryDomainComboBox(); AddressBox.MaxLength = GetNumDigits(Global.Emulator.MemoryDomains[0].Size - 1); } @@ -40,6 +41,14 @@ namespace BizHawk.MultiClient ClearFields(); } + public void UpdateValues() + { + if (!this.IsHandleCreated || this.IsDisposed) return; + CheatListView.ItemCount = Global.CheatList.Count; + DisplayCheatsList(); + CheatListView.Refresh(); + } + public Cheats() { InitializeComponent(); @@ -782,6 +791,7 @@ namespace BizHawk.MultiClient { Global.CheatList.Remove(Global.CheatList.Cheat(indexes[0])); Global.CheatList.Add(MakeCheat()); + Changes(); } CheatListView.Refresh(); }