Truncate lathe announcement lists (#36945)

This commit is contained in:
pathetic meowmeow
2025-04-26 17:45:53 -04:00
committed by GitHub
parent f74b1c35bb
commit b7d020570f
3 changed files with 18 additions and 4 deletions

View File

@@ -385,10 +385,17 @@ namespace Content.Server.Lathe
if (recipeNames.Count == 0)
return;
var message = Loc.GetString(
"lathe-unlock-recipe-radio-broadcast",
("items", ContentLocalizationManager.FormatList(recipeNames))
);
var message =
recipeNames.Count > ent.Comp.MaximumItems ?
Loc.GetString(
"lathe-unlock-recipe-radio-broadcast-overflow",
("items", ContentLocalizationManager.FormatList(recipeNames.GetRange(0, ent.Comp.MaximumItems))),
("count", recipeNames.Count)
) :
Loc.GetString(
"lathe-unlock-recipe-radio-broadcast",
("items", ContentLocalizationManager.FormatList(recipeNames))
);
foreach (var channel in ent.Comp.Channels)
{