diff --git a/Content.Client/Construction/UI/ConstructionMenuPresenter.cs b/Content.Client/Construction/UI/ConstructionMenuPresenter.cs index b1cebab33a..119e92fc6f 100644 --- a/Content.Client/Construction/UI/ConstructionMenuPresenter.cs +++ b/Content.Client/Construction/UI/ConstructionMenuPresenter.cs @@ -38,7 +38,7 @@ namespace Content.Client.Construction.UI private ConstructionSystem? _constructionSystem; private ConstructionPrototype? _selected; private List _favoritedRecipes = []; - private Dictionary _recipeButtons = new(); + private readonly Dictionary _recipeButtons = new(); private string _selectedCategory = string.Empty; private const string FavoriteCatName = "construction-category-favorites"; @@ -217,8 +217,8 @@ namespace Content.Client.Construction.UI var itemButton = new ContainerButton() { VerticalAlignment = Control.VAlignment.Center, - Name = recipe.TargetPrototype.Name, - ToolTip = recipe.TargetPrototype.Name, + Name = recipe.Prototype.Name, + ToolTip = recipe.Prototype.Name, ToggleMode = true, Children = { protoView }, }; @@ -235,7 +235,7 @@ namespace Content.Client.Construction.UI if (buttonToggledEventArgs.Pressed && _selected != null && - _recipeButtons.TryGetValue(_selected.Name!, out var oldButton)) + _recipeButtons.TryGetValue(_selected.ID, out var oldButton)) { oldButton.Pressed = false; SelectGridButton(oldButton, false); @@ -245,7 +245,7 @@ namespace Content.Client.Construction.UI }; recipesGrid.AddChild(itemButtonPanelContainer); - _recipeButtons[recipe.Prototype.Name!] = itemButton; + _recipeButtons[recipe.Prototype.ID] = itemButton; var isCurrentButtonSelected = _selected == recipe.Prototype; itemButton.Pressed = isCurrentButtonSelected; SelectGridButton(itemButton, isCurrentButtonSelected); @@ -307,7 +307,7 @@ namespace Content.Client.Construction.UI if (button.Parent is not PanelContainer buttonPanel) return; - button.Modulate = select ? Color.Green : Color.Transparent; + button.Children.Single().Modulate = select ? Color.Green : Color.White; var buttonColor = select ? StyleNano.ButtonColorDefault : Color.Transparent; buttonPanel.PanelOverride = new StyleBoxFlat { BackgroundColor = buttonColor }; }