Skip to content

Commit

Permalink
FIXIRUYU
Browse files Browse the repository at this point in the history
  • Loading branch information
Korol_Charodey committed Sep 24, 2024
1 parent bb7c4ca commit 4927dfd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Content.Server/ADT/DocumentPrinter/DocumentPrinterSystem.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using Content.Shared.Access.Components;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Inventory;
using Content.Shared.Paper;
using Content.Shared.PDA;

namespace Content.Shared.DocumentPrinter;
public sealed class DocumentPrinterSystem : EntitySystem
{
const int TIME_YEAR_SPACE_STATION_ADT = 544;

public override void Initialize()
{
base.Initialize();
Expand All @@ -22,16 +23,20 @@ public void OnPrinting(EntityUid uid, DocumentPrinterComponent component, Printi

string text = paperComponent.Content;
MetaDataComponent? meta_id = null;
PdaComponent? pda = null;
foreach (var slot in inventoryComponent.Containers)
{
if (slot.ID == "id")//for checking only PDA
{
TryComp(slot.ContainedEntity, out pda);
TryComp<ItemSlotsComponent>(slot.ContainedEntity, out var itemslots);
if (itemslots is not null)
TryComp(itemslots.Slots["PDA-id"].Item, out meta_id);
break;
}
}
if (pda?.StationName is not null)
text = text.Replace("Station XX-000", pda.StationName);
DateTime time = DateTime.UtcNow;
text = text.Replace("$time$", $"{time.AddYears(TIME_YEAR_SPACE_STATION_ADT).AddHours(4)}");
if (meta_id is null)
Expand Down

0 comments on commit 4927dfd

Please sign in to comment.