Inventory Events

Added an event system allowing the UI to subscribe to changes in entity cargo, hardpoints or on specific items
Fixed bugs in colony tab caused by recent refactoring
This commit is contained in:
hyperion51 2020-06-06 03:21:03 +01:00
commit 39ce6809c0
11 changed files with 370 additions and 249 deletions

View file

@ -55,9 +55,16 @@ public class SimpleCommodity : ItemInstance
}
[MessagePackObject, JsonObject(MemberSerialization.OptIn)]
public class Gear : CraftedItemInstance
public class Gear : CraftedItemInstance, IDynamicProperties
{
[JsonProperty("durability"), Key(7)] public float Durability;
public EquippableItemData ItemData => Context.GetData(this);
public event Action OnChanged;
public void Change()
{
OnChanged?.Invoke();
}
}