示例#1
0
 private static void OnItemSubmitted(SubmitItemUpdateResult_t result, bool IOFailure)
 {
     if (IOFailure || result.m_eResult != EResult.k_EResultOK)
     {
         Workshop.uploadingHook = null;
         Dialog_WorkshopOperationInProgress.CloseAll();
         Log.Error("Workshop: OnItemSubmitted failure. Result: " + result.m_eResult.GetLabel(), false);
         Find.WindowStack.Add(new Dialog_MessageBox("WorkshopSubmissionFailed".Translate(new object[]
         {
             GenText.SplitCamelCase(result.m_eResult.GetLabel())
         }), null, null, null, null, null, false, null, null));
     }
     else
     {
         SteamUtility.OpenWorkshopPage(Workshop.uploadingHook.PublishedFileId);
         Messages.Message("WorkshopUploadSucceeded".Translate(new object[]
         {
             Workshop.uploadingHook.Name
         }), MessageTypeDefOf.TaskCompletion, false);
         if (Prefs.LogVerbose)
         {
             Log.Message("Workshop: Item submit result: " + result.m_eResult, false);
         }
     }
     Workshop.curStage     = WorkshopInteractStage.None;
     Workshop.submitResult = null;
 }
示例#2
0
        private static void OnItemCreated(CreateItemResult_t result, bool IOFailure)
        {
            if (IOFailure || result.m_eResult != EResult.k_EResultOK)
            {
                uploadingHook = null;
                Dialog_WorkshopOperationInProgress.CloseAll();
                Log.Error("Workshop: OnItemCreated failure. Result: " + result.m_eResult.GetLabel());
                Find.WindowStack.Add(new Dialog_MessageBox("WorkshopSubmissionFailed".Translate(GenText.SplitCamelCase(result.m_eResult.GetLabel()))));
            }
            else
            {
                uploadingHook.PublishedFileId = result.m_nPublishedFileId;
                if (Prefs.LogVerbose)
                {
                    Log.Message("Workshop: Item created. PublishedFileId: " + uploadingHook.PublishedFileId);
                }
                curUpdateHandle = SteamUGC.StartItemUpdate(SteamUtils.GetAppID(), uploadingHook.PublishedFileId);
                SetWorkshopItemDataFrom(curUpdateHandle, uploadingHook, creating: true);
                curStage = WorkshopInteractStage.SubmittingItem;
                if (Prefs.LogVerbose)
                {
                    Log.Message("Workshop: Submitting item.");
                }
                SteamAPICall_t hAPICall = SteamUGC.SubmitItemUpdate(curUpdateHandle, "[Auto-generated text]: Initial upload.");
                submitResult = CallResult <SubmitItemUpdateResult_t> .Create(OnItemSubmitted);

                submitResult.Set(hAPICall);
                createResult = null;
            }
        }
示例#3
0
        private static void OnItemCreated(CreateItemResult_t result, bool IOFailure)
        {
            if (IOFailure || result.m_eResult != EResult.k_EResultOK)
            {
                Workshop.uploadingHook = null;
                Dialog_WorkshopOperationInProgress.CloseAll();
                Log.Error("Workshop: OnItemCreated failure. Result: " + result.m_eResult.GetLabel(), false);
                Find.WindowStack.Add(new Dialog_MessageBox("WorkshopSubmissionFailed".Translate(new object[]
                {
                    GenText.SplitCamelCase(result.m_eResult.GetLabel())
                }), null, null, null, null, null, false, null, null));
            }
            else
            {
                Workshop.uploadingHook.PublishedFileId = result.m_nPublishedFileId;
                if (Prefs.LogVerbose)
                {
                    Log.Message("Workshop: Item created. PublishedFileId: " + Workshop.uploadingHook.PublishedFileId, false);
                }
                Workshop.curUpdateHandle = SteamUGC.StartItemUpdate(SteamUtils.GetAppID(), Workshop.uploadingHook.PublishedFileId);
                Workshop.SetWorkshopItemDataFrom(Workshop.curUpdateHandle, Workshop.uploadingHook, true);
                Workshop.curStage = WorkshopInteractStage.SubmittingItem;
                if (Prefs.LogVerbose)
                {
                    Log.Message("Workshop: Submitting item.", false);
                }
                SteamAPICall_t hAPICall = SteamUGC.SubmitItemUpdate(Workshop.curUpdateHandle, "[Auto-generated text]: Initial upload.");
                if (Workshop.< > f__mg$cache6 == null)
                {
                    Workshop.< > f__mg$cache6 = new CallResult <SubmitItemUpdateResult_t> .APIDispatchDelegate(Workshop.OnItemSubmitted);
                }
                Workshop.submitResult = CallResult <SubmitItemUpdateResult_t> .Create(Workshop.< > f__mg$cache6);

                Workshop.submitResult.Set(hAPICall, null);
                Workshop.createResult = null;
            }
        }