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:
Flesh
2024-05-20 01:01:44 +02:00
committed by GitHub
parent f2df51660d
commit c551cafdae
22 changed files with 154 additions and 6 deletions

View File

@@ -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();