Skip to content

Commit

Permalink
Minor lathe cleanup, no numbers for singular jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
whatston3 committed Jan 31, 2025
1 parent 668e54a commit 4668278
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Content.Client/Lathe/UI/LatheMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@ public void PopulateQueueList(List<LatheRecipeBatch> queue) // Frontier: LatheRe
queuedRecipeBox.AddChild(GetRecipeDisplayControl(batch.Recipe));

var queuedRecipeLabel = new Label();
queuedRecipeLabel.Text = $"{idx}. {_lathe.GetRecipeName(batch.Recipe)} ({batch.ItemsPrinted}/{batch.ItemsRequested})"; //
if (batch.ItemsRequested > 1)
queuedRecipeLabel.Text = $"{idx}. {_lathe.GetRecipeName(batch.Recipe)} ({batch.ItemsPrinted}/{batch.ItemsRequested})";
else
queuedRecipeLabel.Text = $"{idx}. {_lathe.GetRecipeName(batch.Recipe)}";
// End Frontier
queuedRecipeBox.AddChild(queuedRecipeLabel);
QueueList.AddChild(queuedRecipeBox);
Expand Down
5 changes: 3 additions & 2 deletions Content.Server/Lathe/LatheSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public bool TryAddToQueue(EntityUid uid, LatheRecipePrototype recipe, int quanti
return false;
// Frontier: argument check

if (!CanProduce(uid, recipe, quantity, component))
if (!CanProduce(uid, recipe, quantity, component)) // Frontier: 1<quantity
return false;

foreach (var (mat, amount) in recipe.Materials)
Expand Down Expand Up @@ -305,7 +305,7 @@ public void UpdateUserInterfaceState(EntityUid uid, LatheComponent? component =
if (!Resolve(uid, ref component))
return;

var producing = component.CurrentRecipe ?? component.Queue.FirstOrDefault()?.Recipe; // Frontier
var producing = component.CurrentRecipe ?? component.Queue.FirstOrDefault()?.Recipe; // Frontier: add ?.Recipe

var state = new LatheUpdateState(GetAvailableRecipes(uid, component), component.Queue, producing);
_uiSys.SetUiState(uid, LatheUiKey.Key, state);
Expand Down Expand Up @@ -420,6 +420,7 @@ private void OnLatheQueueRecipeMessage(EntityUid uid, LatheComponent component,
LogImpact.Low,
$"{ToPrettyString(args.Actor):player} queued {args.Quantity} {GetRecipeName(recipe)} at {ToPrettyString(uid):lathe}");
}
// End Frontier
}
TryStartProducing(uid, component);
UpdateUserInterfaceState(uid, component);
Expand Down

0 comments on commit 4668278

Please sign in to comment.