* Added base workbench window * Fixed serialization errors * Created base UI layout * Updated ui * Updated UI after crafting
35 lines
870 B
C#
35 lines
870 B
C#
using Content.Shared._CP14.Workbench;
|
|
using Robust.Client.UserInterface;
|
|
|
|
namespace Content.Client._CP14.Workbench;
|
|
|
|
public sealed class CP14WorkbenchBoundUserInterface : BoundUserInterface
|
|
{
|
|
private CP14WorkbenchWindow? _window;
|
|
|
|
public CP14WorkbenchBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
{
|
|
}
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
_window = this.CreateWindow<CP14WorkbenchWindow>();
|
|
|
|
_window.OnCraft += entry => SendMessage(new CP14WorkbenchUiCraftMessage(entry.ProtoId));
|
|
}
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState state)
|
|
{
|
|
base.UpdateState(state);
|
|
|
|
switch (state)
|
|
{
|
|
case CP14WorkbenchUiRecipesState recipesState:
|
|
_window?.UpdateRecipes(recipesState);
|
|
break;
|
|
}
|
|
}
|
|
}
|