Skip to content

Commit

Permalink
added contraband color back to the guidebook
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian321 committed Jan 15, 2025
1 parent 60ceee9 commit c99ff17
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions Content.Client/Guidebook/Richtext/ContrabandColors.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System.Linq;
using System.Diagnostics.CodeAnalysis;
using Content.Shared.Contraband;
using JetBrains.Annotations;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.RichText;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;

namespace Content.Client.Guidebook.RichText;

[UsedImplicitly]
public sealed class ContrabandColors : IMarkupTag
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;

public string Name => "contrabandcolors";

public Control? Control;

/// <inheritdoc/>
public bool TryGetControl(MarkupNode node, [NotNullWhen(true)] out Control? control)
{
var text = _prototypeManager.EnumeratePrototypes<ContrabandSeverityPrototype>().Select(x =>
{
return $"[color={x.ExamineColor}]{x.ID}[/color]";
}).Aggregate((x, y) => x + ", " + y);

var label = new RichTextLabel()
{
Text = text,
};

control = label;
Control = label;
return true;
}
}
2 changes: 1 addition & 1 deletion Resources/ServerInfo/Guidebook/Security/Forensics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

## Classifying chemicals

Forensic pads can also be used to take a sample of a chemical and determine its contraband status.
Forensic pads can also be used to take a sample of a chemical and determine its contraband status ([contrabandcolors]).

## Fibers
Whenenever people wearing gloves touch anything on the station, they are bound to leave behind some fibers. This complicates things, but nothing is unsolvable for a real detective.
Expand Down

0 comments on commit c99ff17

Please sign in to comment.