// SteamAPICall_t public CallbackHandle SubmitItemUpdate(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchChangeNote /*const char **/, Action <SubmitItemUpdateResult_t, bool> CallbackFunction = null /*Action<SubmitItemUpdateResult_t, bool>*/) { SteamAPICall_t callback = 0; callback = platform.ISteamUGC_SubmitItemUpdate(handle.Value, pchChangeNote); if (CallbackFunction == null) { return(null); } return(SubmitItemUpdateResult_t.CallResult(steamworks, callback, CallbackFunction)); }
private void PublishChanges() { UpdateHandle = workshop.ugc.StartItemUpdate(workshop.steamworks.AppId, Id); if (Title != null) { workshop.ugc.SetItemTitle(UpdateHandle, Title); } if (Description != null) { workshop.ugc.SetItemDescription(UpdateHandle, Description); } if (Folder != null) { workshop.ugc.SetItemContent(UpdateHandle, Folder); } if (Tags != null && Tags.Count > 0) { workshop.ugc.SetItemTags(UpdateHandle, Tags.ToArray()); } if (Visibility.HasValue) { workshop.ugc.SetItemVisibility(UpdateHandle, (SteamNative.RemoteStoragePublishedFileVisibility)(uint) Visibility.Value); } if (PreviewImage != null) { workshop.ugc.SetItemPreview(UpdateHandle, 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.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 * workshop.ugc.AddItemPreviewVideo( UpdateId, const char *pszVideoID ) = 0; // add preview video for this item * workshop.ugc.UpdateItemPreviewFile( UpdateId, uint32 index, const char *pszPreviewFile ) = 0; // updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size * workshop.ugc.UpdateItemPreviewVideo( UpdateId, uint32 index, const char *pszVideoID ) = 0; // updates an existing preview video for this item * workshop.ugc.RemoveItemPreview( UpdateId, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted) */ SubmitItemUpdate = workshop.ugc.SubmitItemUpdate(UpdateHandle, ChangeNote, OnChangesSubmitted); }
private void OnChangesSubmittedInternal(SteamNative.SubmitItemUpdateResult_t obj, bool Failed) { if (Failed) { throw new System.Exception("CreateItemResult_t Failed"); } UpdateHandle = 0; SubmitItemUpdate = null; NeedToAgreeToWorkshopLegal = obj.UserNeedsToAcceptWorkshopLegalAgreement; Publishing = false; Error = obj.Result != SteamNative.Result.OK ? $"Error publishing changes: {obj.Result} ({NeedToAgreeToWorkshopLegal})" : null; OnChangesSubmitted?.Invoke((Result)obj.Result); }
private void OnChangesSubmitted(SteamNative.SubmitItemUpdateResult_t obj, bool Failed) { if (Failed) { throw new System.Exception("CreateItemResult_t Failed"); } UpdateHandle = 0; SubmitItemUpdate = null; NeedToAgreeToWorkshopLegal = obj.UserNeedsToAcceptWorkshopLegalAgreement; Publishing = false; if (obj.Result == SteamNative.Result.OK) { return; } Error = "Error publishing changes: " + obj.Result.ToString() + " (" + NeedToAgreeToWorkshopLegal + ")"; }
// bool public bool SetItemPreview(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pszPreviewFile /*const char **/) { return(platform.ISteamUGC_SetItemPreview(handle.Value, pszPreviewFile)); }
// bool public bool AddItemPreviewVideo(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pszVideoID /*const char **/) { return(platform.ISteamUGC_AddItemPreviewVideo(handle.Value, pszVideoID)); }
private void PublishChanges() { if (WorkshopUploadAppId == 0) { throw new Exception("WorkshopUploadAppId should not be 0"); } UpdateHandle = workshop.ugc.StartItemUpdate(WorkshopUploadAppId, Id); if (Title != null) { workshop.ugc.SetItemTitle(UpdateHandle, Title); } if (Description != null) { workshop.ugc.SetItemDescription(UpdateHandle, Description); } if (Folder != null) { var info = new System.IO.DirectoryInfo(Folder); if (!info.Exists) { throw new System.Exception($"Folder doesn't exist ({Folder})"); } workshop.ugc.SetItemContent(UpdateHandle, Folder); } if (Tags != null && Tags.Count > 0) { workshop.ugc.SetItemTags(UpdateHandle, Tags.ToArray()); } if (Visibility.HasValue) { workshop.ugc.SetItemVisibility(UpdateHandle, (SteamNative.RemoteStoragePublishedFileVisibility)(uint) Visibility.Value); } if (PreviewImage != null) { var info = new System.IO.FileInfo(PreviewImage); if (!info.Exists) { throw new System.Exception($"PreviewImage doesn't exist ({PreviewImage})"); } if (info.Length >= 1024 * 1024) { throw new System.Exception($"PreviewImage should be under 1MB ({info.Length})"); } workshop.ugc.SetItemPreview(UpdateHandle, PreviewImage); } if (MetaData != null) { workshop.ugc.SetItemMetadata(UpdateHandle, MetaData); } if (KeyValues != null) { foreach (var key in KeyValues) { foreach (var value in key.Value) { workshop.ugc.AddItemKeyValueTag(UpdateHandle, key.Key, value); } } } /* * workshop.ugc.SetItemUpdateLanguage( UpdateId, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set * workshop.ugc.RemoveItemKeyValueTags( UpdateId, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key * 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 * workshop.ugc.AddItemPreviewVideo( UpdateId, const char *pszVideoID ) = 0; // add preview video for this item * workshop.ugc.UpdateItemPreviewFile( UpdateId, uint32 index, const char *pszPreviewFile ) = 0; // updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size * workshop.ugc.UpdateItemPreviewVideo( UpdateId, uint32 index, const char *pszVideoID ) = 0; // updates an existing preview video for this item * workshop.ugc.RemoveItemPreview( UpdateId, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted) */ SubmitItemUpdate = workshop.ugc.SubmitItemUpdate(UpdateHandle, ChangeNote, OnChangesSubmittedInternal); }
// bool public bool UpdateItemPreviewVideo(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, uint index /*uint32*/, string pszVideoID /*const char **/) { return(platform.ISteamUGC_UpdateItemPreviewVideo(handle.Value, index, pszVideoID)); }
// bool public bool AddItemPreviewFile(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pszPreviewFile /*const char **/, ItemPreviewType type /*EItemPreviewType*/) { return(platform.ISteamUGC_AddItemPreviewFile(handle.Value, pszPreviewFile, type)); }
// bool public bool UpdateItemPreviewFile(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, uint index /*uint32*/, string pszPreviewFile /*const char **/) { return(platform.ISteamUGC_UpdateItemPreviewFile(handle.Value, index, Utility.GetUtf8Bytes(pszPreviewFile))); }
// bool public bool AddItemKeyValueTag(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchKey /*const char **/, string pchValue /*const char **/) { return(platform.ISteamUGC_AddItemKeyValueTag(handle.Value, pchKey, pchValue)); }
// bool public bool SetItemTitle(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchTitle /*const char **/) { return(platform.ISteamUGC_SetItemTitle(handle.Value, Utility.GetUtf8Bytes(pchTitle))); }
// bool public bool SetItemVisibility(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, RemoteStoragePublishedFileVisibility eVisibility /*ERemoteStoragePublishedFileVisibility*/) { return(platform.ISteamUGC_SetItemVisibility(handle.Value, eVisibility)); }
// bool public bool SetItemMetadata(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchMetaData /*const char **/) { return(platform.ISteamUGC_SetItemMetadata(handle.Value, pchMetaData)); }
private void PublishChanges() { UpdateHandle = workshop.ugc.StartItemUpdate(WorkshopUploadAppId, Id); if (Title != null) { workshop.ugc.SetItemTitle(UpdateHandle, Title); } if (Description != null) { workshop.ugc.SetItemDescription(UpdateHandle, Description); } if (Folder != null) { var info = new System.IO.DirectoryInfo(Folder); if (!info.Exists) { throw new System.Exception($"Folder doesn't exist ({Folder})"); } workshop.ugc.SetItemContent(UpdateHandle, Folder); } if (Tags != null && Tags.Count > 0) { workshop.ugc.SetItemTags(UpdateHandle, Tags.ToArray()); } if (Visibility.HasValue) { workshop.ugc.SetItemVisibility(UpdateHandle, (SteamNative.RemoteStoragePublishedFileVisibility)(uint) Visibility.Value); } for (int i = 0; i < Images.Count; i++) { workshop.ugc.AddItemPreviewFile(UpdateHandle, Images[i], ItemPreviewType.Image); } for (int i = 0; i < Videos.Count; i++) { workshop.ugc.AddItemPreviewVideo(UpdateHandle, Videos[i]); } if (PreviewImage != null) { var info = new System.IO.FileInfo(PreviewImage); if (!info.Exists) { throw new System.Exception($"PreviewImage doesn't exist ({PreviewImage})"); } if (info.Length >= 1024 * 1024) { throw new System.Exception($"PreviewImage should be under 1MB ({info.Length})"); } workshop.ugc.SetItemPreview(UpdateHandle, PreviewImage); } /* * 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.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 * workshop.ugc.AddItemPreviewVideo( UpdateId, const char *pszVideoID ) = 0; // add preview video for this item * workshop.ugc.UpdateItemPreviewFile( UpdateId, uint32 index, const char *pszPreviewFile ) = 0; // updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size * workshop.ugc.UpdateItemPreviewVideo( UpdateId, uint32 index, const char *pszVideoID ) = 0; // updates an existing preview video for this item * workshop.ugc.RemoveItemPreview( UpdateId, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted) */ SubmitItemUpdate = workshop.ugc.SubmitItemUpdate(UpdateHandle, ChangeNote, OnChangesSubmitted); }
// bool public bool SetItemDescription(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchDescription /*const char **/) { return(platform.ISteamUGC_SetItemDescription(handle.Value, pchDescription)); }
// bool public bool SetItemContent(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pszContentFolder /*const char **/) { return(platform.ISteamUGC_SetItemContent(handle.Value, pszContentFolder)); }
// bool public bool RemoveItemPreview(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, uint index /*uint32*/) { return(platform.ISteamUGC_RemoveItemPreview(handle.Value, index)); }
// bool public bool RemoveItemKeyValueTags(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchKey /*const char **/) { return(platform.ISteamUGC_RemoveItemKeyValueTags(handle.Value, pchKey)); }
// ItemUpdateStatus public ItemUpdateStatus GetItemUpdateProgress(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, out ulong punBytesProcessed /*uint64 **/, out ulong punBytesTotal /*uint64 **/) { return(platform.ISteamUGC_GetItemUpdateProgress(handle.Value, out punBytesProcessed, out punBytesTotal)); }
// bool public bool SetItemUpdateLanguage(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchLanguage /*const char **/) { return(platform.ISteamUGC_SetItemUpdateLanguage(handle.Value, pchLanguage)); }
// bool public bool AddItemKeyValueTag(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchKey /*const char **/, string pchValue /*const char **/) { return(platform.ISteamUGC_AddItemKeyValueTag(handle.Value, Utility.GetUtf8Bytes(pchKey), Utility.GetUtf8Bytes(pchValue))); }