Add plant metabolism effects to chemical guidebook (#28038)
* draft one of plant metabolism guidebook * loc fix? * add attributes loc * fix loc syntax * improved appearance * last commit was undercooked, my bad * last commit was still undercooked, my worse * last commit was even still undercooked, my worst * Addressed comments? * Fix newlines * Hopefully this works * Cleanup, I think * 2xs
This commit is contained in:
@@ -47,6 +47,17 @@
|
||||
</CollapsibleBody>
|
||||
</Collapsible>
|
||||
</BoxContainer>
|
||||
<BoxContainer Name="PlantMetabolismsContainer" HorizontalExpand="True">
|
||||
<Collapsible>
|
||||
<CollapsibleHeading Title="{Loc 'guidebook-reagent-plant-metabolisms-header'}"/>
|
||||
<CollapsibleBody>
|
||||
<BoxContainer Name="PlantMetabolismsDescriptionContainer"
|
||||
Orientation="Vertical"
|
||||
Margin="10 0 10 0"
|
||||
HorizontalExpand="True"/>
|
||||
</CollapsibleBody>
|
||||
</Collapsible>
|
||||
</BoxContainer>
|
||||
<BoxContainer Margin="10 5 10 10" HorizontalExpand="True">
|
||||
<!-- The troublemaker !-->
|
||||
<RichTextLabel Name="ReagentDescription" HorizontalAlignment="Left"/>
|
||||
|
||||
@@ -157,6 +157,39 @@ public sealed partial class GuideReagentEmbed : BoxContainer, IDocumentTag, ISea
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region PlantMetabolisms
|
||||
if (_chemistryGuideData.ReagentGuideRegistry.TryGetValue(reagent.ID, out var guideEntryRegistryPlant) &&
|
||||
guideEntryRegistryPlant.PlantMetabolisms != null &&
|
||||
guideEntryRegistryPlant.PlantMetabolisms.Count > 0)
|
||||
{
|
||||
PlantMetabolismsDescriptionContainer.Children.Clear();
|
||||
var metabolismLabel = new RichTextLabel();
|
||||
metabolismLabel.SetMarkup(Loc.GetString("guidebook-reagent-plant-metabolisms-rate"));
|
||||
var descriptionLabel = new RichTextLabel
|
||||
{
|
||||
Margin = new Thickness(25, 0, 10, 0)
|
||||
};
|
||||
var descMsg = new FormattedMessage();
|
||||
var descriptionsCount = guideEntryRegistryPlant.PlantMetabolisms.Count;
|
||||
var i = 0;
|
||||
foreach (var effectString in guideEntryRegistryPlant.PlantMetabolisms)
|
||||
{
|
||||
descMsg.AddMarkup(effectString);
|
||||
i++;
|
||||
if (i < descriptionsCount)
|
||||
descMsg.PushNewline();
|
||||
}
|
||||
descriptionLabel.SetMessage(descMsg);
|
||||
|
||||
PlantMetabolismsDescriptionContainer.AddChild(metabolismLabel);
|
||||
PlantMetabolismsDescriptionContainer.AddChild(descriptionLabel);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlantMetabolismsContainer.Visible = false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
GenerateSources(reagent);
|
||||
|
||||
FormattedMessage description = new();
|
||||
|
||||
Reference in New Issue
Block a user