dont reorder cheats list when editing cheats
This commit is contained in:
parent
15303fd49f
commit
5402f1ff9e
|
@ -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);
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue