Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontier Ship Holo Pads #2734

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Content.Client/Holopad/HolopadWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public HolopadWindow()
ActivateProjectorButton.OnPressed += args => { OnHolopadActivateProjectorMessage(); };
RequestStationAiButton.OnPressed += args => { OnHolopadRequestStationAiMessage(); };

// Frontier - disable the call AI button until AI is finished implemented
RequestStationAiButton.Visible = false;

// XML formatting
AnswerCallButton.AddStyleClass("ButtonAccept");
EndCallButton.AddStyleClass("Caution");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Content.Server.Station.Components;

/// <summary>
/// Rename all holopads on a station when station name changes.
/// Only holopads with "Ship or POI" will be affected.
/// </summary>
[RegisterComponent]
public sealed partial class StationRenameHolopadsComponent : Component
{
}
55 changes: 55 additions & 0 deletions Content.Server/_NF/Station/Systems/StationRenameHolopadsSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using Content.Server.Station.Components;
using Content.Server.Station.Events;
using Content.Shared.Fax.Components;
using Content.Shared.Holopad;
using Content.Shared.Labels.Components;

namespace Content.Server.Station.Systems;

public sealed class StationRenameHolopadsSystem : EntitySystem
{
[Dependency] private readonly StationSystem _stationSystem = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<StationRenameHolopadsComponent, StationPostInitEvent>(OnPostInit);
}

private void OnPostInit(EntityUid uid, StationRenameHolopadsComponent component, ref StationPostInitEvent args)
{
SyncHolopadsNames(uid);
}

private void SyncHolopadsNames(EntityUid stationUid)
{
// update all holopads that belong to this station grid
var query = EntityQueryEnumerator<HolopadComponent>();
while (query.MoveNext(out var uid, out var pad))
{
if (!pad.UseStationName)
continue;

var padStationUid = _stationSystem.GetOwningStation(uid);
if (padStationUid != stationUid)
continue;

var padName = "";

if (!string.IsNullOrEmpty(pad.StationNamePrefix))
{
padName += pad.StationNamePrefix + " ";
}

padName += Name(padStationUid.Value);

if (!string.IsNullOrEmpty(pad.StationNameSuffix))
{
padName += " " + pad.StationNameSuffix;
}

var padLabel = EnsureComp<LabelComponent>(uid);
padLabel.CurrentLabel = padName;
}
}
}
21 changes: 21 additions & 0 deletions Content.Shared/Holopad/HolopadComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,27 @@ public sealed partial class HolopadComponent : Component
/// </summary>
[DataField]
public float ControlLockoutCoolDown { get; private set; } = 180f;

/// <summary>
/// Frontier - If true, will sync pad name with a station name.
/// </summary>
[ViewVariables]
[DataField]
public bool UseStationName { get; set; }

/// <summary>
/// Frontier - If added with UseStationName will add a Prefix to the name
/// </summary>
[ViewVariables]
[DataField]
public string? StationNamePrefix { get; set; } = null;

/// <summary>
/// Frontier - If added with UseStationName will add a suffix to the name
/// </summary>
[ViewVariables]
[DataField]
public string? StationNameSuffix { get; set; } = null;
}

#region: Event messages
Expand Down
19 changes: 19 additions & 0 deletions Resources/Locale/en-US/_NF/holopad/holopad.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Mapping prototypes
# General
nf-holopad-general-laboratory = Anomalous Laboratory
nf-holopad-general-bahama = Bahama Mama's
nf-holopad-general-courthouse-witness = Courthouse - Witness Stand
nf-holopad-general-courthouse-defendant = Courthouse - Defendant's Stand
nf-holopad-general-expedition-lodge = Expedition Lodge
nf-holopad-general-frontier-outpost-stc = Frontier Outpost - Traffic Control
nf-holopad-general-frontier-outpost-station-rep = Frontier Outpost - SR's Office
nf-holopad-general-frontier-outpost-lobby = Frontier Outpost - Main Lobby
nf-holopad-general-trade-station-stc = Trade Station - Traffic Control
nf-holopad-general-trade-station-cafeteria = Trade Station - Cafeteria
nf-holopad-general-medical-dispatch = Medical Dispatch - Reception
nf-holopad-general-medical-dispatch-doc = Medical Dispatch - DoC's Office
nf-holopad-general-nfsd-sheriff-office = NFSD - Sheriff's Office
nf-holopad-general-nfsd-reception = NFSD - Reception
nf-holopad-general-nfsd-lobby = NFSD - Main Lobby
nf-holopad-general-edison-reception = Edison Power Plant - Reception
nf-holopad-general-tinnia = Tinnia's Rest
41 changes: 24 additions & 17 deletions Resources/Maps/_NF/Shuttles/barge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3584,6 +3584,29 @@ entities:
rot: -1.5707963267948966 rad
pos: 2.5,-15.5
parent: 70
- proto: NFHolopadShip
entities:
- uid: 126
components:
- type: Transform
pos: 1.5,-11.5
parent: 70
- type: Fixtures
fixtures:
fix1:
shape: !type:PhysShapeCircle
radius: 0.33275002
position: 0,0
mask:
- Impassable
- LowImpassable
layer:
- LowImpassable
density: 1
hard: False
restitution: 0
friction: 0.4
- type: ScaleVisuals
- proto: NitrogenCanister
entities:
- uid: 46
Expand Down Expand Up @@ -3647,17 +3670,6 @@ entities:
- type: Transform
pos: 1.5,-17.5
parent: 70
- type: FuelGenerator
on: False
- type: Physics
bodyType: Static
- proto: PowerCellRecharger
entities:
- uid: 126
components:
- type: Transform
pos: 1.5,-11.5
parent: 70
- proto: Poweredlight
entities:
- uid: 245
Expand Down Expand Up @@ -4363,11 +4375,6 @@ entities:
rot: -1.5707963267948966 rad
pos: 0.5,-11.5
parent: 70
- uid: 541
components:
- type: Transform
pos: 1.5,-11.5
parent: 70
- uid: 542
components:
- type: Transform
Expand Down Expand Up @@ -4934,7 +4941,7 @@ entities:
- type: Transform
pos: -4.5,4.5
parent: 70
- proto: WarpPointShip
- proto: WarpPoint
entities:
- uid: 599
components:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
WeaponCapacitorRechargerFlatpack: 4294967295 # Infinite
BorgChargerFlatpack: 4294967295 # Infinite
MercenaryTechFabFlatpack: 4294967295 # Infinite
NFHolopadShipFlatpack: 4294967295 # Infinite
ComputerIFFFlatpack: 1
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
WeaponCapacitorRechargerFlatpack: 4294967295 # Infinite
BorgChargerFlatpack: 4294967295 # Infinite
MachineFlatpackerFlatpack: 4294967295 # Infinite
NFHolopadShipFlatpack: 4294967295 # Infinite
AirlockFlatpack: 4294967295 # Infinite
AirlockGlassFlatpack: 4294967295 # Infinite
AirlockShuttleFlatpack: 4294967295 # Infinite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@
entity: BlueprintLithograph

# Service
- type: entity
parent: BaseNFFlatpack
id: NFHolopadShipFlatpack
name: long-range holopad flatpack
description: A flatpack used for constructing a long-range holopad for ship to ship communication.
components:
- type: Flatpack
entity: NFHolopadShip

- type: entity
parent: BaseNFFlatpack
id: UniformPrinterFlatpack
Expand Down
6 changes: 6 additions & 0 deletions Resources/Prototypes/_NF/Entities/Stations/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
abstract: true
components:
- type: StationRenameFaxes

- type: entity
id: BaseStationRenameHolopads
abstract: true
components:
- type: StationRenameHolopads

- type: entity
id: BaseStationRenameWarpPoints
Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/_NF/Entities/Stations/nanotrasen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
- BaseStationRecords
- BaseStationAllEventsEligible
- BaseStationRenameFaxes
- BaseStationRenameHolopads
- BaseStationRenameWarpPoints
- BaseStationSiliconLawFrontierShips
- BaseStationDeadDropHintExempt # No hints on ship generation
Expand All @@ -95,6 +96,7 @@
- BaseStationRecords
- BaseStationAllEventsEligible
- BaseStationRenameFaxes
- BaseStationRenameHolopads
- BaseStationRenameWarpPoints
- BaseStationSiliconLawFrontierShips
- BaseStationDeadDropHintExempt # No hints on ship generation
Expand Down
Loading
Loading