Release v0.15.13.0
This commit is contained in:
@@ -300,6 +300,8 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
requiresRecipeText.RectTransform.RepositionChildInHierarchy(itemList.Content.RectTransform.GetChildIndex(firstRequiresRecipe.RectTransform));
|
||||
}
|
||||
|
||||
HideEmptyItemListCategories();
|
||||
}
|
||||
|
||||
private void DrawInputOverLay(SpriteBatch spriteBatch, GUICustomComponent overlayComponent)
|
||||
@@ -479,6 +481,13 @@ namespace Barotrauma.Items.Components
|
||||
child.Visible = recipe.DisplayName.ToLower().Contains(filter);
|
||||
}
|
||||
|
||||
HideEmptyItemListCategories();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void HideEmptyItemListCategories()
|
||||
{
|
||||
//go through the elements backwards, and disable the labels ("insufficient skills to fabricate", "recipe required...") if there's no items below them
|
||||
bool recipeVisible = false;
|
||||
foreach (GUIComponent child in itemList.Content.Children.Reverse())
|
||||
@@ -490,14 +499,12 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
else
|
||||
{
|
||||
recipeVisible = child.Visible;
|
||||
recipeVisible |= child.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
itemList.UpdateScrollBarSize();
|
||||
itemList.BarScroll = 0.0f;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool ClearFilter()
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
internal readonly struct MiniMapSprite
|
||||
{
|
||||
public readonly Sprite Sprite;
|
||||
public readonly Sprite? Sprite;
|
||||
public readonly Color Color;
|
||||
|
||||
public MiniMapSprite(JobPrefab prefab)
|
||||
@@ -1302,6 +1302,8 @@ namespace Barotrauma.Items.Components
|
||||
int i = 0;
|
||||
foreach (MiniMapSprite info in cardsToDraw)
|
||||
{
|
||||
if (info.Sprite is null) { continue; }
|
||||
|
||||
float spriteSize = info.Sprite.size.X * (parentWidth / info.Sprite.size.X) + padding;
|
||||
if (totalWidth + spriteSize > frame.Rect.Width) { break; }
|
||||
|
||||
@@ -1318,7 +1320,8 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
foreach (MiniMapSprite info in cardsToDraw)
|
||||
{
|
||||
Sprite sprite = info.Sprite;
|
||||
Sprite? sprite = info.Sprite;
|
||||
if (sprite is null) { continue; }
|
||||
float scale = parentWidth / sprite.size.X;
|
||||
float spriteSize = sprite.size.X * scale;
|
||||
float posX = adjustedCenterX + offset;
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
Vector2 startPos = GetSourcePos();
|
||||
startPos.Y = -startPos.Y;
|
||||
if (source is Item sourceItem)
|
||||
if (source is Item sourceItem && !sourceItem.Removed)
|
||||
{
|
||||
var turret = sourceItem.GetComponent<Turret>();
|
||||
var weapon = sourceItem.GetComponent<RangedWeapon>();
|
||||
|
||||
Reference in New Issue
Block a user