From 585ab5ca845588644d456072c3e04a89a75ba1bb Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Sat, 30 Sep 2023 13:22:07 -0700 Subject: [PATCH] Move view variables verb to the top of the list with no category and localize it (#20546) --- .../Administration/Systems/AdminVerbSystem.cs | 5 ++--- Content.Shared/Verbs/Verb.cs | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Content.Client/Administration/Systems/AdminVerbSystem.cs b/Content.Client/Administration/Systems/AdminVerbSystem.cs index d08ebc0fce..e0f84bc4f0 100644 --- a/Content.Client/Administration/Systems/AdminVerbSystem.cs +++ b/Content.Client/Administration/Systems/AdminVerbSystem.cs @@ -24,10 +24,9 @@ namespace Content.Client.Administration.Systems // View variables verbs if (_clientConGroupController.CanViewVar()) { - Verb verb = new() + var verb = new VvVerb() { - Category = VerbCategory.Debug, - Text = "View Variables", + Text = Loc.GetString("view-variables"), Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/vv.svg.192dpi.png")), Act = () => _clientConsoleHost.ExecuteCommand($"vv {GetNetEntity(args.Target)}"), ClientExclusive = true // opening VV window is client-side. Don't ask server to run this verb. diff --git a/Content.Shared/Verbs/Verb.cs b/Content.Shared/Verbs/Verb.cs index 33576b6b9c..76ed207307 100644 --- a/Content.Shared/Verbs/Verb.cs +++ b/Content.Shared/Verbs/Verb.cs @@ -1,7 +1,7 @@ -using Robust.Shared.Serialization; -using Robust.Shared.Utility; using Content.Shared.Database; using Content.Shared.Interaction.Events; +using Robust.Shared.Serialization; +using Robust.Shared.Utility; namespace Content.Shared.Verbs { @@ -215,6 +215,7 @@ namespace Content.Shared.Verbs public static List VerbTypes = new() { typeof(Verb), + typeof(VvVerb), typeof(InteractionVerb), typeof(UtilityVerb), typeof(InnateVerb), @@ -225,6 +226,16 @@ namespace Content.Shared.Verbs }; } + /// + /// View variables verbs. + /// + /// Currently only used for the verb that opens the view variables panel. + [Serializable, NetSerializable] + public sealed class VvVerb : Verb + { + public override int TypePriority => int.MaxValue; + } + /// /// Primary interaction verbs. This includes both use-in-hand and interacting with external entities. /// -- 2.51.2