lathe recipes no longer specify textures (#12944)

Co-authored-by: Moony <moony@hellomouse.net>
This commit is contained in:
Nemanja
2023-01-01 18:56:03 -05:00
committed by GitHub
parent 4a7c0b94b2
commit 69971272e6
20 changed files with 25 additions and 566 deletions

View File

@@ -13,7 +13,7 @@ namespace Content.Client.Lathe.UI
[Dependency] private readonly IEntityManager _entityManager = default!;
private readonly SpriteSystem _spriteSystem;
public LatheQueueMenu(LatheBoundUserInterface owner)
public LatheQueueMenu()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
@@ -26,7 +26,9 @@ namespace Content.Client.Lathe.UI
{
if (recipe != null)
{
Icon.Texture = _spriteSystem.Frame0(recipe.Icon);
Icon.Texture = recipe.Icon == null
? _spriteSystem.GetPrototypeIcon(recipe.Result).Default
: _spriteSystem.Frame0(recipe.Icon);
NameLabel.Text = recipe.Name;
Description.Text = recipe.Description;
}
@@ -44,7 +46,10 @@ namespace Content.Client.Lathe.UI
var idx = 1;
foreach (var recipe in queue)
{
QueueList.AddItem($"{idx}. {recipe.Name}", _spriteSystem.Frame0(recipe.Icon));
var icon =recipe.Icon == null
? _spriteSystem.GetPrototypeIcon(recipe.Result).Default
: _spriteSystem.Frame0(recipe.Icon);
QueueList.AddItem($"{idx}. {recipe.Name}", icon);
idx++;
}
}