diff --git a/BizHawk.MultiClient/tools/RamSearch.cs b/BizHawk.MultiClient/tools/RamSearch.cs index 4b0daf6d39..511818df39 100644 --- a/BizHawk.MultiClient/tools/RamSearch.cs +++ b/BizHawk.MultiClient/tools/RamSearch.cs @@ -2193,20 +2193,7 @@ namespace BizHawk.MultiClient string columnName = SearchListView.Columns[columnToOrder].Text; if (sortedCol.CompareTo(columnName) != 0) sortReverse = false; - string previous = "Last Frame"; - switch (Global.Config.RamSearchPreviousAs) - { - case 0: - previous = "Last Search"; - break; - case 1: - previous = "Original"; - break; - case 3: - previous = "Last Change"; - break; - } - searchList.Sort((x, y) => x.CompareTo(y, columnName, previous) * (sortReverse ? -1 : 1)); + searchList.Sort((x, y) => x.CompareTo(y, columnName, (prevDef)Global.Config.RamSearchPreviousAs) * (sortReverse ? -1 : 1)); sortedCol = columnName; sortReverse = !(sortReverse); SearchListView.Refresh(); diff --git a/BizHawk.MultiClient/tools/RamWatch.cs b/BizHawk.MultiClient/tools/RamWatch.cs index 31bcadf41e..8b759bb56a 100644 --- a/BizHawk.MultiClient/tools/RamWatch.cs +++ b/BizHawk.MultiClient/tools/RamWatch.cs @@ -1336,7 +1336,7 @@ namespace BizHawk.MultiClient string columnName = WatchListView.Columns[columnToOrder].Text; if (sortedCol.CompareTo(columnName) != 0) sortReverse = false; - watchList.Sort((x, y) => x.CompareTo(y, columnName, "Last Frame") * (sortReverse ? -1 : 1)); + watchList.Sort((x, y) => x.CompareTo(y, columnName, prevDef.LASTFRAME) * (sortReverse ? -1 : 1)); sortedCol = columnName; sortReverse = !(sortReverse); WatchListView.Refresh(); diff --git a/BizHawk.MultiClient/tools/Watch.cs b/BizHawk.MultiClient/tools/Watch.cs index 3d3484e00b..9a95aaa716 100644 --- a/BizHawk.MultiClient/tools/Watch.cs +++ b/BizHawk.MultiClient/tools/Watch.cs @@ -7,6 +7,7 @@ namespace BizHawk.MultiClient { public enum atype { BYTE, WORD, DWORD, SEPARATOR }; //TODO: more custom types too like 12.4 and 24.12 fixed point public enum asigned { SIGNED, UNSIGNED, HEX }; + public enum prevDef { LASTSEARCH, ORIGINAL, LASTFRAME, LASTCHANGE }; /// /// An object that represent a ram address and related properties @@ -338,18 +339,18 @@ namespace BizHawk.MultiClient return ValToString(lastsearch); } - private int ComparePrevious(Watch Other, string previous) + private int ComparePrevious(Watch Other, prevDef previous) { switch (previous) { - case "Last Search": + case prevDef.LASTSEARCH: return CompareLastSearch(Other); - case "Original": + case prevDef.ORIGINAL: return CompareOriginal(Other); default: - case "Last Frame": + case prevDef.LASTFRAME: return ComparePrev(Other); - case "Last Change": + case prevDef.LASTCHANGE: return CompareLastChange(Other); } } @@ -481,7 +482,7 @@ namespace BizHawk.MultiClient return this.notes.CompareTo(Other.notes); } - public int CompareTo(Watch Other, string parameter, string previous) + public int CompareTo(Watch Other, string parameter, prevDef previous) { int compare = 0; if (parameter == "Address")