From 842b6a2e34473099e7106afef51c85f0a0417e45 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Wed, 10 Apr 2019 13:22:19 +0300 Subject: [PATCH] (9619c01cd) Change the info text colors and cache the list. --- Barotrauma/BarotraumaShared/Source/Items/Item.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Source/Items/Item.cs b/Barotrauma/BarotraumaShared/Source/Items/Item.cs index 6e4b95df0..9e78d920e 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Item.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Item.cs @@ -1608,23 +1608,22 @@ namespace Barotrauma if (remove) { Spawner?.AddToRemoveQueue(this); } } + List texts = new List(); public List GetHUDTexts(Character character) { - List texts = new List(); - + texts.Clear(); foreach (ItemComponent ic in components) { if (string.IsNullOrEmpty(ic.DisplayMsg)) continue; if (!ic.CanBePicked && !ic.CanBeSelected) continue; if (ic is Holdable holdable && !holdable.CanBeDeattached()) continue; - - Color color = Color.Red; + + Color color = Color.Gray; bool hasRequiredSkillsAndItems = ic.HasRequiredSkills(character) && ic.HasRequiredItems(character, false); if (hasRequiredSkillsAndItems) { - color = Color.Orange; + color = Color.Cyan; } - // TODO: Blue color if the item is selected texts.Add(new ColoredText(ic.DisplayMsg, color, false)); }