Redesign and reimplement inventory menu
Add jewels but no implementation yet (needed redesign of inventory menu to function correctly)
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Collections;
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.Serialization;
|
||||
using Godot;
|
||||
using Zennysoft.Game.Abstractions;
|
||||
using Zennysoft.Game.Implementation;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
@@ -17,6 +18,9 @@ public partial class ThrowableItem : InventoryItem, IStackable
|
||||
public override void _Ready()
|
||||
{
|
||||
_sprite.Texture = Stats.Texture;
|
||||
var rng = new RandomNumberGenerator();
|
||||
rng.Randomize();
|
||||
Count = new AutoProp<int>(rng.RandiRange(Stats.MinimumCount, Stats.MaximumCount));
|
||||
}
|
||||
|
||||
public override string ItemName => Stats.Name;
|
||||
@@ -45,7 +49,7 @@ public partial class ThrowableItem : InventoryItem, IStackable
|
||||
public void SetDescription(string description) => Stats.Description = description;
|
||||
|
||||
[Save("throwable_item_count")]
|
||||
public int Count { get; private set; } = 1;
|
||||
public AutoProp<int> Count { get; private set; }
|
||||
|
||||
[Export]
|
||||
[Save("throwable_item_stats")]
|
||||
@@ -53,5 +57,5 @@ public partial class ThrowableItem : InventoryItem, IStackable
|
||||
|
||||
public override Texture2D GetTexture() => Stats.Texture;
|
||||
|
||||
public void SetCount(int count) => Count = count;
|
||||
public void SetCount(int count) => Count.OnNext(count);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user