diff --git a/Content.Shared/Research/TechnologyDisk/Systems/TechnologyDiskSystem.cs b/Content.Shared/Research/TechnologyDisk/Systems/TechnologyDiskSystem.cs index d647b3c1e6..6fe1174619 100644 --- a/Content.Shared/Research/TechnologyDisk/Systems/TechnologyDiskSystem.cs +++ b/Content.Shared/Research/TechnologyDisk/Systems/TechnologyDiskSystem.cs @@ -1,6 +1,7 @@ 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; @@ -20,6 +21,7 @@ public sealed class TechnologyDiskSystem : EntitySystem [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() { @@ -28,6 +30,7 @@ public sealed class TechnologyDiskSystem : EntitySystem SubscribeLocalEvent(OnMapInit); SubscribeLocalEvent(OnAfterInteract); SubscribeLocalEvent(OnExamine); + SubscribeLocalEvent(OnRefreshNameModifiers); } private void OnMapInit(Entity ent, ref MapInitEvent args) @@ -55,6 +58,7 @@ public sealed class TechnologyDiskSystem : EntitySystem ent.Comp.Recipes = []; ent.Comp.Recipes.Add(_random.Pick(techs)); Dirty(ent); + _nameModifier.RefreshNameModifiers(ent.Owner); } private void OnAfterInteract(Entity ent, ref AfterInteractEvent args) @@ -90,4 +94,16 @@ public sealed class TechnologyDiskSystem : EntitySystem } args.PushMarkup(message); } + + private void OnRefreshNameModifiers(Entity 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))); + } + } + } } diff --git a/Resources/Locale/en-US/research/components/technology-disk.ftl b/Resources/Locale/en-US/research/components/technology-disk.ftl index 4f72532010..90992f76d7 100644 --- a/Resources/Locale/en-US/research/components/technology-disk.ftl +++ b/Resources/Locale/en-US/research/components/technology-disk.ftl @@ -2,8 +2,9 @@ tech-disk-inserted = You insert the disk, adding a new recipe to the server. 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