Skip to content

Commit

Permalink
Changed Lathe UI to two-column layout so its easier to see what mater…
Browse files Browse the repository at this point in the history
…ials are currently loaded (#19608)
  • Loading branch information
ItsMeThom authored Aug 29, 2023
1 parent 15c0211 commit a1029be
Show file tree
Hide file tree
Showing 10 changed files with 215 additions and 329 deletions.
35 changes: 4 additions & 31 deletions Content.Client/Lathe/UI/LatheBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ public sealed class LatheBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private LatheMenu? _menu;

[ViewVariables]
private LatheQueueMenu? _queueMenu;

[ViewVariables]
private LatheMaterialsEjectionMenu? _materialsEjectionMenu;

public LatheBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
Expand All @@ -26,26 +19,8 @@ protected override void Open()
base.Open();

_menu = new LatheMenu(this);
_queueMenu = new LatheQueueMenu();
_materialsEjectionMenu = new LatheMaterialsEjectionMenu();

_menu.OnClose += Close;

_menu.OnQueueButtonPressed += _ =>
{
if (_queueMenu.IsOpen)
_queueMenu.Close();
else
_queueMenu.OpenCenteredLeft();
};

_menu.OnMaterialsEjectionButtonPressed += _ =>
{
if (_materialsEjectionMenu.IsOpen)
_materialsEjectionMenu.Close();
else
_materialsEjectionMenu.OpenCenteredRight();
};

_menu.OnServerListButtonPressed += _ =>
{
Expand All @@ -57,7 +32,7 @@ protected override void Open()
SendMessage(new LatheQueueRecipeMessage(recipe, amount));
};

_materialsEjectionMenu.OnEjectPressed += (material, sheetsToExtract) =>
_menu.OnEjectPressed += (material, sheetsToExtract) =>
{
SendMessage(new LatheEjectMaterialMessage(material, sheetsToExtract));
};
Expand All @@ -76,9 +51,8 @@ protected override void UpdateState(BoundUserInterfaceState state)
_menu.Recipes = msg.Recipes;
_menu?.PopulateRecipes(Owner);
_menu?.PopulateMaterials(Owner);
_queueMenu?.PopulateList(msg.Queue);
_queueMenu?.SetInfo(msg.CurrentlyProducing);
_materialsEjectionMenu?.PopulateMaterials(Owner);
_menu?.PopulateQueueList(msg.Queue);
_menu?.SetQueueInfo(msg.CurrentlyProducing);
break;
}
}
Expand All @@ -89,8 +63,7 @@ protected override void Dispose(bool disposing)
if (!disposing)
return;
_menu?.Dispose();
_queueMenu?.Dispose();
_materialsEjectionMenu?.Dispose();
//thom _materialsEjectionMenu?.Dispose();
}
}
}
2 changes: 1 addition & 1 deletion Content.Client/Lathe/UI/LatheMaterialEjector.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Access="Public"
HorizontalExpand="True"
ClipText="True"
Margin="0 4 0 0"/>
Margin="4 4 4 4"/>
</BoxContainer>
<!--Here go buttons which added in c#-->
</BoxContainer>
Expand Down
16 changes: 0 additions & 16 deletions Content.Client/Lathe/UI/LatheMaterialsEjectionMenu.xaml

This file was deleted.

74 changes: 0 additions & 74 deletions Content.Client/Lathe/UI/LatheMaterialsEjectionMenu.xaml.cs

This file was deleted.

Loading

0 comments on commit a1029be

Please sign in to comment.