mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-16 00:28:22 +03:00
Merge pull request #276 from JannikNickel/master
Added missing functionality to UgcQuery and UgcItem
This commit is contained in:
commit
08405459bd
@ -93,6 +93,16 @@ namespace Steamworks.Ugc
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsAcceptedForUse => details.AcceptedForUse;
|
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 IsInstalled => (State & ItemState.Installed) == ItemState.Installed;
|
||||||
public bool IsDownloading => (State & ItemState.Downloading) == ItemState.Downloading;
|
public bool IsDownloading => (State & ItemState.Downloading) == ItemState.Downloading;
|
||||||
public bool IsDownloadPending => (State & ItemState.DownloadPending) == ItemState.DownloadPending;
|
public bool IsDownloadPending => (State & ItemState.DownloadPending) == ItemState.DownloadPending;
|
||||||
@ -156,6 +166,24 @@ namespace Steamworks.Ugc
|
|||||||
return Tags.Contains( find, StringComparer.OrdinalIgnoreCase );
|
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 ()
|
||||||
|
{
|
||||||
|
var result = await SteamUGC.Internal.UnsubscribeItem( _id );
|
||||||
|
return result?.Result == Result.OK;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allows the user to rate a workshop item up or down.
|
/// Allows the user to rate a workshop item up or down.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -14,6 +14,7 @@ namespace Steamworks.Ugc
|
|||||||
UGCQuery queryType;
|
UGCQuery queryType;
|
||||||
AppId consumerApp;
|
AppId consumerApp;
|
||||||
AppId creatorApp;
|
AppId creatorApp;
|
||||||
|
string searchText;
|
||||||
|
|
||||||
public Query( UgcType type ) : this()
|
public Query( UgcType type ) : this()
|
||||||
{
|
{
|
||||||
@ -90,6 +91,8 @@ namespace Steamworks.Ugc
|
|||||||
public Query SortByVoteScore() { userSort = UserUGCListSortOrder.VoteScoreDesc; return this; }
|
public Query SortByVoteScore() { userSort = UserUGCListSortOrder.VoteScoreDesc; return this; }
|
||||||
public Query SortByModeration() { userSort = UserUGCListSortOrder.ForModeration; return this; }
|
public Query SortByModeration() { userSort = UserUGCListSortOrder.ForModeration; return this; }
|
||||||
|
|
||||||
|
public Query WhereSearchText(string searchText) { this.searchText = searchText; return this; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Files
|
#region Files
|
||||||
@ -227,6 +230,11 @@ namespace Steamworks.Ugc
|
|||||||
{
|
{
|
||||||
SteamUGC.Internal.SetRankedByTrendDays( handle, (uint)trendDays.Value );
|
SteamUGC.Internal.SetRankedByTrendDays( handle, (uint)trendDays.Value );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !string.IsNullOrEmpty( searchText ) )
|
||||||
|
{
|
||||||
|
SteamUGC.Internal.SetSearchText( handle, searchText );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
x
Reference in New Issue
Block a user