]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
remove Injector SolutionName constant (#27493)
authorEd <96445749+TheShuEd@users.noreply.github.com>
Mon, 29 Apr 2024 21:29:15 +0000 (00:29 +0300)
committerGitHub <noreply@github.com>
Mon, 29 Apr 2024 21:29:15 +0000 (17:29 -0400)
remove stupid constant

Content.Client/Chemistry/UI/InjectorStatusControl.cs
Content.Server/Chemistry/EntitySystems/InjectorSystem.cs
Content.Shared/Chemistry/Components/InjectorComponent.cs
Content.Shared/Chemistry/EntitySystems/SharedInjectorSystem.cs

index ba1f97cd1e43d376c0faf00c740f7577d9e8d701..f9b0d90e205597d75befad12c68fab061640cfb8 100644 (file)
@@ -32,7 +32,7 @@ public sealed class InjectorStatusControl : Control
     {
         base.FrameUpdate(args);
 
-        if (!_solutionContainers.TryGetSolution(_parent.Owner, InjectorComponent.SolutionName, out _, out var solution))
+        if (!_solutionContainers.TryGetSolution(_parent.Owner, _parent.Comp.SolutionName, out _, out var solution))
             return;
 
         // only updates the UI if any of the details are different than they previously were
index 85d4ade3a4a7c687407c12b2af49815e173ccf10..77c8620ea49fd38dc32dd26c6727eb1fadf60a30 100644 (file)
@@ -124,7 +124,7 @@ public sealed class InjectorSystem : SharedInjectorSystem
             Popup.PopupEntity(Loc.GetString("injector-component-injecting-user"), target, user);
         }
 
-        if (!SolutionContainers.TryGetSolution(injector.Owner, InjectorComponent.SolutionName, out _, out var solution))
+        if (!SolutionContainers.TryGetSolution(injector.Owner, injector.Comp.SolutionName, out _, out var solution))
             return;
 
         var actualDelay = MathHelper.Max(injector.Comp.Delay, TimeSpan.FromSeconds(1));
@@ -254,7 +254,7 @@ public sealed class InjectorSystem : SharedInjectorSystem
     private void TryInject(Entity<InjectorComponent> injector, EntityUid targetEntity,
         Entity<SolutionComponent> targetSolution, EntityUid user, bool asRefill)
     {
-        if (!SolutionContainers.TryGetSolution(injector.Owner, InjectorComponent.SolutionName, out var soln,
+        if (!SolutionContainers.TryGetSolution(injector.Owner, injector.Comp.SolutionName, out var soln,
                 out var solution) || solution.Volume == 0)
             return;
 
@@ -296,7 +296,7 @@ public sealed class InjectorSystem : SharedInjectorSystem
     private void AfterInject(Entity<InjectorComponent> injector, EntityUid target)
     {
         // Automatically set syringe to draw after completely draining it.
-        if (SolutionContainers.TryGetSolution(injector.Owner, InjectorComponent.SolutionName, out _,
+        if (SolutionContainers.TryGetSolution(injector.Owner, injector.Comp.SolutionName, out _,
                 out var solution) && solution.Volume == 0)
         {
             SetMode(injector, InjectorToggleMode.Draw);
@@ -310,7 +310,7 @@ public sealed class InjectorSystem : SharedInjectorSystem
     private void AfterDraw(Entity<InjectorComponent> injector, EntityUid target)
     {
         // Automatically set syringe to inject after completely filling it.
-        if (SolutionContainers.TryGetSolution(injector.Owner, InjectorComponent.SolutionName, out _,
+        if (SolutionContainers.TryGetSolution(injector.Owner, injector.Comp.SolutionName, out _,
                 out var solution) && solution.AvailableVolume == 0)
         {
             SetMode(injector, InjectorToggleMode.Inject);
@@ -324,7 +324,7 @@ public sealed class InjectorSystem : SharedInjectorSystem
     private void TryDraw(Entity<InjectorComponent> injector, Entity<BloodstreamComponent?> target,
         Entity<SolutionComponent> targetSolution, EntityUid user)
     {
-        if (!SolutionContainers.TryGetSolution(injector.Owner, InjectorComponent.SolutionName, out var soln,
+        if (!SolutionContainers.TryGetSolution(injector.Owner, injector.Comp.SolutionName, out var soln,
                 out var solution) || solution.AvailableVolume == 0)
         {
             return;
index 605a15d73ab94ab5539c9490d05328ab43a381e9..ee7f9bd5798183bbaaf1ef1e029a4db36e52f4a7 100644 (file)
@@ -24,7 +24,8 @@ public sealed partial class InjectorDoAfterEvent : SimpleDoAfterEvent
 [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
 public sealed partial class InjectorComponent : Component
 {
-    public const string SolutionName = "injector";
+    [DataField]
+    public string SolutionName = "injector";
 
     /// <summary>
     /// Whether or not the injector is able to draw from containers or if it's a single use
index 6c43c1d5f06dc15672a65e651f6228f3310a0f51..1620344652c2bf622bd7c85431fb61b977d34ac2 100644 (file)
@@ -113,7 +113,7 @@ public abstract class SharedInjectorSystem : EntitySystem
         if (injector.Comp.InjectOnly)
             return;
 
-        if (!SolutionContainers.TryGetSolution(injector.Owner, InjectorComponent.SolutionName, out var solEnt, out var solution))
+        if (!SolutionContainers.TryGetSolution(injector.Owner, injector.Comp.SolutionName, out var solEnt, out var solution))
             return;
 
         string msg;