Remove some obsolete AppearanceComponent method usages (#13726)
This commit is contained in:
@@ -27,6 +27,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly ToolSystem _toolSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
private const float ScrewTime = 2f;
|
||||
|
||||
@@ -114,7 +115,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
|
||||
if (appearance != null)
|
||||
{
|
||||
appearance.SetData(ApcVisuals.ChargeState, newState);
|
||||
_appearance.SetData(uid, ApcVisuals.ChargeState, newState, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,7 +232,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
if (!Resolve(uid, ref appearance, ref apc, false))
|
||||
return;
|
||||
|
||||
appearance.SetData(ApcVisuals.PanelState, GetPanelState(apc));
|
||||
_appearance.SetData(uid, ApcVisuals.PanelState, GetPanelState(apc), appearance);
|
||||
}
|
||||
|
||||
private sealed class ApcToolFinishedEvent : EntityEventArgs
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Server.Power.Components;
|
||||
using Content.Server.Power.Nodes;
|
||||
using Content.Shared.Wires;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Server.Power.EntitySystems
|
||||
@@ -12,6 +13,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
public sealed class CableVisSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -55,7 +57,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
};
|
||||
}
|
||||
|
||||
appearance.SetData(WireVisVisuals.ConnectedMask, mask);
|
||||
_appearance.SetData(uid, WireVisVisuals.ConnectedMask, mask, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,14 +22,14 @@ public sealed class PowerWireAction : BaseWireAction
|
||||
|
||||
public override StatusLightState? GetLightState(Wire wire)
|
||||
{
|
||||
if (WiresSystem.TryGetData(wire.Owner, PowerWireActionKey.MainWire, out int main)
|
||||
if (WiresSystem.TryGetData<int>(wire.Owner, PowerWireActionKey.MainWire, out var main)
|
||||
&& main != wire.Id)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!AllWiresMended(wire.Owner)
|
||||
|| WiresSystem.TryGetData(wire.Owner, PowerWireActionKey.Pulsed, out bool pulsed)
|
||||
|| WiresSystem.TryGetData<bool>(wire.Owner, PowerWireActionKey.Pulsed, out var pulsed)
|
||||
&& pulsed)
|
||||
{
|
||||
return StatusLightState.BlinkingSlow;
|
||||
@@ -40,14 +40,14 @@ public sealed class PowerWireAction : BaseWireAction
|
||||
|
||||
private bool AllWiresCut(EntityUid owner)
|
||||
{
|
||||
return WiresSystem.TryGetData(owner, PowerWireActionKey.CutWires, out int? cut)
|
||||
&& WiresSystem.TryGetData(owner, PowerWireActionKey.WireCount, out int? count)
|
||||
return WiresSystem.TryGetData<int?>(owner, PowerWireActionKey.CutWires, out var cut)
|
||||
&& WiresSystem.TryGetData<int?>(owner, PowerWireActionKey.WireCount, out var count)
|
||||
&& count == cut;
|
||||
}
|
||||
|
||||
private bool AllWiresMended(EntityUid owner)
|
||||
{
|
||||
return WiresSystem.TryGetData(owner, PowerWireActionKey.CutWires, out int? cut)
|
||||
return WiresSystem.TryGetData<int?>(owner, PowerWireActionKey.CutWires, out var cut)
|
||||
&& cut == 0;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public sealed class PowerWireAction : BaseWireAction
|
||||
}
|
||||
else
|
||||
{
|
||||
if (WiresSystem.TryGetData(owner, PowerWireActionKey.Pulsed, out bool isPulsed)
|
||||
if (WiresSystem.TryGetData<bool>(owner, PowerWireActionKey.Pulsed, out var isPulsed)
|
||||
&& isPulsed)
|
||||
{
|
||||
return;
|
||||
@@ -84,8 +84,8 @@ public sealed class PowerWireAction : BaseWireAction
|
||||
|
||||
private void SetWireCuts(EntityUid owner, bool isCut)
|
||||
{
|
||||
if (WiresSystem.TryGetData(owner, PowerWireActionKey.CutWires, out int? cut)
|
||||
&& WiresSystem.TryGetData(owner, PowerWireActionKey.WireCount, out int? count))
|
||||
if (WiresSystem.TryGetData<int?>(owner, PowerWireActionKey.CutWires, out var cut)
|
||||
&& WiresSystem.TryGetData<int?>(owner, PowerWireActionKey.WireCount, out var count))
|
||||
{
|
||||
if (cut == count && isCut
|
||||
|| cut <= 0 && !isCut)
|
||||
@@ -131,7 +131,7 @@ public sealed class PowerWireAction : BaseWireAction
|
||||
|
||||
var activePulse = false;
|
||||
|
||||
if (WiresSystem.TryGetData(wire.Owner, PowerWireActionKey.Pulsed, out bool pulsed))
|
||||
if (WiresSystem.TryGetData<bool>(wire.Owner, PowerWireActionKey.Pulsed, out var pulsed))
|
||||
{
|
||||
activePulse = pulsed;
|
||||
}
|
||||
@@ -218,7 +218,7 @@ public sealed class PowerWireAction : BaseWireAction
|
||||
|
||||
var electrocuted = !TrySetElectrocution(user, wire, true);
|
||||
|
||||
if (WiresSystem.TryGetData(wire.Owner, PowerWireActionKey.Pulsed, out bool pulsedKey) && pulsedKey)
|
||||
if (WiresSystem.TryGetData<bool>(wire.Owner, PowerWireActionKey.Pulsed, out var pulsedKey) && pulsedKey)
|
||||
return;
|
||||
|
||||
WiresSystem.SetData(wire.Owner, PowerWireActionKey.Pulsed, true);
|
||||
@@ -236,7 +236,7 @@ public sealed class PowerWireAction : BaseWireAction
|
||||
|
||||
if (!IsPowered(wire.Owner))
|
||||
{
|
||||
if (!WiresSystem.TryGetData(wire.Owner, PowerWireActionKey.Pulsed, out bool pulsed)
|
||||
if (!WiresSystem.TryGetData<bool>(wire.Owner, PowerWireActionKey.Pulsed, out var pulsed)
|
||||
|| !pulsed)
|
||||
{
|
||||
WiresSystem.TryCancelWireAction(wire.Owner, PowerWireActionKey.ElectrifiedCancel);
|
||||
|
||||
Reference in New Issue
Block a user