(586e37096) Merge branch 'dev' of https://github.com/Regalis11/Barotrauma-development into dev

This commit is contained in:
Joonas Rikkonen
2019-04-10 13:22:57 +03:00
parent bd0c8a9d34
commit fde99f5373
@@ -1432,13 +1432,13 @@ namespace Barotrauma
selectHit = picker.IsKeyHit(ic.SelectKey); selectHit = picker.IsKeyHit(ic.SelectKey);
#if CLIENT #if CLIENT
//if the cursor is on a UI component, disable interaction with the left mouse button //if the cursor is on a UI component, disable interaction with the left mouse button
//to prevent accidentally selecting items when clicking UI elements //to prevent accidentally selecting items when clicking UI elements
if (picker == Character.Controlled && GUI.MouseOn != null) if (picker == Character.Controlled && GUI.MouseOn != null)
{ {
if (GameMain.Config.KeyBind(ic.PickKey).MouseButton == 0) pickHit = false; if (GameMain.Config.KeyBind(ic.PickKey).MouseButton == 0) pickHit = false;
if (GameMain.Config.KeyBind(ic.SelectKey).MouseButton == 0) selectHit = false; if (GameMain.Config.KeyBind(ic.SelectKey).MouseButton == 0) selectHit = false;
} }
#endif #endif
} }
} }
@@ -1608,6 +1608,7 @@ namespace Barotrauma
if (remove) { Spawner?.AddToRemoveQueue(this); } if (remove) { Spawner?.AddToRemoveQueue(this); }
} }
List<ColoredText> texts = new List<ColoredText>();
public List<ColoredText> GetHUDTexts(Character character) public List<ColoredText> GetHUDTexts(Character character)
{ {
texts.Clear(); texts.Clear();
@@ -1616,14 +1617,13 @@ namespace Barotrauma
if (string.IsNullOrEmpty(ic.DisplayMsg)) continue; if (string.IsNullOrEmpty(ic.DisplayMsg)) continue;
if (!ic.CanBePicked && !ic.CanBeSelected) continue; if (!ic.CanBePicked && !ic.CanBeSelected) continue;
if (ic is Holdable holdable && !holdable.CanBeDeattached()) 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); bool hasRequiredSkillsAndItems = ic.HasRequiredSkills(character) && ic.HasRequiredItems(character, false);
if (hasRequiredSkillsAndItems) if (hasRequiredSkillsAndItems)
{ {
color = Color.Orange; color = Color.Cyan;
} }
// TODO: Blue color if the item is selected
texts.Add(new ColoredText(ic.DisplayMsg, color, false)); texts.Add(new ColoredText(ic.DisplayMsg, color, false));
} }