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

@@ -3,10 +3,12 @@ using Content.Client.ContextMenu.UI;
using Content.Shared.Verbs;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.Utility;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Utility;
namespace Content.Client.Verbs.UI
{
@@ -27,7 +29,17 @@ namespace Content.Client.Verbs.UI
public VerbMenuElement(Verb verb) : base(verb.Text)
{
ToolTip = verb.Message;
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;
};
Disabled = verb.Disabled;
Verb = verb;