mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-27 22:18:11 +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>
|
/// </summary>
|
||||||
public string[] Tags { get; internal set; }
|
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>
|
/// <summary>
|
||||||
/// App Id of the app that created this item
|
/// App Id of the app that created this item
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -149,6 +149,7 @@ namespace Steamworks.Ugc
|
|||||||
ResultCount = (int) result.Value.NumResultsReturned,
|
ResultCount = (int) result.Value.NumResultsReturned,
|
||||||
TotalCount = (int)result.Value.TotalMatchingResults,
|
TotalCount = (int)result.Value.TotalMatchingResults,
|
||||||
CachedData = result.Value.CachedData
|
CachedData = result.Value.CachedData
|
||||||
|
ReturnsKeyValueTags = WantsReturnKeyValueTags ?? false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,7 +242,9 @@ namespace Steamworks.Ugc
|
|||||||
bool? WantsReturnOnlyIDs;
|
bool? WantsReturnOnlyIDs;
|
||||||
public QueryType WithOnlyIDs(bool b) { WantsReturnOnlyIDs = b; return this; }
|
public QueryType WithOnlyIDs(bool b) { WantsReturnOnlyIDs = b; return this; }
|
||||||
bool? WantsReturnKeyValueTags;
|
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;
|
bool? WantsReturnLongDescription;
|
||||||
public QueryType WithLongDescription(bool b) { WantsReturnLongDescription = b; return this; }
|
public QueryType WithLongDescription(bool b) { WantsReturnLongDescription = b; return this; }
|
||||||
bool? WantsReturnMetadata;
|
bool? WantsReturnMetadata;
|
||||||
|
@ -12,6 +12,7 @@ namespace Steamworks.Ugc
|
|||||||
|
|
||||||
public bool CachedData;
|
public bool CachedData;
|
||||||
|
|
||||||
|
internal bool ReturnsKeyValueTags;
|
||||||
public IEnumerable<Item> Entries
|
public IEnumerable<Item> Entries
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -43,9 +44,21 @@ namespace Steamworks.Ugc
|
|||||||
item.PreviewImageUrl = preview;
|
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 GetQueryUGCAdditionalPreview
|
||||||
// TODO GetQueryUGCChildren
|
// TODO GetQueryUGCChildren
|
||||||
// TODO GetQueryUGCKeyValueTag
|
|
||||||
// TODO GetQueryUGCMetadata
|
// TODO GetQueryUGCMetadata
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user