66using Robust . Client . UserInterface ;
77using Robust . Client . UserInterface . Controls ;
88using Robust . Client . UserInterface . XAML ;
9- using Robust . Client . Utility ;
109using Robust . Shared . Prototypes ;
1110using Robust . Shared . Utility ;
1211using System . Linq ;
1312using System . Numerics ;
1413using Content . Shared . FixedPoint ;
1514using Robust . Client . Graphics ;
1615using static Robust . Client . UserInterface . Controls . BoxContainer ;
16+ using Robust . Client . GameObjects ;
1717
1818namespace Content . Client . Chemistry . UI
1919{
@@ -24,6 +24,10 @@ namespace Content.Client.Chemistry.UI
2424 public sealed partial class ChemMasterWindow : FancyWindow
2525 {
2626 [ Dependency ] private readonly IPrototypeManager _prototypeManager = default ! ;
27+ [ Dependency ] private readonly IEntityManager _entityManager = default ! ;
28+
29+ private readonly SpriteSystem _sprite ;
30+
2731 public event Action < BaseButton . ButtonEventArgs , ReagentButton > ? OnReagentButtonPressed ;
2832 public readonly Button [ ] PillTypeButtons ;
2933
@@ -38,6 +42,8 @@ public ChemMasterWindow()
3842 RobustXamlLoader . Load ( this ) ;
3943 IoCManager . InjectDependencies ( this ) ;
4044
45+ _sprite = _entityManager . System < SpriteSystem > ( ) ;
46+
4147 // Pill type selection buttons, in total there are 20 pills.
4248 // Pill rsi file should have states named as pill1, pill2, and so on.
4349 var resourcePath = new ResPath ( PillsRsiPath ) ;
@@ -69,7 +75,7 @@ public ChemMasterWindow()
6975 var specifier = new SpriteSpecifier . Rsi ( resourcePath , "pill" + ( i + 1 ) ) ;
7076 TextureRect pillTypeTexture = new TextureRect
7177 {
72- Texture = specifier . Frame0 ( ) ,
78+ Texture = _sprite . Frame0 ( specifier ) ,
7379 TextureScale = new Vector2 ( 1.75f , 1.75f ) ,
7480 Stretch = TextureRect . StretchMode . KeepCentered ,
7581 } ;
0 commit comments