From f0c939d87c5dc11359ace81d4d69ec88a4f15075 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Wed, 23 Dec 2015 17:18:39 -0800 Subject: [PATCH] reimplement strings for OSD watches also fixed saving separators --- BizHawk.Client.Common/tools/Watch/SeparatorWatch.cs | 2 +- BizHawk.Client.Common/tools/Watch/Watch.cs | 7 ++++++- BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/BizHawk.Client.Common/tools/Watch/SeparatorWatch.cs b/BizHawk.Client.Common/tools/Watch/SeparatorWatch.cs index e00d522ee6..dae9193522 100644 --- a/BizHawk.Client.Common/tools/Watch/SeparatorWatch.cs +++ b/BizHawk.Client.Common/tools/Watch/SeparatorWatch.cs @@ -75,7 +75,7 @@ namespace BizHawk.Client.Common get { return string.Empty; } } - public override string ToString() + public override string ToDisplayString() { return "----"; } diff --git a/BizHawk.Client.Common/tools/Watch/Watch.cs b/BizHawk.Client.Common/tools/Watch/Watch.cs index 42bab1ba87..e6ece27059 100644 --- a/BizHawk.Client.Common/tools/Watch/Watch.cs +++ b/BizHawk.Client.Common/tools/Watch/Watch.cs @@ -558,7 +558,7 @@ namespace BizHawk.Client.Common public override string ToString() { return string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}" - , Address.ToHexString((Domain.Size - 1).NumHexDigits()) + , Domain == null && Address == 0 ? "0" : Address.ToHexString((Domain.Size - 1).NumHexDigits()) , SizeAsChar , TypeAsChar , Convert.ToInt32(BigEndian) @@ -567,6 +567,11 @@ namespace BizHawk.Client.Common ); } + public virtual string ToDisplayString() + { + return Notes + ": " + ValueString; + } + #endregion #region Properties diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs index 80d2d3e11c..09e8e9995f 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs @@ -254,7 +254,7 @@ namespace BizHawk.Client.EmuHawk { var frozen = !_watches[i].IsSeparator && Global.CheatList.IsActive(_watches[i].Domain, _watches[i].Address); GlobalWin.OSD.AddGUIText( - _watches[i].ToString(), + _watches[i].ToDisplayString(), Global.Config.DispRamWatchx, Global.Config.DispRamWatchy + (i * 14), Color.Black, @@ -324,7 +324,7 @@ namespace BizHawk.Client.EmuHawk { var frozen = !_watches[i].IsSeparator && Global.CheatList.IsActive(_watches[i].Domain, _watches[i].Address); GlobalWin.OSD.AddGUIText( - _watches[i].ToString(), + _watches[i].ToDisplayString(), Global.Config.DispRamWatchx, Global.Config.DispRamWatchy + (i * 14), Color.Black,