Cheats - implement editing (oops, it was released without it!), fix value display (was showing the actual ram value, not the cheat's override value), don't flag changes if erroneously adding an existing cheat.

This commit is contained in:
adelikat 2013-11-05 19:33:06 +00:00
parent 9bbd8a07a6
commit 4aae8a1311
3 changed files with 23 additions and 3 deletions

View File

@ -121,7 +121,21 @@ namespace BizHawk.Client.Common
public string ValueStr
{
get { return _watch.ValueString; }
get
{
switch (_watch.Size)
{
default:
case Watch.WatchSize.Separator:
return String.Empty;
case Watch.WatchSize.Byte:
return (_watch as ByteWatch).FormatValue((byte)_val);
case Watch.WatchSize.Word:
return (_watch as WordWatch).FormatValue((ushort)_val);
case Watch.WatchSize.DWord:
return (_watch as DWordWatch).FormatValue((uint)_val);
}
}
}
public string CompareStr

View File

@ -106,6 +106,7 @@ namespace BizHawk.Client.Common
if (cheat.IsSeparator)
{
_cheatList.Add(cheat);
Changes = true;
}
else
{
@ -117,10 +118,11 @@ namespace BizHawk.Client.Common
else
{
_cheatList.Add(cheat);
Changes = true;
}
}
Changes = true;
}
public void Insert(int index, Cheat c)

View File

@ -229,7 +229,11 @@ namespace BizHawk.Client.EmuHawk
private void EditCheat()
{
MessageBox.Show("Edit clicked");
var cheat = CheatEditor.Cheat;
Global.CheatList.Remove(Global.CheatList.FirstOrDefault(x => x.Domain == cheat.Domain && x.Address == cheat.Address));
Global.CheatList.Add(cheat);
UpdateListView();
UpdateMessageLabel();
}
public void SaveConfigSettings()