private static string TranslateStatus(EItemUpdateStatus s) { switch (s) { case EItemUpdateStatus.k_EItemUpdateStatusInvalid: return("..."); case EItemUpdateStatus.k_EItemUpdateStatusCommittingChanges: return("Committing changes..."); case EItemUpdateStatus.k_EItemUpdateStatusPreparingConfig: return("Preparing config..."); case EItemUpdateStatus.k_EItemUpdateStatusPreparingContent: return("Preparing content..."); case EItemUpdateStatus.k_EItemUpdateStatusUploadingContent: return("Uploading content..."); case EItemUpdateStatus.k_EItemUpdateStatusUploadingPreviewFile: return("Uploading preview file..."); default: return(s.ToString()); } }
public bool IsPreparingContentUpload() { ulong processed, total; EItemUpdateStatus status = SteamUGC.GetItemUpdateProgress(this.lastUpdateHandle, out processed, out total); return(status == EItemUpdateStatus.k_EItemUpdateStatusPreparingContent || status == EItemUpdateStatus.k_EItemUpdateStatusPreparingConfig); }
/// <summary> /// Gets the upload progress of a file. /// </summary> public EItemUpdateStatus getProgress(UGCUpdateHandle_t m_UGCUpdateHandle, out ulong BytesProcessed, out ulong BytesTotal) { EItemUpdateStatus ret = SteamUGC.GetItemUpdateProgress(m_UGCUpdateHandle, out BytesProcessed, out BytesTotal); Console.WriteLine("GetItemUpdateProgress (" + m_UGCUpdateHandle + "): " + ret + " -- " + BytesProcessed + " -- " + BytesTotal); return(ret); }
private void GetItemUpdateProgress() { EItemUpdateStatus updateStatus = SteamUGC.GetItemUpdateProgress(updateHandle, out ulong punBytesProcessed, out ulong punBytesTotal); Debug.WriteLine("Progress: " + punBytesProcessed + "/" + punBytesTotal + ", " + updateStatus.ToString().Substring(19)); string progressPerc = ""; if (updateStatus == EItemUpdateStatus.k_EItemUpdateStatusInvalid) { return; } if (punBytesTotal > 0) { float progress = (float)punBytesProcessed / (float)punBytesTotal; progressPerc = " " + (int)(progress * 100) + "%"; this.btnSendContentButton.BackgroundImage = Progressbar(((float)updateStatus + progress) / 5.0f); } else { this.btnSendContentButton.BackgroundImage = Progressbar((float)updateStatus / 5.0f); } this.btnSendContentButton.Text = AddSpacesToSentence(updateStatus.ToString().Substring(19)) + progressPerc; }
/// <summary> /// 开始上传进度协程跟进 /// </summary> /// <param name="updateHandle"></param> /// <returns></returns> private IEnumerator ProgressCoroutine(UGCUpdateHandle_t updateHandle, PublishedFileId_t fileId) { mIsComplete = false; while (!mIsComplete) { ulong progressBytes; ulong totalBytes; EItemUpdateStatus state = SteamUGC.GetItemUpdateProgress(updateHandle, out progressBytes, out totalBytes); if (this.mUpdateCallBack != null) { if (state == EItemUpdateStatus.k_EItemUpdateStatusCommittingChanges) { mIsComplete = true; this.mUpdateCallBack.UpdateSuccess(); } else if (state == EItemUpdateStatus.k_EItemUpdateStatusInvalid) { mIsComplete = true; this.mUpdateCallBack.UpdateFail(SteamWorkshopUpdateFailEnum.REQUEST_FAIL); SteamUGC.DeleteItem(fileId); } else { this.mUpdateCallBack.UpdateProgress(state, progressBytes, totalBytes); } } yield return(new WaitForSeconds(0.1f)); } }
public override void DoWindowContents(Rect inRect) { EItemUpdateStatus eItemUpdateStatus = default(EItemUpdateStatus); float num = default(float); Workshop.GetUpdateStatus(out eItemUpdateStatus, out num); WorkshopInteractStage curStage = Workshop.CurStage; if (curStage == WorkshopInteractStage.None && eItemUpdateStatus == EItemUpdateStatus.k_EItemUpdateStatusInvalid) { this.Close(true); } else { string text = string.Empty; if (curStage != 0) { text += curStage.GetLabel(); text += "\n\n"; } if (eItemUpdateStatus != 0) { text += eItemUpdateStatus.GetLabel(); if (num > 0.0) { text = text + " (" + num.ToStringPercent() + ")"; } text += GenText.MarchingEllipsis(0f); } Widgets.Label(inRect, text); } }
public void UpdateProgress(EItemUpdateStatus status, ulong progressBytes, ulong totalBytes) { string contentStr = ""; if (status == EItemUpdateStatus.k_EItemUpdateStatusUploadingPreviewFile) { contentStr = "Uploading Preview File"; } else if (status == EItemUpdateStatus.k_EItemUpdateStatusUploadingContent) { contentStr = "Uploading Content: " + progressBytes + "/" + totalBytes; } else if (status == EItemUpdateStatus.k_EItemUpdateStatusPreparingConfig) { contentStr = "Preparing Config"; } else if (status == EItemUpdateStatus.k_EItemUpdateStatusPreparingContent) { contentStr = "Preparing Content"; } else if (status == EItemUpdateStatus.k_EItemUpdateStatusCommittingChanges) { contentStr = "Committing Changes"; } customUI.uploadLoadingProgress.text = contentStr; }
public static void GetUpdateStatus(out EItemUpdateStatus updateStatus, out float progPercent) { ulong num; ulong num2; updateStatus = SteamUGC.GetItemUpdateProgress(Workshop.curUpdateHandle, out num, out num2); progPercent = num / num2; }
public static void GetUpdateStatus(out EItemUpdateStatus updateStatus, out float progPercent) { ulong num = default(ulong); ulong num2 = default(ulong); updateStatus = SteamUGC.GetItemUpdateProgress(Workshop.curUpdateHandle, out num, out num2); progPercent = (float)(double)num / (float)(double)num2; }
public unsafe TransferProgress GetDownloadProgress() { ulong bytesDownloaded, bytesTotal; EItemUpdateStatus status = SteamUGC.GetItemUpdateProgress(_currentUpdateHandle, out bytesDownloaded, out bytesTotal); return(new TransferProgress { status = ItemUpdateStatus.Invalid, bytesDownloaded = bytesDownloaded, bytesTotal = bytesTotal }); }
public static EItemUpdateStatus GetUpdateItemProgress(out ulong OutBytesProcessed, out ulong OutBytesTotal) { EItemUpdateStatus status = EItemUpdateStatus.k_EItemUpdateStatusInvalid; OutBytesProcessed = 0uL; OutBytesTotal = 0uL; if (hUpdate != UGCUpdateHandle_t.Invalid) { status = SteamUGC.GetItemUpdateProgress(hUpdate, out OutBytesProcessed, out OutBytesTotal); } return(status); }
private void btnUploadProgress_Click(object sender, EventArgs e) { //getProgress ulong temp; ulong temp2; EItemUpdateStatus progress = SteamManager.SteamUGCworkshop.getProgress(SteamManager.SteamUGCworkshop.m_UGCUpdateHandle, out temp, out temp2); Program.debugString += "Upload progress: " + progress + "\n" + newLine; //+ bSuccess SteamManager.SteamUGCworkshop.m_UGCUpdateHandle = SteamUGC.StartItemUpdate((AppId_t)480, SteamManager.SteamUGCworkshop.m_PublishedFileId); Program.debugString += "SteamUGC.StartItemUpdate((AppId_t)480, " + SteamManager.SteamUGCworkshop.m_PublishedFileId + ") : " + SteamManager.SteamUGCworkshop.m_UGCUpdateHandle + newLine; txtDebug.Text = Program.debugString; }
static void SubmitItemTask(SteamAPICall_t handle, UGCUpdateHandle_t updateHandle) { while (!IsCompleted(handle)) { if (updateHandle != UGCUpdateHandle_t.Invalid) { System.Threading.Thread.Sleep(1); EItemUpdateStatus status = SteamUGC.GetItemUpdateProgress(updateHandle, out ulong punBytesProcessed, out ulong punBytesTotal); float progress = (float)punBytesProcessed / (float)punBytesTotal * 100.0f; if (status == EItemUpdateStatus.k_EItemUpdateStatusPreparingConfig) { ClearLine("Processing configuration data..."); } else if (status == EItemUpdateStatus.k_EItemUpdateStatusPreparingContent && !Single.IsNaN(progress)) { ClearLine("Processing files: " + progress.ToString("F2") + " % "); } else if (status == EItemUpdateStatus.k_EItemUpdateStatusUploadingContent && !Single.IsNaN(progress)) { ClearLine("Upload files: " + progress.ToString("F2") + " % "); } else if (status == EItemUpdateStatus.k_EItemUpdateStatusUploadingPreviewFile) { ClearLine("Upload preview file..."); } else if (status == EItemUpdateStatus.k_EItemUpdateStatusCommittingChanges) { ClearLine("Commiting changes..."); } } } SubmitItemUpdateResult_t callback = AllocCallback <SubmitItemUpdateResult_t>(handle, out IntPtr pCallback, SubmitItemUpdateResult_t.k_iCallback); if (callback.m_eResult == EResult.k_EResultOK) { Console.WriteLine("\nSuccessfully submitted item to Steam ! Press any key to continue..."); } else { Console.WriteLine("\nCouldn't submit the item to Steam (" + callback.m_eResult.ToString() + ") ! Press any key to continue..."); } ReleaseCallback(pCallback); }
private void UpdateProgressBar(UGCUpdateHandle_t handle) { ulong bytesDone; ulong bytesTotal; EItemUpdateStatus status = SteamUGC.GetItemUpdateProgress(handle, out bytesDone, out bytesTotal); float progress = (float)bytesDone / (float)bytesTotal; progressBar.value = progress; switch (status) { case EItemUpdateStatus.k_EItemUpdateStatusCommittingChanges: statusText.text = "Committing changes..."; break; case EItemUpdateStatus.k_EItemUpdateStatusUploadingPreviewFile: statusText.text = "Uploading preview image..."; break; case EItemUpdateStatus.k_EItemUpdateStatusUploadingContent: statusText.text = "Uploading content..."; break; case EItemUpdateStatus.k_EItemUpdateStatusPreparingConfig: statusText.text = "Preparing configuration..."; break; case EItemUpdateStatus.k_EItemUpdateStatusPreparingContent: statusText.text = "Preparing content..."; break; // from the docs: "The item update handle was invalid, the job might be finished, a SubmitItemUpdateResult_t call result should have been returned for it." // case EItemUpdateStatus.k_EItemUpdateStatusInvalid: // statusText.text = "Item invalid ... dunno why! :("; // break; } }
private void UpdateProgressBar(UGCUpdateHandle_t handle) { ulong bytesDone; ulong bytesTotal; EItemUpdateStatus status = SteamUGC.GetItemUpdateProgress(handle, out bytesDone, out bytesTotal); float progress = (float)bytesDone / (float)bytesTotal; progressBar.value = progress; switch (status) { case EItemUpdateStatus.k_EItemUpdateStatusCommittingChanges: statusText.text = "Committing changes..."; break; case EItemUpdateStatus.k_EItemUpdateStatusInvalid: statusText.text = "Item invalid ... dunno why! :("; break; case EItemUpdateStatus.k_EItemUpdateStatusUploadingPreviewFile: statusText.text = "Uploading preview image..."; break; case EItemUpdateStatus.k_EItemUpdateStatusUploadingContent: statusText.text = "Uploading content..."; break; case EItemUpdateStatus.k_EItemUpdateStatusPreparingConfig: statusText.text = "Preparing configuration..."; break; case EItemUpdateStatus.k_EItemUpdateStatusPreparingContent: statusText.text = "Preparing content..."; break; } }
static void Main(string[] args) { foreach (var arg in args) { Console.WriteLine(arg); } var configPath = args[0]; var file = File.ReadAllText(configPath); var package = JsonConvert.DeserializeObject <Package>(file); m_itemCreated = CallResult <CreateItemResult_t> .Create(OnItemCreated); var appID = "798840"; var AppId_t = new AppId_t(uint.Parse(appID)); var isInit = SteamAPI.Init(); if (package.publishFileID == 0) { SteamAPICall_t call = SteamUGC.CreateItem(new AppId_t(uint.Parse(appID)), EWorkshopFileType.k_EWorkshopFileTypeCommunity); m_itemCreated.Set(call); } else { publishID = package.publishFileID; } while (publishID == 0) { SteamAPI.RunCallbacks(); Thread.Sleep(1000); } Thread.Sleep(1000); if (package.publishFileID == 0) { package.publishFileID = publishID; File.WriteAllText(configPath, JsonConvert.SerializeObject(package)); Console.WriteLine(string.Format("Rewrite package ID with {0}", publishID)); } var publishFileID_t = new PublishedFileId_t(publishID); ugcUpdateHandle = SteamUGC.StartItemUpdate(AppId_t, publishFileID_t); SteamUGC.SetItemTitle(ugcUpdateHandle, package.title); SteamUGC.SetItemDescription(ugcUpdateHandle, package.description); SteamUGC.SetItemVisibility(ugcUpdateHandle, fileVisibility); SteamUGC.SetItemTags(ugcUpdateHandle, new string[] { package.tags }); SteamUGC.SetItemPreview(ugcUpdateHandle, Directory.GetCurrentDirectory() + "/" + package.previewUrl); SteamUGC.SetItemContent(ugcUpdateHandle, Directory.GetCurrentDirectory() + "/" + package.contentUrl); Console.WriteLine(string.Format("{0} {1} {2}", package.title, package.description, package.tags)); SteamAPICall_t t = SteamUGC.SubmitItemUpdate(ugcUpdateHandle, "Update file from game tool"); m_itemSubmitted = CallResult <SubmitItemUpdateResult_t> .Create(OnItemSubmitted); m_itemSubmitted.Set(t); while (true) { Thread.Sleep(1000); if (ugcUpdateHandle == UGCUpdateHandle_t.Invalid) { break; } SteamAPI.RunCallbacks(); ulong bytesDone, bytesTotal; EItemUpdateStatus status = SteamUGC.GetItemUpdateProgress(ugcUpdateHandle, out bytesDone, out bytesTotal); ProgressPrint(string.Format("status:{0} bytesDone:{1} bytesTotal:{2}", status, bytesDone, bytesTotal)); } Console.Clear(); Console.WriteLine("Everything is ready !Check it on your workshop."); Console.WriteLine("Be sure to set the item public so that the community can download it!"); Console.WriteLine("Press any key to quit"); if (fileVisibility == ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPrivate) { Console.WriteLine("Press anykey(exclude escape) to set your content's visibility to public instantly"); var key = Console.ReadKey(); if (key.Key != ConsoleKey.Escape) { fileVisibility = ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic; Console.Clear(); Console.WriteLine("Preparing the content for sharing!"); Main(args); } } else { return; } Console.ReadKey(); SteamAPI.Shutdown(); }
public static void GetUpdateStatus(out EItemUpdateStatus updateStatus, out float progPercent) { updateStatus = SteamUGC.GetItemUpdateProgress(curUpdateHandle, out ulong punBytesProcessed, out ulong punBytesTotal); progPercent = (float)(double)punBytesProcessed / (float)(double)punBytesTotal; }
public SteamNativeData(PublishedFileId_t p_nPublishedFileId) { m_nPublishedFileId = p_nPublishedFileId; m_uploadHandle = UGCUpdateHandle_t.Invalid; m_lastValidUpdateStatus = EItemUpdateStatus.k_EItemUpdateStatusInvalid; }
public void RenderOnGUI() { GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height)); GUILayout.Label("Variables:"); GUILayout.Label("m_UGCQueryHandle: " + m_UGCQueryHandle); GUILayout.Label("m_PublishedFileId: " + m_PublishedFileId); GUILayout.Label("m_UGCUpdateHandle: " + m_UGCUpdateHandle); GUILayout.EndArea(); GUILayout.BeginVertical("box"); m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); if (GUILayout.Button("CreateQueryUserUGCRequest(SteamUser.GetSteamID().GetAccountID(), EUserUGCList.k_EUserUGCList_Published, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Screenshots, EUserUGCListSortOrder.k_EUserUGCListSortOrder_CreationOrderDesc, AppId_t.Invalid, SteamUtils.GetAppID(), 1)")) { m_UGCQueryHandle = SteamUGC.CreateQueryUserUGCRequest(SteamUser.GetSteamID().GetAccountID(), EUserUGCList.k_EUserUGCList_Published, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Screenshots, EUserUGCListSortOrder.k_EUserUGCListSortOrder_CreationOrderDesc, AppId_t.Invalid, SteamUtils.GetAppID(), 1); print("SteamUGC.CreateQueryUserUGCRequest(" + SteamUser.GetSteamID().GetAccountID() + ", " + EUserUGCList.k_EUserUGCList_Published + ", " + EUGCMatchingUGCType.k_EUGCMatchingUGCType_Screenshots + ", " + EUserUGCListSortOrder.k_EUserUGCListSortOrder_CreationOrderDesc + ", " + AppId_t.Invalid + ", " + SteamUtils.GetAppID() + ", " + 1 + ") : " + m_UGCQueryHandle); } if (GUILayout.Button("CreateQueryAllUGCRequest(EUGCQuery.k_EUGCQuery_RankedByPublicationDate, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Items, AppId_t.Invalid, SteamUtils.GetAppID(), 1)")) { m_UGCQueryHandle = SteamUGC.CreateQueryAllUGCRequest(EUGCQuery.k_EUGCQuery_RankedByPublicationDate, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Items, AppId_t.Invalid, SteamUtils.GetAppID(), 1); print("SteamUGC.CreateQueryAllUGCRequest(" + EUGCQuery.k_EUGCQuery_RankedByPublicationDate + ", " + EUGCMatchingUGCType.k_EUGCMatchingUGCType_Items + ", " + AppId_t.Invalid + ", " + SteamUtils.GetAppID() + ", " + 1 + ") : " + m_UGCQueryHandle); } if (GUILayout.Button("CreateQueryAllUGCRequest(EUGCQuery.k_EUGCQuery_RankedByPublicationDate, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Items, AppId_t.Invalid, SteamUtils.GetAppID(), null)")) { m_UGCQueryHandle = SteamUGC.CreateQueryAllUGCRequest(EUGCQuery.k_EUGCQuery_RankedByPublicationDate, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Items, AppId_t.Invalid, SteamUtils.GetAppID(), null); print("SteamUGC.CreateQueryAllUGCRequest(" + EUGCQuery.k_EUGCQuery_RankedByPublicationDate + ", " + EUGCMatchingUGCType.k_EUGCMatchingUGCType_Items + ", " + AppId_t.Invalid + ", " + SteamUtils.GetAppID() + ", " + null + ") : " + m_UGCQueryHandle); } if (GUILayout.Button("CreateQueryUGCDetailsRequest(PublishedFileIDs, (uint)PublishedFileIDs.Length)")) { PublishedFileId_t[] PublishedFileIDs = new PublishedFileId_t[] { TestConstants.Instance.k_PublishedFileId_Champions }; m_UGCQueryHandle = SteamUGC.CreateQueryUGCDetailsRequest(PublishedFileIDs, (uint)PublishedFileIDs.Length); print("SteamUGC.CreateQueryUGCDetailsRequest(" + PublishedFileIDs + ", " + (uint)PublishedFileIDs.Length + ") : " + m_UGCQueryHandle); } if (GUILayout.Button("SendQueryUGCRequest(m_UGCQueryHandle)")) { SteamAPICall_t handle = SteamUGC.SendQueryUGCRequest(m_UGCQueryHandle); OnSteamUGCQueryCompletedCallResult.Set(handle); print("SteamUGC.SendQueryUGCRequest(" + m_UGCQueryHandle + ") : " + handle); } if (GUILayout.Button("GetQueryUGCResult(m_UGCQueryHandle, 0, out Details)")) { SteamUGCDetails_t Details; bool ret = SteamUGC.GetQueryUGCResult(m_UGCQueryHandle, 0, out Details); print(Details.m_nPublishedFileId + " -- " + Details.m_eResult + " -- " + Details.m_eFileType + " -- " + Details.m_nCreatorAppID + " -- " + Details.m_nConsumerAppID + " -- " + Details.m_rgchTitle + " -- " + Details.m_rgchDescription + " -- " + Details.m_ulSteamIDOwner + " -- " + Details.m_rtimeCreated + " -- " + Details.m_rtimeUpdated + " -- " + Details.m_rtimeAddedToUserList + " -- " + Details.m_eVisibility + " -- " + Details.m_bBanned + " -- " + Details.m_bAcceptedForUse + " -- " + Details.m_bTagsTruncated + " -- " + Details.m_rgchTags + " -- " + Details.m_hFile + " -- " + Details.m_hPreviewFile + " -- " + Details.m_pchFileName + " -- " + Details.m_nFileSize + " -- " + Details.m_nPreviewFileSize + " -- " + Details.m_rgchURL + " -- " + Details.m_unVotesUp + " -- " + Details.m_unVotesDown + " -- " + Details.m_flScore + " -- " + Details.m_unNumChildren); print("SteamUGC.GetQueryUGCResult(" + m_UGCQueryHandle + ", " + 0 + ", " + "out Details" + ") : " + ret + " -- " + Details); } if (GUILayout.Button("GetQueryUGCPreviewURL(m_UGCQueryHandle, 0, out URL, 1024)")) { string URL; bool ret = SteamUGC.GetQueryUGCPreviewURL(m_UGCQueryHandle, 0, out URL, 1024); print("SteamUGC.GetQueryUGCPreviewURL(" + m_UGCQueryHandle + ", " + 0 + ", " + "out URL" + ", " + 1024 + ") : " + ret + " -- " + URL); } if (GUILayout.Button("GetQueryUGCMetadata(m_UGCQueryHandle, 0, out Metadata, Constants.k_cchDeveloperMetadataMax)")) { string Metadata; bool ret = SteamUGC.GetQueryUGCMetadata(m_UGCQueryHandle, 0, out Metadata, Constants.k_cchDeveloperMetadataMax); print("SteamUGC.GetQueryUGCMetadata(" + m_UGCQueryHandle + ", " + 0 + ", " + "out Metadata" + ", " + Constants.k_cchDeveloperMetadataMax + ") : " + ret + " -- " + Metadata); } if (GUILayout.Button("GetQueryUGCChildren(m_UGCQueryHandle, 0, PublishedFileIDs, (uint)PublishedFileIDs.Length)")) { PublishedFileId_t[] PublishedFileIDs = new PublishedFileId_t[1]; // Use SteamUGCDetails_t.m_unNumChildren instead... bool ret = SteamUGC.GetQueryUGCChildren(m_UGCQueryHandle, 0, PublishedFileIDs, (uint)PublishedFileIDs.Length); print("SteamUGC.GetQueryUGCChildren(" + m_UGCQueryHandle + ", " + 0 + ", " + PublishedFileIDs + ", " + (uint)PublishedFileIDs.Length + ") : " + ret); } if (GUILayout.Button("GetQueryUGCStatistic(m_UGCQueryHandle, 0, EItemStatistic.k_EItemStatistic_NumSubscriptions, out StatValue)")) { ulong StatValue; bool ret = SteamUGC.GetQueryUGCStatistic(m_UGCQueryHandle, 0, EItemStatistic.k_EItemStatistic_NumSubscriptions, out StatValue); print("SteamUGC.GetQueryUGCStatistic(" + m_UGCQueryHandle + ", " + 0 + ", " + EItemStatistic.k_EItemStatistic_NumSubscriptions + ", " + "out StatValue" + ") : " + ret + " -- " + StatValue); } if (GUILayout.Button("GetQueryUGCNumAdditionalPreviews(m_UGCQueryHandle, 0)")) { uint ret = SteamUGC.GetQueryUGCNumAdditionalPreviews(m_UGCQueryHandle, 0); print("SteamUGC.GetQueryUGCNumAdditionalPreviews(" + m_UGCQueryHandle + ", " + 0 + ") : " + ret); } if (GUILayout.Button("GetQueryUGCAdditionalPreview(m_UGCQueryHandle, 0, 0, out pchURLOrVideoID, 1024, out pchOriginalFileName, 260, out pPreviewType)")) { // Should check GetQueryUGCNumAdditionalPreviews first. string pchURLOrVideoID; string pchOriginalFileName; EItemPreviewType pPreviewType; bool ret = SteamUGC.GetQueryUGCAdditionalPreview(m_UGCQueryHandle, 0, 0, out pchURLOrVideoID, 1024, out pchOriginalFileName, 260, out pPreviewType); print("SteamUGC.GetQueryUGCAdditionalPreview(" + m_UGCQueryHandle + ", " + 0 + ", " + 0 + ", " + "out pchURLOrVideoID" + ", " + 1024 + ", " + "out pchOriginalFileName" + ", " + 260 + ", " + "out pPreviewType" + ") : " + ret + " -- " + pchURLOrVideoID + " -- " + pchOriginalFileName + " -- " + pPreviewType); } if (GUILayout.Button("GetQueryUGCNumKeyValueTags(m_UGCQueryHandle, 0)")) { uint ret = SteamUGC.GetQueryUGCNumKeyValueTags(m_UGCQueryHandle, 0); print("SteamUGC.GetQueryUGCNumKeyValueTags(" + m_UGCQueryHandle + ", " + 0 + ") : " + ret); } if (GUILayout.Button("GetQueryUGCKeyValueTag(m_UGCQueryHandle, 0, 0, out Key, 260, out Value, 260)")) { string Key; string Value; bool ret = SteamUGC.GetQueryUGCKeyValueTag(m_UGCQueryHandle, 0, 0, out Key, 260, out Value, 260); print("SteamUGC.GetQueryUGCKeyValueTag(" + m_UGCQueryHandle + ", " + 0 + ", " + 0 + ", " + "out Key" + ", " + 260 + ", " + "out Value" + ", " + 260 + ") : " + ret + " -- " + Key + " -- " + Value); } if (GUILayout.Button("GetQueryUGCKeyValueTag(m_UGCQueryHandle, 0, \"TestKey\", out Value, 260)")) { string Value; bool ret = SteamUGC.GetQueryUGCKeyValueTag(m_UGCQueryHandle, 0, "TestKey", out Value, 260); print("SteamUGC.GetQueryUGCKeyValueTag(" + m_UGCQueryHandle + ", " + 0 + ", " + "\"TestKey\"" + ", " + "out Value" + ", " + 260 + ") : " + ret + " -- " + Value); } if (GUILayout.Button("ReleaseQueryUGCRequest(m_UGCQueryHandle)")) { bool ret = SteamUGC.ReleaseQueryUGCRequest(m_UGCQueryHandle); print("SteamUGC.ReleaseQueryUGCRequest(" + m_UGCQueryHandle + ") : " + ret); } if (GUILayout.Button("AddRequiredTag(m_UGCQueryHandle, \"Co-op\")")) { bool ret = SteamUGC.AddRequiredTag(m_UGCQueryHandle, "Co-op"); print("SteamUGC.AddRequiredTag(" + m_UGCQueryHandle + ", " + "\"Co-op\"" + ") : " + ret); } if (GUILayout.Button("AddRequiredTagGroup(m_UGCQueryHandle, new string[] {\"Sorry\"})")) { bool ret = SteamUGC.AddRequiredTagGroup(m_UGCQueryHandle, new string[] { "Sorry" }); print("SteamUGC.AddRequiredTagGroup(" + m_UGCQueryHandle + ", " + new string[] { "Sorry" } +") : " + ret); } if (GUILayout.Button("AddExcludedTag(m_UGCQueryHandle, \"Co-op\")")) { bool ret = SteamUGC.AddExcludedTag(m_UGCQueryHandle, "Co-op"); print("SteamUGC.AddExcludedTag(" + m_UGCQueryHandle + ", " + "\"Co-op\"" + ") : " + ret); } if (GUILayout.Button("SetReturnOnlyIDs(m_UGCQueryHandle, true)")) { bool ret = SteamUGC.SetReturnOnlyIDs(m_UGCQueryHandle, true); print("SteamUGC.SetReturnOnlyIDs(" + m_UGCQueryHandle + ", " + true + ") : " + ret); } if (GUILayout.Button("SetReturnKeyValueTags(m_UGCQueryHandle, true)")) { bool ret = SteamUGC.SetReturnKeyValueTags(m_UGCQueryHandle, true); print("SteamUGC.SetReturnKeyValueTags(" + m_UGCQueryHandle + ", " + true + ") : " + ret); } if (GUILayout.Button("SetReturnLongDescription(m_UGCQueryHandle, true)")) { bool ret = SteamUGC.SetReturnLongDescription(m_UGCQueryHandle, true); print("SteamUGC.SetReturnLongDescription(" + m_UGCQueryHandle + ", " + true + ") : " + ret); } if (GUILayout.Button("SetReturnMetadata(m_UGCQueryHandle, true)")) { bool ret = SteamUGC.SetReturnMetadata(m_UGCQueryHandle, true); print("SteamUGC.SetReturnMetadata(" + m_UGCQueryHandle + ", " + true + ") : " + ret); } if (GUILayout.Button("SetReturnChildren(m_UGCQueryHandle, true)")) { bool ret = SteamUGC.SetReturnChildren(m_UGCQueryHandle, true); print("SteamUGC.SetReturnChildren(" + m_UGCQueryHandle + ", " + true + ") : " + ret); } if (GUILayout.Button("SetReturnAdditionalPreviews(m_UGCQueryHandle, true)")) { bool ret = SteamUGC.SetReturnAdditionalPreviews(m_UGCQueryHandle, true); print("SteamUGC.SetReturnAdditionalPreviews(" + m_UGCQueryHandle + ", " + true + ") : " + ret); } if (GUILayout.Button("SetReturnTotalOnly(m_UGCQueryHandle, true)")) { bool ret = SteamUGC.SetReturnTotalOnly(m_UGCQueryHandle, true); print("SteamUGC.SetReturnTotalOnly(" + m_UGCQueryHandle + ", " + true + ") : " + ret); } if (GUILayout.Button("SetReturnPlaytimeStats(m_UGCQueryHandle, 7)")) { bool ret = SteamUGC.SetReturnPlaytimeStats(m_UGCQueryHandle, 7); print("SteamUGC.SetReturnPlaytimeStats(" + m_UGCQueryHandle + ", " + 7 + ") : " + ret); } if (GUILayout.Button("SetLanguage(m_UGCQueryHandle, \"english\")")) { bool ret = SteamUGC.SetLanguage(m_UGCQueryHandle, "english"); print("SteamUGC.SetLanguage(" + m_UGCQueryHandle + ", " + "\"english\"" + ") : " + ret); } if (GUILayout.Button("SetAllowCachedResponse(m_UGCQueryHandle, 5)")) { bool ret = SteamUGC.SetAllowCachedResponse(m_UGCQueryHandle, 5); print("SteamUGC.SetAllowCachedResponse(" + m_UGCQueryHandle + ", " + 5 + ") : " + ret); } if (GUILayout.Button("SetCloudFileNameFilter(m_UGCQueryHandle, \"\")")) { bool ret = SteamUGC.SetCloudFileNameFilter(m_UGCQueryHandle, ""); print("SteamUGC.SetCloudFileNameFilter(" + m_UGCQueryHandle + ", " + "\"\"" + ") : " + ret); } if (GUILayout.Button("SetMatchAnyTag(m_UGCQueryHandle, true)")) { bool ret = SteamUGC.SetMatchAnyTag(m_UGCQueryHandle, true); print("SteamUGC.SetMatchAnyTag(" + m_UGCQueryHandle + ", " + true + ") : " + ret); } if (GUILayout.Button("SetSearchText(m_UGCQueryHandle, \"Test\")")) { bool ret = SteamUGC.SetSearchText(m_UGCQueryHandle, "Test"); print("SteamUGC.SetSearchText(" + m_UGCQueryHandle + ", " + "\"Test\"" + ") : " + ret); } if (GUILayout.Button("SetRankedByTrendDays(m_UGCQueryHandle, 7)")) { bool ret = SteamUGC.SetRankedByTrendDays(m_UGCQueryHandle, 7); print("SteamUGC.SetRankedByTrendDays(" + m_UGCQueryHandle + ", " + 7 + ") : " + ret); } if (GUILayout.Button("AddRequiredKeyValueTag(m_UGCQueryHandle, \"TestKey\", \"TestValue\")")) { bool ret = SteamUGC.AddRequiredKeyValueTag(m_UGCQueryHandle, "TestKey", "TestValue"); print("SteamUGC.AddRequiredKeyValueTag(" + m_UGCQueryHandle + ", " + "\"TestKey\"" + ", " + "\"TestValue\"" + ") : " + ret); } if (GUILayout.Button("RequestUGCDetails(m_PublishedFileId, 5)")) { SteamAPICall_t handle = SteamUGC.RequestUGCDetails(m_PublishedFileId, 5); OnSteamUGCRequestUGCDetailsResultCallResult.Set(handle); OnSteamUGCRequestUGCDetailsResultCallResult.Set(handle); print("SteamUGC.RequestUGCDetails(" + m_PublishedFileId + ", " + 5 + ") : " + handle); } if (GUILayout.Button("CreateItem(SteamUtils.GetAppID(), EWorkshopFileType.k_EWorkshopFileTypeCommunity)")) { SteamAPICall_t handle = SteamUGC.CreateItem(SteamUtils.GetAppID(), EWorkshopFileType.k_EWorkshopFileTypeCommunity); OnCreateItemResultCallResult.Set(handle); print("SteamUGC.CreateItem(" + SteamUtils.GetAppID() + ", " + EWorkshopFileType.k_EWorkshopFileTypeCommunity + ") : " + handle); } if (GUILayout.Button("StartItemUpdate(SteamUtils.GetAppID(), m_PublishedFileId)")) { m_UGCUpdateHandle = SteamUGC.StartItemUpdate(SteamUtils.GetAppID(), m_PublishedFileId); print("SteamUGC.StartItemUpdate(" + SteamUtils.GetAppID() + ", " + m_PublishedFileId + ") : " + m_UGCUpdateHandle); } if (GUILayout.Button("SetItemTitle(m_UGCUpdateHandle, \"This is a Test\")")) { bool ret = SteamUGC.SetItemTitle(m_UGCUpdateHandle, "This is a Test"); print("SteamUGC.SetItemTitle(" + m_UGCUpdateHandle + ", " + "\"This is a Test\"" + ") : " + ret); } if (GUILayout.Button("SetItemDescription(m_UGCUpdateHandle, \"This is the test description.\")")) { bool ret = SteamUGC.SetItemDescription(m_UGCUpdateHandle, "This is the test description."); print("SteamUGC.SetItemDescription(" + m_UGCUpdateHandle + ", " + "\"This is the test description.\"" + ") : " + ret); } if (GUILayout.Button("SetItemUpdateLanguage(m_UGCUpdateHandle, \"english\")")) { bool ret = SteamUGC.SetItemUpdateLanguage(m_UGCUpdateHandle, "english"); print("SteamUGC.SetItemUpdateLanguage(" + m_UGCUpdateHandle + ", " + "\"english\"" + ") : " + ret); } if (GUILayout.Button("SetItemMetadata(m_UGCUpdateHandle, \"This is the test metadata.\")")) { bool ret = SteamUGC.SetItemMetadata(m_UGCUpdateHandle, "This is the test metadata."); print("SteamUGC.SetItemMetadata(" + m_UGCUpdateHandle + ", " + "\"This is the test metadata.\"" + ") : " + ret); } if (GUILayout.Button("SetItemVisibility(m_UGCUpdateHandle, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic)")) { bool ret = SteamUGC.SetItemVisibility(m_UGCUpdateHandle, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic); print("SteamUGC.SetItemVisibility(" + m_UGCUpdateHandle + ", " + ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic + ") : " + ret); } if (GUILayout.Button("SetItemTags(m_UGCUpdateHandle, new string[] {\"Tag One\", \"Tag Two\", \"Test Tags\", \"Sorry\"})")) { bool ret = SteamUGC.SetItemTags(m_UGCUpdateHandle, new string[] { "Tag One", "Tag Two", "Test Tags", "Sorry" }); print("SteamUGC.SetItemTags(" + m_UGCUpdateHandle + ", " + new string[] { "Tag One", "Tag Two", "Test Tags", "Sorry" } +") : " + ret); } if (GUILayout.Button("SetItemContent(m_UGCUpdateHandle, Application.dataPath + \"/Scenes\")")) { bool ret = SteamUGC.SetItemContent(m_UGCUpdateHandle, Application.dataPath + "/Scenes"); print("SteamUGC.SetItemContent(" + m_UGCUpdateHandle + ", " + Application.dataPath + "/Scenes" + ") : " + ret); } if (GUILayout.Button("SetItemPreview(m_UGCUpdateHandle, Application.dataPath + \"/PreviewImage.jpg\")")) { bool ret = SteamUGC.SetItemPreview(m_UGCUpdateHandle, Application.dataPath + "/PreviewImage.jpg"); print("SteamUGC.SetItemPreview(" + m_UGCUpdateHandle + ", " + Application.dataPath + "/PreviewImage.jpg" + ") : " + ret); } if (GUILayout.Button("SetAllowLegacyUpload(m_UGCUpdateHandle, true)")) { bool ret = SteamUGC.SetAllowLegacyUpload(m_UGCUpdateHandle, true); print("SteamUGC.SetAllowLegacyUpload(" + m_UGCUpdateHandle + ", " + true + ") : " + ret); } if (GUILayout.Button("RemoveAllItemKeyValueTags(m_UGCUpdateHandle)")) { bool ret = SteamUGC.RemoveAllItemKeyValueTags(m_UGCUpdateHandle); print("SteamUGC.RemoveAllItemKeyValueTags(" + m_UGCUpdateHandle + ") : " + ret); } if (GUILayout.Button("RemoveItemKeyValueTags(m_UGCUpdateHandle, \"TestKey\")")) { bool ret = SteamUGC.RemoveItemKeyValueTags(m_UGCUpdateHandle, "TestKey"); print("SteamUGC.RemoveItemKeyValueTags(" + m_UGCUpdateHandle + ", " + "\"TestKey\"" + ") : " + ret); } if (GUILayout.Button("AddItemKeyValueTag(m_UGCUpdateHandle, \"TestKey\", \"TestValue\")")) { bool ret = SteamUGC.AddItemKeyValueTag(m_UGCUpdateHandle, "TestKey", "TestValue"); print("SteamUGC.AddItemKeyValueTag(" + m_UGCUpdateHandle + ", " + "\"TestKey\"" + ", " + "\"TestValue\"" + ") : " + ret); } if (GUILayout.Button("AddItemPreviewFile(m_UGCUpdateHandle, Application.dataPath + \"/PreviewImage.jpg\", EItemPreviewType.k_EItemPreviewType_Image)")) { bool ret = SteamUGC.AddItemPreviewFile(m_UGCUpdateHandle, Application.dataPath + "/PreviewImage.jpg", EItemPreviewType.k_EItemPreviewType_Image); print("SteamUGC.AddItemPreviewFile(" + m_UGCUpdateHandle + ", " + Application.dataPath + "/PreviewImage.jpg" + ", " + EItemPreviewType.k_EItemPreviewType_Image + ") : " + ret); } if (GUILayout.Button("AddItemPreviewVideo(m_UGCUpdateHandle, \"jHgZh4GV9G0\")")) { bool ret = SteamUGC.AddItemPreviewVideo(m_UGCUpdateHandle, "jHgZh4GV9G0"); print("SteamUGC.AddItemPreviewVideo(" + m_UGCUpdateHandle + ", " + "\"jHgZh4GV9G0\"" + ") : " + ret); } if (GUILayout.Button("UpdateItemPreviewFile(m_UGCUpdateHandle, 0, Application.dataPath + \"/PreviewImage.jpg\")")) { bool ret = SteamUGC.UpdateItemPreviewFile(m_UGCUpdateHandle, 0, Application.dataPath + "/PreviewImage.jpg"); print("SteamUGC.UpdateItemPreviewFile(" + m_UGCUpdateHandle + ", " + 0 + ", " + Application.dataPath + "/PreviewImage.jpg" + ") : " + ret); } if (GUILayout.Button("UpdateItemPreviewVideo(m_UGCUpdateHandle, 0, \"jHgZh4GV9G0\")")) { bool ret = SteamUGC.UpdateItemPreviewVideo(m_UGCUpdateHandle, 0, "jHgZh4GV9G0"); print("SteamUGC.UpdateItemPreviewVideo(" + m_UGCUpdateHandle + ", " + 0 + ", " + "\"jHgZh4GV9G0\"" + ") : " + ret); } if (GUILayout.Button("RemoveItemPreview(m_UGCUpdateHandle, 0)")) { bool ret = SteamUGC.RemoveItemPreview(m_UGCUpdateHandle, 0); print("SteamUGC.RemoveItemPreview(" + m_UGCUpdateHandle + ", " + 0 + ") : " + ret); } if (GUILayout.Button("SubmitItemUpdate(m_UGCUpdateHandle, \"Test Changenote\")")) { SteamAPICall_t handle = SteamUGC.SubmitItemUpdate(m_UGCUpdateHandle, "Test Changenote"); OnSubmitItemUpdateResultCallResult.Set(handle); print("SteamUGC.SubmitItemUpdate(" + m_UGCUpdateHandle + ", " + "\"Test Changenote\"" + ") : " + handle); } { ulong BytesProcessed; ulong BytesTotal; EItemUpdateStatus ret = SteamUGC.GetItemUpdateProgress(m_UGCUpdateHandle, out BytesProcessed, out BytesTotal); GUILayout.Label("GetItemUpdateProgress(m_UGCUpdateHandle, out BytesProcessed, out BytesTotal) : " + ret + " -- " + BytesProcessed + " -- " + BytesTotal); } if (GUILayout.Button("SetUserItemVote(TestConstants.Instance.k_PublishedFileId_Champions, true)")) { SteamAPICall_t handle = SteamUGC.SetUserItemVote(TestConstants.Instance.k_PublishedFileId_Champions, true); OnSetUserItemVoteResultCallResult.Set(handle); print("SteamUGC.SetUserItemVote(" + TestConstants.Instance.k_PublishedFileId_Champions + ", " + true + ") : " + handle); } if (GUILayout.Button("GetUserItemVote(TestConstants.Instance.k_PublishedFileId_Champions)")) { SteamAPICall_t handle = SteamUGC.GetUserItemVote(TestConstants.Instance.k_PublishedFileId_Champions); OnGetUserItemVoteResultCallResult.Set(handle); print("SteamUGC.GetUserItemVote(" + TestConstants.Instance.k_PublishedFileId_Champions + ") : " + handle); } if (GUILayout.Button("AddItemToFavorites(SteamUtils.GetAppID(), TestConstants.Instance.k_PublishedFileId_Champions)")) { SteamAPICall_t handle = SteamUGC.AddItemToFavorites(SteamUtils.GetAppID(), TestConstants.Instance.k_PublishedFileId_Champions); OnUserFavoriteItemsListChangedCallResult.Set(handle); print("SteamUGC.AddItemToFavorites(" + SteamUtils.GetAppID() + ", " + TestConstants.Instance.k_PublishedFileId_Champions + ") : " + handle); } if (GUILayout.Button("RemoveItemFromFavorites(SteamUtils.GetAppID(), TestConstants.Instance.k_PublishedFileId_Champions)")) { SteamAPICall_t handle = SteamUGC.RemoveItemFromFavorites(SteamUtils.GetAppID(), TestConstants.Instance.k_PublishedFileId_Champions); OnUserFavoriteItemsListChangedCallResult.Set(handle); print("SteamUGC.RemoveItemFromFavorites(" + SteamUtils.GetAppID() + ", " + TestConstants.Instance.k_PublishedFileId_Champions + ") : " + handle); } if (GUILayout.Button("SubscribeItem(TestConstants.Instance.k_PublishedFileId_Champions)")) { SteamAPICall_t handle = SteamUGC.SubscribeItem(TestConstants.Instance.k_PublishedFileId_Champions); OnRemoteStorageSubscribePublishedFileResultCallResult.Set(handle); print("SteamUGC.SubscribeItem(" + TestConstants.Instance.k_PublishedFileId_Champions + ") : " + handle); } if (GUILayout.Button("UnsubscribeItem(TestConstants.Instance.k_PublishedFileId_Champions)")) { SteamAPICall_t handle = SteamUGC.UnsubscribeItem(TestConstants.Instance.k_PublishedFileId_Champions); OnRemoteStorageUnsubscribePublishedFileResultCallResult.Set(handle); print("SteamUGC.UnsubscribeItem(" + TestConstants.Instance.k_PublishedFileId_Champions + ") : " + handle); } GUILayout.Label("GetNumSubscribedItems() : " + SteamUGC.GetNumSubscribedItems()); if (GUILayout.Button("GetSubscribedItems(PublishedFileID, (uint)PublishedFileID.Length)")) { PublishedFileId_t[] PublishedFileID = new PublishedFileId_t[1]; uint ret = SteamUGC.GetSubscribedItems(PublishedFileID, (uint)PublishedFileID.Length); m_PublishedFileId = PublishedFileID[0]; print("SteamUGC.GetSubscribedItems(" + PublishedFileID + ", " + (uint)PublishedFileID.Length + ") : " + ret); print(m_PublishedFileId); } GUILayout.Label("GetItemState(PublishedFileID) : " + (EItemState)SteamUGC.GetItemState(m_PublishedFileId)); { ulong SizeOnDisk; string Folder; uint punTimeStamp; bool ret = SteamUGC.GetItemInstallInfo(m_PublishedFileId, out SizeOnDisk, out Folder, 1024, out punTimeStamp); GUILayout.Label("GetItemInstallInfo(m_PublishedFileId, out SizeOnDisk, out Folder, 1024, out punTimeStamp) : " + ret + " -- " + SizeOnDisk + " -- " + Folder + " -- " + punTimeStamp); } if (GUILayout.Button("GetItemDownloadInfo(m_PublishedFileId, out BytesDownloaded, out BytesTotal)")) { ulong BytesDownloaded; ulong BytesTotal; bool ret = SteamUGC.GetItemDownloadInfo(m_PublishedFileId, out BytesDownloaded, out BytesTotal); print("SteamUGC.GetItemDownloadInfo(" + m_PublishedFileId + ", " + "out BytesDownloaded" + ", " + "out BytesTotal" + ") : " + ret + " -- " + BytesDownloaded + " -- " + BytesTotal); } if (GUILayout.Button("DownloadItem(m_PublishedFileId, true)")) { bool ret = SteamUGC.DownloadItem(m_PublishedFileId, true); print("SteamUGC.DownloadItem(" + m_PublishedFileId + ", " + true + ") : " + ret); } if (GUILayout.Button("BInitWorkshopForGameServer((DepotId_t)481, \"C:/UGCTest\")")) { bool ret = SteamUGC.BInitWorkshopForGameServer((DepotId_t)481, "C:/UGCTest"); print("SteamUGC.BInitWorkshopForGameServer(" + (DepotId_t)481 + ", " + "\"C:/UGCTest\"" + ") : " + ret); } if (GUILayout.Button("SuspendDownloads(true)")) { SteamUGC.SuspendDownloads(true); print("SteamUGC.SuspendDownloads(" + true + ")"); } if (GUILayout.Button("StartPlaytimeTracking(PublishedFileIds, (uint)PublishedFileIds.Length)")) { PublishedFileId_t[] PublishedFileIds = new PublishedFileId_t[] { TestConstants.Instance.k_PublishedFileId_Champions }; SteamAPICall_t handle = SteamUGC.StartPlaytimeTracking(PublishedFileIds, (uint)PublishedFileIds.Length); OnStartPlaytimeTrackingResultCallResult.Set(handle); print("SteamUGC.StartPlaytimeTracking(" + PublishedFileIds + ", " + (uint)PublishedFileIds.Length + ") : " + handle); } if (GUILayout.Button("StopPlaytimeTracking(PublishedFileIds, (uint)PublishedFileIds.Length)")) { PublishedFileId_t[] PublishedFileIds = new PublishedFileId_t[] { TestConstants.Instance.k_PublishedFileId_Champions }; SteamAPICall_t handle = SteamUGC.StopPlaytimeTracking(PublishedFileIds, (uint)PublishedFileIds.Length); OnStopPlaytimeTrackingResultCallResult.Set(handle); print("SteamUGC.StopPlaytimeTracking(" + PublishedFileIds + ", " + (uint)PublishedFileIds.Length + ") : " + handle); } if (GUILayout.Button("StopPlaytimeTrackingForAllItems()")) { SteamAPICall_t handle = SteamUGC.StopPlaytimeTrackingForAllItems(); OnStopPlaytimeTrackingResultCallResult.Set(handle); print("SteamUGC.StopPlaytimeTrackingForAllItems() : " + handle); } if (GUILayout.Button("AddDependency(m_PublishedFileId, TestConstants.Instance.k_PublishedFileId_Champions)")) { SteamAPICall_t handle = SteamUGC.AddDependency(m_PublishedFileId, TestConstants.Instance.k_PublishedFileId_Champions); OnAddUGCDependencyResultCallResult.Set(handle); print("SteamUGC.AddDependency(" + m_PublishedFileId + ", " + TestConstants.Instance.k_PublishedFileId_Champions + ") : " + handle); } if (GUILayout.Button("RemoveDependency(m_PublishedFileId, TestConstants.Instance.k_PublishedFileId_Champions)")) { SteamAPICall_t handle = SteamUGC.RemoveDependency(m_PublishedFileId, TestConstants.Instance.k_PublishedFileId_Champions); OnRemoveUGCDependencyResultCallResult.Set(handle); print("SteamUGC.RemoveDependency(" + m_PublishedFileId + ", " + TestConstants.Instance.k_PublishedFileId_Champions + ") : " + handle); } if (GUILayout.Button("AddAppDependency(m_PublishedFileId, SteamUtils.GetAppID())")) { SteamAPICall_t handle = SteamUGC.AddAppDependency(m_PublishedFileId, SteamUtils.GetAppID()); OnAddAppDependencyResultCallResult.Set(handle); print("SteamUGC.AddAppDependency(" + m_PublishedFileId + ", " + SteamUtils.GetAppID() + ") : " + handle); } if (GUILayout.Button("RemoveAppDependency(m_PublishedFileId, SteamUtils.GetAppID())")) { SteamAPICall_t handle = SteamUGC.RemoveAppDependency(m_PublishedFileId, SteamUtils.GetAppID()); OnRemoveAppDependencyResultCallResult.Set(handle); print("SteamUGC.RemoveAppDependency(" + m_PublishedFileId + ", " + SteamUtils.GetAppID() + ") : " + handle); } if (GUILayout.Button("GetAppDependencies(m_PublishedFileId)")) { SteamAPICall_t handle = SteamUGC.GetAppDependencies(m_PublishedFileId); OnGetAppDependenciesResultCallResult.Set(handle); print("SteamUGC.GetAppDependencies(" + m_PublishedFileId + ") : " + handle); } if (GUILayout.Button("DeleteItem(m_PublishedFileId)")) { SteamAPICall_t handle = SteamUGC.DeleteItem(m_PublishedFileId); OnDeleteItemResultCallResult.Set(handle); print("SteamUGC.DeleteItem(" + m_PublishedFileId + ") : " + handle); } GUILayout.EndScrollView(); GUILayout.EndVertical(); }
public void RenderOnGUI() { GUILayout.BeginArea(new Rect(Screen.width - 120, 0, 120, Screen.height)); GUILayout.Label("Variables:"); GUILayout.Label("m_UGCQueryHandle: " + m_UGCQueryHandle); GUILayout.Label("m_PublishedFileId: " + m_PublishedFileId); GUILayout.Label("m_UGCUpdateHandle: " + m_UGCUpdateHandle); GUILayout.EndArea(); if (GUILayout.Button("CreateQueryUserUGCRequest(SteamUser.GetSteamID().GetAccountID(), EUserUGCList.k_EUserUGCList_Published, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Screenshots, EUserUGCListSortOrder.k_EUserUGCListSortOrder_CreationOrderDesc, AppId_t.Invalid, SteamUtils.GetAppID(), 1)")) { m_UGCQueryHandle = SteamUGC.CreateQueryUserUGCRequest(SteamUser.GetSteamID().GetAccountID(), EUserUGCList.k_EUserUGCList_Published, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Screenshots, EUserUGCListSortOrder.k_EUserUGCListSortOrder_CreationOrderDesc, AppId_t.Invalid, SteamUtils.GetAppID(), 1); print("SteamUGC.CreateQueryUserUGCRequest(" + SteamUser.GetSteamID().GetAccountID() + ", EUserUGCList.k_EUserUGCList_Published, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Screenshots, EUserUGCListSortOrder.k_EUserUGCListSortOrder_CreationOrderDesc, " + AppId_t.Invalid + ", " + SteamUtils.GetAppID() + ", 1) : " + m_UGCQueryHandle); } if (GUILayout.Button("CreateQueryAllUGCRequest(EUGCQuery.k_EUGCQuery_RankedByPublicationDate, EUGCMatchingUGCType.k_EUGCMatchingUGCType_AllGuides, AppId_t.Invalid, SteamUtils.GetAppID(), 1)")) { m_UGCQueryHandle = SteamUGC.CreateQueryAllUGCRequest(EUGCQuery.k_EUGCQuery_RankedByPublicationDate, EUGCMatchingUGCType.k_EUGCMatchingUGCType_AllGuides, AppId_t.Invalid, SteamUtils.GetAppID(), 1); print("SteamUGC.CreateQueryAllUGCRequest(EUGCQuery.k_EUGCQuery_RankedByPublicationDate, EUGCMatchingUGCType.k_EUGCMatchingUGCType_AllGuides, " + AppId_t.Invalid + ", " + SteamUtils.GetAppID() + ", 1) : " + m_UGCQueryHandle); } if (GUILayout.Button("SendQueryUGCRequest(m_UGCQueryHandle)")) { SteamAPICall_t handle = SteamUGC.SendQueryUGCRequest(m_UGCQueryHandle); OnSteamUGCQueryCompletedCallResult.Set(handle); print("SteamUGC.SendQueryUGCRequest(" + m_UGCQueryHandle + ") : " + handle); } if (GUILayout.Button("GetQueryUGCResult(m_UGCQueryHandle, 0, out Details)")) { SteamUGCDetails_t Details; bool ret = SteamUGC.GetQueryUGCResult(m_UGCQueryHandle, 0, out Details); print("SteamUGC.GetQueryUGCResult(" + m_UGCQueryHandle + ", 0, out Details) : " + ret); print(Details.m_nPublishedFileId + " -- " + Details.m_eResult + " -- " + Details.m_eFileType + " -- " + Details.m_nCreatorAppID + " -- " + Details.m_nConsumerAppID + " -- " + Details.m_rgchTitle + " -- " + Details.m_rgchDescription + " -- " + Details.m_ulSteamIDOwner + " -- " + Details.m_rtimeCreated + " -- " + Details.m_rtimeUpdated + " -- " + Details.m_rtimeAddedToUserList + " -- " + Details.m_eVisibility + " -- " + Details.m_bBanned + " -- " + Details.m_bAcceptedForUse + " -- " + Details.m_bTagsTruncated + " -- " + Details.m_rgchTags + " -- " + Details.m_hFile + " -- " + Details.m_hPreviewFile + " -- " + Details.m_pchFileName + " -- " + Details.m_nFileSize + " -- " + Details.m_nPreviewFileSize + " -- " + Details.m_rgchURL + " -- " + Details.m_unVotesUp + " -- " + Details.m_unVotesDown + " -- " + Details.m_flScore + " -- " + Details.m_unNumChildren); } if (GUILayout.Button("ReleaseQueryUGCRequest(m_UGCQueryHandle)")) { print("SteamUGC.ReleaseQueryUGCRequest(" + m_UGCQueryHandle + ") : " + SteamUGC.ReleaseQueryUGCRequest(m_UGCQueryHandle)); } if (GUILayout.Button("AddRequiredTag(m_UGCQueryHandle, \"Co-op\")")) { print("SteamUGC.AddRequiredTag(" + m_UGCQueryHandle + ", \"Co-op\") : " + SteamUGC.AddRequiredTag(m_UGCQueryHandle, "Co-op")); } if (GUILayout.Button("AddExcludedTag(m_UGCQueryHandle, \"Co-op\")")) { print("SteamUGC.AddExcludedTag(" + m_UGCQueryHandle + ", \"Co-op\") : " + SteamUGC.AddExcludedTag(m_UGCQueryHandle, "Co-op")); } if (GUILayout.Button("SetReturnLongDescription(m_UGCQueryHandle, true)")) { print("SteamUGC.SetReturnLongDescription(" + m_UGCQueryHandle + ", true) : " + SteamUGC.SetReturnLongDescription(m_UGCQueryHandle, true)); } if (GUILayout.Button("SetReturnTotalOnly(m_UGCQueryHandle, true)")) { print("SteamUGC.SetReturnTotalOnly(" + m_UGCQueryHandle + ", true) : " + SteamUGC.SetReturnTotalOnly(m_UGCQueryHandle, true)); } if (GUILayout.Button("SetAllowCachedResponse(m_UGCQueryHandle, 5)")) { print("SteamUGC.SetAllowCachedResponse(" + m_UGCQueryHandle + ", 5) : " + SteamUGC.SetAllowCachedResponse(m_UGCQueryHandle, 5)); } if (GUILayout.Button("SetCloudFileNameFilter(m_UGCQueryHandle, \"\")")) { print("SteamUGC.SetCloudFileNameFilter(" + m_UGCQueryHandle + ", \"\") : " + SteamUGC.SetCloudFileNameFilter(m_UGCQueryHandle, "")); } if (GUILayout.Button("SetMatchAnyTag(m_UGCQueryHandle, true)")) { print("SteamUGC.SetMatchAnyTag(" + m_UGCQueryHandle + ", true) : " + SteamUGC.SetMatchAnyTag(m_UGCQueryHandle, true)); } if (GUILayout.Button("SetSearchText(m_UGCQueryHandle, \"AciD\")")) { print("SteamUGC.SetSearchText(" + m_UGCQueryHandle + ", \"AciD\") : " + SteamUGC.SetSearchText(m_UGCQueryHandle, "AciD")); } if (GUILayout.Button("SetRankedByTrendDays(m_UGCQueryHandle, 7)")) { print("SteamUGC.SetRankedByTrendDays(" + m_UGCQueryHandle + ", 7) : " + SteamUGC.SetRankedByTrendDays(m_UGCQueryHandle, 7)); } if (GUILayout.Button("RequestUGCDetails((PublishedFileId_t)113142309, 5)")) { SteamAPICall_t handle = SteamUGC.RequestUGCDetails((PublishedFileId_t)113142309, 5); OnSteamUGCRequestUGCDetailsResultCallResult.Set(handle); print("SteamUGC.RequestUGCDetails((PublishedFileId_t)113142309, 5) : " + handle); } if (GUILayout.Button("CreateItem((AppId_t)480, EWorkshopFileType.k_EWorkshopFileTypeWebGuide)")) { SteamAPICall_t handle = SteamUGC.CreateItem((AppId_t)480, EWorkshopFileType.k_EWorkshopFileTypeWebGuide); OnCreateItemResultCallResult.Set(handle); print("SteamUGC.CreateItem((AppId_t)480, EWorkshopFileType.k_EWorkshopFileTypeWebGuide) : " + handle); } if (GUILayout.Button("StartItemUpdate((AppId_t)480, m_PublishedFileId)")) { m_UGCUpdateHandle = SteamUGC.StartItemUpdate((AppId_t)480, m_PublishedFileId); print("SteamUGC.StartItemUpdate((AppId_t)480, " + m_PublishedFileId + ") : " + m_UGCUpdateHandle); } if (GUILayout.Button("SetItemTitle(m_UGCUpdateHandle, \"This is a Test\")")) { bool ret = SteamUGC.SetItemTitle(m_UGCUpdateHandle, "This is a Test"); print("SteamUGC.SetItemTitle(" + m_UGCUpdateHandle + ", \"This is a Test\") : " + ret); } if (GUILayout.Button("SetItemDescription(m_UGCUpdateHandle, \"This is the test description.\")")) { bool ret = SteamUGC.SetItemDescription(m_UGCUpdateHandle, "This is the test description."); print("SteamUGC.SetItemDescription(" + m_UGCUpdateHandle + ", \"This is the test description.\") : " + ret); } if (GUILayout.Button("SetItemVisibility(m_UGCUpdateHandle, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPrivate)")) { bool ret = SteamUGC.SetItemVisibility(m_UGCUpdateHandle, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPrivate); print("SteamUGC.SetItemVisibility(" + m_UGCUpdateHandle + ", ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPrivate) : " + ret); } if (GUILayout.Button("SetItemTags(m_UGCUpdateHandle, new string[] {\"Tag One\", \"Tag Two\", \"Test Tags\", \"Sorry\"})")) { bool ret = SteamUGC.SetItemTags(m_UGCUpdateHandle, new string[] { "Tag One", "Tag Two", "Test Tags", "Sorry" }); print("SteamUGC.SetItemTags(" + m_UGCUpdateHandle + ", new string[] {\"Tag One\", \"Tag Two\", \"Test Tags\", \"Sorry\"}) : " + ret); } if (GUILayout.Button("SetItemContent(m_UGCUpdateHandle, Application.dataPath + \"/controller.vdf\")")) { bool ret = SteamUGC.SetItemContent(m_UGCUpdateHandle, Application.dataPath + "/controller.vdf"); print("SteamUGC.SetItemContent(" + m_UGCUpdateHandle + ", Application.dataPath + \"/controller.vdf\") : " + ret); } if (GUILayout.Button("SetItemPreview(m_UGCUpdateHandle, Application.dataPath + \"/controller.vdf\")")) { bool ret = SteamUGC.SetItemPreview(m_UGCUpdateHandle, Application.dataPath + "/controller.vdf"); print("SteamUGC.SetItemPreview(" + m_UGCUpdateHandle + ", Application.dataPath + \"/controller.vdf\") : " + ret); } if (GUILayout.Button("SubmitItemUpdate(m_UGCUpdateHandle, \"Test Changenote\")")) { SteamAPICall_t handle = SteamUGC.SubmitItemUpdate(m_UGCUpdateHandle, "Test Changenote"); OnSubmitItemUpdateResultCallResult.Set(handle); print("SteamUGC.SubmitItemUpdate(" + m_UGCUpdateHandle + ", \"Test Changenote\") : " + handle); } { ulong BytesProcessed; ulong BytesTotal; EItemUpdateStatus ret = SteamUGC.GetItemUpdateProgress(m_UGCUpdateHandle, out BytesProcessed, out BytesTotal); GUILayout.Label("GetItemUpdateProgress(m_UGCUpdateHandle, out BytesProcessed, out BytesTotal) : " + ret + " -- " + BytesProcessed + " -- " + BytesTotal); } if (GUILayout.Button("SubscribeItem((PublishedFileId_t)113142309)")) { SteamAPICall_t handle = SteamUGC.SubscribeItem((PublishedFileId_t)113142309); OnRemoteStorageSubscribePublishedFileResultCallResult.Set(handle); print("SteamUGC. : " + handle); } if (GUILayout.Button("UnsubscribeItem((PublishedFileId_t)113142309)")) { SteamAPICall_t handle = SteamUGC.UnsubscribeItem((PublishedFileId_t)113142309); OnRemoteStorageUnsubscribePublishedFileResultCallResult.Set(handle); print("SteamUGC. : " + handle); } GUILayout.Label("GetNumSubscribedItems() : " + SteamUGC.GetNumSubscribedItems()); if (GUILayout.Button("GetSubscribedItems(PublishedFileID, (uint)PublishedFileID.Length)")) { PublishedFileId_t[] PublishedFileID = new PublishedFileId_t[1]; uint ret = SteamUGC.GetSubscribedItems(PublishedFileID, (uint)PublishedFileID.Length); m_PublishedFileId = PublishedFileID[0]; print("SteamUGC.GetSubscribedItems(" + PublishedFileID + ", (uint)PublishedFileID.Length) : " + ret + " -- " + PublishedFileID[0]); } { ulong SizeOnDisk; string Folder; bool ret = SteamUGC.GetItemInstallInfo(m_PublishedFileId, out SizeOnDisk, out Folder, 1024); GUILayout.Label("GetItemInstallInfo(m_PublishedFileId, out SizeOnDisk, out Folder, 1024) : " + ret + " -- " + SizeOnDisk + " -- " + Folder); } { bool NeedsUpdate; bool IsDownloading; ulong BytesDownloaded; ulong BytesTotal; bool ret = SteamUGC.GetItemUpdateInfo(m_PublishedFileId, out NeedsUpdate, out IsDownloading, out BytesDownloaded, out BytesTotal); GUILayout.Label("GetItemUpdateInfo(m_PublishedFileId, out NeedsUpdate, out IsDownloading, out BytesDownloaded, out BytesTotal) : " + ret + " -- " + NeedsUpdate + " -- " + IsDownloading + " -- " + BytesDownloaded + " -- " + BytesTotal); } }
public static string GetLabel(this EItemUpdateStatus status) { return(("EItemUpdateStatus_" + status.ToString()).Translate()); }
public void DrawItemWindow() { ImGui.PushStyleColor(ImGuiCol.WindowBg, SteamScript.backgroundColor); ImGui.PushStyleColor(ImGuiCol.Button, SteamScript.buttonColor); ImGui.PushStyleColor(ImGuiCol.ButtonHovered, SteamScript.buttonHoveredColor); ImGui.PushStyleColor(ImGuiCol.ButtonActive, SteamScript.buttonActiveColor); ImGui.PushStyleColor(ImGuiCol.TitleBgActive, SteamScript.headerColor); ImGui.PushStyleColor(ImGuiCol.FrameBg, SteamScript.buttonActiveColor); ImGui.PushStyleColor(ImGuiCol.PopupBg, SteamScript.buttonColor); ImGui.PushStyleColor(ImGuiCol.ResizeGrip, SteamScript.buttonColor); ImGui.PushStyleColor(ImGuiCol.ResizeGripHovered, SteamScript.buttonActiveColor); ImGui.PushStyleColor(ImGuiCol.ResizeGripActive, SteamScript.buttonActiveColor); ImGui.SetNextWindowSize(new Vector2(600.0f, 480.0f), ImGuiCond.FirstUseEver); ImGui.Begin("Local mod info"); ImGui.Text("Type: " + mod.GetTypeString()); ImGui.InputText("Title", name); ImGui.InputTextMultiline("Description", description, new Vector2(400.0f, 120.0f)); ImGui.InputText("Tags (comma separated)", tags); if (ImGui.IsItemHovered()) { ImGui.PushStyleColor(ImGuiCol.Text, SteamScript.buttonTextColor); ImGui.SetTooltip("Tags for Steam Workshop items. Mod type is always added."); ImGui.PopStyleColor(1); } ImGui.InputText("Author", author); ImGui.InputText("Version", version); ImGui.Image(mod.thumbnail, Vector2.one * 100); ImGui.Dummy(new Vector2(0.0f, 10.0f)); if (uploading) { if (update_handle != UGCUpdateHandle_t.Invalid) { ulong bytesProcessed = 0; ulong bytesTotal = 1; EItemUpdateStatus status = SteamUGC.GetItemUpdateProgress(update_handle, out bytesProcessed, out bytesTotal); switch (status) { case EItemUpdateStatus.k_EItemUpdateStatusCommittingChanges: ImGui.Text("Committing Changes"); break; case EItemUpdateStatus.k_EItemUpdateStatusPreparingConfig: ImGui.Text("Preparing Config"); break; case EItemUpdateStatus.k_EItemUpdateStatusPreparingContent: ImGui.Text("Preparing Content"); break; case EItemUpdateStatus.k_EItemUpdateStatusUploadingContent: ImGui.Text("Uploading Content"); break; case EItemUpdateStatus.k_EItemUpdateStatusUploadingPreviewFile: ImGui.Text("Uploading Preview File"); break; default: break; } float progress = bytesProcessed / Math.Max(bytesTotal, 1); ImGui.ProgressBar(progress, new Vector2(0.0f, 0.0f)); } } else { ImGui.PushStyleColor(ImGuiCol.Text, SteamScript.buttonTextColor); if (steamworks_id == PublishedFileId_t.Invalid) { if (ImGui.Button("Upload to Workshop")) { RequestCreation(); } } else if (is_owner) { if (ImGui.Button("Update Workshop item")) { RequestCreation(); } } if (ImGui.Button("Update local metadata")) { UpdateMetadata(); } if (ImGui.IsItemHovered()) { ImGui.SetTooltip("Update local mod metadata without uploading to Steam Workshop"); } if (ImGui.Button("Close")) { waiting_for_create = false; } ImGui.PopStyleColor(1); } ImGui.End(); ImGui.PopStyleColor(10); }
public void RenderOnGUI() { GUILayout.BeginArea(new Rect(Screen.width - 120, 0, 120, Screen.height)); GUILayout.Label("Variables:"); GUILayout.Label("m_UGCQueryHandle: " + m_UGCQueryHandle); GUILayout.Label("m_PublishedFileId: " + m_PublishedFileId); GUILayout.Label("m_UGCUpdateHandle: " + m_UGCUpdateHandle); GUILayout.EndArea(); if (GUILayout.Button("CreateQueryUserUGCRequest(SteamUser.GetSteamID().GetAccountID(), EUserUGCList.k_EUserUGCList_Published, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Screenshots, EUserUGCListSortOrder.k_EUserUGCListSortOrder_CreationOrderDesc, AppId_t.Invalid, SteamUtils.GetAppID(), 1)")) { m_UGCQueryHandle = SteamUGC.CreateQueryUserUGCRequest(SteamUser.GetSteamID().GetAccountID(), EUserUGCList.k_EUserUGCList_Published, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Screenshots, EUserUGCListSortOrder.k_EUserUGCListSortOrder_CreationOrderDesc, AppId_t.Invalid, SteamUtils.GetAppID(), 1); print("SteamUGC.CreateQueryUserUGCRequest(" + SteamUser.GetSteamID().GetAccountID() + ", EUserUGCList.k_EUserUGCList_Published, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Screenshots, EUserUGCListSortOrder.k_EUserUGCListSortOrder_CreationOrderDesc, " + AppId_t.Invalid + ", " + SteamUtils.GetAppID() + ", 1) : " + m_UGCQueryHandle); } if (GUILayout.Button("CreateQueryAllUGCRequest(EUGCQuery.k_EUGCQuery_RankedByPublicationDate, EUGCMatchingUGCType.k_EUGCMatchingUGCType_AllGuides, AppId_t.Invalid, SteamUtils.GetAppID(), 1)")) { m_UGCQueryHandle = SteamUGC.CreateQueryAllUGCRequest(EUGCQuery.k_EUGCQuery_RankedByPublicationDate, EUGCMatchingUGCType.k_EUGCMatchingUGCType_AllGuides, AppId_t.Invalid, SteamUtils.GetAppID(), 1); print("SteamUGC.CreateQueryAllUGCRequest(EUGCQuery.k_EUGCQuery_RankedByPublicationDate, EUGCMatchingUGCType.k_EUGCMatchingUGCType_AllGuides, " + AppId_t.Invalid + ", " + SteamUtils.GetAppID() + ", 1) : " + m_UGCQueryHandle); } if (GUILayout.Button("CreateQueryUGCDetailsRequest(PublishedFileIDs, (uint)PublishedFileIDs.Length)")) { PublishedFileId_t[] PublishedFileIDs = new PublishedFileId_t[] { (PublishedFileId_t)280762427, //(PublishedFileId_t)280664702, }; m_UGCQueryHandle = SteamUGC.CreateQueryUGCDetailsRequest(PublishedFileIDs, (uint)PublishedFileIDs.Length); print("SteamUGC.CreateQueryUGCDetailsRequest(PublishedFileIDs, " + (uint)PublishedFileIDs.Length + ") : " + m_UGCQueryHandle); } if (GUILayout.Button("SendQueryUGCRequest(m_UGCQueryHandle)")) { SteamAPICall_t handle = SteamUGC.SendQueryUGCRequest(m_UGCQueryHandle); OnSteamUGCQueryCompletedCallResult.Set(handle); print("SteamUGC.SendQueryUGCRequest(" + m_UGCQueryHandle + ") : " + handle); } if (GUILayout.Button("GetQueryUGCResult(m_UGCQueryHandle, 0, out Details)")) { SteamUGCDetails_t Details; bool ret = SteamUGC.GetQueryUGCResult(m_UGCQueryHandle, 0, out Details); print("SteamUGC.GetQueryUGCResult(" + m_UGCQueryHandle + ", 0, out Details) : " + ret); print(Details.m_nPublishedFileId + " -- " + Details.m_eResult + " -- " + Details.m_eFileType + " -- " + Details.m_nCreatorAppID + " -- " + Details.m_nConsumerAppID + " -- " + Details.m_rgchTitle + " -- " + Details.m_rgchDescription + " -- " + Details.m_ulSteamIDOwner + " -- " + Details.m_rtimeCreated + " -- " + Details.m_rtimeUpdated + " -- " + Details.m_rtimeAddedToUserList + " -- " + Details.m_eVisibility + " -- " + Details.m_bBanned + " -- " + Details.m_bAcceptedForUse + " -- " + Details.m_bTagsTruncated + " -- " + Details.m_rgchTags + " -- " + Details.m_hFile + " -- " + Details.m_hPreviewFile + " -- " + Details.m_pchFileName + " -- " + Details.m_nFileSize + " -- " + Details.m_nPreviewFileSize + " -- " + Details.m_rgchURL + " -- " + Details.m_unVotesUp + " -- " + Details.m_unVotesDown + " -- " + Details.m_flScore + " -- " + Details.m_unNumChildren); } if (GUILayout.Button("GetQueryUGCPreviewURL(m_UGCQueryHandle, 0, out URL, 1024)")) { string URL; bool ret = SteamUGC.GetQueryUGCPreviewURL(m_UGCQueryHandle, 0, out URL, 1024); print("SteamUGC.GetQueryUGCPreviewURL(" + m_UGCQueryHandle + ", 0, out URL, 1024) : " + ret + " -- " + URL); } if (GUILayout.Button("GetQueryUGCMetadata(m_UGCQueryHandle, 0, out Metadata, Constants.k_cchDeveloperMetadataMax)")) { string Metadata; bool ret = SteamUGC.GetQueryUGCMetadata(m_UGCQueryHandle, 0, out Metadata, Constants.k_cchDeveloperMetadataMax); print("SteamUGC.GetQueryUGCMetadata(" + m_UGCQueryHandle + ", 0, out Metadata, " + Constants.k_cchDeveloperMetadataMax + ") : " + ret + " -- " + Metadata); } if (GUILayout.Button("GetQueryUGCChildren(m_UGCQueryHandle, 0, PublishedFileIDs, (uint)PublishedFileIDs.Length)")) { PublishedFileId_t[] PublishedFileIDs = new PublishedFileId_t[1]; // Use SteamUGCDetails_t::m_unNumChildren instead... bool ret = SteamUGC.GetQueryUGCChildren(m_UGCQueryHandle, 0, PublishedFileIDs, (uint)PublishedFileIDs.Length); print("SteamUGC.GetQueryUGCChildren(" + m_UGCQueryHandle + ", 0, PublishedFileIDs, " + (uint)PublishedFileIDs.Length + ") : " + ret + " -- " + PublishedFileIDs[0]); } if (GUILayout.Button("GetQueryUGCStatistic(m_UGCQueryHandle, 0, EItemStatistic.k_EItemStatistic_NumSubscriptions, out StatValue)")) { uint StatValue; bool ret = SteamUGC.GetQueryUGCStatistic(m_UGCQueryHandle, 0, EItemStatistic.k_EItemStatistic_NumSubscriptions, out StatValue); print("SteamUGC.GetQueryUGCStatistic(" + m_UGCQueryHandle + ", 0, EItemStatistic.k_EItemStatistic_NumSubscriptions, out StatValue) : " + ret + " -- " + StatValue); } if (GUILayout.Button("GetQueryUGCNumAdditionalPreviews(m_UGCQueryHandle, 0)")) { print("SteamUGC.GetQueryUGCNumAdditionalPreviews(" + m_UGCQueryHandle + ", 0) : " + SteamUGC.GetQueryUGCNumAdditionalPreviews(m_UGCQueryHandle, 0)); } if (GUILayout.Button("GetQueryUGCAdditionalPreview(m_UGCQueryHandle, 0, 0, out URLOrVideoID, 1024, out IsImage)")) { string URLOrVideoID; bool IsImage; bool ret = SteamUGC.GetQueryUGCAdditionalPreview(m_UGCQueryHandle, 0, 0, out URLOrVideoID, 1024, out IsImage); // Should check GetQueryUGCNumAdditionalPreviews first. print("SteamUGC.GetQueryUGCAdditionalPreview(" + m_UGCQueryHandle + ", 0, 0, out URLOrVideoID, 1024, out IsImage) : " + ret + " -- " + URLOrVideoID + " -- " + IsImage); } if (GUILayout.Button("GetQueryUGCNumKeyValueTags(m_UGCQueryHandle, 0)")) { uint ret = SteamUGC.GetQueryUGCNumKeyValueTags(m_UGCQueryHandle, 0); print("SteamUGC.GetQueryUGCNumKeyValueTags(" + m_UGCQueryHandle + ", 0) : " + ret); } if (GUILayout.Button("GetQueryUGCKeyValueTag(m_UGCQueryHandle, 0, 0, out Key, 260, out Value, 260)")) { string Key; string Value; bool ret = SteamUGC.GetQueryUGCKeyValueTag(m_UGCQueryHandle, 0, 0, out Key, 260, out Value, 260); print("SteamUGC.GetQueryUGCKeyValueTag(" + m_UGCQueryHandle + ", 0, 0, out Key, 260, out Value, 260) : " + ret + " -- " + Key + " -- " + Value); } if (GUILayout.Button("ReleaseQueryUGCRequest(m_UGCQueryHandle)")) { print("SteamUGC.ReleaseQueryUGCRequest(" + m_UGCQueryHandle + ") : " + SteamUGC.ReleaseQueryUGCRequest(m_UGCQueryHandle)); } if (GUILayout.Button("AddRequiredTag(m_UGCQueryHandle, \"Co-op\")")) { print("SteamUGC.AddRequiredTag(" + m_UGCQueryHandle + ", \"Co-op\") : " + SteamUGC.AddRequiredTag(m_UGCQueryHandle, "Co-op")); } if (GUILayout.Button("AddExcludedTag(m_UGCQueryHandle, \"Co-op\")")) { print("SteamUGC.AddExcludedTag(" + m_UGCQueryHandle + ", \"Co-op\") : " + SteamUGC.AddExcludedTag(m_UGCQueryHandle, "Co-op")); } if (GUILayout.Button("SetReturnKeyValueTags(m_UGCQueryHandle, true)")) { print("SteamUGC.SetReturnKeyValueTags(" + m_UGCQueryHandle + ", true) : " + SteamUGC.SetReturnKeyValueTags(m_UGCQueryHandle, true)); } if (GUILayout.Button("SetReturnLongDescription(m_UGCQueryHandle, true)")) { print("SteamUGC.SetReturnLongDescription(" + m_UGCQueryHandle + ", true) : " + SteamUGC.SetReturnLongDescription(m_UGCQueryHandle, true)); } if (GUILayout.Button("SetReturnMetadata(m_UGCQueryHandle, true)")) { print("SteamUGC.SetReturnMetadata(" + m_UGCQueryHandle + ", true) : " + SteamUGC.SetReturnMetadata(m_UGCQueryHandle, true)); } if (GUILayout.Button("SetReturnChildren(m_UGCQueryHandle, true)")) { print("SteamUGC.SetReturnChildren(" + m_UGCQueryHandle + ", true) : " + SteamUGC.SetReturnChildren(m_UGCQueryHandle, true)); } if (GUILayout.Button("SetReturnAdditionalPreviews(m_UGCQueryHandle, true)")) { print("SteamUGC.SetReturnAdditionalPreviews(" + m_UGCQueryHandle + ", true) : " + SteamUGC.SetReturnAdditionalPreviews(m_UGCQueryHandle, true)); } if (GUILayout.Button("SetReturnTotalOnly(m_UGCQueryHandle, true)")) { print("SteamUGC.SetReturnTotalOnly(" + m_UGCQueryHandle + ", true) : " + SteamUGC.SetReturnTotalOnly(m_UGCQueryHandle, true)); } if (GUILayout.Button("SetLanguage(m_UGCQueryHandle, \"english\")")) { print("SteamUGC.SetLanguage(" + m_UGCQueryHandle + ", \"english\") : " + SteamUGC.SetLanguage(m_UGCQueryHandle, "english")); } if (GUILayout.Button("SetAllowCachedResponse(m_UGCQueryHandle, 5)")) { print("SteamUGC.SetAllowCachedResponse(" + m_UGCQueryHandle + ", 5) : " + SteamUGC.SetAllowCachedResponse(m_UGCQueryHandle, 5)); } if (GUILayout.Button("SetCloudFileNameFilter(m_UGCQueryHandle, \"\")")) { print("SteamUGC.SetCloudFileNameFilter(" + m_UGCQueryHandle + ", \"\") : " + SteamUGC.SetCloudFileNameFilter(m_UGCQueryHandle, "")); } if (GUILayout.Button("SetMatchAnyTag(m_UGCQueryHandle, true)")) { print("SteamUGC.SetMatchAnyTag(" + m_UGCQueryHandle + ", true) : " + SteamUGC.SetMatchAnyTag(m_UGCQueryHandle, true)); } if (GUILayout.Button("SetSearchText(m_UGCQueryHandle, \"AciD\")")) { print("SteamUGC.SetSearchText(" + m_UGCQueryHandle + ", \"AciD\") : " + SteamUGC.SetSearchText(m_UGCQueryHandle, "AciD")); } if (GUILayout.Button("SetRankedByTrendDays(m_UGCQueryHandle, 7)")) { print("SteamUGC.SetRankedByTrendDays(" + m_UGCQueryHandle + ", 7) : " + SteamUGC.SetRankedByTrendDays(m_UGCQueryHandle, 7)); } if (GUILayout.Button("AddRequiredKeyValueTag(m_UGCQueryHandle, \"TestKey\", \"TestValue\")")) { print("SteamUGC.AddRequiredKeyValueTag(" + m_UGCQueryHandle + ", \"TestKey\", \"TestValue\") : " + SteamUGC.AddRequiredKeyValueTag(m_UGCQueryHandle, "TestKey", "TestValue")); } if (GUILayout.Button("RequestUGCDetails(m_PublishedFileId, 5)")) { SteamAPICall_t handle = SteamUGC.RequestUGCDetails(m_PublishedFileId, 5); OnSteamUGCRequestUGCDetailsResultCallResult.Set(handle); print("SteamUGC.RequestUGCDetails(m_PublishedFileId, 5) : " + handle); } if (GUILayout.Button("CreateItem((AppId_t)480, EWorkshopFileType.k_EWorkshopFileTypeWebGuide)")) { SteamAPICall_t handle = SteamUGC.CreateItem((AppId_t)480, EWorkshopFileType.k_EWorkshopFileTypeWebGuide); OnCreateItemResultCallResult.Set(handle); print("SteamUGC.CreateItem((AppId_t)480, EWorkshopFileType.k_EWorkshopFileTypeWebGuide) : " + handle); } if (GUILayout.Button("StartItemUpdate((AppId_t)480, m_PublishedFileId)")) { m_UGCUpdateHandle = SteamUGC.StartItemUpdate((AppId_t)480, m_PublishedFileId); print("SteamUGC.StartItemUpdate((AppId_t)480, " + m_PublishedFileId + ") : " + m_UGCUpdateHandle); } if (GUILayout.Button("SetItemTitle(m_UGCUpdateHandle, \"This is a Test\")")) { bool ret = SteamUGC.SetItemTitle(m_UGCUpdateHandle, "This is a Test"); print("SteamUGC.SetItemTitle(" + m_UGCUpdateHandle + ", \"This is a Test\") : " + ret); } if (GUILayout.Button("SetItemDescription(m_UGCUpdateHandle, \"This is the test description.\")")) { bool ret = SteamUGC.SetItemDescription(m_UGCUpdateHandle, "This is the test description."); print("SteamUGC.SetItemDescription(" + m_UGCUpdateHandle + ", \"This is the test description.\") : " + ret); } if (GUILayout.Button("SetItemUpdateLanguage(m_UGCUpdateHandle, \"english\")")) { bool ret = SteamUGC.SetItemUpdateLanguage(m_UGCUpdateHandle, "english"); print("SteamUGC.SetItemUpdateLanguage(" + m_UGCUpdateHandle + ", \"english\") : " + ret); } if (GUILayout.Button("SetItemMetadata(m_UGCUpdateHandle, \"This is the test metadata.\")")) { bool ret = SteamUGC.SetItemMetadata(m_UGCUpdateHandle, "This is the test metadata."); print("SteamUGC.SetItemMetadata(" + m_UGCUpdateHandle + ", \"This is the test metadata.\") : " + ret); } if (GUILayout.Button("SetItemVisibility(m_UGCUpdateHandle, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPrivate)")) { bool ret = SteamUGC.SetItemVisibility(m_UGCUpdateHandle, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPrivate); print("SteamUGC.SetItemVisibility(" + m_UGCUpdateHandle + ", ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPrivate) : " + ret); } if (GUILayout.Button("SetItemTags(m_UGCUpdateHandle, new string[] {\"Tag One\", \"Tag Two\", \"Test Tags\", \"Sorry\"})")) { bool ret = SteamUGC.SetItemTags(m_UGCUpdateHandle, new string[] { "Tag One", "Tag Two", "Test Tags", "Sorry" }); print("SteamUGC.SetItemTags(" + m_UGCUpdateHandle + ", new string[] {\"Tag One\", \"Tag Two\", \"Test Tags\", \"Sorry\"}) : " + ret); } if (GUILayout.Button("SetItemContent(m_UGCUpdateHandle, Application.dataPath + \"/Scenes\")")) { bool ret = SteamUGC.SetItemContent(m_UGCUpdateHandle, Application.dataPath + "/Scenes"); // Should point to a folder containing the UGC Item print("SteamUGC.SetItemContent(" + m_UGCUpdateHandle + ", Application.dataPath + \"/Scenes\") : " + ret); } if (GUILayout.Button("SetItemPreview(m_UGCUpdateHandle, Application.dataPath + \"/controller.vdf\")")) { bool ret = SteamUGC.SetItemPreview(m_UGCUpdateHandle, Application.dataPath + "/controller.vdf"); // Should actually be a PNG/JPG Screenshot. print("SteamUGC.SetItemPreview(" + m_UGCUpdateHandle + ", Application.dataPath + \"/controller.vdf\") : " + ret); } if (GUILayout.Button("RemoveItemKeyValueTags(m_UGCUpdateHandle, \"TestKey\")")) { bool ret = SteamUGC.RemoveItemKeyValueTags(m_UGCUpdateHandle, "TestKey"); print("SteamUGC.RemoveItemKeyValueTags(" + m_UGCUpdateHandle + "\"TestKey\") : " + ret); } if (GUILayout.Button("AddItemKeyValueTag(m_UGCUpdateHandle, \"TestKey\", \"TestValue\")")) { bool ret = SteamUGC.AddItemKeyValueTag(m_UGCUpdateHandle, "TestKey", "TestValue"); print("SteamUGC.AddItemKeyValueTag(" + m_UGCUpdateHandle + "\"TestKey\", \"TestValue\") : " + ret); } if (GUILayout.Button("SubmitItemUpdate(m_UGCUpdateHandle, \"Test Changenote\")")) { SteamAPICall_t handle = SteamUGC.SubmitItemUpdate(m_UGCUpdateHandle, "Test Changenote"); OnSubmitItemUpdateResultCallResult.Set(handle); print("SteamUGC.SubmitItemUpdate(" + m_UGCUpdateHandle + ", \"Test Changenote\") : " + handle); } { ulong BytesProcessed; ulong BytesTotal; EItemUpdateStatus ret = SteamUGC.GetItemUpdateProgress(m_UGCUpdateHandle, out BytesProcessed, out BytesTotal); GUILayout.Label("GetItemUpdateProgress(m_UGCUpdateHandle, out BytesProcessed, out BytesTotal) : " + ret + " -- " + BytesProcessed + " -- " + BytesTotal); } if (GUILayout.Button("SetUserItemVote((PublishedFileId_t)280762427, true)")) { SteamAPICall_t handle = SteamUGC.SetUserItemVote((PublishedFileId_t)280762427, true); // http://steamcommunity.com/sharedfiles/filedetails/?id=280762427 OnSetUserItemVoteResultCallResult.Set(handle); print("SteamUGC.SetUserItemVote((PublishedFileId_t)280762427, true) : " + handle); } if (GUILayout.Button("GetUserItemVote((PublishedFileId_t)280762427)")) { SteamAPICall_t handle = SteamUGC.GetUserItemVote((PublishedFileId_t)280762427); // http://steamcommunity.com/sharedfiles/filedetails/?id=280762427 OnGetUserItemVoteResultCallResult.Set(handle); print("SteamUGC.GetUserItemVote((PublishedFileId_t)280762427) : " + handle); } if (GUILayout.Button("AddItemToFavorites(SteamUtils.GetAppID(), (PublishedFileId_t)280762427)")) { SteamAPICall_t handle = SteamUGC.AddItemToFavorites(SteamUtils.GetAppID(), (PublishedFileId_t)280762427); // http://steamcommunity.com/sharedfiles/filedetails/?id=280762427 OnUserFavoriteItemsListChangedCallResult.Set(handle); print("SteamUGC.AddItemToFavorites(" + SteamUtils.GetAppID() + ", (PublishedFileId_t)280762427) : " + handle); } if (GUILayout.Button("RemoveItemFromFavorites(SteamUtils.GetAppID(), (PublishedFileId_t)280762427)")) { SteamAPICall_t handle = SteamUGC.RemoveItemFromFavorites(SteamUtils.GetAppID(), (PublishedFileId_t)280762427); // http://steamcommunity.com/sharedfiles/filedetails/?id=280762427 OnUserFavoriteItemsListChangedCallResult.Set(handle); print("SteamUGC.RemoveItemFromFavorites(" + SteamUtils.GetAppID() + ", (PublishedFileId_t)280762427) : " + handle); } if (GUILayout.Button("SubscribeItem((PublishedFileId_t)280762427)")) { SteamAPICall_t handle = SteamUGC.SubscribeItem((PublishedFileId_t)280762427); // http://steamcommunity.com/sharedfiles/filedetails/?id=280762427 OnRemoteStorageSubscribePublishedFileResultCallResult.Set(handle); print("SteamUGC.SubscribeItem((PublishedFileId_t)280762427) : " + handle); } if (GUILayout.Button("UnsubscribeItem((PublishedFileId_t)280762427)")) { SteamAPICall_t handle = SteamUGC.UnsubscribeItem((PublishedFileId_t)280762427); // http://steamcommunity.com/sharedfiles/filedetails/?id=280762427 OnRemoteStorageUnsubscribePublishedFileResultCallResult.Set(handle); print("SteamUGC.UnsubscribeItem((PublishedFileId_t)280762427) : " + handle); } GUILayout.Label("GetNumSubscribedItems() : " + SteamUGC.GetNumSubscribedItems()); if (GUILayout.Button("GetSubscribedItems(PublishedFileID, (uint)PublishedFileID.Length)")) { PublishedFileId_t[] PublishedFileID = new PublishedFileId_t[1]; uint ret = SteamUGC.GetSubscribedItems(PublishedFileID, (uint)PublishedFileID.Length); m_PublishedFileId = PublishedFileID[0]; print("SteamUGC.GetSubscribedItems(" + PublishedFileID + ", (uint)PublishedFileID.Length) : " + ret + " -- " + PublishedFileID[0]); } GUILayout.Label("GetItemState(PublishedFileID) : " + (EItemState)SteamUGC.GetItemState(m_PublishedFileId)); { ulong SizeOnDisk; string Folder; uint punTimeStamp; bool ret = SteamUGC.GetItemInstallInfo(m_PublishedFileId, out SizeOnDisk, out Folder, 1024, out punTimeStamp); GUILayout.Label("GetItemInstallInfo(m_PublishedFileId, out SizeOnDisk, out Folder, 1024, out punTimeStamp) : " + ret + " -- " + SizeOnDisk + " -- " + Folder + " -- " + punTimeStamp); } { ulong BytesDownloaded; ulong BytesTotal; bool ret = SteamUGC.GetItemDownloadInfo(m_PublishedFileId, out BytesDownloaded, out BytesTotal); GUILayout.Label("GetItemDownloadInfo(m_PublishedFileId, out BytesDownloaded, out BytesTotal) : " + ret + " -- " + BytesDownloaded + " -- " + BytesTotal); } if (GUILayout.Button("DownloadItem(PublishedFileID, true)")) { print("SteamUGC.DownloadItem(m_PublishedFileId, true) : " + SteamUGC.DownloadItem(m_PublishedFileId, true)); } }
public void UploadMod(ModObject mod, string changelog, string[] tags, bool keepUnCooked, bool keepScripts, int visibility, string description) { if (IsUploaderRunning) { MainWindow.Instance.Invoke(new MethodInvoker(() => { GUI.MessageBox.Show(MainWindow.Instance, "Only one uploader instance can run at once!"); })); return; } success = true; IsUploaderRunning = true; try { ERemoteStoragePublishedFileVisibility fileVisibility = (ERemoteStoragePublishedFileVisibility)Enum.ToObject(typeof(ERemoteStoragePublishedFileVisibility), visibility);; mod.Refresh(); SetStatus("Preparing the uploader..."); var tmpDir = Path.Combine(Program.GetAppRoot(), "uploader_tmp"); if (Directory.Exists(tmpDir)) { Directory.Delete(tmpDir, true); } Directory.CreateDirectory(tmpDir); Utils.DirectoryCopy(mod.RootPath, tmpDir, true); if (!keepScripts) { if (Directory.Exists(Path.Combine(tmpDir, "CompiledScripts"))) { Directory.Delete(Path.Combine(tmpDir, "CompiledScripts"), true); } if (Directory.Exists(Path.Combine(tmpDir, "Classes"))) { Directory.Delete(Path.Combine(tmpDir, "Classes"), true); } } if (!keepUnCooked) { if (Directory.Exists(Path.Combine(tmpDir, "Maps"))) { Directory.Delete(Path.Combine(tmpDir, "Maps"), true); } if (Directory.Exists(Path.Combine(tmpDir, "Content"))) { Directory.Delete(Path.Combine(tmpDir, "Content"), true); } } //var description = mod.GetDescription(); var modid = mod.GetUploadedId(); SetStatus("Creating callback..."); m_itemCreated = CallResult <CreateItemResult_t> .Create(OnItemCreated); var appId = new AppId_t(uint.Parse(GameFinder.AppID)); if (modid == 0) { SteamAPICall_t call = SteamUGC.CreateItem(appId, EWorkshopFileType.k_EWorkshopFileTypeCommunity); m_itemCreated.Set(call); } else { publishID = modid; } while (publishID == 0) { SteamAPI.RunCallbacks(); Thread.Sleep(1000); } Thread.Sleep(1000); if (modid == 0) { SetStatus("Uploading an new mod " + mod.Name + " with WorkshopID: " + publishID); mod.SetUploadedId(publishID); } else { SetStatus("Updating the mod " + mod.Name + " with WorkshopID: " + publishID); } var publishFileID_t = new PublishedFileId_t(publishID); ugcUpdateHandle = SteamUGC.StartItemUpdate(appId, publishFileID_t); SteamUGC.SetItemTitle(ugcUpdateHandle, mod.Name); SteamUGC.SetItemDescription(ugcUpdateHandle, description); SteamUGC.SetItemVisibility(ugcUpdateHandle, fileVisibility); if (tags != null) { SteamUGC.SetItemTags(ugcUpdateHandle, tags); } SteamUGC.SetItemPreview(ugcUpdateHandle, Path.Combine(tmpDir, mod.Icon)); SteamUGC.SetItemContent(ugcUpdateHandle, tmpDir); SteamAPICall_t t = SteamUGC.SubmitItemUpdate(ugcUpdateHandle, changelog); m_itemSubmitted = CallResult <SubmitItemUpdateResult_t> .Create(OnItemSubmitted); m_itemSubmitted.Set(t); while (true) { Thread.Sleep(1000); if (ugcUpdateHandle == UGCUpdateHandle_t.Invalid) { break; } SteamAPI.RunCallbacks(); ulong bytesDone, bytesTotal; EItemUpdateStatus status = SteamUGC.GetItemUpdateProgress(ugcUpdateHandle, out bytesDone, out bytesTotal); if (status == EItemUpdateStatus.k_EItemUpdateStatusInvalid && !success) { break; } SetStatus(string.Format("[{3}%] Status: {0}\n{1}/{2}", TranslateStatus(status), BytesToString(bytesDone), BytesToString(bytesTotal), bytesTotal > 0 ? Math.Floor(((double)bytesDone / (double)bytesTotal) * (double)100) : 100)); } DialogResult res = DialogResult.No; if (success) { MainWindow.Instance.Invoke(new MethodInvoker(() => { res = GUI.MessageBox.Show(MainWindow.Instance, "Done, mod url:" + "\nhttps://steamcommunity.com/sharedfiles/filedetails/?id=" + publishID + "\n\nOpen it in the browser?", "Uploader", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (res == DialogResult.Yes) { Process.Start("steam://openurl/https://steamcommunity.com/sharedfiles/filedetails/?id=" + publishID); } })); SetStatus("Item uploaded successfully!"); Thread.Sleep(1000); } SetStatus("Cleanup"); if (Directory.Exists(tmpDir)) { Directory.Delete(tmpDir, true); } SetStatus(null); IsUploaderRunning = false; } catch (Exception e) { MainWindow.Instance.Invoke(new MethodInvoker(() => { GUI.MessageBox.Show(MainWindow.Instance, e.Message + "\n" + e.ToString()); })); IsUploaderRunning = false; SetStatus(null); } }
public void GetUpdateProgress(out ulong bytesProcessed, out ulong bytesTotal) { EItemUpdateStatus status = SteamUGC.GetItemUpdateProgress(updateHandle, out bytesProcessed, out bytesTotal); }
protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); e.Graphics.DrawImage(globals.GetTexture(ulFileID.ToString(), "jpg"), new Rectangle(1, 1, Height - 2, Height - 2)); if (m_bWhitelisted) { e.Graphics.DrawImage(Properties.Resources.verified, new Rectangle(Height - 18, Height - 18, 18, 18)); } e.Graphics.FillRectangle(new SolidBrush(colOverlay), new Rectangle(0, 0, Width, Height)); e.Graphics.DrawRectangle(Pens.Black, new Rectangle(1, 1, Height - 2, Height - 2)); StringFormat formatter = new StringFormat(); formatter.LineAlignment = StringAlignment.Center; formatter.Alignment = StringAlignment.Near; if (m_bUploading) { bool bDrawProgress = false; string statusString = ""; ulong punBytesProcessed = 0, punBytesTotal = 0; EItemUpdateStatus uploadStatus = SteamUGC.GetItemUpdateProgress(updateHandle, out punBytesProcessed, out punBytesTotal); if (uploadStatus == EItemUpdateStatus.k_EItemUpdateStatusPreparingConfig) { statusString = "Preparing Content..."; } else if (uploadStatus == EItemUpdateStatus.k_EItemUpdateStatusPreparingContent) { statusString = string.Format("Uploading Content: {0} / {1} bytes", punBytesProcessed, punBytesTotal); bDrawProgress = true; } else if (uploadStatus == EItemUpdateStatus.k_EItemUpdateStatusUploadingContent || uploadStatus == EItemUpdateStatus.k_EItemUpdateStatusUploadingPreviewFile) { statusString = "Configuring Content..."; } else if (uploadStatus == EItemUpdateStatus.k_EItemUpdateStatusCommittingChanges) { statusString = "Committing Changes..."; } e.Graphics.DrawString(statusString, new Font("Times New Roman", 11, FontStyle.Bold), new SolidBrush(Color.White), new Rectangle(Height + 2, 1, Width - Height - 2, 30), formatter); if (bDrawProgress && (punBytesTotal > 0)) { e.Graphics.DrawImage(globals.GetTexture("bar"), new Rectangle(Height + 2, 33, Width - Height - 24, 16)); double flPercent = ((double)punBytesProcessed) / ((double)punBytesTotal); double flWide = (double)(Width - Height - 24) * flPercent; e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(145, 200, 15, 15)), new Rectangle(Height + 2, 33, (int)flWide, 16)); e.Graphics.DrawRectangle(Pens.Black, new Rectangle(Height + 2, 33, Width - Height - 24, 16)); } return; } e.Graphics.DrawString(pszName, new Font("Times New Roman", 20, FontStyle.Bold), new SolidBrush(Color.White), new Rectangle(Height + 2, 1, Width - Height - 2, 30), formatter); e.Graphics.DrawString(pszDescription, new Font("Times New Roman", 10, FontStyle.Regular), new SolidBrush(Color.White), new Rectangle(Height + 3, 33, Width - Height - 3, 20), formatter); formatter.LineAlignment = StringAlignment.Center; formatter.Alignment = StringAlignment.Far; e.Graphics.DrawString(pszDate, new Font("Times New Roman", 10, FontStyle.Bold), new SolidBrush(Color.White), new Rectangle(Width - 142, 2, 140, 20), formatter); }