Unstable 1.1.14.0
This commit is contained in:
@@ -10,17 +10,20 @@ using Steamworks.Data;
|
||||
namespace Steamworks
|
||||
{
|
||||
/// <summary>
|
||||
/// Undocumented Parental Settings
|
||||
/// Class for utilizing the Steam Inventory API.
|
||||
/// </summary>
|
||||
public class SteamInventory : SteamSharedClass<SteamInventory>
|
||||
{
|
||||
internal static ISteamInventory? Internal => Interface as ISteamInventory;
|
||||
|
||||
internal override void InitializeInterface( bool server )
|
||||
internal override bool InitializeInterface( bool server )
|
||||
{
|
||||
SetInterface( server, new ISteamInventory( server ) );
|
||||
if ( Interface is null || Interface.Self == IntPtr.Zero ) return false;
|
||||
|
||||
InstallEvents( server );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
internal static void InstallEvents( bool server )
|
||||
@@ -65,7 +68,7 @@ namespace Steamworks
|
||||
/// <summary>
|
||||
/// Call this if you're going to want to access definition information. You should be able to get
|
||||
/// away with calling this once at the start if your game, assuming your items don't change all the time.
|
||||
/// This will trigger OnDefinitionsUpdated at which point Definitions should be set.
|
||||
/// This will trigger <see cref="OnDefinitionsUpdated"/> at which point Definitions should be set.
|
||||
/// </summary>
|
||||
public static void LoadItemDefinitions()
|
||||
{
|
||||
@@ -83,7 +86,7 @@ namespace Steamworks
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Will call LoadItemDefinitions and wait until Definitions is not null
|
||||
/// Will call <see cref="LoadItemDefinitions"/> and wait until Definitions is not null
|
||||
/// </summary>
|
||||
public static async Task<bool> WaitForDefinitions( float timeoutSeconds = 30 )
|
||||
{
|
||||
@@ -302,7 +305,7 @@ namespace Steamworks
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Grant all promotional items the user is eligible for
|
||||
/// Grant all promotional items the user is eligible for.
|
||||
/// </summary>
|
||||
public static async Task<InventoryResult?> GrantPromoItemsAsync()
|
||||
{
|
||||
@@ -351,8 +354,9 @@ namespace Steamworks
|
||||
{
|
||||
if (Internal is null) { return null; }
|
||||
|
||||
var item_i = items.Select( x => x._id ).ToArray();
|
||||
var item_q = items.Select( x => (uint)1 ).ToArray();
|
||||
var d = items.GroupBy( x => x._id ).ToDictionary( x => x.Key, x => (uint) x.Count() );
|
||||
var item_i = d.Keys.ToArray();
|
||||
var item_q = d.Values.ToArray();
|
||||
|
||||
var r = await Internal.StartPurchase( item_i, item_q, (uint)item_i.Length );
|
||||
if ( !r.HasValue ) return null;
|
||||
@@ -366,4 +370,4 @@ namespace Steamworks
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user