mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-13 15:18:07 +03:00
Ugc item key value tags
(cherry picked from commit a5386b358fec87911d2c4cd221d53b90f470bcf4)
This commit is contained in:
parent
9b487aae0e
commit
392b57e18d
@ -39,6 +39,11 @@ namespace Steamworks.Ugc
|
||||
/// </summary>
|
||||
public string[] Tags { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// A dictionary of key value tags for this item, only available from queries WithKeyValueTags(true)
|
||||
/// </summary>
|
||||
public Dictionary<string,string> KeyValueTags { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// App Id of the app that created this item
|
||||
/// </summary>
|
||||
|
@ -149,6 +149,7 @@ namespace Steamworks.Ugc
|
||||
ResultCount = (int) result.Value.NumResultsReturned,
|
||||
TotalCount = (int)result.Value.TotalMatchingResults,
|
||||
CachedData = result.Value.CachedData
|
||||
ReturnsKeyValueTags = WantsReturnKeyValueTags ?? false,
|
||||
};
|
||||
}
|
||||
|
||||
@ -241,7 +242,9 @@ namespace Steamworks.Ugc
|
||||
bool? WantsReturnOnlyIDs;
|
||||
public QueryType WithOnlyIDs(bool b) { WantsReturnOnlyIDs = b; return this; }
|
||||
bool? WantsReturnKeyValueTags;
|
||||
public QueryType WithKeyValueTag(bool b) { WantsReturnKeyValueTags = b; return this; }
|
||||
public QueryType WithKeyValueTags(bool b) { WantsReturnKeyValueTags = b; return this; }
|
||||
[Obsolete( "Renamed to WithKeyValueTags" )]
|
||||
public QueryType WithKeyValueTag(bool b) { WantsReturnKeyValueTags = b; return this; }
|
||||
bool? WantsReturnLongDescription;
|
||||
public QueryType WithLongDescription(bool b) { WantsReturnLongDescription = b; return this; }
|
||||
bool? WantsReturnMetadata;
|
||||
|
@ -12,6 +12,7 @@ namespace Steamworks.Ugc
|
||||
|
||||
public bool CachedData;
|
||||
|
||||
internal bool ReturnsKeyValueTags;
|
||||
public IEnumerable<Item> Entries
|
||||
{
|
||||
get
|
||||
@ -43,9 +44,21 @@ namespace Steamworks.Ugc
|
||||
item.PreviewImageUrl = preview;
|
||||
}
|
||||
|
||||
if ( ReturnsKeyValueTags )
|
||||
{
|
||||
var keyValueTagsCount = SteamUGC.Internal.GetQueryUGCNumKeyValueTags( Handle, i );
|
||||
|
||||
item.KeyValueTags = new Dictionary<string, string>( (int)keyValueTagsCount );
|
||||
for ( uint j = 0; j < keyValueTagsCount; j++ )
|
||||
{
|
||||
string key, value;
|
||||
if ( SteamUGC.Internal.GetQueryUGCKeyValueTag( Handle, i, j, out key, out value ) )
|
||||
item.KeyValueTags[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO GetQueryUGCAdditionalPreview
|
||||
// TODO GetQueryUGCChildren
|
||||
// TODO GetQueryUGCKeyValueTag
|
||||
// TODO GetQueryUGCMetadata
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user