diff --git a/Content.Client/Construction/ConstructionMenu.xaml.cs b/Content.Client/Construction/ConstructionMenu.xaml.cs index de94eacb65..c899923859 100644 --- a/Content.Client/Construction/ConstructionMenu.xaml.cs +++ b/Content.Client/Construction/ConstructionMenu.xaml.cs @@ -320,6 +320,7 @@ namespace Content.Client.Construction private void RecipeSelected(ItemList.ItemListSelectedEventArgs obj) { _selected = (ConstructionPrototype) obj.ItemList[obj.ItemIndex].Metadata!; + if(_placementManager.IsActive && !_placementManager.Eraser) UpdateGhostPlacement(); PopulateInfo(_selected); } @@ -344,7 +345,7 @@ namespace Content.Client.Construction { if (args.Pressed) { - if (_selected == null) return; + if(_selected == null) return; var constructSystem = EntitySystem.Get(); @@ -355,11 +356,7 @@ namespace Content.Client.Construction return; } - _placementManager.BeginPlacing(new PlacementInformation() - { - IsTile = false, - PlacementOption = _selected.PlacementMode, - }, new ConstructionPlacementHijack(constructSystem, _selected)); + UpdateGhostPlacement(); } else { @@ -369,6 +366,21 @@ namespace Content.Client.Construction BuildButton.Pressed = args.Pressed; } + private void UpdateGhostPlacement() + { + if (_selected == null || _selected.Type != ConstructionType.Structure) return; + + var constructSystem = EntitySystem.Get(); + + _placementManager.BeginPlacing(new PlacementInformation() + { + IsTile = false, + PlacementOption = _selected.PlacementMode, + }, new ConstructionPlacementHijack(constructSystem, _selected)); + + BuildButton.Pressed = true; + } + private void EraseButtonToggled(BaseButton.ButtonToggledEventArgs args) { if (args.Pressed) _placementManager.Clear();