]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Map-Init guidebook entities. (#14823)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Fri, 24 Mar 2023 09:00:29 +0000 (22:00 +1300)
committerGitHub <noreply@github.com>
Fri, 24 Mar 2023 09:00:29 +0000 (20:00 +1100)
Content.Client/Guidebook/Controls/GuideEntityEmbed.xaml.cs
Content.Server/Construction/ConstructionSystem.Graph.cs
Content.Shared/Containers/ContainerFillComponent.cs [moved from Content.Server/Containers/ContainerFillComponent.cs with 95% similarity]
Content.Shared/Containers/ContainerFillSystem.cs [moved from Content.Server/Containers/ContainerFillSystem.cs with 97% similarity]

index 840ecb132319caeecfba1cbb39346c1ed616a12d..34b4f3bdaab091d642dd223a036db2a2cb927db1 100644 (file)
@@ -171,6 +171,10 @@ public sealed partial class GuideEntityEmbed : BoxContainer, IDocumentTag
 
         Margin = new Thickness(4, 8);
 
+        // By default, we will map-initialize guidebook entities.
+        if (!args.TryGetValue("Init", out var mapInit) || !bool.Parse(mapInit))
+            _entityManager.RunMapInit(ent, _entityManager.GetComponent<MetaDataComponent>(ent));
+
         control = this;
         return true;
     }
index bd906ab5390f1f9db08cdf93caf89a9f15d1acdd..4b5c530ae04f7f23e83b7309336d46b1cd75cb6b 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.Containers;
 using Content.Shared.Construction;
 using Content.Shared.Construction.Prototypes;
 using Content.Shared.Construction.Steps;
+using Content.Shared.Containers;
 using Content.Shared.Database;
 using Robust.Server.Containers;
 using Robust.Shared.Containers;
similarity index 95%
rename from Content.Server/Containers/ContainerFillComponent.cs
rename to Content.Shared/Containers/ContainerFillComponent.cs
index 26aee86e46e5730ad9e1abd36887343c8249f2cb..6d5fd93ed77b6cd0ab662d9edd3fdad06e9f364b 100644 (file)
@@ -1,7 +1,5 @@
-using Content.Server.Storage.Components;
 using Content.Shared.Storage;
 using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization;
 using Robust.Shared.Serialization.Manager;
 using Robust.Shared.Serialization.Markdown.Mapping;
 using Robust.Shared.Serialization.Markdown.Sequence;
@@ -9,7 +7,7 @@ using Robust.Shared.Serialization.Markdown.Validation;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
 using Robust.Shared.Serialization.TypeSerializers.Interfaces;
 
-namespace Content.Server.Containers;
+namespace Content.Shared.Containers;
 
 /// <summary>
 ///     Component for spawning entity prototypes into containers on map init.
similarity index 97%
rename from Content.Server/Containers/ContainerFillSystem.cs
rename to Content.Shared/Containers/ContainerFillSystem.cs
index 4ab1ca899a85ed254db82290b696453166a73235..aad0acaa613a604e932a633958c00f179643a9fe 100644 (file)
@@ -1,7 +1,7 @@
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 
-namespace Content.Server.Containers;
+namespace Content.Shared.Containers;
 
 public sealed class ContainerFillSystem : EntitySystem
 {