Changed Lathe UI to two-column layout so its easier to see what materials are currently loaded (#19608)

This commit is contained in:
Thom
2023-08-29 01:36:07 +01:00
committed by GitHub
parent 15c0211fb2
commit a1029be654
10 changed files with 216 additions and 330 deletions

View File

@@ -10,13 +10,6 @@ namespace Content.Client.Lathe.UI
{
[ViewVariables]
private LatheMenu? _menu;
[ViewVariables]
private LatheQueueMenu? _queueMenu;
[ViewVariables]
private LatheMaterialsEjectionMenu? _materialsEjectionMenu;
public LatheBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
@@ -26,26 +19,8 @@ namespace Content.Client.Lathe.UI
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 += _ =>
{
@@ -57,7 +32,7 @@ namespace Content.Client.Lathe.UI
SendMessage(new LatheQueueRecipeMessage(recipe, amount));
};
_materialsEjectionMenu.OnEjectPressed += (material, sheetsToExtract) =>
_menu.OnEjectPressed += (material, sheetsToExtract) =>
{
SendMessage(new LatheEjectMaterialMessage(material, sheetsToExtract));
};
@@ -76,9 +51,8 @@ namespace Content.Client.Lathe.UI
_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;
}
}
@@ -89,8 +63,7 @@ namespace Content.Client.Lathe.UI
if (!disposing)
return;
_menu?.Dispose();
_queueMenu?.Dispose();
_materialsEjectionMenu?.Dispose();
//thom _materialsEjectionMenu?.Dispose();
}
}
}