Skip to content

Commit

Permalink
Merge branch 'master' into resprites
Browse files Browse the repository at this point in the history
  • Loading branch information
Schrodinger71 authored Oct 27, 2024
2 parents c047df8 + 339adb6 commit fa1eb2e
Showing 1 changed file with 33 additions and 17 deletions.
50 changes: 33 additions & 17 deletions Content.Server/ADT/DocumentPrinter/DocumentPrinterSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,32 +75,48 @@ public void OnPrinting(EntityUid uid, DocumentPrinterComponent component, Printi
}
DateTime time = DateTime.UtcNow.AddYears(TIME_YEAR_SPACE_STATION_ADT).AddHours(3);
text = text.Replace("$time$", $"{_gameTiming.CurTime.Subtract(_ticker.RoundStartTimeSpan).ToString("hh\\:mm\\:ss")} | {(time.Day < 10 ? $"0{time.Day}" : time.Day)}.{(time.Month < 10 ? $"0{time.Month}" : time.Month)}.{time.Year}");
if (pda?.StationName is not null)
if (pda is not null)
{
text = text.Replace("Station XX-000", pda.StationName);
}
if (meta_id is null)
{
text = text.Replace("$name$", "");
text = text.Replace("$job$", "");
}
else
{
int startIndex = meta_id.EntityName.IndexOf("("); int endIndex = meta_id.EntityName.IndexOf(")");
if (startIndex.Equals(-1) || startIndex.Equals(-1))
if (pda?.StationName is not null)
{
text = text.Replace("Station XX-000", pda.StationName);
}
if (meta_id is null)
{
text = text.Replace("$name$", "");
text = text.Replace("$job$", "");
}
else
{
string id_card_word = "ID карта ";
text = text.Replace("$name$", meta_id.EntityName.Replace(id_card_word, "").Substring(0, startIndex - id_card_word.Length - 2));
text = text.Replace("$job$", meta_id.EntityName.Substring(startIndex + 1, endIndex - startIndex - 1));
int startIndex = meta_id.EntityName.IndexOf("("); int endIndex = meta_id.EntityName.IndexOf(")");
if (startIndex.Equals(-1) || endIndex.Equals(-1))
{
text = text.Replace("$name$", "");
text = text.Replace("$job$", "");
}
else
{
string id_card_word = "ID карта ";
if (startIndex - id_card_word.Length - 2 > 0)
text = text.Replace("$name$", meta_id.EntityName.Replace(id_card_word, "").Substring(0, startIndex - id_card_word.Length - 2));
else
text = text.Replace("$name$", "");
if (startIndex + 1 != endIndex)
text = text.Replace("$job$", meta_id.EntityName.Substring(startIndex + 1, endIndex - startIndex - 1));

else
text = text.Replace("$name$", "");
}
}
paperComponent.Content = text;
// if (!TryComp<MetaDataComponent>(args.Actor, out var comp)) return; // was for test, STFU JUST LEAVE IT HERE
}
else
{
text = text.Replace("$name$", "");
text = text.Replace("$job$", "");
paperComponent.Content = text;
}
paperComponent.Content = text;
// if (!TryComp<MetaDataComponent>(args.Actor, out var comp)) return; // was for test, STFU JUST LEAVE IT HERE
}
else
{
Expand Down

0 comments on commit fa1eb2e

Please sign in to comment.