More fixes to the cheats system
This commit is contained in:
parent
0a0b8ac173
commit
0e934d5454
|
@ -217,6 +217,7 @@ namespace BizHawk.MultiClient
|
||||||
if (!IsSeparator)
|
if (!IsSeparator)
|
||||||
{
|
{
|
||||||
_val++;
|
_val++;
|
||||||
|
Pulse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,6 +226,7 @@ namespace BizHawk.MultiClient
|
||||||
if (!IsSeparator)
|
if (!IsSeparator)
|
||||||
{
|
{
|
||||||
_val--;
|
_val--;
|
||||||
|
Pulse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,25 +94,30 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
if (_cheatList.Any(x => x.Domain == c.Domain && x.Address == c.Address))
|
if (_cheatList.Any(x => x.Domain == c.Domain && x.Address == c.Address))
|
||||||
{
|
{
|
||||||
var cheat = _cheatList.FirstOrDefault(x => x.Domain == c.Domain && x.Address == c.Address);
|
_cheatList.FirstOrDefault(x => x.Domain == c.Domain && x.Address == c.Address).Enable();
|
||||||
cheat.Enable();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_changes = true;
|
|
||||||
_cheatList.Add(c);
|
_cheatList.Add(c);
|
||||||
ToolHelpers.UpdateCheatRelatedTools();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_changes = true;
|
||||||
|
ToolHelpers.UpdateCheatRelatedTools();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Insert(int index, Cheat c)
|
public void Insert(int index, Cheat c)
|
||||||
{
|
{
|
||||||
if (!_cheatList.Any(x => x.Domain == c.Domain && x.Address == c.Address))
|
if (_cheatList.Any(x => x.Domain == c.Domain && x.Address == c.Address))
|
||||||
{
|
{
|
||||||
_changes = true;
|
_cheatList.FirstOrDefault(x => x.Domain == c.Domain && x.Address == c.Address).Enable();
|
||||||
_cheatList.Insert(index, c);
|
|
||||||
ToolHelpers.UpdateCheatRelatedTools();
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_cheatList.Insert(index, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
_changes = true;
|
||||||
|
ToolHelpers.UpdateCheatRelatedTools();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Remove(Cheat c)
|
public void Remove(Cheat c)
|
||||||
|
@ -545,7 +550,7 @@ namespace BizHawk.MultiClient
|
||||||
sb
|
sb
|
||||||
.Append(cheat.AddressStr).Append('\t')
|
.Append(cheat.AddressStr).Append('\t')
|
||||||
.Append(cheat.ValueStr).Append('\t')
|
.Append(cheat.ValueStr).Append('\t')
|
||||||
.Append(cheat.Compare.HasValue ? cheat.Compare.Value : 'N').Append('\t')
|
.Append(cheat.Compare.HasValue ? cheat.Compare.Value.ToString() : "N").Append('\t')
|
||||||
.Append(cheat.Domain != null ? cheat.Domain.Name : String.Empty).Append('\t')
|
.Append(cheat.Domain != null ? cheat.Domain.Name : String.Empty).Append('\t')
|
||||||
.Append(cheat.Enabled ? '1' : '0').Append('\t')
|
.Append(cheat.Enabled ? '1' : '0').Append('\t')
|
||||||
.Append(cheat.Name).Append('\t')
|
.Append(cheat.Name).Append('\t')
|
||||||
|
|
|
@ -1692,8 +1692,8 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
if (Global.CheatList.IsActive(Domain, address))
|
if (Global.CheatList.IsActive(Domain, address))
|
||||||
{
|
{
|
||||||
var cheat = Global.CheatList.FirstOrDefault(x => x.Domain == Domain && x.Address == address);
|
Global.CheatList.FirstOrDefault(x => x.Domain == Domain && x.Address == address).Increment();
|
||||||
cheat.Increment();
|
Global.CheatList.FlagChanges();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1730,8 +1730,8 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
if (Global.CheatList.IsActive(Domain, address))
|
if (Global.CheatList.IsActive(Domain, address))
|
||||||
{
|
{
|
||||||
var cheat = Global.CheatList.FirstOrDefault(x => x.Domain == Domain && x.Address == address);
|
Global.CheatList.FirstOrDefault(x => x.Domain == Domain && x.Address == address).Decrement();
|
||||||
cheat.Decrement();
|
Global.CheatList.FlagChanges();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue