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;
}
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>
/// Attaches a piece of user generated content the user's entry on a leaderboard
/// </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;
return r.Value.Result;
@ -157,4 +157,4 @@ internal static async Task WaitForUserNames( LeaderboardEntry[] entries)
}
#endregion
}
}
}

View File

@ -8,7 +8,7 @@ public struct LeaderboardEntry
public int GlobalRank;
public int Score;
public int[] Details;
// UGCHandle_t m_hUGC
public PublishedFileId? Ugc;
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 ),
GlobalRank = e.GlobalRank,
Score = e.Score,
Details = null
Details = null,
Ugc = e.UGC == 0 ? null : (PublishedFileId?) e.UGC
};
if ( e.CDetails > 0 )
@ -28,4 +29,4 @@ internal static LeaderboardEntry From( LeaderboardEntry_t e, int[] detailsBuffer
return r;
}
}
}
}

View File

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