]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Borg module action QOL: put module name into tooltips (#38750)
authoreoineoineoin <helloworld@eoinrul.es>
Sat, 1 Nov 2025 17:13:57 +0000 (17:13 +0000)
committerGitHub <noreply@github.com>
Sat, 1 Nov 2025 17:13:57 +0000 (17:13 +0000)
* Borg module action QOL: put module name into tooltips

* Fix tests

* Tidy up component lookups

* formatting

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
Content.Server/Silicons/Borgs/BorgSystem.Modules.cs
Resources/Locale/en-US/borg/borg.ftl
Resources/Prototypes/Entities/Objects/Specific/Robotics/borg_modules.yml

index bbd62d7a015ea3f1a7bdff352954655cf86c52d8..67408d1d5ada5b979d536246748fe8c9a354d3c2 100644 (file)
@@ -65,6 +65,16 @@ public sealed partial class BorgSystem
             _actions.SetEntityIcon(actEnt, uid);
             if (TryComp<BorgModuleIconComponent>(uid, out var moduleIconComp))
                 _actions.SetIcon(actEnt, moduleIconComp.Icon);
+
+            /// Set a custom name and description on the action. The borg module action prototypes are shared across
+            /// all modules. Extract localized names, then populate variables with the info from the module itself.
+            var moduleName = Name(uid);
+            var actionMetaData = MetaData(component.ModuleSwapActionEntity.Value);
+
+            var instanceName = Loc.GetString("borg-module-action-name", ("moduleName", moduleName));
+            _metaData.SetEntityName(component.ModuleSwapActionEntity.Value, instanceName, actionMetaData);
+            var instanceDesc = Loc.GetString("borg-module-action-description", ("moduleName", moduleName));
+            _metaData.SetEntityDescription(component.ModuleSwapActionEntity.Value, instanceDesc, actionMetaData);
         }
 
         if (!TryComp(chassis, out BorgChassisComponent? chassisComp))
index 9c9dc71069a616e6943e94fd82a68cd96bd93378..54a733e1cfb2636263fc6bacb63d766520a3a3d3 100644 (file)
@@ -10,6 +10,9 @@ borg-module-too-many = There's not enough room for another module...
 borg-module-duplicate = This module is already installed in this cyborg.
 borg-module-whitelist-deny = This module doesn't fit in this type of cyborg...
 
+borg-module-action-name = Activate {$moduleName}
+borg-module-action-description = Select the {$moduleName}, enabling you to use the tools it provides.
+
 borg-construction-guide-string = The cyborg limbs and torso must be attached to the endoskeleton.
 
 borg-ui-menu-title = Cyborg Interface
@@ -60,5 +63,3 @@ borg-type-medical-transponder = medical cyborg
 borg-type-service-name = Service
 borg-type-service-desc = Help out with a wide range of crew services, ranging from serving snacks and drinks to botany to entertainment.
 borg-type-service-transponder = service cyborg
-
-
index e023133f2720050a1f1c862ffa8eaafc24ef4307..9cc47d5b10fcd4a84ad558278828f96c61a03ea6 100644 (file)
@@ -51,6 +51,7 @@
 - type: entity
   parent: BaseAction
   id: ActionBorgSwapModule
+  # Name and description will normally be changed by BorgSystem
   name: Swap Module
   description: Select this module, enabling you to use the tools it provides.
   components: