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:
Ciarán Walsh
2025-05-09 01:06:26 +01:00
committed by GitHub
parent 7bec148634
commit 2a201837c7
9 changed files with 287 additions and 56 deletions

View File

@@ -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