Пример #1
0
 public static void Apply()
 {
     autoFollowInvites        = MelonPreferences.GetEntryValue <bool>(categoryName, "AutoFollowInvites");
     autoFollowWorlds         = MelonPreferences.GetEntryValue <bool>(categoryName, "AutoFollowWorlds");
     autoFollowFriends        = MelonPreferences.GetEntryValue <bool>(categoryName, "AutoFollowFriends");
     showStatusOnQM           = MelonPreferences.GetEntryValue <bool>(categoryName, "ShowStatusOnQM");
     hideQMStatusWhenInActive = MelonPreferences.GetEntryValue <bool>(categoryName, "HideQMStatusWhenInActive");
     showStatusOnHud          = MelonPreferences.GetEntryValue <bool>(categoryName, "ShowStatusOnHud");
     showHudMessages          = MelonPreferences.GetEntryValue <bool>(categoryName, "ShowHudMessages");
     showPopupsOnComplete     = MelonPreferences.GetEntryValue <bool>(categoryName, "ShowPopupsOnComplete");
     if (AdvancedInvites)
     {
         tryUseAdvancedInvitePopup = MelonPreferences.GetEntryValue <bool>(categoryName, "UseAdvancedInvitesPopup");
     }
     if (showStatusOnQM)
     {
         WorldDownloadStatus.Enable();
     }
     else
     {
         WorldDownloadStatus.Disable();
     }
     if (hideQMStatusWhenInActive && !WorldDownloadManager.downloading)
     {
         WorldDownloadStatus.Disable();
     }
     else
     {
         WorldDownloadStatus.Enable();
     }
 }
Пример #2
0
 public static void LoadSettings()
 {
     autoFollowInvites        = AutoFollowInvites.Value;
     autoFollowWorlds         = AutoFollowWorlds.Value;
     autoFollowFriends        = AutoFollowFriends.Value;
     showStatusOnQM           = ShowStatusOnQM.Value;
     hideQMStatusWhenInActive = HideQMStatusWhenInActive.Value;
     showStatusOnHud          = ShowStatusOnHud.Value;
     showHudMessages          = ShowHudMessages.Value;
     showPopupsOnComplete     = ShowPopupsOnComplete.Value;
     downloadUserAgent        = DownloadUserAgent.Value;
     //cvrStyle = CVRStyle.Value;
     if (AdvancedInvites)
     {
         tryUseAdvancedInvitePopup = TryUseAdvancedInvitePopup.Value;
     }
     if (showStatusOnQM)
     {
         WorldDownloadStatus.Enable();
     }
     else
     {
         WorldDownloadStatus.Disable();
     }
     if (hideQMStatusWhenInActive && !WorldDownloadManager.Downloading)
     {
         WorldDownloadStatus.Disable();
     }
     else
     {
         WorldDownloadStatus.Enable();
     }
 }
Пример #3
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;
            }
        }