dont reorder cheats list when editing cheats

This commit is contained in:
zeromus 2015-08-04 22:25:58 -05:00
parent 15303fd49f
commit 5402f1ff9e
2 changed files with 15 additions and 2 deletions

View File

@ -164,6 +164,18 @@ namespace BizHawk.Client.Common
Changes = true;
}
public bool Exchange(Cheat oldCheat, Cheat newCheat)
{
int index = _cheatList.IndexOf(oldCheat);
if (index == -1)
return false;
_cheatList[index] = newCheat;
Changes = true;
return true;
}
public bool Remove(Cheat c)
{
var result = _cheatList.Remove(c);

View File

@ -178,8 +178,9 @@ namespace BizHawk.Client.EmuHawk
private void EditCheat()
{
Global.CheatList.Remove(CheatEditor.OriginalCheat);
AddCheat();
Global.CheatList.Exchange(CheatEditor.OriginalCheat, CheatEditor.Cheat);
UpdateDialog();
UpdateMessageLabel();
}
public void SaveConfigSettings()