Readds Iconcomponent (#2142)

* icon fix

* stuff

* directional texture rework
This commit is contained in:
Paul Ritter
2020-09-28 20:53:47 +02:00
committed by GitHub
parent b24d36eda0
commit 68031990a2
7 changed files with 71 additions and 28 deletions

View File

@@ -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]);