/[RomCheater]/trunk/RomCheater.RVACalculator/RVACalculatorDockControl.cs
ViewVC logotype

Diff of /trunk/RomCheater.RVACalculator/RVACalculatorDockControl.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater.RVACalculator/RVACalculatorDockControl.cs	2013/06/17 05:11:25	669
+++ trunk/RomCheater.RVACalculator/RVACalculatorDockControl.cs	2013/06/17 05:19:32	670
@@ -155,17 +155,20 @@
                         }
 
                         txtRVA.Value = list.RVA;
-                        result = MessageBox.Show("Clear existing Cheats?", "", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);
-                        if (result == System.Windows.Forms.DialogResult.Cancel)
+                        if (lstCheats.Items.Count > 0)
                         {
-                            // assume abort of load
-                            logger.Warn.WriteLine("Abored processing of file (by user request): {0}", CheatLoader.FileName);
-                            fs.Close();
-                            return;
-                        }
-                        if (result == DialogResult.Yes)
-                        {
-                            lstCheats.Items.Clear();
+                            result = MessageBox.Show("Clear existing Cheats?", "", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);
+                            if (result == System.Windows.Forms.DialogResult.Cancel)
+                            {
+                                // assume abort of load
+                                logger.Warn.WriteLine("Abored processing of file (by user request): {0}", CheatLoader.FileName);
+                                fs.Close();
+                                return;
+                            }
+                            if (result == DialogResult.Yes)
+                            {
+                                lstCheats.Items.Clear();
+                            }
                         }
                         foreach (var cheat in list.Cheats)
                         {
@@ -217,17 +220,18 @@
             {
                 cheats.Add(new ICheatEntry2(li.Text, Convert.ToUInt32(li.SubItems[1].Text, 16), Convert.ToUInt32(li.SubItems[2].Text, 16)));
             }
+            list.Cheats = cheats;
             StringBuilder builder = new StringBuilder();
             builder.AppendFormat("RVA: 0x{0:x8}", list.RVA);
             builder.AppendLine();
             foreach (ColumnHeader t in lstCheats.Columns)
             {
-                builder.AppendFormat("{0}:\t", t.Name);
+                builder.AppendFormat("{0}:\t\t", t.Text);
             }
             builder.AppendLine();
             foreach (var cheat in list.Cheats)
             {
-                builder.AppendFormat("{0}\t{1}\t{2}", cheat.CheatName, cheat.CheatAddress, cheat.PhysicalAddress);
+                builder.AppendFormat("{0}\t\t0x{1:x8}\t\t0x{2:x8}", cheat.CheatName, cheat.CheatAddress, cheat.PhysicalAddress);
                 builder.AppendLine();
             }
             Clipboard.SetText(builder.ToString());

 

  ViewVC Help
Powered by ViewVC 1.1.22