Exemple #1
0
    private void OnOwnedItemListLoaded(WorkshopItemListEventArgs p_itemListArgs)
    {
        uMyGUI_PopupManager.Instance.HidePopup(uMyGUI_PopupManager.POPUP_LOADING);

        if (p_itemListArgs.IsError)
        {
            return;
        }

        if (p_itemListArgs.ItemList.Items.Count > 0)
        {
            // generate a list of item names
            string[] dropdownEntries = new string[p_itemListArgs.ItemList.Items.Count];
            for (int i = 0; i < dropdownEntries.Length; i++)
            {
                dropdownEntries[i] = p_itemListArgs.ItemList.Items[i].Name;
            }

            // select the item, which you want to update
            ((uMyGUI_PopupDropdown)uMyGUI_PopupManager.Instance.ShowPopup(uMyGUI_PopupManager.POPUP_DROPDOWN))
            .SetEntries(dropdownEntries)
            .SetOnSelected((int p_selectedIndex) => OnOwnedItemSelectedForUpdate(p_itemListArgs.ItemList.Items[p_selectedIndex]))
            .SetText("Select Item", "Select the item, which you want to update");
        }
        else
        {
            ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup(uMyGUI_PopupManager.POPUP_TEXT))
            .SetText("No Items Found", "Cannot find any items to update, it seems that you haven't uploaded any items yet.")
            .ShowButton(uMyGUI_PopupManager.BTN_OK);
        }
    }
 protected virtual void SetItems(WorkshopItemListEventArgs p_itemListArgs)
 {
     if (!p_itemListArgs.IsError)
     {
         SetItems(p_itemListArgs.ItemList);
     }
     else
     {
         Debug.LogError("SteamWorkshopUIBrowse: SetItems: Steam Error: " + p_itemListArgs.ErrorMessage);
     }
 }
Exemple #3
0
    void OnSubscribedWorkshopListLoaded(WorkshopItemListEventArgs args)
    {
        SetCategoryLoading(WORKSHOP, false);
        if (!IsOpen())
        {
            return;
        }

        if (args.IsError)
        {
            Debug.Log($"Sorry, encountered an error: {args.ErrorMessage}");
            return;
        }

        StartCoroutine(GenerateWorkshopThumbnails(args.ItemList.Items));
    }
Exemple #4
0
    void OnWorkshopListLoaded(WorkshopItemListEventArgs args, ItemListData data)
    {
        gettingItemList = false;

        if (args.IsError)
        {
            Debug.Log($"Sorry, encountered an error: {args.ErrorMessage}");
            return;
        }

        if (!itemListData.Equals(data))
        {
            Invoke("CreateSteamThumbnails", .1f);
            return;
        }

        pageCount = args.ItemList.PagesItems;

        workingFeedback.SetActive(false);

        if (args.ItemList.Items.Count == 0)
        {
            noResultsFeedback.SetActive(true);
        }

        foreach (WorkshopItem item in args.ItemList.Items)
        {
            GameThumbnail gameThumbnail = Instantiate(gameThumbnailPrefab).GetComponent <GameThumbnail>();
            if (item.PreviewImageURL != null && item.PreviewImageURL.Length > 0)
            {
                gameThumbnail.SetThumbnailUrl(item.PreviewImageURL);
            }
            else
            {
                gameThumbnail.SetThumbnail(placeholderThumbnailTexture);
            }

            gameThumbnail.SetGameSource(GameDetail.GameSource.Workshop);
            gameThumbnail.SetName(item.Name);
            gameThumbnail.OnClick        = () => OpenWorkshopEntry(gameThumbnail, item);
            gameThumbnail.GetDescription = () => { return(item.Description); };
            AddThumbnail(gameThumbnail);
        }
    }
    void OnWorkshopListLoaded(WorkshopItemListEventArgs args)
    {
        if (args.IsError)
        {
            Debug.Log($"Sorry, encountered an error: {args.ErrorMessage}");
            return;
        }

        pageCount = args.ItemList.PagesItems;

        workingFeedback.SetActive(false);

        if (args.ItemList.Items.Count == 0)
        {
            noResultsFeedback.SetActive(true);
        }

        foreach (WorkshopItem item in args.ItemList.Items)
        {
            if (item.Name.IsNullOrEmpty())
            {
                continue;
            }
            ThumbnailItem thumbnailItem = Instantiate(cardPackThumbnailPrefab).GetComponent <ThumbnailItem>();
            // TEMP: Ignore workshop thumbnail texture for now since it's ugly
            // if (item.PreviewImageURL != null && item.PreviewImageURL.Length > 0)
            // {
            //   thumbnailItem.SetThumbnailUrl(item.PreviewImageURL);
            // }
            // else
            // {
            thumbnailItem.SetThumbnail(placeholderThumbnailTexture);
            // }

            thumbnailItem.SetName(item.Name);
            thumbnailItem.OnClick        = () => OpenWorkshopEntry(thumbnailItem, item);
            thumbnailItem.GetDescription = () => { return(item.Description); };
            AddThumbnail(thumbnailItem);
        }
    }