Handheld Crew Monitor and Station Map use power (#15983)

This commit is contained in:
themias
2023-05-05 13:52:40 -04:00
committed by GitHub
parent 2dd535284d
commit a7be595954
2 changed files with 10 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ using Content.Shared.Medical.CrewMonitoring;
using Robust.Shared.Map; using Robust.Shared.Map;
using Content.Shared.Medical.SuitSensor; using Content.Shared.Medical.SuitSensor;
using Robust.Shared.Timing; using Robust.Shared.Timing;
using Content.Server.PowerCell;
namespace Content.Server.Medical.CrewMonitoring namespace Content.Server.Medical.CrewMonitoring
{ {
@@ -16,6 +17,7 @@ namespace Content.Server.Medical.CrewMonitoring
[Dependency] private readonly SharedTransformSystem _xform = default!; [Dependency] private readonly SharedTransformSystem _xform = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly PowerCellSystem _cell = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -47,6 +49,9 @@ namespace Content.Server.Medical.CrewMonitoring
private void OnUIOpened(EntityUid uid, CrewMonitoringConsoleComponent component, BoundUIOpenedEvent args) private void OnUIOpened(EntityUid uid, CrewMonitoringConsoleComponent component, BoundUIOpenedEvent args)
{ {
if (!_cell.TryUseActivatableCharge(uid))
return;
UpdateUserInterface(uid, component); UpdateUserInterface(uid, component);
} }

View File

@@ -1,3 +1,4 @@
using Content.Server.PowerCell;
using Content.Shared.Pinpointer; using Content.Shared.Pinpointer;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
@@ -6,6 +7,7 @@ namespace Content.Server.Pinpointer;
public sealed class StationMapSystem : EntitySystem public sealed class StationMapSystem : EntitySystem
{ {
[Dependency] private readonly UserInterfaceSystem _ui = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!;
[Dependency] private readonly PowerCellSystem _cell = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -36,6 +38,9 @@ public sealed class StationMapSystem : EntitySystem
if (args.Session.AttachedEntity == null) if (args.Session.AttachedEntity == null)
return; return;
if (!_cell.TryUseActivatableCharge(uid))
return;
var comp = EnsureComp<StationMapUserComponent>(args.Session.AttachedEntity.Value); var comp = EnsureComp<StationMapUserComponent>(args.Session.AttachedEntity.Value);
comp.Map = uid; comp.Map = uid;
} }