Readds Iconcomponent (#2142)
* icon fix * stuff * directional texture rework
This commit is contained in:
@@ -4,6 +4,7 @@ using Content.Shared.Chemistry;
|
||||
using Content.Shared.Kitchen;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.GameObjects.Components.UserInterface;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Graphics.Drawing;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
@@ -109,11 +110,21 @@ namespace Content.Client.GameObjects.Components.Kitchen
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (entity.Deleted || !entity.TryGetComponent(out SpriteComponent spriteComponent))
|
||||
if (entity.Deleted)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var solidItem = _menu.IngredientsList.AddItem(entity.Name, spriteComponent.Icon);
|
||||
|
||||
Texture texture;
|
||||
if (entity.TryGetComponent(out IconComponent iconComponent))
|
||||
{
|
||||
texture = iconComponent.Icon?.Default;
|
||||
}else if (entity.TryGetComponent(out SpriteComponent spriteComponent))
|
||||
{
|
||||
texture = spriteComponent.Icon?.Default;
|
||||
}else{continue;}
|
||||
|
||||
var solidItem = _menu.IngredientsList.AddItem(entity.Name, texture);
|
||||
var solidIndex = _menu.IngredientsList.IndexOf(solidItem);
|
||||
_solids.Add(solidIndex, containedSolids[j]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user