Exemplo n.º 1
0
 public static void Prefix(ApiWorld __0, ref OnDownloadComplete __2)
 {
     __2 = Il2CppSystem.Delegate.Combine(
         __2,
         (OnDownloadComplete) new Action <AssetBundleDownload>(
             _ =>
     {
         if (CacheManager.WorldFileExists(__0.id))
         {
             CacheManager.AddDirectory(CacheManager.ComputeAssetHash(__0.id));
         }
         else
         {
             MelonLogger.Warning($"Failed to verify world {__0.id} was downloaded. No idea why this would happen");
         }
     }
             )
         ).Cast <OnDownloadComplete>();
 }
Exemplo n.º 2
0
        private static async void OnRecompress()
        {
            await TaskUtilities.YieldToMainThread();

            CacheManager.CreateInfoFileFor(file);
            if (ModSettings.showHudMessages)
            {
                Utilities.QueueHudMessage("Download Finished");
            }
            if (ModSettings.hideQMStatusWhenInActive)
            {
                WorldDownloadStatus.Disable();
            }
            Downloading = false;
            CacheManager.AddDirectory(CacheManager.ComputeAssetHash(DownloadInfo.ApiWorld.id));
            HudIcon.Disable();
            InviteButton.UpdateTextDownloadStopped();
            FriendButton.UpdateTextDownloadStopped();
            WorldButton.UpdateTextDownloadStopped();
            WorldDownloadStatus.gameObject.SetText(Constants.DOWNLOAD_STATUS_IDLE_TEXT);
            switch (DownloadInfo.DownloadType)
            {
            case DownloadType.Friend:
                if (!ModSettings.autoFollowFriends)
                {
                    if (ModSettings.showPopupsOnComplete)
                    {
                        DisplayFriendPopup();
                    }
                }
                else
                {
                    Utilities.GoToWorld(DownloadInfo.ApiWorld, DownloadInfo.InstanceIDTags, false);
                }
                break;

            case DownloadType.Invite:
                if (!ModSettings.autoFollowInvites)
                {
                    if (ModSettings.showPopupsOnComplete)
                    {
                        DisplayInvitePopup();
                    }
                }
                else
                {
                    Utilities.GoToWorld(DownloadInfo.ApiWorld, DownloadInfo.InstanceIDTags, true);
                }
                break;

            case DownloadType.World:
                if (!ModSettings.autoFollowWorlds)
                {
                    if (ModSettings.showPopupsOnComplete)
                    {
                        DisplayWorldPopup();
                    }
                }
                else
                {
                    Utilities.GoToWorld(DownloadInfo.ApiWorld, DownloadInfo.InstanceIDTags, false);
                }
                break;
            }
        }