From 19bf80792f5b795d4777376963983f1712d60c2e Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:24:04 +0100 Subject: [PATCH] Block DL profile during load & delete survey --- Fika.Core/UI/Patches/MenuTaskBar_Patch.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Fika.Core/UI/Patches/MenuTaskBar_Patch.cs b/Fika.Core/UI/Patches/MenuTaskBar_Patch.cs index 2da9382a..ffd57f5c 100644 --- a/Fika.Core/UI/Patches/MenuTaskBar_Patch.cs +++ b/Fika.Core/UI/Patches/MenuTaskBar_Patch.cs @@ -6,6 +6,7 @@ using Newtonsoft.Json.Linq; using SPT.Reflection.Patching; using System; +using System.Collections.Generic; using System.IO; using System.Reflection; using UnityEngine; @@ -22,7 +23,7 @@ protected override MethodBase GetTargetMethod() } [PatchPostfix] - public static void Postfix(MenuTaskBar __instance) + public static void Postfix(Dictionary ____toggleButtons, Dictionary ____hoverTooltipAreas) { GameObject watchlistGameobject = GameObject.Find("Preloader UI/Preloader UI/BottomPanel/Content/TaskBar/Tabs/Watchlist"); if (watchlistGameobject != null) @@ -91,6 +92,8 @@ public static void Postfix(MenuTaskBar __instance) NotificationManagerClass.DisplayMessageNotification(string.Format(LocaleUtils.SAVED_PROFILE.Localized(), [ColorizeText(EColor.BLUE, profileId), fikaDir])); + ____toggleButtons.Remove(EMenuType.NewsHub); + ____hoverTooltipAreas.Remove(EMenuType.NewsHub); GameObject.Destroy(downloadProfileGameObject); } } @@ -105,6 +108,14 @@ public static void Postfix(MenuTaskBar __instance) FikaPlugin.Instance.FikaLogger.LogError(ex.Message); } }); + + HoverTooltipArea surveryButton = ____hoverTooltipAreas[EMenuType.NewsHub]; + GameObject.Destroy(surveryButton.gameObject); + + ____toggleButtons.Remove(EMenuType.NewsHub); + ____hoverTooltipAreas.Remove(EMenuType.NewsHub); + ____toggleButtons.Add(EMenuType.NewsHub, animatedToggle); + ____hoverTooltipAreas.Add(EMenuType.NewsHub, downloadProfileGameObject.GetComponent()); } } }