add tooltip with entity name on inventory hover (#22203)
This commit is contained in:
@@ -5,6 +5,7 @@ using Content.Shared.Storage;
|
|||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
|
|
||||||
namespace Content.Client.UserInterface.Systems.Storage.Controls;
|
namespace Content.Client.UserInterface.Systems.Storage.Controls;
|
||||||
|
|
||||||
@@ -55,9 +56,22 @@ public sealed class ItemGridPiece : Control
|
|||||||
Visible = true;
|
Visible = true;
|
||||||
MouseFilter = MouseFilterMode.Pass;
|
MouseFilter = MouseFilterMode.Pass;
|
||||||
|
|
||||||
|
TooltipSupplier = SupplyTooltip;
|
||||||
|
|
||||||
OnThemeUpdated();
|
OnThemeUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Control? SupplyTooltip(Control sender)
|
||||||
|
{
|
||||||
|
if (_storageController.IsDragging)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return new Tooltip
|
||||||
|
{
|
||||||
|
Text = _entityManager.GetComponent<MetaDataComponent>(Entity).EntityName
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnThemeUpdated()
|
protected override void OnThemeUpdated()
|
||||||
{
|
{
|
||||||
base.OnThemeUpdated();
|
base.OnThemeUpdated();
|
||||||
|
|||||||
Reference in New Issue
Block a user