Sort reagent prototypes for solutions (#22049)
This commit is contained in:
@@ -174,10 +174,19 @@ public sealed partial class SolutionContainerSystem : EntitySystem
|
||||
: "shared-solution-container-component-on-examine-worded-amount-multiple-reagents")),
|
||||
("desc", primary.LocalizedPhysicalDescription)));
|
||||
|
||||
|
||||
var reagentPrototypes = solution.GetReagentPrototypes(_prototypeManager);
|
||||
|
||||
// Sort the reagents by amount, descending then alphabetically
|
||||
var sortedReagentPrototypes = reagentPrototypes
|
||||
.OrderByDescending(pair => pair.Value.Value)
|
||||
.ThenBy(pair => pair.Key.LocalizedName);
|
||||
|
||||
// Add descriptions of immediately recognizable reagents, like water or beer
|
||||
var recognized = new List<ReagentPrototype>();
|
||||
foreach (var proto in solution.GetReagentPrototypes(_prototypeManager).Keys)
|
||||
foreach (var keyValuePair in sortedReagentPrototypes)
|
||||
{
|
||||
var proto = keyValuePair.Key;
|
||||
if (!proto.Recognizable)
|
||||
{
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user