Skip to content

Commit

Permalink
added examine ftl entries
Browse files Browse the repository at this point in the history
  • Loading branch information
Alkheemist committed Dec 27, 2024
1 parent 0c829d0 commit 123dde8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Content.Server/_NF/Shuttles/Systems/AdvDoorSealSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public override void Initialize()
SubscribeLocalEvent<AdvDoorSealComponent, AnchorStateChangedEvent>(OnAnchorChange);
SubscribeLocalEvent<AdvDoorSealComponent, UpdateSpacedEvent>(OnTileChange);
SubscribeLocalEvent<AdvDoorSealComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<AdvDoorSealComponent, ExaminedEvent>(OnDoorExamine);
}

private void OnComponentInit(EntityUid uid, AdvDoorSealComponent component, ComponentInit args)
Expand Down Expand Up @@ -89,6 +90,33 @@ private void OnAnchorChange(EntityUid uid, AdvDoorSealComponent component, ref A
}


private void OnDoorExamine(EntityUid uid, AdvDoorSealComponent component, ExaminedEvent args)
{
// Powered is already handled by other power components
var enabled = Loc.GetString(component.IsOn ? "adv-door-seal-comp-enabled" : "adv-door-seal-comp-disabled");

using (args.PushGroup(nameof(AdvDoorSealComponent)))
{
args.PushMarkup(enabled);

if (EntityManager.TryGetComponent(uid, out TransformComponent? xform) && xform.Anchored)
{
var doorLocalization = ContentLocalizationManager.FormatDirection(xform.LocalRotation.ToWorldVec().GetDir()).ToLower();
var doorDir = Loc.GetString("adv-door-seal-comp-door-direction",
("direction", doorLocalization));

args.PushMarkup(doorDir);

var exposed = DockExposed(xform);

var doorText =
Loc.GetString(exposed ? "adv-door-seal-comp-door-exposed" : "adv-door-seal-comp-door-not-exposed");

args.PushMarkup(doorText);
}
}
}

/// <summary>
/// Tries to enable the seals and turn it on. If it's already enabled it does nothing.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions Resources/Locale/en-US/_NF/shuttles/adv-door-seals.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
adv-door-seal-comp-enabled = The airtight seal system is turned [color=green]on[/color].
adv-door-seal-comp-disabled = The airtight seal system is turned [color=red]off[/color].
adv-door-seal-comp-door-direction = The door is facing [color=yellow]{$direction}[/color].
adv-door-seal-comp-door-exposed = The seals are [color=green]exposed[/color] to space.
adv-door-seal-comp-door-not-exposed = The seals are [color=red]not exposed[/color] to space.

0 comments on commit 123dde8

Please sign in to comment.