]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Centcom & FTLDestination cleanup (#30226)
authorIProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
Tue, 27 Aug 2024 11:28:26 +0000 (07:28 -0400)
committerGitHub <noreply@github.com>
Tue, 27 Aug 2024 11:28:26 +0000 (13:28 +0200)
* centcomm name and ftlcomp

* networking microopstimization

* go sleep.

* map names and arrivals

Content.Server/Shuttles/Systems/ArrivalsSystem.cs
Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs
Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs
Resources/Locale/en-US/shuttles/emergency.ftl

index 40a2778b93753e11b99e459f656adb1f62cfa1da..e921590e390eeedba87f1ba9ac3e715eda0eed73 100644 (file)
@@ -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))
         {
index 1f3b4a749bc7530b8522f66d267eb4a63a702300..52b327ee010082d6477b4bdfa4ef536018d94336 100644 (file)
@@ -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)}");
     }
 
index 274437aa40474199891b625077544d3fb1e58063..e6704457450007d232009708715c74919f74ed53 100644 (file)
@@ -186,6 +186,11 @@ public sealed partial class ShuttleSystem
     /// Adds the target map as available for FTL.
     /// </summary>
     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<FTLDestinationComponent>(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;
index b4dcaa3e67493d60bf63a9dcfe4df21a239c2059..be3f0962fa7ced4829b6d06d2348a68aa99d0b2d 100644 (file)
@@ -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