From a0956a399ad6791acbd5618238a4891fa1708f98 Mon Sep 17 00:00:00 2001 From: Ed <96445749+TheShuEd@users.noreply.github.com> Date: Fri, 30 May 2025 15:43:23 +0300 Subject: [PATCH] fix reagent guidebook --- .../Controls/GuideReagentReaction.xaml | 8 ++++---- .../Controls/GuideReagentReaction.xaml.cs | 20 ++++++------------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/Content.Client/Guidebook/Controls/GuideReagentReaction.xaml b/Content.Client/Guidebook/Controls/GuideReagentReaction.xaml index 7980a48a1f..670cc17579 100644 --- a/Content.Client/Guidebook/Controls/GuideReagentReaction.xaml +++ b/Content.Client/Guidebook/Controls/GuideReagentReaction.xaml @@ -39,11 +39,11 @@ Visible="False" HorizontalAlignment="Center" FontColorOverride="#1e6651" /> - - + + + + - - diff --git a/Content.Client/Guidebook/Controls/GuideReagentReaction.xaml.cs b/Content.Client/Guidebook/Controls/GuideReagentReaction.xaml.cs index 3bbf64fd40..460e24272f 100644 --- a/Content.Client/Guidebook/Controls/GuideReagentReaction.xaml.cs +++ b/Content.Client/Guidebook/Controls/GuideReagentReaction.xaml.cs @@ -45,25 +45,17 @@ public sealed partial class GuideReagentReaction : BoxContainer, ISearchableCont products.Add(reagent, reactantProto.Amount); } SetReagents(products, ref productContainer, protoMan, false); + // CP14 random reagents begin - foreach (var randomVariation in prototype.Cp14RandomProducts) + Container randomProductContainer = RandomProductsContainer; + if (prototype.Cp14RandomProducts.Count > 0) { // If there aren't any variations, this label will be not visible RandomVariationsLabel.Visible = true; - Container randomProductContainer = RandomProductsContainer; - var randomProducts = new Dictionary(randomVariation); - RandomVariations.AddChild(randomProductContainer); - RandomVariations.AddChild(new SplitBar - { - MinHeight = 10, - }); - foreach (var (reagent, reactantProto) in prototype.Reactants) - { - if (reactantProto.Catalyst) - randomProducts.Add(reagent, reactantProto.Amount); - } - SetReagents(randomProducts, ref randomProductContainer, protoMan); + var randomProducts = new Dictionary(prototype.Cp14RandomProducts[prototype.Cp14RandomProductIndex]); + + SetReagents(randomProducts, ref randomProductContainer, protoMan, false); } // CP14 random reagents end