Fix labels
This commit is contained in:
@@ -7,7 +7,7 @@ using System.Collections.Generic;
|
||||
|
||||
public interface IInventoryMenu : IControl
|
||||
{
|
||||
public void PopulateItems(List<InventoryItem> items);
|
||||
public void PopulateItems(List<IInventoryItem> items);
|
||||
|
||||
public void ClearItems();
|
||||
}
|
||||
@@ -25,7 +25,7 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
||||
|
||||
private int _currentSelection = 0;
|
||||
|
||||
public void PopulateItems(List<InventoryItem> items)
|
||||
public void PopulateItems(List<IInventoryItem> items)
|
||||
{
|
||||
foreach (var item in items)
|
||||
{
|
||||
@@ -130,7 +130,7 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
||||
UnequipItem(currentlySelectedItem);
|
||||
GameRepo.OnAccessoryEquipped(null);
|
||||
}
|
||||
else
|
||||
else if (currentlySelectedItem.InventoryItem is IEquippable)
|
||||
EquipItem(currentlySelectedItem);
|
||||
}
|
||||
|
||||
@@ -180,13 +180,13 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
||||
|
||||
public partial class ItemLabel : Label
|
||||
{
|
||||
public ItemLabel(InventoryItem inventoryItem)
|
||||
public ItemLabel(IInventoryItem inventoryItem)
|
||||
{
|
||||
InventoryItem = inventoryItem;
|
||||
LabelSettings = UnequippedItemFont;
|
||||
}
|
||||
|
||||
public InventoryItem InventoryItem { get; set; } = default!;
|
||||
public IInventoryItem InventoryItem { get; set; } = default!;
|
||||
|
||||
private static LabelSettings UnequippedItemFont => GD.Load<LabelSettings>("res://src/inventory_menu/InventoryLabelSettings.tres");
|
||||
private static LabelSettings EquippedItemFont => GD.Load<LabelSettings>("res://src/inventory_menu/EquippedInventoryLabelSettings.tres");
|
||||
|
||||
Reference in New Issue
Block a user