From e7f4d1474e455d36022022990055b742727dd766 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sun, 27 Aug 2017 18:10:17 +0300 Subject: [PATCH] Fixed interact rects not being calculated correctly for subinventory slots, the tooltip of a parent item isn't shown when highlighting a contained item --- Barotrauma/BarotraumaClient/Source/Items/Inventory.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaClient/Source/Items/Inventory.cs b/Barotrauma/BarotraumaClient/Source/Items/Inventory.cs index bdde02fa6..78a5ee727 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Inventory.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Inventory.cs @@ -247,6 +247,9 @@ namespace Barotrauma { subRect.Y = subRect.Y - subRect.Height - 10; container.Inventory.slots[i].Rect = subRect; + container.Inventory.slots[i].InteractRect = subRect; + container.Inventory.slots[i].InteractRect.Inflate(5, 5); + } container.Inventory.isSubInventory = true; @@ -284,7 +287,7 @@ namespace Barotrauma for (int i = 0; i < capacity; i++) { - if (slots[i].IsHighlighted && !slots[i].Disabled && Items[i] != null) + if (slots[i].InteractRect.Contains(PlayerInput.MousePosition) && !slots[i].Disabled && Items[i] != null) { string toolTip = ""; if (GameMain.DebugDraw)