Link to reagent ingredients on the same Guidebook page (#36700)
* Add in-page links for guidebook reagent recipes * Add links to microwave recipes * This function is too specific to be in Control extensions * Better naming * Wrap RichTextLabel instead of subclassing * "Activate" is ambiguous
This commit is contained in:
@@ -22,13 +22,15 @@ namespace Content.Client.Guidebook.Controls;
|
||||
/// Control for embedding a reagent into a guidebook.
|
||||
/// </summary>
|
||||
[UsedImplicitly, GenerateTypedNameReferences]
|
||||
public sealed partial class GuideReagentEmbed : BoxContainer, IDocumentTag, ISearchableControl
|
||||
public sealed partial class GuideReagentEmbed : BoxContainer, IDocumentTag, ISearchableControl, IPrototypeRepresentationControl
|
||||
{
|
||||
[Dependency] private readonly IEntitySystemManager _systemManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
||||
|
||||
private readonly ChemistryGuideDataSystem _chemistryGuideData;
|
||||
|
||||
public IPrototype? RepresentedPrototype { get; private set; }
|
||||
|
||||
public GuideReagentEmbed()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
@@ -80,6 +82,8 @@ public sealed partial class GuideReagentEmbed : BoxContainer, IDocumentTag, ISea
|
||||
|
||||
private void GenerateControl(ReagentPrototype reagent)
|
||||
{
|
||||
RepresentedPrototype = reagent;
|
||||
|
||||
NameBackground.PanelOverride = new StyleBoxFlat
|
||||
{
|
||||
BackgroundColor = reagent.SubstanceColor
|
||||
|
||||
Reference in New Issue
Block a user