From bd92bdfbf8387a4c56145bdca26c3100ba3656ce Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Sat, 23 May 2020 22:57:25 +0200 Subject: [PATCH] Improve equip fail messages. Message when trying to equip regular items to slots. Mention ID slot specifically. --- .../Components/GUI/HumanInventoryControllerComponent.cs | 4 +++- .../GameObjects/Components/GUI/InventoryComponent.cs | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Content.Server/GameObjects/Components/GUI/HumanInventoryControllerComponent.cs b/Content.Server/GameObjects/Components/GUI/HumanInventoryControllerComponent.cs index bc881cf344..d084fdf462 100644 --- a/Content.Server/GameObjects/Components/GUI/HumanInventoryControllerComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/HumanInventoryControllerComponent.cs @@ -34,7 +34,9 @@ namespace Content.Server.GameObjects // Can't wear stuff in ID card or pockets unless you have a uniform. if (_inventory.GetSlotItem(Slots.INNERCLOTHING) == null) { - reason = Loc.GetString("You need a uniform to store something in your pockets!"); + reason = Loc.GetString(slotMask == SlotFlags.IDCARD + ? "You need a uniform to store something in your ID slot!" + : "You need a uniform to store something in your pockets!"); return false; } diff --git a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs index 383dc9c0e2..4b4968d61f 100644 --- a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks.Dataflow; @@ -158,6 +158,11 @@ namespace Content.Server.GameObjects reason = controllerReason ?? reason; } + if (!pass && reason == null) + { + reason = Loc.GetString("You can't equip this!"); + } + return pass && SlotContainers[slot].CanInsert(item.Owner); }