Fix unlabeled jugs in ChemVend (#29178)
* Spawn dummy entities on client for vending machine UI * Asked sloth, and we kinda need this pr --------- Co-authored-by: Vasilis <vasilis@pikachu.systems>
This commit is contained in:
@@ -7,14 +7,27 @@ namespace Content.Shared.Labels.EntitySystems;
|
||||
|
||||
public abstract partial class SharedLabelSystem : EntitySystem
|
||||
{
|
||||
[Dependency] protected readonly NameModifierSystem NameMod = default!;
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<LabelComponent, MapInitEvent>(OnLabelCompMapInit);
|
||||
SubscribeLocalEvent<LabelComponent, ExaminedEvent>(OnExamine);
|
||||
SubscribeLocalEvent<LabelComponent, RefreshNameModifiersEvent>(OnRefreshNameModifiers);
|
||||
}
|
||||
|
||||
private void OnLabelCompMapInit(EntityUid uid, LabelComponent component, MapInitEvent args)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(component.CurrentLabel))
|
||||
{
|
||||
component.CurrentLabel = Loc.GetString(component.CurrentLabel);
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
NameMod.RefreshNameModifiers(uid);
|
||||
}
|
||||
|
||||
public virtual void Label(EntityUid uid, string? text, MetaDataComponent? metadata = null, LabelComponent? label = null){}
|
||||
|
||||
private void OnExamine(EntityUid uid, LabelComponent? label, ExaminedEvent args)
|
||||
|
||||
Reference in New Issue
Block a user