Examine which borg that module fits into (#41461)
* modules tip * add color * solved a edge case * use ContentLocalizationManager instead of hardcoded grammar * improve summary * improve improved summary Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> * not my first language Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> * keep names consistent Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> * keep consistent part 2 * fixed the yml error --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
namespace Content.Shared.Silicons.Borgs.Components;
|
namespace Content.Shared.Silicons.Borgs.Components;
|
||||||
|
|
||||||
@@ -24,6 +25,13 @@ public sealed partial class BorgModuleComponent : Component
|
|||||||
[DataField]
|
[DataField]
|
||||||
[AutoNetworkedField]
|
[AutoNetworkedField]
|
||||||
public bool DefaultModule;
|
public bool DefaultModule;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// List of types of borgs this module fits into.
|
||||||
|
/// This only affects examine text. The actual whitelist for modules that can be inserted into a borg is defined in its <see cref="BorgChassisComponent"/>.
|
||||||
|
/// </summary>
|
||||||
|
[DataField]
|
||||||
|
public HashSet<LocId>? BorgFitTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using Content.Shared.Containers.ItemSlots;
|
using Content.Shared.Containers.ItemSlots;
|
||||||
|
using Content.Shared.Examine;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
using Content.Shared.Item.ItemToggle;
|
using Content.Shared.Item.ItemToggle;
|
||||||
|
using Content.Shared.Localizations;
|
||||||
using Content.Shared.Movement.Components;
|
using Content.Shared.Movement.Components;
|
||||||
using Content.Shared.Movement.Systems;
|
using Content.Shared.Movement.Systems;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
@@ -35,10 +37,30 @@ public abstract partial class SharedBorgSystem : EntitySystem
|
|||||||
SubscribeLocalEvent<BorgChassisComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovementSpeedModifiers);
|
SubscribeLocalEvent<BorgChassisComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovementSpeedModifiers);
|
||||||
SubscribeLocalEvent<BorgChassisComponent, ActivatableUIOpenAttemptEvent>(OnUIOpenAttempt);
|
SubscribeLocalEvent<BorgChassisComponent, ActivatableUIOpenAttemptEvent>(OnUIOpenAttempt);
|
||||||
SubscribeLocalEvent<TryGetIdentityShortInfoEvent>(OnTryGetIdentityShortInfo);
|
SubscribeLocalEvent<TryGetIdentityShortInfoEvent>(OnTryGetIdentityShortInfo);
|
||||||
|
SubscribeLocalEvent<BorgModuleComponent, ExaminedEvent>(OnModuleExamine);
|
||||||
|
|
||||||
InitializeRelay();
|
InitializeRelay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnModuleExamine(Entity<BorgModuleComponent> ent, ref ExaminedEvent args)
|
||||||
|
{
|
||||||
|
if (ent.Comp.BorgFitTypes == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (ent.Comp.BorgFitTypes.Count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var typeList = new List<string>();
|
||||||
|
|
||||||
|
foreach (var type in ent.Comp.BorgFitTypes)
|
||||||
|
{
|
||||||
|
typeList.Add(Loc.GetString(type));
|
||||||
|
}
|
||||||
|
|
||||||
|
var types = ContentLocalizationManager.FormatList(typeList);
|
||||||
|
args.PushMarkup(Loc.GetString("borg-module-fit", ("types", types)));
|
||||||
|
}
|
||||||
|
|
||||||
private void OnTryGetIdentityShortInfo(TryGetIdentityShortInfoEvent args)
|
private void OnTryGetIdentityShortInfo(TryGetIdentityShortInfoEvent args)
|
||||||
{
|
{
|
||||||
if (args.Handled)
|
if (args.Handled)
|
||||||
|
|||||||
18
Resources/Locale/en-US/silicons/borg-module.ftl
Normal file
18
Resources/Locale/en-US/silicons/borg-module.ftl
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
borg-module-fit = This module fits into {$types}.
|
||||||
|
|
||||||
|
borg-type-all = [color=white]any cyborg[/color]
|
||||||
|
borg-type-salvage = [color= #d6b328]salvage cyborgs[/color]
|
||||||
|
borg-type-engineer = [color= #ff9900]engineer cyborgs[/color]
|
||||||
|
borg-type-generic = [color= #666680]generic cyborgs[/color]
|
||||||
|
borg-type-janitor = [color= #a747c0]janitor cyborgs[/color]
|
||||||
|
borg-type-medical = [color= #5995ba]medical cyborgs[/color]
|
||||||
|
borg-type-service = [color= #508242]service cyborgs[/color]
|
||||||
|
|
||||||
|
borg-type-syndicate = [color= #962023]syndicate cyborgs[/color]
|
||||||
|
borg-type-syndicate-assault = [color= #680a0d]syndicate assault cyborgs[/color]
|
||||||
|
|
||||||
|
xenoborg-type-all = [color= #3d94ff]any xenoborg[/color]
|
||||||
|
xenoborg-type-engi = [color= #edd45b]engi xenoborgs[/color]
|
||||||
|
xenoborg-type-heavy = [color= #d62020]heavy xenoborgs[/color]
|
||||||
|
xenoborg-type-scout = [color= #6a6b6f]scout xenoborgs[/color]
|
||||||
|
xenoborg-type-stealth = [color= #ff00cc]stealth xenoborgs[/color]
|
||||||
@@ -27,6 +27,8 @@
|
|||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Specific/Robotics/borgmodule.rsi
|
sprite: Objects/Specific/Robotics/borgmodule.rsi
|
||||||
- type: BorgModule
|
- type: BorgModule
|
||||||
|
borgFitTypes:
|
||||||
|
- borg-type-all
|
||||||
- type: BorgModuleIcon
|
- type: BorgModuleIcon
|
||||||
icon: { sprite: Interface/Actions/actions_borg.rsi, state: no-action }
|
icon: { sprite: Interface/Actions/actions_borg.rsi, state: no-action }
|
||||||
- type: StaticPrice
|
- type: StaticPrice
|
||||||
@@ -66,6 +68,9 @@
|
|||||||
parent: BaseBorgModule
|
parent: BaseBorgModule
|
||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
|
- type: BorgModule
|
||||||
|
borgFitTypes:
|
||||||
|
- borg-type-salvage
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- BorgModuleCargo
|
- BorgModuleCargo
|
||||||
@@ -91,6 +96,9 @@
|
|||||||
parent: BaseBorgModule
|
parent: BaseBorgModule
|
||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
|
- type: BorgModule
|
||||||
|
borgFitTypes:
|
||||||
|
- borg-type-engineer
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- BorgModuleEngineering
|
- BorgModuleEngineering
|
||||||
@@ -118,6 +126,9 @@
|
|||||||
parent: BaseBorgModule
|
parent: BaseBorgModule
|
||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
|
- type: BorgModule
|
||||||
|
borgFitTypes:
|
||||||
|
- borg-type-janitor
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- BorgModuleJanitor
|
- BorgModuleJanitor
|
||||||
@@ -145,6 +156,9 @@
|
|||||||
parent: BaseBorgModule
|
parent: BaseBorgModule
|
||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
|
- type: BorgModule
|
||||||
|
borgFitTypes:
|
||||||
|
- borg-type-medical
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- BorgModuleMedical
|
- BorgModuleMedical
|
||||||
@@ -172,6 +186,9 @@
|
|||||||
parent: BaseBorgModule
|
parent: BaseBorgModule
|
||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
|
- type: BorgModule
|
||||||
|
borgFitTypes:
|
||||||
|
- borg-type-generic
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- BorgModuleScience
|
- BorgModuleScience
|
||||||
@@ -199,6 +216,9 @@
|
|||||||
parent: BaseBorgModule
|
parent: BaseBorgModule
|
||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
|
- type: BorgModule
|
||||||
|
borgFitTypes:
|
||||||
|
- borg-type-service
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- BorgModuleService
|
- BorgModuleService
|
||||||
@@ -226,6 +246,9 @@
|
|||||||
parent: BaseBorgModule
|
parent: BaseBorgModule
|
||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
|
- type: BorgModule
|
||||||
|
borgFitTypes:
|
||||||
|
- borg-type-syndicate
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- BorgModuleSyndicate
|
- BorgModuleSyndicate
|
||||||
@@ -254,6 +277,9 @@
|
|||||||
parent: BaseBorgModule
|
parent: BaseBorgModule
|
||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
|
- type: BorgModule
|
||||||
|
borgFitTypes:
|
||||||
|
- borg-type-syndicate-assault
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- BorgModuleSyndicateAssault
|
- BorgModuleSyndicateAssault
|
||||||
@@ -281,6 +307,9 @@
|
|||||||
parent: BaseBorgModule
|
parent: BaseBorgModule
|
||||||
id: BaseXenoborgModuleGeneric
|
id: BaseXenoborgModuleGeneric
|
||||||
components:
|
components:
|
||||||
|
- type: BorgModule
|
||||||
|
borgFitTypes:
|
||||||
|
- xenoborg-type-all
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- XenoborgModuleGeneric
|
- XenoborgModuleGeneric
|
||||||
@@ -308,6 +337,9 @@
|
|||||||
parent: BaseBorgModule
|
parent: BaseBorgModule
|
||||||
id: BaseXenoborgModuleEngi
|
id: BaseXenoborgModuleEngi
|
||||||
components:
|
components:
|
||||||
|
- type: BorgModule
|
||||||
|
borgFitTypes:
|
||||||
|
- xenoborg-type-engi
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- XenoborgModuleEngi
|
- XenoborgModuleEngi
|
||||||
@@ -335,6 +367,9 @@
|
|||||||
id: BaseXenoborgModuleHeavy
|
id: BaseXenoborgModuleHeavy
|
||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
|
- type: BorgModule
|
||||||
|
borgFitTypes:
|
||||||
|
- xenoborg-type-heavy
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- XenoborgModuleHeavy
|
- XenoborgModuleHeavy
|
||||||
@@ -362,6 +397,9 @@
|
|||||||
id: BaseXenoborgModuleScout
|
id: BaseXenoborgModuleScout
|
||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
|
- type: BorgModule
|
||||||
|
borgFitTypes:
|
||||||
|
- xenoborg-type-scout
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- XenoborgModuleScout
|
- XenoborgModuleScout
|
||||||
@@ -389,6 +427,9 @@
|
|||||||
id: BaseXenoborgModuleStealth
|
id: BaseXenoborgModuleStealth
|
||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
|
- type: BorgModule
|
||||||
|
borgFitTypes:
|
||||||
|
- xenoborg-type-stealth
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- XenoborgModuleStealth
|
- XenoborgModuleStealth
|
||||||
|
|||||||
Reference in New Issue
Block a user