using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.Lathe;
+using Content.Shared.NameModifier.EntitySystems;
using Content.Shared.Popups;
using Content.Shared.Random.Helpers;
using Content.Shared.Research.Components;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedResearchSystem _research = default!;
[Dependency] private readonly SharedLatheSystem _lathe = default!;
+ [Dependency] private readonly NameModifierSystem _nameModifier = default!;
public override void Initialize()
{
SubscribeLocalEvent<TechnologyDiskComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<TechnologyDiskComponent, AfterInteractEvent>(OnAfterInteract);
SubscribeLocalEvent<TechnologyDiskComponent, ExaminedEvent>(OnExamine);
+ SubscribeLocalEvent<TechnologyDiskComponent, RefreshNameModifiersEvent>(OnRefreshNameModifiers);
}
private void OnMapInit(Entity<TechnologyDiskComponent> ent, ref MapInitEvent args)
ent.Comp.Recipes = [];
ent.Comp.Recipes.Add(_random.Pick(techs));
Dirty(ent);
+ _nameModifier.RefreshNameModifiers(ent.Owner);
}
private void OnAfterInteract(Entity<TechnologyDiskComponent> ent, ref AfterInteractEvent args)
}
args.PushMarkup(message);
}
+
+ private void OnRefreshNameModifiers(Entity<TechnologyDiskComponent> entity, ref RefreshNameModifiersEvent args)
+ {
+ if (entity.Comp.Recipes != null)
+ {
+ foreach (var recipe in entity.Comp.Recipes)
+ {
+ var proto = _protoMan.Index(recipe);
+ args.AddModifier("tech-disk-name-format", extraArgs: ("technology", _lathe.GetRecipeName(proto)));
+ }
+ }
+ }
}
tech-disk-examine-none = The label is blank.
tech-disk-examine = The label has a small dot matrix printed image depicting a {$result}.
tech-disk-examine-more = There are more images printed, but they're too small to discern.
+tech-disk-name-format = {$baseName} ({$technology})
tech-disk-ui-name = technology disk terminal
tech-disk-ui-total-label = There are {$amount} points on the selected server
tech-disk-ui-cost-label = Each disk costs {$amount} points to print
-tech-disk-ui-print-button = Print Disk
\ No newline at end of file
+tech-disk-ui-print-button = Print Disk