separate out lua and ram watch on screen message lists so they can't clobber each other, fixes #1831

This commit is contained in:
adelikat 2020-02-02 12:09:13 -06:00
parent 45221eb0ad
commit bfd33e5399
2 changed files with 21 additions and 4 deletions

View File

@ -95,12 +95,29 @@ namespace BizHawk.Client.EmuHawk
private readonly List<UIMessage> _messages = new List<UIMessage>(5);
private readonly List<UIDisplay> _guiTextList = new List<UIDisplay>();
private readonly List<UIDisplay> _ramWatchList = new List<UIDisplay>();
public void AddMessage(string message)
{
_messages.Add(new UIMessage { Message = message, ExpireAt = DateTime.Now + TimeSpan.FromSeconds(2) });
}
public void ClearRamWatches()
{
_ramWatchList.Clear();
}
public void AddRamWatch(string message, MessagePosition pos, Color backGround, Color foreColor)
{
_ramWatchList.Add(new UIDisplay
{
Message = message,
Position = pos,
BackGround = backGround,
ForeColor = foreColor
});
}
public void AddGuiText(string message, MessagePosition pos, Color backGround, Color foreColor)
{
_guiTextList.Add(new UIDisplay
@ -156,7 +173,7 @@ namespace BizHawk.Client.EmuHawk
}
}
foreach (var text in _guiTextList)
foreach (var text in _guiTextList.Concat(_ramWatchList))
{
try
{

View File

@ -236,7 +236,7 @@ namespace BizHawk.Client.EmuHawk
for (var i = 0; i < _watches.Count; i++)
{
var frozen = !_watches[i].IsSeparator && Global.CheatList.IsActive(_watches[i].Domain, _watches[i].Address);
GlobalWin.OSD.AddGuiText(
GlobalWin.OSD.AddRamWatch(
_watches[i].ToDisplayString(),
new MessagePosition
{
@ -262,7 +262,7 @@ namespace BizHawk.Client.EmuHawk
return;
}
GlobalWin.OSD.ClearGuiText();
GlobalWin.OSD.ClearRamWatches();
if (_watches.Any())
{
_watches.UpdateValues();
@ -997,7 +997,7 @@ namespace BizHawk.Client.EmuHawk
if (!Config.DisplayRamWatch)
{
GlobalWin.OSD.ClearGuiText();
GlobalWin.OSD.ClearRamWatches();
}
else
{