From: J Date: Sun, 30 Mar 2025 12:07:34 +0000 (+0000) Subject: Chemistry warnings cleanup (#36160) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=504e70be2b5223099b317179f2d462bf89bdb867;p=space-station-14.git Chemistry warnings cleanup (#36160) * Chemistry warnings cleanup * Fixing failed ITest * Better entity instantiation * Caching spritesystem and entity instantiation improvement * Correcting naming conventions * Rearranging dependency caching --- diff --git a/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs b/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs index 807ec4c1e7..e264b859a0 100644 --- a/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs +++ b/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs @@ -6,7 +6,6 @@ using Robust.Client.AutoGenerated; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; -using Robust.Client.Utility; using Robust.Shared.Prototypes; using Robust.Shared.Utility; using System.Linq; @@ -14,6 +13,7 @@ using System.Numerics; using Content.Shared.FixedPoint; using Robust.Client.Graphics; using static Robust.Client.UserInterface.Controls.BoxContainer; +using Robust.Client.GameObjects; namespace Content.Client.Chemistry.UI { @@ -24,6 +24,10 @@ namespace Content.Client.Chemistry.UI public sealed partial class ChemMasterWindow : FancyWindow { [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; + + private readonly SpriteSystem _sprite; + public event Action? OnReagentButtonPressed; public readonly Button[] PillTypeButtons; @@ -38,6 +42,8 @@ namespace Content.Client.Chemistry.UI RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); + _sprite = _entityManager.System(); + // Pill type selection buttons, in total there are 20 pills. // Pill rsi file should have states named as pill1, pill2, and so on. var resourcePath = new ResPath(PillsRsiPath); @@ -69,7 +75,7 @@ namespace Content.Client.Chemistry.UI var specifier = new SpriteSpecifier.Rsi(resourcePath, "pill" + (i + 1)); TextureRect pillTypeTexture = new TextureRect { - Texture = specifier.Frame0(), + Texture = _sprite.Frame0(specifier), TextureScale = new Vector2(1.75f, 1.75f), Stretch = TextureRect.StretchMode.KeepCentered, }; diff --git a/Content.Client/Chemistry/Visualizers/FoamVisualizerSystem.cs b/Content.Client/Chemistry/Visualizers/FoamVisualizerSystem.cs index 2ee88956ff..2f895718c7 100644 --- a/Content.Client/Chemistry/Visualizers/FoamVisualizerSystem.cs +++ b/Content.Client/Chemistry/Visualizers/FoamVisualizerSystem.cs @@ -1,4 +1,4 @@ -using Content.Shared.Chemistry.Components; +using Content.Shared.Chemistry.Components; using Robust.Client.Animations; using Robust.Client.GameObjects; using Robust.Shared.Timing; @@ -37,7 +37,7 @@ public sealed class FoamVisualizerSystem : VisualizerSystem(uid, out var animPlayer) && !AnimationSystem.HasRunningAnimation(uid, animPlayer, VaporVisualsComponent.AnimationKey)) { - AnimationSystem.Play(uid, animPlayer, comp.VaporFlick, VaporVisualsComponent.AnimationKey); + AnimationSystem.Play((uid, animPlayer), comp.VaporFlick, VaporVisualsComponent.AnimationKey); } }