diff --git a/Content.Client/GameObjects/Components/HUD/Inventory/HumanInventoryInterfaceController.cs b/Content.Client/GameObjects/Components/HUD/Inventory/HumanInventoryInterfaceController.cs index 5fc0f88b70..dbd487aa25 100644 --- a/Content.Client/GameObjects/Components/HUD/Inventory/HumanInventoryInterfaceController.cs +++ b/Content.Client/GameObjects/Components/HUD/Inventory/HumanInventoryInterfaceController.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using Content.Client.GameObjects.Components.Storage; using Content.Client.Utility; using JetBrains.Annotations; @@ -114,12 +115,17 @@ namespace Content.Client.GameObjects foreach (var button in buttons) { - button.SpriteView.Sprite = null; - button.OnPressed = AddToInventory; - button.StorageButton.Visible = false; + ClearButton(button); } } + private void ClearButton(InventoryButton button) + { + button.SpriteView.Sprite = null; + button.OnPressed = AddToInventory; + button.StorageButton.Visible = false; + } + public override void PlayerAttached() { base.PlayerAttached(); @@ -132,6 +138,11 @@ namespace Content.Client.GameObjects base.PlayerDetached(); GameHud.InventoryQuickButtonContainer.RemoveChild(_quickButtonsContainer); + + foreach (var button in _inventoryButtons.Values.SelectMany(l => l)) + { + ClearButton(button); + } } private class HumanInventoryWindow : SS14Window