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;
using Content.Shared.FixedPoint;
using Robust.Client.Graphics;
using static Robust.Client.UserInterface.Controls.BoxContainer;
+using Robust.Client.GameObjects;
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<BaseButton.ButtonEventArgs, ReagentButton>? OnReagentButtonPressed;
public readonly Button[] PillTypeButtons;
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
+ _sprite = _entityManager.System<SpriteSystem>();
+
// 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);
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,
};
-using Content.Shared.Chemistry.Components;
+using Content.Shared.Chemistry.Components;
using Robust.Client.Animations;
using Robust.Client.GameObjects;
using Robust.Shared.Timing;
if (TryComp(uid, out AnimationPlayerComponent? animPlayer)
&& !AnimationSystem.HasRunningAnimation(uid, animPlayer, FoamVisualsComponent.AnimationKey))
{
- AnimationSystem.Play(uid, animPlayer, comp.Animation, FoamVisualsComponent.AnimationKey);
+ AnimationSystem.Play((uid, animPlayer), comp.Animation, FoamVisualsComponent.AnimationKey);
}
}
}
-using Content.Shared.Vapor;
+using Content.Shared.Vapor;
using Robust.Client.Animations;
using Robust.Client.GameObjects;
TryComp<AnimationPlayerComponent>(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);
}
}