Sort construction graph recipes alphabetically (#5039)

This commit is contained in:
metalgearsloth
2021-10-27 01:18:43 +11:00
committed by GitHub
parent 2fcb56f9be
commit 27b50c9485

View File

@@ -155,6 +155,7 @@ namespace Content.Client.Construction.UI
var recipesList = _constructionView.Recipes; var recipesList = _constructionView.Recipes;
recipesList.Clear(); recipesList.Clear();
var recipes = new List<ConstructionPrototype>();
foreach (var recipe in _prototypeManager.EnumeratePrototypes<ConstructionPrototype>()) foreach (var recipe in _prototypeManager.EnumeratePrototypes<ConstructionPrototype>())
{ {
@@ -170,6 +171,13 @@ namespace Content.Client.Construction.UI
continue; 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)); recipesList.Add(GetItem(recipe, recipesList));
} }