Fix construction button not working (#12033)

This commit is contained in:
Leon Friedrich
2022-10-22 12:51:03 +13:00
committed by GitHub
parent 19586ea46c
commit 4b42f28cf7

View File

@@ -1,8 +1,9 @@
using Content.Client.Construction.UI; using Content.Client.Construction.UI;
using Content.Client.Gameplay; using Content.Client.Gameplay;
using Content.Client.UserInterface.Controls; using Content.Client.UserInterface.Controls;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Client.UserInterface.Controllers; using Robust.Client.UserInterface.Controllers;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Utility; using Robust.Shared.Utility;
namespace Content.Client.UserInterface.Systems.Crafting; namespace Content.Client.UserInterface.Systems.Crafting;
@@ -50,11 +51,16 @@ public sealed class CraftingUIController : UIController, IOnStateChanged<Gamepla
public void LoadButton() public void LoadButton()
{ {
if (CraftingButton == null || _presenter == null) if (CraftingButton == null)
{ {
return; return;
} }
CraftingButton.OnToggled += _presenter.OnHudCraftingButtonToggled; CraftingButton.OnToggled += ButtonToggled;
}
private void ButtonToggled(BaseButton.ButtonToggledEventArgs obj)
{
_presenter?.OnHudCraftingButtonToggled(obj);
} }
} }