Skip to content

Commit

Permalink
Block DL profile during load & delete survey
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Dec 17, 2024
1 parent 914b21a commit 19bf807
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Fika.Core/UI/Patches/MenuTaskBar_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -22,7 +23,7 @@ protected override MethodBase GetTargetMethod()
}

[PatchPostfix]
public static void Postfix(MenuTaskBar __instance)
public static void Postfix(Dictionary<EMenuType, AnimatedToggle> ____toggleButtons, Dictionary<EMenuType, HoverTooltipArea> ____hoverTooltipAreas)
{
GameObject watchlistGameobject = GameObject.Find("Preloader UI/Preloader UI/BottomPanel/Content/TaskBar/Tabs/Watchlist");
if (watchlistGameobject != null)
Expand Down Expand Up @@ -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);
}
}
Expand All @@ -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<HoverTooltipArea>());
}
}
}
Expand Down

0 comments on commit 19bf807

Please sign in to comment.