Exemple #1
0
        private void onItemDownloaded(DownloadItemResult_t callback)
        {
            if (this.installing == null || this.installing.Count == 0)
            {
                return;
            }
            this.installing.Remove(callback.m_nPublishedFileId);
            LoadingUI.updateProgress((float)(this.installed - this.installing.Count) / (float)this.installed);
            ulong  num;
            string text;
            uint   num2;

            if (SteamUGC.GetItemInstallInfo(callback.m_nPublishedFileId, ref num, ref text, 1024u, ref num2) && ReadWrite.folderExists(text, false))
            {
                if (WorkshopTool.checkMapMeta(text, false))
                {
                    this.ugc.Add(new SteamContent(callback.m_nPublishedFileId, text, ESteamUGCType.MAP));
                    if (ReadWrite.folderExists(text + "/Bundles", false))
                    {
                        Assets.load(text + "/Bundles", false, false, EAssetOrigin.WORKSHOP);
                    }
                }
                else if (WorkshopTool.checkLocalizationMeta(text, false))
                {
                    this.ugc.Add(new SteamContent(callback.m_nPublishedFileId, text, ESteamUGCType.LOCALIZATION));
                }
                else if (WorkshopTool.checkObjectMeta(text, false))
                {
                    this.ugc.Add(new SteamContent(callback.m_nPublishedFileId, text, ESteamUGCType.OBJECT));
                    Assets.load(text, false, false, EAssetOrigin.WORKSHOP);
                }
                else if (WorkshopTool.checkItemMeta(text, false))
                {
                    this.ugc.Add(new SteamContent(callback.m_nPublishedFileId, text, ESteamUGCType.ITEM));
                    Assets.load(text, false, false, EAssetOrigin.WORKSHOP);
                }
                else if (WorkshopTool.checkVehicleMeta(text, false))
                {
                    this.ugc.Add(new SteamContent(callback.m_nPublishedFileId, text, ESteamUGCType.VEHICLE));
                    Assets.load(text, false, false, EAssetOrigin.WORKSHOP);
                }
                if (Directory.Exists(text + "/Translations"))
                {
                    Translator.registerTranslationDirectory(text + "/Translations");
                }
                if (Directory.Exists(text + "/Content"))
                {
                    Assets.searchForAndLoadContent(text + "/Content");
                }
            }
            if (this.installing.Count == 0)
            {
                Provider.launch();
            }
            else
            {
                SteamUGC.DownloadItem(this.installing[0], true);
            }
        }
Exemple #2
0
        public void refreshUGC()
        {
            this._ugc = new List <SteamContent>();
            uint numSubscribedItems = SteamUGC.GetNumSubscribedItems();

            PublishedFileId_t[] array = new PublishedFileId_t[numSubscribedItems];
            SteamUGC.GetSubscribedItems(array, numSubscribedItems);
            for (uint num = 0u; num < numSubscribedItems; num += 1u)
            {
                ulong  num2;
                string text;
                uint   num3;
                if (SteamUGC.GetItemInstallInfo(array[(int)((UIntPtr)num)], ref num2, ref text, 1024u, ref num3) && ReadWrite.folderExists(text, false))
                {
                    if (WorkshopTool.checkMapMeta(text, false))
                    {
                        this.ugc.Add(new SteamContent(array[(int)((UIntPtr)num)], text, ESteamUGCType.MAP));
                    }
                    else if (WorkshopTool.checkLocalizationMeta(text, false))
                    {
                        this.ugc.Add(new SteamContent(array[(int)((UIntPtr)num)], text, ESteamUGCType.LOCALIZATION));
                    }
                    else if (WorkshopTool.checkObjectMeta(text, false))
                    {
                        this.ugc.Add(new SteamContent(array[(int)((UIntPtr)num)], text, ESteamUGCType.OBJECT));
                    }
                    else if (WorkshopTool.checkItemMeta(text, false))
                    {
                        this.ugc.Add(new SteamContent(array[(int)((UIntPtr)num)], text, ESteamUGCType.ITEM));
                    }
                    else if (WorkshopTool.checkVehicleMeta(text, false))
                    {
                        this.ugc.Add(new SteamContent(array[(int)((UIntPtr)num)], text, ESteamUGCType.VEHICLE));
                    }
                }
            }
        }