Add lathe material ejection (#19218)
This completes PilgrimViis' (now closed) PR 16398. It addresses issue 10896, by allowing materials to be ejected from most lathes (except the ore processor and sheet-meister 2000) * - Refinements to the material ejection UI - Made the lathe UI default to a slightly larger size - Fixed an offset issue with the label of the item currently being printed in the build queue UI * Allow the materiel reclamation UI to pop if there is material left in the lathe, but not enough to print any sheets --------- Co-authored-by: Kevin Zheng <kevinz5000@gmail.com>
This commit is contained in:
@@ -14,6 +14,9 @@ namespace Content.Client.Lathe.UI
|
||||
[ViewVariables]
|
||||
private LatheQueueMenu? _queueMenu;
|
||||
|
||||
[ViewVariables]
|
||||
private LatheMaterialsEjectionMenu? _materialsEjectionMenu;
|
||||
|
||||
public LatheBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
@@ -24,6 +27,7 @@ namespace Content.Client.Lathe.UI
|
||||
|
||||
_menu = new LatheMenu(this);
|
||||
_queueMenu = new LatheQueueMenu();
|
||||
_materialsEjectionMenu = new LatheMaterialsEjectionMenu();
|
||||
|
||||
_menu.OnClose += Close;
|
||||
|
||||
@@ -34,15 +38,30 @@ namespace Content.Client.Lathe.UI
|
||||
else
|
||||
_queueMenu.OpenCenteredLeft();
|
||||
};
|
||||
|
||||
_menu.OnMaterialsEjectionButtonPressed += _ =>
|
||||
{
|
||||
if (_materialsEjectionMenu.IsOpen)
|
||||
_materialsEjectionMenu.Close();
|
||||
else
|
||||
_materialsEjectionMenu.OpenCenteredRight();
|
||||
};
|
||||
|
||||
_menu.OnServerListButtonPressed += _ =>
|
||||
{
|
||||
SendMessage(new ConsoleServerSelectionMessage());
|
||||
};
|
||||
|
||||
_menu.RecipeQueueAction += (recipe, amount) =>
|
||||
{
|
||||
SendMessage(new LatheQueueRecipeMessage(recipe, amount));
|
||||
};
|
||||
|
||||
_materialsEjectionMenu.OnEjectPressed += (material, sheetsToExtract) =>
|
||||
{
|
||||
SendMessage(new LatheEjectMaterialMessage(material, sheetsToExtract));
|
||||
};
|
||||
|
||||
_menu.OpenCentered();
|
||||
}
|
||||
|
||||
@@ -59,6 +78,7 @@ namespace Content.Client.Lathe.UI
|
||||
_menu?.PopulateMaterials(Owner);
|
||||
_queueMenu?.PopulateList(msg.Queue);
|
||||
_queueMenu?.SetInfo(msg.CurrentlyProducing);
|
||||
_materialsEjectionMenu?.PopulateMaterials(Owner);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -70,6 +90,7 @@ namespace Content.Client.Lathe.UI
|
||||
return;
|
||||
_menu?.Dispose();
|
||||
_queueMenu?.Dispose();
|
||||
_materialsEjectionMenu?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user