From 2a55d7a8e8ea0c18bd3fd840d5c45b048ea285f2 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Mon, 6 May 2019 15:45:25 +0100 Subject: [PATCH] Added Ugc.Item.Directory --- Facepunch.Steamworks/Structs/UgcItem.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Facepunch.Steamworks/Structs/UgcItem.cs b/Facepunch.Steamworks/Structs/UgcItem.cs index 857eb33..63d1715 100644 --- a/Facepunch.Steamworks/Structs/UgcItem.cs +++ b/Facepunch.Steamworks/Structs/UgcItem.cs @@ -28,11 +28,25 @@ namespace Steamworks.Ugc public string[] Tags { get; internal set; } public bool IsInstalled => (State & ItemState.Installed) == ItemState.Installed; - public bool IsDownloading => (State & ItemState.Downloading) == ItemState.Downloading; - public bool IsDownloadPending => (State & ItemState.DownloadPending) == ItemState.DownloadPending; + public bool IsDownloading => (State & ItemState.Downloading) == ItemState.Downloading; + public bool IsDownloadPending => (State & ItemState.DownloadPending) == ItemState.DownloadPending; public bool IsSubscribed => (State & ItemState.Subscribed) == ItemState.Subscribed; public bool NeedsUpdate => (State & ItemState.NeedsUpdate) == ItemState.NeedsUpdate; + public string Directory + { + get + { + ulong size = 0; + uint ts = 0; + var sb = Helpers.TakeStringBuilder(); + if ( !SteamUGC.Internal.GetItemInstallInfo( Id, ref size, sb, (uint)sb.Capacity, ref ts ) ) + return null; + + return sb.ToString(); + } + } + public bool Download( bool highPriority = false ) { return SteamUGC.Internal.DownloadItem( Id, highPriority );