2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Verbs;
|
2019-10-30 11:31:35 -04:00
|
|
|
using Robust.Client.Console;
|
|
|
|
|
using Robust.Client.ViewVariables;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Shared.GameObjects;
|
2019-10-30 11:31:35 -04:00
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Client.ViewVariables
|
2019-10-30 11:31:35 -04:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Global verb that opens a view variables window for the entity in question.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[GlobalVerb]
|
|
|
|
|
class ViewVariablesVerb : GlobalVerb
|
|
|
|
|
{
|
|
|
|
|
public override bool RequireInteractionRange => false;
|
2020-08-15 20:42:39 +02:00
|
|
|
public override bool BlockedByContainers => false;
|
2019-10-30 11:31:35 -04:00
|
|
|
|
2020-05-23 03:09:44 +02:00
|
|
|
public override void GetData(IEntity user, IEntity target, VerbData data)
|
2019-10-30 11:31:35 -04:00
|
|
|
{
|
|
|
|
|
var groupController = IoCManager.Resolve<IClientConGroupController>();
|
2020-05-23 03:09:44 +02:00
|
|
|
if (!groupController.CanViewVar())
|
|
|
|
|
{
|
|
|
|
|
data.Visibility = VerbVisibility.Invisible;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
data.Text = "View Variables";
|
|
|
|
|
data.CategoryData = VerbCategories.Debug;
|
2021-03-14 14:40:01 +01:00
|
|
|
data.IconTexture = "/Textures/Interface/VerbIcons/vv.svg.192dpi.png";
|
2019-10-30 11:31:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Activate(IEntity user, IEntity target)
|
|
|
|
|
{
|
|
|
|
|
var vvm = IoCManager.Resolve<IViewVariablesManager>();
|
|
|
|
|
vvm.OpenVV(target);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|