move criminal records console component to shared (#24957)

* move criminal records console component to shared

* todone

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2024-02-05 12:55:39 +00:00
committed by GitHub
parent 9deaf67521
commit 9b1c88b78b
7 changed files with 38 additions and 13 deletions

View File

@@ -1,45 +0,0 @@
using Content.Server.CriminalRecords.Systems;
using Content.Shared.Radio;
using Content.Shared.StationRecords;
using Robust.Shared.Prototypes;
namespace Content.Server.CriminalRecords.Components;
/// <summary>
/// A component for Criminal Record Console storing an active station record key and a currently applied filter
/// </summary>
[RegisterComponent]
[Access(typeof(CriminalRecordsConsoleSystem))]
public sealed partial class CriminalRecordsConsoleComponent : Component
{
/// <summary>
/// Currently active station record key.
/// There is no station parameter as the console uses the current station.
/// </summary>
/// <remarks>
/// TODO: in the future this should be clientside instead of something players can fight over.
/// Client selects a record and tells the server the key it wants records for.
/// Server then sends a state with just the records, not the listing or filter, and the client updates just that.
/// I don't know if it's possible to have multiple bui states right now.
/// </remarks>
[DataField]
public uint? ActiveKey;
/// <summary>
/// Currently applied filter.
/// </summary>
[DataField]
public StationRecordsFilter? Filter;
/// <summary>
/// Channel to send messages to when someone's status gets changed.
/// </summary>
[DataField]
public ProtoId<RadioChannelPrototype> SecurityChannel = "Security";
/// <summary>
/// Max length of arrest and crime history strings.
/// </summary>
[DataField]
public uint MaxStringLength = 256;
}

View File

@@ -1,4 +1,3 @@
using Content.Server.CriminalRecords.Components;
using Content.Server.Popups;
using Content.Server.Radio.EntitySystems;
using Content.Server.Station.Systems;
@@ -6,6 +5,8 @@ using Content.Server.StationRecords;
using Content.Server.StationRecords.Systems;
using Content.Shared.Access.Systems;
using Content.Shared.CriminalRecords;
using Content.Shared.CriminalRecords.Components;
using Content.Shared.CriminalRecords.Systems;
using Content.Shared.Security;
using Content.Shared.StationRecords;
using Robust.Server.GameObjects;
@@ -14,7 +15,10 @@ using System.Diagnostics.CodeAnalysis;
namespace Content.Server.CriminalRecords.Systems;
public sealed class CriminalRecordsConsoleSystem : EntitySystem
/// <summary>
/// Handles all UI for criminal records console
/// </summary>
public sealed class CriminalRecordsConsoleSystem : SharedCriminalRecordsConsoleSystem
{
[Dependency] private readonly AccessReaderSystem _access = default!;
[Dependency] private readonly CriminalRecordsSystem _criminalRecords = default!;