quantum-space-buddies/QSB/HUD/Patches/MinimapPatches.cs

41 lines
977 B
C#
Raw Normal View History

2023-03-04 13:30:50 +00:00
using HarmonyLib;
using QSB.Patches;
namespace QSB.HUD.Patches;
[HarmonyPatch(typeof(Minimap))]
2023-07-28 18:30:57 +00:00
public class MinimapPatches : QSBPatch
2023-03-04 13:30:50 +00:00
{
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
[HarmonyPostfix]
[HarmonyPatch(nameof(Minimap.UpdateMarkers))]
public static void UpdateMarkers(Minimap __instance)
{
2023-05-05 17:36:35 +00:00
if (__instance._minimapMode == Minimap.MinimapMode.Player)
{
MultiplayerHUDManager.Instance.UpdateMinimapMarkers(__instance);
}
}
[HarmonyPostfix]
[HarmonyPatch(nameof(Minimap.HideMinimap))]
public static void HideMinimap(Minimap __instance)
{
if (__instance._minimapMode == Minimap.MinimapMode.Player)
{
MultiplayerHUDManager.Instance.HideMinimap(__instance);
}
}
[HarmonyPostfix]
[HarmonyPatch(nameof(Minimap.ShowMinimap))]
public static void ShowMinimap(Minimap __instance)
{
if (__instance._minimapMode == Minimap.MinimapMode.Player)
{
MultiplayerHUDManager.Instance.ShowMinimap(__instance);
}
2023-03-04 13:30:50 +00:00
}
}