Borg module action QOL: put module name into tooltips (#38750)
* 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>
This commit is contained in:
@@ -65,6 +65,16 @@ public sealed partial class BorgSystem
|
|||||||
_actions.SetEntityIcon(actEnt, uid);
|
_actions.SetEntityIcon(actEnt, uid);
|
||||||
if (TryComp<BorgModuleIconComponent>(uid, out var moduleIconComp))
|
if (TryComp<BorgModuleIconComponent>(uid, out var moduleIconComp))
|
||||||
_actions.SetIcon(actEnt, moduleIconComp.Icon);
|
_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))
|
if (!TryComp(chassis, out BorgChassisComponent? chassisComp))
|
||||||
|
|||||||
@@ -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-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-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-construction-guide-string = The cyborg limbs and torso must be attached to the endoskeleton.
|
||||||
|
|
||||||
borg-ui-menu-title = Cyborg Interface
|
borg-ui-menu-title = Cyborg Interface
|
||||||
@@ -60,5 +63,3 @@ borg-type-medical-transponder = medical cyborg
|
|||||||
borg-type-service-name = Service
|
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-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
|
borg-type-service-transponder = service cyborg
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
parent: BaseAction
|
parent: BaseAction
|
||||||
id: ActionBorgSwapModule
|
id: ActionBorgSwapModule
|
||||||
|
# Name and description will normally be changed by BorgSystem
|
||||||
name: Swap Module
|
name: Swap Module
|
||||||
description: Select this module, enabling you to use the tools it provides.
|
description: Select this module, enabling you to use the tools it provides.
|
||||||
components:
|
components:
|
||||||
|
|||||||
Reference in New Issue
Block a user