Hover examine buttons (#35206)

* hover examine verbs (not aligned to the left yet)

* handle click hovers and align them to the left

* revert contrabandsystem changes (this is for another PR)

* add support for markup tags
This commit is contained in:
Killerqu00
2025-03-22 03:22:01 +01:00
committed by GitHub
parent 4027115e0c
commit dacf0d915c
7 changed files with 82 additions and 16 deletions

View File

@@ -4,6 +4,7 @@ using Content.Shared.Verbs;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Client.Utility;
using Robust.Shared.Utility;
@@ -40,7 +41,17 @@ public sealed class ExamineButton : ContainerButton
Disabled = true;
}
ToolTip = verb.Message ?? verb.Text;
TooltipSupplier = sender =>
{
var label = new RichTextLabel();
label.SetMessage(FormattedMessage.FromMarkupOrThrow(verb.Message ?? verb.Text));
var tooltip = new Tooltip();
tooltip.GetChild(0).Children.Clear();
tooltip.GetChild(0).Children.Add(label);
return tooltip;
};
Icon = new TextureRect
{