Move view variables verb to the top of the list with no category and localize it (#20546)

This commit is contained in:
DrSmugleaf
2023-09-30 13:22:07 -07:00
committed by GitHub
parent 574b2a94d9
commit 585ab5ca84
2 changed files with 15 additions and 5 deletions

View File

@@ -24,10 +24,9 @@ namespace Content.Client.Administration.Systems
// View variables verbs // View variables verbs
if (_clientConGroupController.CanViewVar()) if (_clientConGroupController.CanViewVar())
{ {
Verb verb = new() var verb = new VvVerb()
{ {
Category = VerbCategory.Debug, Text = Loc.GetString("view-variables"),
Text = "View Variables",
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/vv.svg.192dpi.png")), Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/vv.svg.192dpi.png")),
Act = () => _clientConsoleHost.ExecuteCommand($"vv {GetNetEntity(args.Target)}"), Act = () => _clientConsoleHost.ExecuteCommand($"vv {GetNetEntity(args.Target)}"),
ClientExclusive = true // opening VV window is client-side. Don't ask server to run this verb. ClientExclusive = true // opening VV window is client-side. Don't ask server to run this verb.

View File

@@ -1,7 +1,7 @@
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.Interaction.Events; using Content.Shared.Interaction.Events;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Shared.Verbs namespace Content.Shared.Verbs
{ {
@@ -215,6 +215,7 @@ namespace Content.Shared.Verbs
public static List<Type> VerbTypes = new() public static List<Type> VerbTypes = new()
{ {
typeof(Verb), typeof(Verb),
typeof(VvVerb),
typeof(InteractionVerb), typeof(InteractionVerb),
typeof(UtilityVerb), typeof(UtilityVerb),
typeof(InnateVerb), typeof(InnateVerb),
@@ -225,6 +226,16 @@ namespace Content.Shared.Verbs
}; };
} }
/// <summary>
/// View variables verbs.
/// </summary>
/// <remarks>Currently only used for the verb that opens the view variables panel.</remarks>
[Serializable, NetSerializable]
public sealed class VvVerb : Verb
{
public override int TypePriority => int.MaxValue;
}
/// <summary> /// <summary>
/// Primary interaction verbs. This includes both use-in-hand and interacting with external entities. /// Primary interaction verbs. This includes both use-in-hand and interacting with external entities.
/// </summary> /// </summary>