Truncate lathe announcement lists (#36945)
This commit is contained in:
committed by
GitHub
parent
f74b1c35bb
commit
b7d020570f
@@ -14,4 +14,10 @@ public sealed partial class LatheAnnouncingComponent : Component
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public List<ProtoId<RadioChannelPrototype>> Channels = new();
|
||||
|
||||
/// <summary>
|
||||
/// How many items should be announced in a message before it truncates
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public int MaximumItems = 5;
|
||||
}
|
||||
|
||||
@@ -385,7 +385,14 @@ namespace Content.Server.Lathe
|
||||
if (recipeNames.Count == 0)
|
||||
return;
|
||||
|
||||
var message = Loc.GetString(
|
||||
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))
|
||||
);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
lathe-popup-material-not-used = This material is not used in this machine.
|
||||
lathe-unlock-recipe-radio-broadcast = This lathe is now capable of producing the following recipes: {$items}
|
||||
lathe-unlock-recipe-radio-broadcast-overflow = This lathe is now capable of producing {$count} new recipes, including: {$items}
|
||||
lathe-unlock-recipe-radio-broadcast-item = [bold]{$item}[/bold]
|
||||
|
||||
Reference in New Issue
Block a user