lathe machine upgrading (#12032)

This commit is contained in:
Nemanja
2022-10-30 03:12:11 -04:00
committed by GitHub
parent 56a93139b1
commit 3ab98e320a
7 changed files with 107 additions and 14 deletions

View File

@@ -25,7 +25,6 @@ public sealed partial class LatheMenu : DefaultWindow
public event Action<string, int>? RecipeQueueAction;
public List<string> Recipes = new();
private List<LatheRecipePrototype> _oldRecipesToShow = new();
public LatheMenu(LatheBoundUserInterface owner)
{
@@ -85,6 +84,9 @@ public sealed partial class LatheMenu : DefaultWindow
/// <param name="lathe"></param>
public void PopulateRecipes(EntityUid lathe)
{
if (!_entityManager.TryGetComponent<LatheComponent>(lathe, out var component))
return;
var recipesToShow = new List<LatheRecipePrototype>();
foreach (var recipe in Recipes)
{
@@ -106,7 +108,6 @@ public sealed partial class LatheMenu : DefaultWindow
quantity = 1;
RecipeList.Children.Clear();
_oldRecipesToShow = recipesToShow;
foreach (var prototype in recipesToShow)
{
StringBuilder sb = new();
@@ -121,7 +122,7 @@ public sealed partial class LatheMenu : DefaultWindow
else
sb.Append('\n');
sb.Append(amount);
sb.Append((int) (amount * component.MaterialUseMultiplier));
sb.Append(' ');
sb.Append(proto.Name);
}