public void RegisterData(HeathenWorkshopReadCommunityItem data)
        {
            loading = true;
            Data    = data;
            PreviewImage.texture  = Data.previewImage;
            Title.text            = Data.Title;
            Subscribed.isOn       = Data.IsSubscribed;
            ScoreImage.fillAmount = Data.VoteScore;

            loading = false;
        }
Пример #2
0
        /// <summary>
        /// Creates a new editor tool to update a given UGC item.
        /// This will assume the file ID and AppID of the itemDetails provided.
        /// </summary>
        /// <param name="itemDetails">The details of the item to update</param>
        public SteamworksWorkshopItemEditorTool(HeathenWorkshopReadCommunityItem itemDetails)
        {
            m_SubmitItemUpdateResult = CallResult <SubmitItemUpdateResult_t> .Create(HandleItemUpdated);

            m_CreatedItem = CallResult <CreateItemResult_t> .Create(HandleItemCreate);

            m_RemoteStorageDownloadUGCResult = CallResult <RemoteStorageDownloadUGCResult_t> .Create(HandleUGCDownload);

            TargetApp            = itemDetails.TargetApp;
            FileId               = itemDetails.FileId;
            Title                = itemDetails.Title;
            Description          = itemDetails.Description;
            Visibility           = itemDetails.Visibility;
            Author               = SteamSettings.current.client.GetUserData(itemDetails.Author);
            previewImage         = itemDetails.previewImage;
            PreviewImageLocation = itemDetails.PreviewImageLocation;
        }
Пример #3
0
        private void HandleQueryCompleted(SteamUGCQueryCompleted_t param, bool bIOFailure)
        {
            if (!bIOFailure)
            {
                if (param.m_eResult == EResult.k_EResultOK)
                {
                    matchedRecordCount = param.m_unTotalMatchingResults;

                    PageCount = (uint)Mathf.Clamp((int)matchedRecordCount / 50, 1, int.MaxValue);
                    if (PageCount * 50 < matchedRecordCount)
                    {
                        PageCount++;
                    }

                    for (int i = 0; i < param.m_unNumResultsReturned; i++)
                    {
                        SteamUGCDetails_t details;
                        SteamUGC.GetQueryUGCResult(param.m_handle, (uint)i, out details);
                        var nRecord = new HeathenWorkshopReadCommunityItem(details);
                        ResultsList.Add(nRecord);
                    }
                    ReleaseHandle();
                    if (Callback != null)
                    {
                        Callback.Invoke(this);
                    }
                }
                else
                {
                    Debug.LogError("HeathenWorkitemQuery|HandleQueryCompleted Unexpected results, state = " + param.m_eResult.ToString());
                }
            }
            else
            {
                Debug.LogError("HeathenWorkitemQuery|HandleQueryCompleted failed.");
            }
        }