Eject verbs for chem and id console (#2098)

* chemmaster eject beaker

* reagentdispencer eject beaker

* idcardconsole eject ID

* implementing InteractUsing for IDCardConsole

* typos
This commit is contained in:
derek
2020-09-16 14:57:14 -07:00
committed by GitHub
parent 27a5a7a09c
commit 84230a47ad
3 changed files with 132 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Utility;
using Content.Shared.GameObjects.Verbs;
using Robust.Server.GameObjects.Components.Container;
using Robust.Server.GameObjects.Components.UserInterface;
using Robust.Server.GameObjects.EntitySystems;
@@ -417,5 +418,27 @@ namespace Content.Server.GameObjects.Components.Chemistry
{
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
}
[Verb]
public sealed class EjectBeakerVerb : Verb<ChemMasterComponent>
{
protected override void GetData(IEntity user, ChemMasterComponent component, VerbData data)
{
if (!ActionBlockerSystem.CanInteract(user))
{
data.Visibility = VerbVisibility.Invisible;
return;
}
data.Text = Loc.GetString("Eject Beaker");
data.Visibility = component.HasBeaker ? VerbVisibility.Visible : VerbVisibility.Invisible;
}
protected override void Activate(IEntity user, ChemMasterComponent component)
{
component.TryEject(user);
}
}
}
}