Merge branch 'final-version' into upupup

This commit is contained in:
Aviu00
2024-02-05 10:24:33 +03:00
1189 changed files with 31542 additions and 354012 deletions

View File

@@ -1,4 +1,3 @@
using Content.Server.Station.Systems;
using Content.Server.StationRecords.Systems;
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
@@ -21,7 +20,6 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly StationRecordsSystem _record = default!;
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly UserInterfaceSystem _userInterface = default!;
[Dependency] private readonly AccessReaderSystem _accessReader = default!;
[Dependency] private readonly AccessSystem _access = default!;
@@ -89,10 +87,9 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
var jobProto = string.Empty;
var jobIcon = string.Empty; //WD-EDIT
if (_station.GetOwningStation(uid) is { } station
&& EntityManager.TryGetComponent<StationRecordKeyStorageComponent>(targetId, out var keyStorage)
&& keyStorage.Key != null
&& _record.TryGetRecord<GeneralStationRecord>(station, keyStorage.Key.Value, out var record))
if (TryComp<StationRecordKeyStorageComponent>(targetId, out var keyStorage)
&& keyStorage.Key is {} key
&& _record.TryGetRecord<GeneralStationRecord>(key, out var record))
{
jobProto = record.JobPrototype;
jobIcon = record.JobIcon;
@@ -109,7 +106,7 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
possibleAccess,
jobProto,
privilegedIdName,
EntityManager.GetComponent<MetaDataComponent>(targetId).EntityName,
Name(targetId),
jobIcon
);
}
@@ -205,7 +202,7 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
if (!Resolve(uid, ref component))
return true;
if (!EntityManager.TryGetComponent<AccessReaderComponent>(uid, out var reader))
if (!TryComp<AccessReaderComponent>(uid, out var reader))
return true;
var privilegedId = component.PrivilegedIdSlot.Item;
@@ -220,10 +217,9 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
JobPrototype? newJobProto,
string? newJobIcon) // WD EDIT
{
if (_station.GetOwningStation(uid) is not { } station
|| !EntityManager.TryGetComponent<StationRecordKeyStorageComponent>(targetId, out var keyStorage)
if (!TryComp<StationRecordKeyStorageComponent>(targetId, out var keyStorage)
|| keyStorage.Key is not { } key
|| !_record.TryGetRecord<GeneralStationRecord>(station, key, out var record))
|| !_record.TryGetRecord<GeneralStationRecord>(key, out var record))
{
return;
}
@@ -240,6 +236,6 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
if (!string.IsNullOrWhiteSpace(newJobIcon))
record.JobIcon = newJobIcon;
_record.Synchronize(station);
_record.Synchronize(key);
}
}