]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Hide ruins spawns (#23857)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Wed, 10 Jan 2024 11:15:48 +0000 (22:15 +1100)
committerGitHub <noreply@github.com>
Wed, 10 Jan 2024 11:15:48 +0000 (04:15 -0700)
* Hide ruins spawns

* Update count

* Add naming

Content.Server/Shuttles/Components/GridSpawnComponent.cs
Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs
Resources/Prototypes/Entities/Stations/base.yml

index 7e6e308fd385b0bf879619f23303e23d9f11d693..86874541df22743548cc0f323e30bf9d77e6f54c 100644 (file)
@@ -23,6 +23,16 @@ public record struct GridSpawnGroup
     public int MinCount = 1;
     public int MaxCount = 1;
 
+    /// <summary>
+    /// Hide the IFF of the grid.
+    /// </summary>
+    public bool Hide = false;
+
+    /// <summary>
+    /// Should we set the metadata name of a grid. Useful for admin purposes.
+    /// </summary>
+    public bool NameGrid = false;
+
     public GridSpawnGroup()
     {
     }
index 678a557668a70a4393571a5ca469f83ce2cf1e8f..5452a0bb9dc770380c4bf552201860ef3e577e57 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.Station.Components;
 using Content.Server.Station.Events;
 using Content.Shared.Cargo.Components;
 using Content.Shared.CCVar;
+using Content.Shared.Shuttles.Components;
 using Robust.Shared.Random;
 using Robust.Shared.Utility;
 
@@ -87,6 +88,13 @@ public sealed partial class ShuttleSystem
 
                 if (_loader.TryLoad(mapId, path.ToString(), out var ent) && ent.Count == 1)
                 {
+                    if (group.Hide)
+                    {
+                        var iffComp = EnsureComp<IFFComponent>(ent[0]);
+                        iffComp.Flags |= IFFFlags.Hide;
+                        Dirty(ent[0], iffComp);
+                    }
+
                     if (TryComp<ShuttleComponent>(ent[0], out var shuttle))
                     {
                         TryFTLProximity(ent[0], shuttle, targetGrid.Value);
@@ -96,6 +104,12 @@ public sealed partial class ShuttleSystem
                     {
                         valid = false;
                     }
+
+                    if (group.NameGrid)
+                    {
+                        var name = path.FilenameWithoutExtension;
+                        _metadata.SetEntityName(ent[0], name);
+                    }
                 }
                 else
                 {
index 049fd78d4b3b04a7d15b7a29d23a25dec1a5f02d..4871ae50f18f36d775856571335a2b363795c449 100644 (file)
           paths:
           - /Maps/Shuttles/mining.yml
         ruins:
+          hide: true
+          nameGrid: true
+          minCount: 2
+          maxCount: 2
           paths:
           - /Maps/Ruins/derelict.yml
           - /Maps/Ruins/djstation.yml
@@ -59,7 +63,7 @@
           - /Maps/Ruins/relaystation.yml
           - /Maps/Ruins/whiteship_ancient.yml
           - /Maps/Ruins/whiteship_bluespacejumper.yml
-          
+
 
 
 - type: entity
           paths:
           - /Maps/Shuttles/mining.yml
         ruins:
+          hide: true
+          nameGrid: true
+          minCount: 2
+          maxCount: 2
           paths:
           - /Maps/Ruins/derelict.yml
           - /Maps/Ruins/djstation.yml