mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-27 23:25:55 +03:00
Added missing methods to UgcItem and UgcQuery
Added Steamworks.Ugc.Query.WhereSearchText Added Steamworks.Ugc.Item.VotesUp Added Steamworks.Ugc.Item.VotesDown Added Steamworks.Ugc.Item.Subscribe Added Steamworks.Ugc.Item.Unsubscribe
This commit is contained in:
parent
fd50e3ba71
commit
c4eff7f61a
@ -93,6 +93,16 @@ public Item( PublishedFileId id ) : this()
|
||||
/// </summary>
|
||||
public bool IsAcceptedForUse => details.AcceptedForUse;
|
||||
|
||||
/// <summary>
|
||||
/// The number of upvotes of this item
|
||||
/// </summary>
|
||||
public uint VotesUp => details.VotesUp;
|
||||
|
||||
/// <summary>
|
||||
/// The number of downvotes of this item
|
||||
/// </summary>
|
||||
public uint VotesDown => details.VotesDown;
|
||||
|
||||
public bool IsInstalled => (State & ItemState.Installed) == ItemState.Installed;
|
||||
public bool IsDownloading => (State & ItemState.Downloading) == ItemState.Downloading;
|
||||
public bool IsDownloadPending => (State & ItemState.DownloadPending) == ItemState.DownloadPending;
|
||||
@ -156,6 +166,22 @@ public bool HasTag( string find )
|
||||
return Tags.Contains( find, StringComparer.OrdinalIgnoreCase );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows the user to subscribe to this item
|
||||
/// </summary>
|
||||
public async Task<bool> Subscribe ()
|
||||
{
|
||||
var result = await SteamUGC.Internal.SubscribeItem( _id );
|
||||
return result?.Result == Result.OK;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows the user to unsubscribe from this item
|
||||
/// </summary>
|
||||
public async Task<bool> Unsubscribe ()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows the user to rate a workshop item up or down.
|
||||
/// </summary>
|
||||
|
@ -14,6 +14,7 @@ public struct Query
|
||||
UGCQuery queryType;
|
||||
AppId consumerApp;
|
||||
AppId creatorApp;
|
||||
string searchText;
|
||||
|
||||
public Query( UgcType type ) : this()
|
||||
{
|
||||
@ -90,6 +91,8 @@ internal Query LimitUser( SteamId steamid )
|
||||
public Query SortByVoteScore() { userSort = UserUGCListSortOrder.VoteScoreDesc; return this; }
|
||||
public Query SortByModeration() { userSort = UserUGCListSortOrder.ForModeration; return this; }
|
||||
|
||||
public Query WhereSearchText(string searchText) { this.searchText = searchText; return this; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Files
|
||||
@ -227,6 +230,11 @@ void ApplyConstraints( UGCQueryHandle_t handle )
|
||||
{
|
||||
SteamUGC.Internal.SetRankedByTrendDays( handle, (uint)trendDays.Value );
|
||||
}
|
||||
|
||||
if ( !string.IsNullOrEmpty( searchText ) )
|
||||
{
|
||||
SteamUGC.Internal.SetSearchText( handle, searchText );
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
Loading…
Reference in New Issue
Block a user