예제 #1
0
 public void PrepareSearchFollowed(string filter)
 {
     lastSearchString = filter;
     ActiveQuery      = HeathenWorkshopItemQuery.Create(SteamUser.GetSteamID().GetAccountID(), EUserUGCList.k_EUserUGCList_Followed, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Items_ReadyToUse, EUserUGCListSortOrder.k_EUserUGCListSortOrder_TitleAsc, CreatorAppId, steamSettings.applicationId);
     if (!string.IsNullOrEmpty(filter))
     {
         SteamworksWorkshop.WorkshopSetSearchText(ActiveQuery.handle, filter);
     }
     QueryPrepared.Invoke(ActiveQuery);
 }
예제 #2
0
 public void SearchAll(string filter)
 {
     lastSearchString = filter;
     ActiveQuery      = HeathenWorkshopItemQuery.Create(EUGCQuery.k_EUGCQuery_RankedByTrend, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Items_ReadyToUse, CreatorAppId, steamSettings.applicationId);
     if (!string.IsNullOrEmpty(filter))
     {
         SteamworksWorkshop.WorkshopSetSearchText(ActiveQuery.handle, filter);
     }
     ActiveQuery.Execute(HandleResults);
 }
예제 #3
0
 public void SearchFavorites(string filter)
 {
     lastSearchString = filter;
     ActiveQuery      = HeathenWorkshopItemQuery.Create(SteamUser.GetSteamID().GetAccountID(), EUserUGCList.k_EUserUGCList_Favorited, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Items_ReadyToUse, EUserUGCListSortOrder.k_EUserUGCListSortOrder_TitleAsc, CreatorAppId, steamSettings.applicationId);
     if (!string.IsNullOrEmpty(filter))
     {
         SteamworksWorkshop.WorkshopSetSearchText(ActiveQuery.handle, filter);
     }
     ActiveQuery.Execute(HandleResults);
 }
예제 #4
0
        public static HeathenWorkshopItemQuery Create(IEnumerable <PublishedFileId_t> fileIds)
        {
            var list = new List <PublishedFileId_t>(fileIds);
            HeathenWorkshopItemQuery nQuery = new HeathenWorkshopItemQuery
            {
                matchedRecordCount = 0,
                PageCount          = 1,
                isAllQuery         = true,
                isUserQuery        = false,
                FileIds            = list,
                Page   = 1,
                handle = SteamUGC.CreateQueryUGCDetailsRequest(list.ToArray(), (uint)list.Count)
            };

            return(nQuery);
        }
예제 #5
0
        public static HeathenWorkshopItemQuery Create(EUGCQuery queryType, EUGCMatchingUGCType matchingType, AppId_t creatorApp, AppId_t consumerApp)
        {
            HeathenWorkshopItemQuery nQuery = new HeathenWorkshopItemQuery
            {
                matchedRecordCount = 0,
                PageCount          = 1,
                isAllQuery         = true,
                isUserQuery        = false,
                queryType          = queryType,
                matchingType       = matchingType,
                creatorApp         = creatorApp,
                consumerApp        = consumerApp,
                Page   = 1,
                handle = SteamUGC.CreateQueryAllUGCRequest(queryType, matchingType, creatorApp, consumerApp, 1)
            };

            return(nQuery);
        }
예제 #6
0
        public static HeathenWorkshopItemQuery Create(AccountID_t account, EUserUGCList listType, EUGCMatchingUGCType matchingType, EUserUGCListSortOrder sortOrder, AppId_t creatorApp, AppId_t consumerApp)
        {
            HeathenWorkshopItemQuery nQuery = new HeathenWorkshopItemQuery
            {
                matchedRecordCount = 0,
                PageCount          = 1,
                isAllQuery         = false,
                isUserQuery        = true,
                listType           = listType,
                sortOrder          = sortOrder,
                matchingType       = matchingType,
                creatorApp         = creatorApp,
                consumerApp        = consumerApp,
                account            = account,
                Page   = 1,
                handle = SteamUGC.CreateQueryUserUGCRequest(account, listType, matchingType, sortOrder, creatorApp, consumerApp, 1)
            };

            return(nQuery);
        }
예제 #7
0
        private void HandleResults(HeathenWorkshopItemQuery query)
        {
            //Only load if this is the current active query ... otherwise this query has been abandoned
            if (query == ActiveQuery)
            {
                ClearCollectionRoot();

                foreach (var result in query.ResultsList)
                {
                    var go    = Instantiate(WorkshopItemDisplayTemplate, CollectionRoot);
                    var trans = go.GetComponent <Transform>();
                    trans.localPosition = Vector3.zero;
                    var record = go.GetComponent <IWorkshopItemDisplay>();
                    record.RegisterData(result);
                }
                ResultsUpdated.Invoke();
            }
            else
            {
                query.Dispose();
            }
        }