From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Fri, 8 Dec 2023 02:38:07 +0000 (-0500) Subject: add tooltip with entity name on inventory hover (#22203) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=b01f0b5f82bb7d1b6c8acf42af2c9ee60ee5b3cb;p=space-station-14.git add tooltip with entity name on inventory hover (#22203) --- diff --git a/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs b/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs index 1441681e68..ece668c945 100644 --- a/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs +++ b/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs @@ -5,6 +5,7 @@ using Content.Shared.Storage; using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Client.UserInterface; +using Robust.Client.UserInterface.CustomControls; namespace Content.Client.UserInterface.Systems.Storage.Controls; @@ -55,9 +56,22 @@ public sealed class ItemGridPiece : Control Visible = true; MouseFilter = MouseFilterMode.Pass; + TooltipSupplier = SupplyTooltip; + OnThemeUpdated(); } + private Control? SupplyTooltip(Control sender) + { + if (_storageController.IsDragging) + return null; + + return new Tooltip + { + Text = _entityManager.GetComponent(Entity).EntityName + }; + } + protected override void OnThemeUpdated() { base.OnThemeUpdated();