Add a toggle flashlight verb to the PDA (#2287)

* Add a toggle flashlight verb to the PDA

* capitalization

* Remove redundancy
This commit is contained in:
Peter Wedder
2020-10-18 15:52:42 +03:00
committed by GitHub
parent a7ca11611d
commit 699f4f912f

View File

@@ -293,6 +293,25 @@ namespace Content.Server.GameObjects.Components.PDA
}
}
public sealed class ToggleFlashlightVerb : Verb<PDAComponent>
{
protected override void GetData(IEntity user, PDAComponent component, VerbData data)
{
if (!ActionBlockerSystem.CanInteract(user))
{
data.Visibility = VerbVisibility.Invisible;
return;
}
data.Text = Loc.GetString("Toggle flashlight");
}
protected override void Activate(IEntity user, PDAComponent component)
{
component.ToggleLight();
}
}
private ISet<string>? GetContainedAccess()
{
return ContainedID?.Owner?.GetComponent<AccessComponent>()?.Tags;