diff --git a/Facepunch.Steamworks.Test/Client/InventoryTest.cs b/Facepunch.Steamworks.Test/Client/InventoryTest.cs index 837b1b8..0886996 100644 --- a/Facepunch.Steamworks.Test/Client/InventoryTest.cs +++ b/Facepunch.Steamworks.Test/Client/InventoryTest.cs @@ -107,7 +107,7 @@ public void InventoryItemList() bool CallbackCalled = false; // OnUpdate hsould be called when we receive a list of our items - client.Inventory.OnUpdate = () => { CallbackCalled = true; }; + client.Inventory.OnUpdate += () => { CallbackCalled = true; }; // tell steam to download the items client.Inventory.Refresh(); diff --git a/Facepunch.Steamworks/Interfaces/Inventory.cs b/Facepunch.Steamworks/Interfaces/Inventory.cs index d3b34e5..a6d00bf 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.cs @@ -14,7 +14,7 @@ public partial class Inventory : IDisposable /// Called when the local client's items are first retrieved, and when they change. /// Obviously not called on the server. /// - public Action OnUpdate; + public event Action OnUpdate; /// /// A list of items owned by this user. You should call Refresh() before trying to access this, @@ -466,6 +466,7 @@ public void UpdatePrices() Definitions[i].UpdatePrice(); } + OnUpdate?.Invoke(); }); } } diff --git a/Facepunch.Steamworks/Utility.cs b/Facepunch.Steamworks/Utility.cs index cdf1e8a..7ddd9b3 100644 --- a/Facepunch.Steamworks/Utility.cs +++ b/Facepunch.Steamworks/Utility.cs @@ -60,9 +60,14 @@ public static uint FromDateTime( DateTime dt ) } - public static string FormatPrice(string currency, ulong price) + internal static string FormatPrice(string currency, ulong price) { - var decimaled = (price / 100.0).ToString("0.00"); + return FormatPrice(currency, price / 100.0); + } + + public static string FormatPrice(string currency, double price) + { + var decimaled = price.ToString("0.00"); switch (currency) {