Changes for prototype load parallelization (#13066)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Pieter-Jan Briers
2022-12-20 23:25:34 +01:00
committed by GitHub
parent 584921b423
commit a323671984
50 changed files with 169 additions and 249 deletions

View File

@@ -154,7 +154,7 @@ namespace Content.Client.Construction.UI
continue;
}
if (!string.IsNullOrEmpty(category) && category != Loc.GetString("construction-category-all"))
if (!string.IsNullOrEmpty(category) && category != "construction-category-all")
{
if (recipe.Category != category)
continue;
@@ -178,7 +178,7 @@ namespace Content.Client.Construction.UI
var uniqueCategories = new HashSet<string>();
// hard-coded to show all recipes
uniqueCategories.Add(Loc.GetString("construction-category-all"));
uniqueCategories.Add("construction-category-all");
foreach (var prototype in _prototypeManager.EnumeratePrototypes<ConstructionPrototype>())
{
@@ -190,13 +190,13 @@ namespace Content.Client.Construction.UI
_constructionView.Category.Clear();
var array = uniqueCategories.ToArray();
var array = uniqueCategories.OrderBy(Loc.GetString).ToArray();
Array.Sort(array);
for (var i = 0; i < array.Length; i++)
{
var category = array[i];
_constructionView.Category.AddItem(category, i);
_constructionView.Category.AddItem(Loc.GetString(category), i);
}
_constructionView.Categories = array;