Updated from feedback given

This commit is contained in:
Matthew Oldfield 2017-07-10 19:15:36 +01:00
parent 2108dc3b76
commit 27f640fd5a
2 changed files with 11 additions and 16 deletions

View File

@ -123,25 +123,23 @@ public Item GetItem( ulong itemid )
return new Item( itemid, this ); return new Item( itemid, this );
} }
/// <summary>
/// The amount of item's the user is subscribed to for this App
/// </summary>
public uint GetAmountSubsribed()
{
return ugc.GetNumSubscribedItems();
}
/// <summary> /// <summary>
/// Creates a list of all item's that the user is currently subscribed /// Creates a list of all item's that the user is currently subscribed
/// to for this App. This does not query titles or descriptions but /// to for this App. This does not query titles or descriptions but
/// allows you to get the directories, state and ID of any subscribed Item. /// allows you to get the directories, state and ID of any subscribed Item.
/// This is mostly useful for getting all subscribed items install location. /// This is mostly useful for getting all subscribed items install location
/// on initial load to load all workshop content
/// </summary> /// </summary>
public Item[] GetSubscribedItems(uint amount) public unsafe Item[] GetSubscribedItems()
{ {
Item[] items; Item[] items;
uint subAmount;
var amount = ugc.GetNumSubscribedItems();
PublishedFileId_t[] vecSubscribedItems = new PublishedFileId_t[amount]; PublishedFileId_t[] vecSubscribedItems = new PublishedFileId_t[amount];
uint subAmount = ugc.GetSubscribedItems(vecSubscribedItems, amount); fixed (PublishedFileId_t* vecSubscribedItems_ptr = vecSubscribedItems)
{
subAmount = ugc.GetSubscribedItems(vecSubscribedItems_ptr, amount);
}
if (subAmount < amount) if (subAmount < amount)
items = new Item[subAmount]; items = new Item[subAmount];
else else

View File

@ -284,12 +284,9 @@ public bool GetQueryUGCStatistic( UGCQueryHandle_t handle /*UGCQueryHandle_t*/,
} }
// uint // uint
public uint GetSubscribedItems( PublishedFileId_t[] pvecPublishedFileID /*PublishedFileId_t **/, uint cMaxEntries /*uint32*/ ) public uint GetSubscribedItems( PublishedFileId_t* pvecPublishedFileID /*PublishedFileId_t **/, uint cMaxEntries /*uint32*/ )
{ {
fixed (PublishedFileId_t* pvecPublishedFileID_ptr = pvecPublishedFileID) return platform.ISteamUGC_GetSubscribedItems( (IntPtr) pvecPublishedFileID, cMaxEntries );
{
return platform.ISteamUGC_GetSubscribedItems((IntPtr)pvecPublishedFileID_ptr, cMaxEntries);
}
} }
// SteamAPICall_t // SteamAPICall_t