mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-13 15:18:07 +03:00
Merge branch 'k3-item-dependency' into k7-addit-prevs
This commit is contained in:
commit
11bc35f254
@ -108,6 +108,10 @@ namespace Steamworks.Ugc
|
|||||||
/// The number of downvotes of this item
|
/// The number of downvotes of this item
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint VotesDown => details.VotesDown;
|
public uint VotesDown => details.VotesDown;
|
||||||
|
/// <summary>
|
||||||
|
/// Dependencies/children of this item or collection, available only from WithDependencies(true) queries
|
||||||
|
/// </summary>
|
||||||
|
public PublishedFileId[] Children;
|
||||||
|
|
||||||
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;
|
||||||
@ -382,7 +386,19 @@ namespace Steamworks.Ugc
|
|||||||
{
|
{
|
||||||
return new Ugc.Editor( Id );
|
return new Ugc.Editor( Id );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<bool> AddDependency( PublishedFileId child )
|
||||||
|
{
|
||||||
|
var r = await SteamUGC.Internal.AddDependency( Id, child );
|
||||||
|
return r?.Result == Result.OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> RemoveDependency( PublishedFileId child )
|
||||||
|
{
|
||||||
|
var r = await SteamUGC.Internal.RemoveDependency( Id, child );
|
||||||
|
return r?.Result == Result.OK;
|
||||||
|
}
|
||||||
|
|
||||||
public Result Result => details.Result;
|
public Result Result => details.Result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -152,6 +152,7 @@ namespace Steamworks.Ugc
|
|||||||
ReturnsKeyValueTags = WantsReturnKeyValueTags ?? false,
|
ReturnsKeyValueTags = WantsReturnKeyValueTags ?? false,
|
||||||
ReturnsDefaultStats = WantsDefaultStats ?? true, //true by default
|
ReturnsDefaultStats = WantsDefaultStats ?? true, //true by default
|
||||||
ReturnsMetadata = WantsReturnMetadata ?? false,
|
ReturnsMetadata = WantsReturnMetadata ?? false,
|
||||||
|
ReturnsChildren = WantsReturnChildren ?? false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ namespace Steamworks.Ugc
|
|||||||
internal bool ReturnsKeyValueTags;
|
internal bool ReturnsKeyValueTags;
|
||||||
internal bool ReturnsDefaultStats;
|
internal bool ReturnsDefaultStats;
|
||||||
internal bool ReturnsMetadata;
|
internal bool ReturnsMetadata;
|
||||||
|
internal bool ReturnsChildren;
|
||||||
|
|
||||||
public IEnumerable<Item> Entries
|
public IEnumerable<Item> Entries
|
||||||
{
|
{
|
||||||
@ -73,8 +74,16 @@ namespace Steamworks.Ugc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint numChildren = item.details.NumChildren;
|
||||||
|
if ( ReturnsChildren && numChildren > 0 )
|
||||||
|
{
|
||||||
|
var children = new PublishedFileId[numChildren];
|
||||||
|
if ( SteamUGC.Internal.GetQueryUGCChildren( Handle, i, children, numChildren ) )
|
||||||
|
{
|
||||||
|
item.Children = children;
|
||||||
|
}
|
||||||
|
}
|
||||||
// TODO GetQueryUGCAdditionalPreview
|
// TODO GetQueryUGCAdditionalPreview
|
||||||
// TODO GetQueryUGCChildren
|
|
||||||
|
|
||||||
yield return item;
|
yield return item;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user