Added missing methods needed by Chippy

This commit is contained in:
James King 2022-03-16 21:23:18 +01:00
parent 5cb1496e80
commit 42762eabbd
4 changed files with 17 additions and 6 deletions

View File

@ -200,5 +200,13 @@ public static bool ShowWorkshopEula()
return status?.Accepted; return status?.Accepted;
} }
public static PublishedFileId[] GetSubscribedItemIds()
{
var count = Internal.GetNumSubscribedItems();
var ids = new PublishedFileId[count];
Internal.GetSubscribedItems(ids, count);
return ids;
}
} }
} }

View File

@ -51,9 +51,9 @@ public struct Leaderboard
/// <summary> /// <summary>
/// Attaches a piece of user generated content the user's entry on a leaderboard /// Attaches a piece of user generated content the user's entry on a leaderboard
/// </summary> /// </summary>
public async Task<Result> AttachUgc( Ugc file ) public async Task<Result> AttachUgc( PublishedFileId file )
{ {
var r = await SteamUserStats.Internal.AttachLeaderboardUGC( Id, file.Handle ); var r = await SteamUserStats.Internal.AttachLeaderboardUGC( Id, file.Value );
if ( !r.HasValue ) return Result.Fail; if ( !r.HasValue ) return Result.Fail;
return r.Value.Result; return r.Value.Result;

View File

@ -8,7 +8,7 @@ public struct LeaderboardEntry
public int GlobalRank; public int GlobalRank;
public int Score; public int Score;
public int[] Details; public int[] Details;
// UGCHandle_t m_hUGC public PublishedFileId? Ugc;
internal static LeaderboardEntry From( LeaderboardEntry_t e, int[] detailsBuffer ) internal static LeaderboardEntry From( LeaderboardEntry_t e, int[] detailsBuffer )
{ {
@ -17,7 +17,8 @@ internal static LeaderboardEntry From( LeaderboardEntry_t e, int[] detailsBuffer
User = new Friend( e.SteamIDUser ), User = new Friend( e.SteamIDUser ),
GlobalRank = e.GlobalRank, GlobalRank = e.GlobalRank,
Score = e.Score, Score = e.Score,
Details = null Details = null,
Ugc = e.UGC == 0 ? null : (PublishedFileId?) e.UGC
}; };
if ( e.CDetails > 0 ) if ( e.CDetails > 0 )

View File

@ -124,6 +124,8 @@ public Item( PublishedFileId id ) : this()
public bool IsSubscribed => (State & ItemState.Subscribed) == ItemState.Subscribed; public bool IsSubscribed => (State & ItemState.Subscribed) == ItemState.Subscribed;
public bool NeedsUpdate => (State & ItemState.NeedsUpdate) == ItemState.NeedsUpdate; public bool NeedsUpdate => (State & ItemState.NeedsUpdate) == ItemState.NeedsUpdate;
public bool IsGameManagedItem => details.FileType == WorkshopFileType.GameManagedItem;
public string Directory public string Directory
{ {
get get