@@ -71,28 +71,16 @@ public sealed class EntityCrimeRecordsOverlay : Overlay
|
|||||||
|
|
||||||
if (GetRecord(hum.Owner, args.MapId, out var criminalType))
|
if (GetRecord(hum.Owner, args.MapId, out var criminalType))
|
||||||
{
|
{
|
||||||
var icon = "released";
|
var icon = criminalType switch
|
||||||
switch (criminalType)
|
|
||||||
{
|
{
|
||||||
case EnumCriminalRecordType.Released:
|
EnumCriminalRecordType.Released => "released",
|
||||||
icon = "released";
|
EnumCriminalRecordType.Discharged => "discharged",
|
||||||
break;
|
EnumCriminalRecordType.Parolled => "parolled",
|
||||||
case EnumCriminalRecordType.Discharged:
|
EnumCriminalRecordType.Suspected => "suspected",
|
||||||
icon = "discharged";
|
EnumCriminalRecordType.Wanted => "wanted",
|
||||||
break;
|
EnumCriminalRecordType.Incarcerated => "incarcerated",
|
||||||
case EnumCriminalRecordType.Parolled:
|
_ => "released"
|
||||||
icon = "parolled";
|
};
|
||||||
break;
|
|
||||||
case EnumCriminalRecordType.Suspected:
|
|
||||||
icon = "suspected";
|
|
||||||
break;
|
|
||||||
case EnumCriminalRecordType.Wanted:
|
|
||||||
icon = "wanted";
|
|
||||||
break;
|
|
||||||
case EnumCriminalRecordType.Incarcerated:
|
|
||||||
icon = "incarcerated";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
var sprite_icon = new SpriteSpecifier.Rsi(new ResPath("/Textures/White/Interface/records.rsi"), icon);
|
var sprite_icon = new SpriteSpecifier.Rsi(new ResPath("/Textures/White/Interface/records.rsi"), icon);
|
||||||
var _iconTexture = _entManager.EntitySysManager.GetEntitySystem<SpriteSystem>().Frame0(sprite_icon);
|
var _iconTexture = _entManager.EntitySysManager.GetEntitySystem<SpriteSystem>().Frame0(sprite_icon);
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public sealed class EntityHealthBarOverlay : Overlay
|
|||||||
var scaleMatrix = Matrix3.CreateScale(new Vector2(scale, scale));
|
var scaleMatrix = Matrix3.CreateScale(new Vector2(scale, scale));
|
||||||
var rotationMatrix = Matrix3.CreateRotation(-rotation);
|
var rotationMatrix = Matrix3.CreateRotation(-rotation);
|
||||||
|
|
||||||
foreach (var (mob, dmg) in _entManager.EntityQuery<MobStateComponent, DamageableComponent>(true))
|
foreach (var (mob, dmg, threasholds) in _entManager.EntityQuery<MobStateComponent, DamageableComponent, MobThresholdsComponent>(true))
|
||||||
{
|
{
|
||||||
if (!xformQuery.TryGetComponent(mob.Owner, out var xform) ||
|
if (!xformQuery.TryGetComponent(mob.Owner, out var xform) ||
|
||||||
xform.MapID != args.MapId)
|
xform.MapID != args.MapId)
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using Content.Shared.White.CriminalRecords;
|
||||||
|
using Robust.Server.GameStates;
|
||||||
|
using Robust.Shared.GameStates;
|
||||||
|
|
||||||
|
namespace Content.Server.White.CriminalRecords;
|
||||||
|
|
||||||
|
public sealed class CriminalRecordsServerSystem : EntitySystem
|
||||||
|
{
|
||||||
|
[Dependency] private readonly PVSOverrideSystem _pvsSys = default!;
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
SubscribeLocalEvent<CriminalRecordsServerComponent, ComponentStartup>(OnCompInit);
|
||||||
|
SubscribeLocalEvent<CriminalRecordsServerComponent, ComponentRemove>(OnCompRemove);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnCompInit(EntityUid uid, CriminalRecordsServerComponent component, ComponentStartup args)
|
||||||
|
{
|
||||||
|
_pvsSys.AddGlobalOverride(uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnCompRemove(EntityUid uid, CriminalRecordsServerComponent component, ComponentRemove args)
|
||||||
|
{
|
||||||
|
_pvsSys.ClearOverride(uid);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -33,8 +33,7 @@ public sealed class CriminalRecordInfo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[RegisterComponent]
|
[RegisterComponent, NetworkedComponent]
|
||||||
[NetworkedComponent]
|
|
||||||
public sealed partial class CriminalRecordsServerComponent : Component
|
public sealed partial class CriminalRecordsServerComponent : Component
|
||||||
{
|
{
|
||||||
[DataField("Cache")] public Dictionary<StationRecordKey, CriminalRecordInfo> Cache = new();
|
[DataField("Cache")] public Dictionary<StationRecordKey, CriminalRecordInfo> Cache = new();
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
using Content.Shared.StationRecords;
|
using Content.Shared.StationRecords;
|
||||||
|
using JetBrains.Annotations;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
|
|
||||||
namespace Content.Shared.White.CriminalRecords;
|
namespace Content.Shared.White.CriminalRecords;
|
||||||
|
|
||||||
public sealed class CriminalRecordsServerSystem: EntitySystem
|
[PublicAPI]
|
||||||
|
public class SharedCriminalRecordsServerSystem: EntitySystem
|
||||||
{
|
{
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
Reference in New Issue
Block a user