-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added contraband color back to the guidebook
- Loading branch information
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters