Literally Murder IExamine (#7352)

This commit is contained in:
Rane
2022-04-08 17:17:25 -04:00
committed by GitHub
parent 427f7378c3
commit 7900abb888
27 changed files with 372 additions and 469 deletions

View File

@@ -3,9 +3,8 @@ using Content.Server.UserInterface;
using Content.Shared.Actions;
using Content.Shared.Interaction.Events;
using Content.Shared.Toggleable;
using Content.Shared.Verbs;
using Content.Shared.Examine;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
namespace Content.Server.Atmos.EntitySystems
{
@@ -22,6 +21,7 @@ namespace Content.Server.Atmos.EntitySystems
base.Initialize();
SubscribeLocalEvent<GasTankComponent, BeforeActivatableUIOpenEvent>(BeforeUiOpen);
SubscribeLocalEvent<GasTankComponent, GetActionsEvent>(OnGetActions);
SubscribeLocalEvent<GasTankComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<GasTankComponent, ToggleActionEvent>(OnActionToggle);
SubscribeLocalEvent<GasTankComponent, DroppedEvent>(OnDropped);
}
@@ -42,6 +42,14 @@ namespace Content.Server.Atmos.EntitySystems
args.Actions.Add(component.ToggleAction);
}
private void OnExamined(EntityUid uid, GasTankComponent component, ExaminedEvent args)
{
if (args.IsInDetailsRange)
args.PushMarkup(Loc.GetString("comp-gas-tank-examine", ("pressure", Math.Round(component.Air?.Pressure ?? 0))));
if (component.IsConnected)
args.PushMarkup(Loc.GetString("comp-gas-tank-connected"));
}
private void OnActionToggle(EntityUid uid, GasTankComponent component, ToggleActionEvent args)
{
if (args.Handled)