Set equipment stats in item slot
This commit is contained in:
@@ -52,6 +52,10 @@ public partial class ItemSlot : Control, IItemSlot
|
|||||||
|
|
||||||
if (item is IStackable stackable)
|
if (item is IStackable stackable)
|
||||||
SetItemCount(stackable.Count.Value);
|
SetItemCount(stackable.Count.Value);
|
||||||
|
else if (item is IWeapon weapon)
|
||||||
|
SetEquipmentStat($"ATK {weapon.BonusAttack:D2}");
|
||||||
|
else if (item is IArmor armor)
|
||||||
|
SetEquipmentStat($"DEF {armor.BonusDefense:D2}");
|
||||||
|
|
||||||
if (item is IEquipableItem equipableItem)
|
if (item is IEquipableItem equipableItem)
|
||||||
{
|
{
|
||||||
@@ -95,6 +99,8 @@ public partial class ItemSlot : Control, IItemSlot
|
|||||||
|
|
||||||
public void SetItemCount(int count) => ItemCountLabel.Text = count > 0 ? $"x{count:D2}" : string.Empty;
|
public void SetItemCount(int count) => ItemCountLabel.Text = count > 0 ? $"x{count:D2}" : string.Empty;
|
||||||
|
|
||||||
|
public void SetEquipmentStat(string str) => ItemCountLabel.Text = str;
|
||||||
|
|
||||||
public void FocusItem()
|
public void FocusItem()
|
||||||
{
|
{
|
||||||
ItemName.GrabFocus();
|
ItemName.GrabFocus();
|
||||||
|
|||||||
Reference in New Issue
Block a user