From af65af836a319e5481929a3a6ef19ca719a5c0eb Mon Sep 17 00:00:00 2001 From: IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com> Date: Tue, 27 Aug 2024 07:28:26 -0400 Subject: [PATCH] Centcom & FTLDestination cleanup (#30226) * centcomm name and ftlcomp * networking microopstimization * go sleep. * map names and arrivals --- Content.Server/Shuttles/Systems/ArrivalsSystem.cs | 2 ++ .../Shuttles/Systems/EmergencyShuttleSystem.cs | 4 +++- .../Shuttles/Systems/ShuttleSystem.FasterThanLight.cs | 10 +++++++++- Resources/Locale/en-US/shuttles/emergency.ftl | 4 ++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Content.Server/Shuttles/Systems/ArrivalsSystem.cs b/Content.Server/Shuttles/Systems/ArrivalsSystem.cs index 40a2778b93..e921590e39 100644 --- a/Content.Server/Shuttles/Systems/ArrivalsSystem.cs +++ b/Content.Server/Shuttles/Systems/ArrivalsSystem.cs @@ -52,6 +52,7 @@ public sealed class ArrivalsSystem : EntitySystem [Dependency] private readonly BiomeSystem _biomes = default!; [Dependency] private readonly GameTicker _ticker = default!; [Dependency] private readonly MapLoaderSystem _loader = default!; + [Dependency] private readonly MetaDataSystem _metaData = default!; [Dependency] private readonly DeviceNetworkSystem _deviceNetworkSystem = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly ShuttleSystem _shuttles = default!; @@ -497,6 +498,7 @@ public sealed class ArrivalsSystem : EntitySystem private void SetupArrivalsStation() { var mapUid = _mapSystem.CreateMap(out var mapId, false); + _metaData.SetEntityName(mapUid, Loc.GetString("map-name-terminal")); if (!_loader.TryLoad(mapId, _cfgManager.GetCVar(CCVars.ArrivalsMap), out var uids)) { diff --git a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs index 1f3b4a749b..52b327ee01 100644 --- a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs +++ b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs @@ -61,6 +61,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem [Dependency] private readonly IdCardSystem _idSystem = default!; [Dependency] private readonly NavMapSystem _navMap = default!; [Dependency] private readonly MapLoaderSystem _map = default!; + [Dependency] private readonly MetaDataSystem _metaData = default!; [Dependency] private readonly PopupSystem _popup = default!; [Dependency] private readonly RoundEndSystem _roundEnd = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; @@ -464,8 +465,9 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem } component.MapEntity = map; + _metaData.SetEntityName(map, Loc.GetString("map-name-centcomm")); component.Entity = grid; - _shuttle.TryAddFTLDestination(mapId, false, out _); + _shuttle.TryAddFTLDestination(mapId, true, out _); Log.Info($"Created centcomm grid {ToPrettyString(grid)} on map {ToPrettyString(map)} for station {ToPrettyString(station)}"); } diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs index 274437aa40..e670445745 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs @@ -186,6 +186,11 @@ public sealed partial class ShuttleSystem /// Adds the target map as available for FTL. /// public bool TryAddFTLDestination(MapId mapId, bool enabled, [NotNullWhen(true)] out FTLDestinationComponent? component) + { + return TryAddFTLDestination(mapId, enabled, true, false, out component); + } + + public bool TryAddFTLDestination(MapId mapId, bool enabled, bool requireDisk, bool beaconsOnly, [NotNullWhen(true)] out FTLDestinationComponent? component) { var mapUid = _mapSystem.GetMapOrInvalid(mapId); component = null; @@ -195,10 +200,13 @@ public sealed partial class ShuttleSystem component = EnsureComp(mapUid); - if (component.Enabled == enabled) + if (component.Enabled == enabled && component.RequireCoordinateDisk == requireDisk && component.BeaconsOnly == beaconsOnly) return true; component.Enabled = enabled; + component.RequireCoordinateDisk = requireDisk; + component.BeaconsOnly = beaconsOnly; + _console.RefreshShuttleConsoles(); Dirty(mapUid, component); return true; diff --git a/Resources/Locale/en-US/shuttles/emergency.ftl b/Resources/Locale/en-US/shuttles/emergency.ftl index b4dcaa3e67..be3f0962fa 100644 --- a/Resources/Locale/en-US/shuttles/emergency.ftl +++ b/Resources/Locale/en-US/shuttles/emergency.ftl @@ -33,3 +33,7 @@ emergency-shuttle-ui-authorize = AUTHORIZE emergency-shuttle-ui-repeal = REPEAL emergency-shuttle-ui-authorizations = Authorizations emergency-shuttle-ui-remaining = Remaining: {$remaining} + +# Map Misc. +map-name-centcomm = Central Command +map-name-terminal = Arrivals Terminal \ No newline at end of file -- 2.51.2