Remove some BUI boilerplate (#28399)
* Remove some BUI boilerplate - The disposals overrides got removed due to the helper method handling it. - Replace window creation with CreateWindow helper. - Fixed some stinky code which would cause exceptions. * More * moar * weh * done * More BUIs * More updates * weh * moar * look who it is * weh * merge * weh * fixes
This commit is contained in:
@@ -23,22 +23,27 @@ namespace Content.Client.Medical.CrewMonitoring;
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class CrewMonitoringWindow : FancyWindow
|
||||
{
|
||||
private readonly IEntityManager _entManager;
|
||||
private readonly IPrototypeManager _prototypeManager;
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
private readonly SpriteSystem _spriteSystem;
|
||||
|
||||
private NetEntity? _trackedEntity;
|
||||
private bool _tryToScrollToListFocus;
|
||||
private Texture? _blipTexture;
|
||||
|
||||
public CrewMonitoringWindow(string stationName, EntityUid? mapUid)
|
||||
public CrewMonitoringWindow()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_entManager = IoCManager.Resolve<IEntityManager>();
|
||||
_prototypeManager = IoCManager.Resolve<IPrototypeManager>();
|
||||
_spriteSystem = _entManager.System<SpriteSystem>();
|
||||
|
||||
NavMap.TrackedEntitySelectedAction += SetTrackedEntityFromNavMap;
|
||||
|
||||
}
|
||||
|
||||
public void Set(string stationName, EntityUid? mapUid)
|
||||
{
|
||||
_blipTexture = _spriteSystem.Frame0(new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")));
|
||||
|
||||
if (_entManager.TryGetComponent<TransformComponent>(mapUid, out var xform))
|
||||
@@ -49,8 +54,6 @@ public sealed partial class CrewMonitoringWindow : FancyWindow
|
||||
|
||||
StationName.AddStyleClass("LabelBig");
|
||||
StationName.Text = stationName;
|
||||
|
||||
NavMap.TrackedEntitySelectedAction += SetTrackedEntityFromNavMap;
|
||||
NavMap.ForceNavMapUpdate();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user