Localize preset labels on chem dispenser (#24617)

This commit is contained in:
Errant
2024-01-28 23:31:16 +01:00
committed by GitHub
parent 96ffc31b66
commit 556545e324
3 changed files with 37 additions and 25 deletions

View File

@@ -27,6 +27,7 @@ namespace Content.Server.Labels
base.Initialize();
SubscribeLocalEvent<LabelComponent, ExaminedEvent>(OnExamine);
SubscribeLocalEvent<LabelComponent, MapInitEvent>(OnLabelCompMapInit);
SubscribeLocalEvent<PaperLabelComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<PaperLabelComponent, ComponentRemove>(OnComponentRemove);
SubscribeLocalEvent<PaperLabelComponent, EntInsertedIntoContainerMessage>(OnContainerModified);
@@ -34,6 +35,12 @@ namespace Content.Server.Labels
SubscribeLocalEvent<PaperLabelComponent, ExaminedEvent>(OnExamined);
}
private void OnLabelCompMapInit(EntityUid uid, LabelComponent component, MapInitEvent args)
{
if (!string.IsNullOrEmpty(component.CurrentLabel))
component.CurrentLabel = Loc.GetString(component.CurrentLabel);
}
/// <summary>
/// Apply or remove a label on an entity.
/// </summary>