Cleaner BoundUserInterfaces (#17736)

This commit is contained in:
TemporalOroboros
2023-07-08 09:02:17 -07:00
committed by GitHub
parent 55b4fb1649
commit 3ac4cf85db
137 changed files with 1069 additions and 972 deletions

View File

@@ -16,8 +16,8 @@ namespace Content.Client.Lathe.UI;
[GenerateTypedNameReferences]
public sealed partial class LatheMenu : DefaultWindow
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
private readonly SpriteSystem _spriteSystem;
private readonly LatheSystem _lathe;
@@ -32,24 +32,24 @@ public sealed partial class LatheMenu : DefaultWindow
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_spriteSystem = _entityManager.EntitySysManager.GetEntitySystem<SpriteSystem>();
_lathe = _entityManager.EntitySysManager.GetEntitySystem<LatheSystem>();
_spriteSystem = _entityManager.System<SpriteSystem>();
_lathe = _entityManager.System<LatheSystem>();
Title = _entityManager.GetComponent<MetaDataComponent>(owner.Lathe).EntityName;
Title = _entityManager.GetComponent<MetaDataComponent>(owner.Owner).EntityName;
SearchBar.OnTextChanged += _ =>
{
PopulateRecipes(owner.Lathe);
PopulateRecipes(owner.Owner);
};
AmountLineEdit.OnTextChanged += _ =>
{
PopulateRecipes(owner.Lathe);
PopulateRecipes(owner.Owner);
};
QueueButton.OnPressed += a => OnQueueButtonPressed?.Invoke(a);
ServerListButton.OnPressed += a => OnServerListButtonPressed?.Invoke(a);
if (_entityManager.TryGetComponent<LatheComponent>(owner.Lathe, out var latheComponent))
if (_entityManager.TryGetComponent<LatheComponent>(owner.Owner, out var latheComponent))
{
if (!latheComponent.DynamicRecipes.Any())
{