From 49df734392c061d0e393122cc6065cb1d80a2477 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Fri, 14 Oct 2016 13:28:16 +0100 Subject: [PATCH] Workshop item preview image --- Facepunch.Steamworks/Interfaces/Workshop.Editor.cs | 5 ++++- Facepunch.Steamworks/Interfaces/Workshop.Query.cs | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Facepunch.Steamworks/Interfaces/Workshop.Editor.cs b/Facepunch.Steamworks/Interfaces/Workshop.Editor.cs index 1d51786..f1b0284 100644 --- a/Facepunch.Steamworks/Interfaces/Workshop.Editor.cs +++ b/Facepunch.Steamworks/Interfaces/Workshop.Editor.cs @@ -17,6 +17,7 @@ public class Editor public string Title { get; set; } = null; public string Description { get; set; } = null; public string Folder { get; set; } = null; + public string PreviewImage { get; set; } = null; public List Tags { get; set; } = new List(); public bool Publishing { get; internal set; } public ItemType? Type { get; set; } @@ -148,10 +149,12 @@ private void PublishChanges() if ( Visibility.HasValue ) workshop.ugc.SetItemVisibility( UpdateId, (uint)Visibility.Value ); + if ( PreviewImage != null ) + workshop.ugc.SetItemPreview( UpdateId, PreviewImage ); // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size + /* workshop.ugc.SetItemUpdateLanguage( UpdateId, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set workshop.ugc.SetItemMetadata( UpdateId, const char *pchMetaData ) = 0; // change the metadata of an UGC item (max = k_cchDeveloperMetadataMax) - workshop.ugc.SetItemPreview( UpdateId, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size workshop.ugc.RemoveItemKeyValueTags( UpdateId, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key workshop.ugc.AddItemKeyValueTag( UpdateId, const char *pchKey, const char *pchValue ) = 0; // add new key-value tags for the item. Note that there can be multiple values for a tag. workshop.ugc.AddItemPreviewFile( UpdateId, const char *pszPreviewFile, EItemPreviewType type ) = 0; // add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size diff --git a/Facepunch.Steamworks/Interfaces/Workshop.Query.cs b/Facepunch.Steamworks/Interfaces/Workshop.Query.cs index ae0c212..10bc094 100644 --- a/Facepunch.Steamworks/Interfaces/Workshop.Query.cs +++ b/Facepunch.Steamworks/Interfaces/Workshop.Query.cs @@ -46,6 +46,9 @@ public class Query : IDisposable /// Page starts at 1 !! /// public int Page { get; set; } = 1; + + public int PerPage { get; set; } = 50; + internal Workshop workshop; public unsafe void Run()