[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
- private readonly EntityUid _targetEntity;
+ private readonly NetEntity _targetEntity;
private string _targetSolution;
private ReagentPrototype? _selectedReagent;
// FloatSpinBox does not (yet?) play nice with xaml
private FloatSpinBox _quantitySpin = new(1, 2) { Value = 10, HorizontalExpand = true};
- public AddReagentWindow(EntityUid targetEntity, string targetSolution)
+ public AddReagentWindow(NetEntity targetEntity, string targetSolution)
{
IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this);
public sealed class EditSolutionsEui : BaseEui
{
private readonly EditSolutionsWindow _window;
- private IEntityManager _entManager;
public EditSolutionsEui()
{
- _entManager = IoCManager.Resolve<IEntityManager>();
_window = new EditSolutionsWindow();
_window.OnClose += () => SendMessage(new CloseEuiMessage());
}
public override void HandleState(EuiStateBase baseState)
{
var state = (EditSolutionsEuiState) baseState;
- _window.SetTargetEntity(_entManager.GetEntity(state.Target));
+ _window.SetTargetEntity(state.Target);
_window.UpdateSolutions(state.Solutions);
_window.UpdateReagents();
}
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
- private EntityUid _target = EntityUid.Invalid;
+ private NetEntity _target = NetEntity.Invalid;
private string? _selectedSolution;
private AddReagentWindow? _addReagentWindow;
private Dictionary<string, Solution>? _solutions;
_addReagentWindow?.Dispose();
}
- public void SetTargetEntity(EntityUid target)
+ public void SetTargetEntity(NetEntity target)
{
_target = target;
+ var uid = _entityManager.GetEntity(target);
- var targetName = _entityManager.EntityExists(target)
- ? IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target).EntityName
+ var targetName = _entityManager.EntityExists(uid)
+ ? _entityManager.GetComponent<MetaDataComponent>(uid).EntityName
: string.Empty;
Title = Loc.GetString("admin-solutions-window-title", ("targetName", targetName));