From 27b50c9485bb2dbed9d87902d5ef6764fd082c10 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 27 Oct 2021 01:18:43 +1100 Subject: [PATCH] Sort construction graph recipes alphabetically (#5039) --- .../Construction/UI/ConstructionMenuPresenter.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Content.Client/Construction/UI/ConstructionMenuPresenter.cs b/Content.Client/Construction/UI/ConstructionMenuPresenter.cs index bea5d32763..d7d899fbfe 100644 --- a/Content.Client/Construction/UI/ConstructionMenuPresenter.cs +++ b/Content.Client/Construction/UI/ConstructionMenuPresenter.cs @@ -155,6 +155,7 @@ namespace Content.Client.Construction.UI var recipesList = _constructionView.Recipes; recipesList.Clear(); + var recipes = new List(); foreach (var recipe in _prototypeManager.EnumeratePrototypes()) { @@ -170,6 +171,13 @@ namespace Content.Client.Construction.UI continue; } + recipes.Add(recipe); + } + + recipes.Sort((a, b) => string.Compare(a.Name, b.Name, StringComparison.InvariantCulture)); + + foreach (var recipe in recipes) + { recipesList.Add(GetItem(recipe, recipesList)); }