diff --git a/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs b/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs index 22b1c29..b7249bb 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs @@ -4,6 +4,7 @@ using System.Net; using System.Runtime.InteropServices; using System.Text; +using SteamNative; namespace Facepunch.Steamworks { @@ -191,9 +192,16 @@ internal void SetupCommonProperties() /// public void TriggerItemDrop() { - SteamNative.SteamInventoryResult_t result = 0; - inventory.inventory.TriggerItemDrop( ref result, Id ); - inventory.inventory.DestroyResult( result ); + inventory.TriggerItemDrop( Id ); + } + + /// + /// Trigger a promo item drop. You can call this at startup, it won't + /// give users multiple promo drops. + /// + public void TriggerPromoDrop() + { + inventory.TriggerPromoDrop( Id ); } internal void Link( Definition[] definitions ) @@ -236,6 +244,38 @@ internal void UpdatePrice() } } + /// + /// Trigger a promo item drop. You can call this at startup, it won't + /// give users multiple promo drops. + /// + public void TriggerPromoDrop( int definitionId ) + { + SteamNative.SteamInventoryResult_t result = 0; + inventory.AddPromoItem( ref result, definitionId ); + inventory.DestroyResult( result ); + } + + /// + /// Trigger an item drop for this user. This is for timed drops. For promo + /// drops use TriggerPromoDrop. + /// + public void TriggerItemDrop( int definitionId ) + { + SteamNative.SteamInventoryResult_t result = 0; + inventory.TriggerItemDrop( ref result, definitionId ); + inventory.DestroyResult( result ); + } + + /// + /// Grant all promotional items the user is eligible for. + /// + public void GrantAllPromoItems() + { + SteamNative.SteamInventoryResult_t result = 0; + inventory.GrantPromoItems( ref result ); + inventory.DestroyResult( result ); + } + /// /// Represents a crafting recepie which was defined using the exchange /// section in the item schema.