Esempio n. 1
0
 private void DestroyCallbacks()
 {
     onComplete?.Dispose();
     onComplete = null;
     onGlobalComplete?.Dispose();
     onGlobalComplete = null;
 }
Esempio n. 2
0
 // I'm a f****n idiot...
 public void ResetUploader()
 {
     publishID = 0;
     Message   = "";
     m_itemCreated?.Dispose();
     m_itemSubmitted?.Dispose();
     ugcUpdateHandle = UGCUpdateHandle_t.Invalid;
 }
Esempio n. 3
0
 protected override void OnCleanUp()
 {
     HidePopup();
     unsubCaller?.Dispose();
     if (actionsScreen != null)
     {
         Destroy(actionsScreen.gameObject);
     }
     actionsScreen = null;
     base.OnCleanUp();
 }
Esempio n. 4
0
 protected virtual void Dispose(bool disposing)
 {
     if (!disposedValue)
     {
         if (disposing)
         {
             createItemResult?.Dispose();
             submitItemUpdateResult?.Dispose();
         }
         disposedValue = true;
     }
 }
Esempio n. 5
0
    public void Cleanup()
    {
        if (OnCreateItemResult != null)
        {
            OnCreateItemResult.Dispose();
        }
        OnCreateItemResult = null;

        if (OnSubmitItemUpdateResult != null)
        {
            OnSubmitItemUpdateResult.Dispose();
        }
        OnSubmitItemUpdateResult = null;
    }
Esempio n. 6
0
    //Creates new item and returns ID in the callback
    //Always check if the returned id is valid to check if the call was successful (valid ids are not 0)
    public bool CreateNewItem(CreateItemCallBack callback)
    {
        bool result = false;

        if (SteamManager.Initialized)
        {
            SteamAPICall_t apiCall = SteamUGC.CreateItem(SteamUtils.GetAppID(), EWorkshopFileType.k_EWorkshopFileTypeCommunity);
            if (createItemResult.IsActive())
            {
                createItemResult.Cancel();
                createItemResult.Dispose();
            }
            createItemResult.Set(apiCall);
            createItemCallBack = callback;
            result             = true;
        }
        return(result);
    }
Esempio n. 7
0
    //Used to update a workshop item, the callback function is called after the update is completed. The return value will indicate success or failure.
    public bool UpdateItem(PublishedFileId_t fileId, string title, string description, string contentPath, string previewImagePath, string changeNote, SubmitItemCallBack submitItemCallBack)
    {
        bool result = false;

        if (SteamManager.Initialized && fileId.m_PublishedFileId != 0)
        {
            updateHandle = SteamUGC.StartItemUpdate(SteamUtils.GetAppID(), fileId);
            result       = true;
            result       = result && SteamUGC.SetItemTitle(updateHandle, title);

            if (result)
            {
                result = result && SteamUGC.SetItemDescription(updateHandle, description);
            }

            if (result)
            {
                result = result && SteamUGC.SetItemContent(updateHandle, contentPath);
            }

            if (result)
            {
                result = result && SteamUGC.SetItemPreview(updateHandle, previewImagePath);
            }
            if (result)
            {
                result = result && SteamUGC.SetItemVisibility(updateHandle, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic);
            }


            if (result)
            {
                SteamAPICall_t apiCall = SteamUGC.SubmitItemUpdate(updateHandle, changeNote);
                if (submitItemResult.IsActive())
                {
                    submitItemResult.Cancel();
                    submitItemResult.Dispose();
                }
                submitItemResult.Set(apiCall);
                this.submitItemCallBack = submitItemCallBack;
            }
        }
        return(result);
    }
Esempio n. 8
0
 public void Dispose()
 {
     updateCaller.Dispose();
     uploadCaller.Dispose();
     updateHandle = PublishedFileUpdateHandle_t.Invalid;
 }
Esempio n. 9
0
 public void Dispose()
 {
     onComplete?.Dispose();
     onComplete = null;
 }