Verb confirmation (#6137)

This commit is contained in:
ShadowCommander
2022-01-13 06:28:17 -08:00
committed by GitHub
parent 007caf26b7
commit 4f80dfda0d
8 changed files with 117 additions and 12 deletions

View File

@@ -0,0 +1,34 @@
using Content.Client.ContextMenu.UI;
using Content.Shared.Verbs;
using Robust.Shared.Maths;
using Robust.Shared.Utility;
namespace Content.Client.Verbs.UI;
public partial class ConfirmationMenuElement : ContextMenuElement
{
public const string StyleClassConfirmationContextMenuButton = "confirmationContextMenuButton";
public readonly Verb Verb;
public readonly VerbType Type;
public override string Text
{
set
{
var message = new FormattedMessage();
message.PushColor(Color.White);
message.AddMarkupPermissive(value.Trim());
Label.SetMessage(message);
}
}
public ConfirmationMenuElement(Verb verb, string? text, VerbType type) : base(text)
{
Verb = verb;
Type = type;
Icon.Visible = false;
SetOnlyStyleClass(StyleClassConfirmationContextMenuButton);
}
}