From f60dc25d9f74de6d484940bade37086149ff4e00 Mon Sep 17 00:00:00 2001 From: MaxED Date: Fri, 27 Feb 2015 14:32:29 +0000 Subject: [PATCH] Edit forms: tag lists are now sorted in descending order. --- Source/Core/GZBuilder/Controls/TagSelector.cs | 4 ++-- Source/Core/Types/LinedefTagHandler.cs | 4 ++-- Source/Core/Types/SectorTagHandler.cs | 4 ++-- Source/Core/Types/ThingTagHandler.cs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Core/GZBuilder/Controls/TagSelector.cs b/Source/Core/GZBuilder/Controls/TagSelector.cs index ea229046..c9b1843d 100644 --- a/Source/Core/GZBuilder/Controls/TagSelector.cs +++ b/Source/Core/GZBuilder/Controls/TagSelector.cs @@ -86,8 +86,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls } } - //now sort them - tags.Sort(); + //now sort them in descending order + tags.Sort((a, b) => -1 * a.CompareTo(b)); //create tag infos foreach(int tag in tags) diff --git a/Source/Core/Types/LinedefTagHandler.cs b/Source/Core/Types/LinedefTagHandler.cs index 3561db88..cbc3acf5 100644 --- a/Source/Core/Types/LinedefTagHandler.cs +++ b/Source/Core/Types/LinedefTagHandler.cs @@ -41,8 +41,8 @@ namespace CodeImp.DoomBuilder.Types tags.Add(t.Tag); } - //now sort them - tags.Sort(); + //now sort them in descending order + tags.Sort((a, b) => -1 * a.CompareTo(b)); //create enum items foreach(int tag in tags) diff --git a/Source/Core/Types/SectorTagHandler.cs b/Source/Core/Types/SectorTagHandler.cs index 10ec7f16..f145f59b 100644 --- a/Source/Core/Types/SectorTagHandler.cs +++ b/Source/Core/Types/SectorTagHandler.cs @@ -80,8 +80,8 @@ namespace CodeImp.DoomBuilder.Types tags.Add(t.Tag); } - //now sort them - tags.Sort(); + //now sort them in descending order + tags.Sort((a, b) => -1 * a.CompareTo(b)); //create enum items foreach(int tag in tags) diff --git a/Source/Core/Types/ThingTagHandler.cs b/Source/Core/Types/ThingTagHandler.cs index 8fb2c120..9f3c377d 100644 --- a/Source/Core/Types/ThingTagHandler.cs +++ b/Source/Core/Types/ThingTagHandler.cs @@ -41,8 +41,8 @@ namespace CodeImp.DoomBuilder.Types tags.Add(t.Tag); } - //now sort them - tags.Sort(); + //now sort them in descending order + tags.Sort((a, b) => -1 * a.CompareTo(b)); //create enum items foreach(int tag in tags)