using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("ObjectTrackerMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+2df0c966c055fde3ca8887da4018f8d2fef5fbd5")]
[assembly: AssemblyProduct("ObjectTrackerMod")]
[assembly: AssemblyTitle("ObjectTrackerMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace ObjectTrackerMod
{
[BepInPlugin("com.github.antigravity.objecttrackermod", "Object Tracker Mod", "2.1.2")]
public class Plugin : BasePlugin
{
public class TrackedItem
{
public readonly HashSet<int> TrackedIds = new HashSet<int>();
public readonly HashSet<int> CompletedIds = new HashSet<int>();
public string Name { get; set; }
public int Total { get; set; }
public int Collected { get; set; }
public TrackedItem(string name)
{
Name = name;
Total = 0;
Collected = 0;
}
public void Reset()
{
Total = 0;
Collected = 0;
TrackedIds.Clear();
CompletedIds.Clear();
}
}
public static ManualLogSource? Log;
private Harmony? _harmony;
public static ConfigEntry<bool>? ShowUI;
public static ConfigEntry<KeyCode>? ToggleKey;
public static ConfigEntry<float>? WindowPositionX;
public static ConfigEntry<float>? WindowPositionY;
public static TrackedItem BuffShrines = new TrackedItem("Buff Shrines");
public static TrackedItem WolfStatues = new TrackedItem("Wolf Shrines");
public static TrackedItem RabbitStatues = new TrackedItem("Rabbit Shrines");
public static TrackedItem BearStatues = new TrackedItem("Bear Shrines");
public static TrackedItem FoxStatues = new TrackedItem("Fox Shrines");
public static TrackedItem XpBags = new TrackedItem("XP Bags");
public static TrackedItem Chests = new TrackedItem("Chests");
public static TrackedItem CursedBells = new TrackedItem("Cursed Bells");
public static TrackedItem Lairs = new TrackedItem("Lairs");
public override void Load()
{
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Expected O, but got Unknown
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Expected O, but got Unknown
Log = ((BasePlugin)this).Log;
Log.LogInfo((object)"Sineus Arena Object Tracker Mod initializing...");
try
{
ShowUI = ((BasePlugin)this).Config.Bind<bool>("General", "ShowUI", true, "Show or hide the Object Tracker UI overlay.");
ToggleKey = ((BasePlugin)this).Config.Bind<KeyCode>("General", "ToggleKey", (KeyCode)288, "Key to toggle the Object Tracker UI visibility.");
WindowPositionX = ((BasePlugin)this).Config.Bind<float>("UI", "WindowPositionX", 25f, "X position of the window.");
WindowPositionY = ((BasePlugin)this).Config.Bind<float>("UI", "WindowPositionY", 180f, "Y position of the window.");
ClassInjector.RegisterTypeInIl2Cpp<ObjectTrackerUIController>();
_harmony = new Harmony("com.github.antigravity.objecttrackermod");
_harmony.PatchAll();
GameObject val = new GameObject("ObjectTrackerUIController");
Object.DontDestroyOnLoad((Object)val);
val.AddComponent<ObjectTrackerUIController>();
Log.LogInfo((object)"Object Tracker Mod v2.1.2 loaded successfully!");
}
catch (Exception ex)
{
Log.LogError((object)("Failed to initialize Object Tracker Mod: " + ex));
}
}
public static void ResetAllTrackers()
{
ManualLogSource? log = Log;
if (log != null)
{
log.LogInfo((object)"[ObjectTracker] Resetting all object tracker counters.");
}
BuffShrines.Reset();
WolfStatues.Reset();
RabbitStatues.Reset();
BearStatues.Reset();
FoxStatues.Reset();
XpBags.Reset();
Chests.Reset();
CursedBells.Reset();
Lairs.Reset();
}
public static void HandleObjectPushed(TrackedItem? target, int id)
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Expected O, but got Unknown
if (target == null || id == 0 || !target.TrackedIds.Add(id))
{
return;
}
target.Total++;
ManualLogSource log = Log;
if (log != null)
{
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(44, 3, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ObjectTracker] Registered ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(target.Name);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (ID ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(id);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") -> Total: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(target.Total);
}
log.LogInfo(val);
}
}
public static void HandleObjectCompleted(TrackedItem? target, int id)
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Expected O, but got Unknown
if (target == null || id == 0 || !target.CompletedIds.Add(id))
{
return;
}
target.Collected++;
ManualLogSource log = Log;
if (log != null)
{
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(47, 4, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ObjectTracker] Completed ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(target.Name);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (ID ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(id);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") -> Progress: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(target.Collected);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("/");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(target.Total);
}
log.LogInfo(val);
}
}
public static void HandleIconAdded(IMiniMapEntry entry)
{
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Expected O, but got Unknown
if (entry == null)
{
return;
}
try
{
TrackedItem trackedItem = GetTrackedItem(entry);
if (trackedItem == null)
{
return;
}
if (trackedItem == Lairs)
{
InteractableLairSpawner val = ((Il2CppObjectBase)entry).TryCast<InteractableLairSpawner>();
if ((Object)(object)val != (Object)null && val.IsFinalBossLair)
{
return;
}
}
int objectId = GetObjectId(entry);
HandleObjectPushed(trackedItem, objectId);
}
catch (Exception ex)
{
ManualLogSource log = Log;
if (log != null)
{
bool flag = default(bool);
BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(42, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[ObjectTracker] Error in HandleIconAdded: ");
((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Exception>(ex);
}
log.LogWarning(val2);
}
}
}
public static void HandleIconRemoved(IMiniMapEntry entry)
{
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Expected O, but got Unknown
if (entry == null)
{
return;
}
try
{
TrackedItem trackedItem = GetTrackedItem(entry);
if (trackedItem == null)
{
return;
}
if (trackedItem == Lairs)
{
InteractableLairSpawner val = ((Il2CppObjectBase)entry).TryCast<InteractableLairSpawner>();
if ((Object)(object)val != (Object)null && val.IsFinalBossLair)
{
return;
}
}
int objectId = GetObjectId(entry);
HandleObjectCompleted(trackedItem, objectId);
}
catch (Exception ex)
{
ManualLogSource log = Log;
if (log != null)
{
bool flag = default(bool);
BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(44, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[ObjectTracker] Error in HandleIconRemoved: ");
((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Exception>(ex);
}
log.LogWarning(val2);
}
}
}
public static void ScanMinimapIcons(MinimapController? controller)
{
if ((Object)(object)controller == (Object)null)
{
return;
}
try
{
List<IMiniMapEntry> trackedKeys = controller._trackedKeys;
if (trackedKeys == null)
{
return;
}
for (int i = 0; i < trackedKeys.Count; i++)
{
IMiniMapEntry val = trackedKeys[i];
if (val != null)
{
HandleIconAdded(val);
}
}
}
catch
{
}
}
private static int GetObjectId(IMiniMapEntry entry)
{
Object val = ((Il2CppObjectBase)entry).TryCast<Object>();
if (val != (Object)null)
{
return val.GetInstanceID();
}
if (entry == null)
{
return 0;
}
return ((Il2CppObjectBase)entry).Pointer.GetHashCode();
}
private static TrackedItem? GetTrackedItem(IMiniMapEntry entry)
{
if (entry == null)
{
return null;
}
if ((Object)(object)((Il2CppObjectBase)entry).TryCast<BuffChest>() != (Object)null)
{
return Chests;
}
if ((Object)(object)((Il2CppObjectBase)entry).TryCast<BuffShrine>() != (Object)null)
{
return BuffShrines;
}
if ((Object)(object)((Il2CppObjectBase)entry).TryCast<WolfShrine>() != (Object)null)
{
return WolfStatues;
}
if ((Object)(object)((Il2CppObjectBase)entry).TryCast<RabbitShrine>() != (Object)null)
{
return RabbitStatues;
}
if ((Object)(object)((Il2CppObjectBase)entry).TryCast<BearShrine>() != (Object)null)
{
return BearStatues;
}
if ((Object)(object)((Il2CppObjectBase)entry).TryCast<GreedShrine>() != (Object)null)
{
return FoxStatues;
}
if ((Object)(object)((Il2CppObjectBase)entry).TryCast<AnkhoBag>() != (Object)null)
{
return XpBags;
}
if ((Object)(object)((Il2CppObjectBase)entry).TryCast<CursedBell>() != (Object)null)
{
return CursedBells;
}
if ((Object)(object)((Il2CppObjectBase)entry).TryCast<InteractableLairSpawner>() != (Object)null)
{
return Lairs;
}
return null;
}
}
public class ObjectTrackerUIController : MonoBehaviour
{
private Rect _windowRect = new Rect(25f, 180f, 176f, 264f);
private const int WindowID = 987654;
private Texture2D? _bgTexture;
private Texture2D? _cardBgTexture;
private GUIStyle? _windowStyle;
private GUIStyle? _cardStyle;
private GUIStyle? _headerStyle;
private GUIStyle? _labelStyle;
private GUIStyle? _valueStyle;
public ObjectTrackerUIController(IntPtr ptr)
: base(ptr)
{
}//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
private void Start()
{
if (Plugin.WindowPositionX != null && Plugin.WindowPositionY != null)
{
((Rect)(ref _windowRect)).x = Plugin.WindowPositionX.Value;
((Rect)(ref _windowRect)).y = Plugin.WindowPositionY.Value;
}
((Rect)(ref _windowRect)).width = 176f;
((Rect)(ref _windowRect)).height = 264f;
SceneManager.sceneLoaded += UnityAction<Scene, LoadSceneMode>.op_Implicit((Action<Scene, LoadSceneMode>)OnSceneLoaded);
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Expected O, but got Unknown
ManualLogSource log = Plugin.Log;
if (log != null)
{
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(63, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ObjectTracker] Scene loaded: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((Scene)(ref scene)).name);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(". Resetting counters for new run.");
}
log.LogInfo(val);
}
Plugin.ResetAllTrackers();
}
private void Update()
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
if (Plugin.ToggleKey != null && Input.GetKeyDown(Plugin.ToggleKey.Value) && Plugin.ShowUI != null)
{
Plugin.ShowUI.Value = !Plugin.ShowUI.Value;
}
}
private void InitStyles()
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Expected O, but got Unknown
//IL_0081: Expected O, but got Unknown
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: Expected O, but got Unknown
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Expected O, but got Unknown
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Expected O, but got Unknown
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Expected O, but got Unknown
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_015c: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Expected O, but got Unknown
//IL_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
//IL_01e7: Expected O, but got Unknown
if (_windowStyle == null)
{
_bgTexture = MakeTex(2, 2, new Color(0.055f, 0.07f, 0.094f, 0.9f));
_cardBgTexture = MakeTex(2, 2, new Color(0.12f, 0.15f, 0.2f, 0.55f));
_windowStyle = new GUIStyle
{
border = new RectOffset(2, 2, 2, 2),
padding = new RectOffset(6, 6, 4, 12)
};
_windowStyle.normal.background = _bgTexture;
_windowStyle.onNormal.background = _bgTexture;
_headerStyle = new GUIStyle
{
alignment = (TextAnchor)4,
fontSize = 12,
fontStyle = (FontStyle)1,
fixedHeight = 16f
};
_headerStyle.normal.textColor = new Color(0.95f, 0.75f, 0.3f);
_cardStyle = new GUIStyle
{
padding = new RectOffset(4, 4, 1, 1),
margin = new RectOffset(0, 0, 1, 1),
fixedHeight = 19f
};
_cardStyle.normal.background = _cardBgTexture;
_labelStyle = new GUIStyle
{
fontSize = 12,
fontStyle = (FontStyle)0,
alignment = (TextAnchor)3,
wordWrap = false,
fixedWidth = 90f,
fixedHeight = 17f
};
_labelStyle.normal.textColor = new Color(0.85f, 0.9f, 0.95f);
_valueStyle = new GUIStyle
{
fontSize = 12,
fontStyle = (FontStyle)1,
alignment = (TextAnchor)5,
wordWrap = false,
fixedWidth = 62f,
fixedHeight = 17f
};
}
}
private Texture2D MakeTex(int width, int height, Color col)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Expected O, but got Unknown
Color[] array = (Color[])(object)new Color[width * height];
for (int i = 0; i < array.Length; i++)
{
array[i] = col;
}
Texture2D val = new Texture2D(width, height);
val.SetPixels(Il2CppStructArray<Color>.op_Implicit(array));
val.Apply();
return val;
}
private void OnGUI()
{
//IL_0147: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Expected O, but got Unknown
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
try
{
if (Plugin.ShowUI == null || !Plugin.ShowUI.Value)
{
return;
}
Scene activeScene = SceneManager.GetActiveScene();
string name = ((Scene)(ref activeScene)).name;
if (name.IndexOf("Lobby", StringComparison.OrdinalIgnoreCase) < 0 && name.IndexOf("Menu", StringComparison.OrdinalIgnoreCase) < 0)
{
InitStyles();
_windowRect = GUI.Window(987654, _windowRect, WindowFunction.op_Implicit((Action<int>)DrawWindow), "", _windowStyle);
if (((Rect)(ref _windowRect)).x != Plugin.WindowPositionX?.Value && Plugin.WindowPositionX != null)
{
Plugin.WindowPositionX.Value = ((Rect)(ref _windowRect)).x;
}
if (((Rect)(ref _windowRect)).y != Plugin.WindowPositionY?.Value && Plugin.WindowPositionY != null)
{
Plugin.WindowPositionY.Value = ((Rect)(ref _windowRect)).y;
}
}
}
catch (Exception ex)
{
ManualLogSource log = Plugin.Log;
if (log != null)
{
bool flag = default(bool);
BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(34, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ObjectTrackerUI] Error in OnGUI: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex);
}
log.LogError(val);
}
}
}
private void DrawWindow(int windowID)
{
//IL_018d: Unknown result type (might be due to invalid IL or missing references)
GUILayout.BeginVertical((Il2CppReferenceArray<GUILayoutOption>)null);
GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
GUILayout.Label("OBJECT TRACKER", _headerStyle, Array.Empty<GUILayoutOption>());
GUILayout.EndHorizontal();
GUILayout.Space(2f);
DrawTrackerRow(Plugin.BuffShrines.Name, Plugin.BuffShrines.Collected, Plugin.BuffShrines.Total);
DrawTrackerRow(Plugin.WolfStatues.Name, Plugin.WolfStatues.Collected, Plugin.WolfStatues.Total);
DrawTrackerRow(Plugin.RabbitStatues.Name, Plugin.RabbitStatues.Collected, Plugin.RabbitStatues.Total);
DrawTrackerRow(Plugin.BearStatues.Name, Plugin.BearStatues.Collected, Plugin.BearStatues.Total);
DrawTrackerRow(Plugin.FoxStatues.Name, Plugin.FoxStatues.Collected, Plugin.FoxStatues.Total);
DrawTrackerRow(Plugin.XpBags.Name, Plugin.XpBags.Collected, Plugin.XpBags.Total);
DrawTrackerRow(Plugin.Chests.Name, Plugin.Chests.Collected, Plugin.Chests.Total);
DrawTrackerRow(Plugin.CursedBells.Name, Plugin.CursedBells.Collected, Plugin.CursedBells.Total);
DrawTrackerRow(Plugin.Lairs.Name, Plugin.Lairs.Collected, Plugin.Lairs.Total);
GUILayout.EndVertical();
GUI.DragWindow(new Rect(0f, 0f, 1000f, 20f));
}
private void DrawTrackerRow(string name, int collected, int total)
{
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
GUILayout.BeginHorizontal(_cardStyle, Array.Empty<GUILayoutOption>());
GUILayout.Label(name, _labelStyle, Array.Empty<GUILayoutOption>());
bool flag = total > 0 && collected >= total;
_valueStyle.normal.textColor = (flag ? new Color(0.35f, 0.95f, 0.45f) : ((collected > 0) ? new Color(0.35f, 0.85f, 1f) : new Color(0.95f, 0.8f, 0.35f)));
GUILayout.Label($"{collected} / {total}", _valueStyle, Array.Empty<GUILayoutOption>());
GUILayout.EndHorizontal();
}
}
[HarmonyPatch(typeof(MinimapController), "AddStaticIcon")]
public static class MinimapController_AddStaticIcon_Patch
{
[HarmonyPostfix]
public static void Postfix(IMiniMapEntry entry)
{
Plugin.HandleIconAdded(entry);
}
}
[HarmonyPatch(typeof(MinimapController), "RemoveStaticIcon")]
public static class MinimapController_RemoveStaticIcon_Patch
{
[HarmonyPostfix]
public static void Postfix(IMiniMapEntry entry)
{
Plugin.HandleIconRemoved(entry);
}
}
[HarmonyPatch(typeof(MinimapController), "Start")]
public static class MinimapController_Start_Patch
{
[HarmonyPostfix]
public static void Postfix(MinimapController __instance)
{
Plugin.ScanMinimapIcons(__instance);
}
}
[HarmonyPatch(typeof(WolfShrine), "PushToMinimap")]
public static class WolfShrine_Push_Patch
{
[HarmonyPostfix]
public static void Postfix(WolfShrine __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectPushed(Plugin.WolfStatues, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(WolfShrine), "RemoveIcon")]
public static class WolfShrine_Remove_Patch
{
[HarmonyPostfix]
public static void Postfix(WolfShrine __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectCompleted(Plugin.WolfStatues, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(BearShrine), "PushToMinimap")]
public static class BearShrine_Push_Patch
{
[HarmonyPostfix]
public static void Postfix(BearShrine __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectPushed(Plugin.BearStatues, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(BearShrine), "RemoveIcon")]
public static class BearShrine_Remove_Patch
{
[HarmonyPostfix]
public static void Postfix(BearShrine __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectCompleted(Plugin.BearStatues, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(RabbitShrine), "PushToMinimap")]
public static class RabbitShrine_Push_Patch
{
[HarmonyPostfix]
public static void Postfix(RabbitShrine __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectPushed(Plugin.RabbitStatues, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(RabbitShrine), "RemoveIcon")]
public static class RabbitShrine_Remove_Patch
{
[HarmonyPostfix]
public static void Postfix(RabbitShrine __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectCompleted(Plugin.RabbitStatues, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(GreedShrine), "PushToMinimap")]
public static class GreedShrine_Push_Patch
{
[HarmonyPostfix]
public static void Postfix(GreedShrine __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectPushed(Plugin.FoxStatues, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(GreedShrine), "RemoveIcon")]
public static class GreedShrine_Remove_Patch
{
[HarmonyPostfix]
public static void Postfix(GreedShrine __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectCompleted(Plugin.FoxStatues, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(BuffShrine), "PushToMinimap")]
public static class BuffShrine_Push_Patch
{
[HarmonyPostfix]
public static void Postfix(BuffShrine __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectPushed(Plugin.BuffShrines, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(BuffShrine), "RemoveIcon")]
public static class BuffShrine_Remove_Patch
{
[HarmonyPostfix]
public static void Postfix(BuffShrine __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectCompleted(Plugin.BuffShrines, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(AnkhoBag), "PushToMinimap")]
public static class AnkhoBag_Push_Patch
{
[HarmonyPostfix]
public static void Postfix(AnkhoBag __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectPushed(Plugin.XpBags, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(AnkhoBag), "RemoveIcon")]
public static class AnkhoBag_Remove_Patch
{
[HarmonyPostfix]
public static void Postfix(AnkhoBag __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectCompleted(Plugin.XpBags, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(BuffChest), "PushToMinimap")]
public static class BuffChest_Push_Patch
{
[HarmonyPostfix]
public static void Postfix(BuffChest __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectPushed(Plugin.Chests, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(BuffChest), "RemoveIcon")]
public static class BuffChest_Remove_Patch
{
[HarmonyPostfix]
public static void Postfix(BuffChest __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectCompleted(Plugin.Chests, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(CursedBell), "PushToMinimap")]
public static class CursedBell_Push_Patch
{
[HarmonyPostfix]
public static void Postfix(CursedBell __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectPushed(Plugin.CursedBells, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(CursedBell), "RemoveIcon")]
public static class CursedBell_Remove_Patch
{
[HarmonyPostfix]
public static void Postfix(CursedBell __instance)
{
if ((Object)(object)__instance != (Object)null)
{
Plugin.HandleObjectCompleted(Plugin.CursedBells, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(InteractableLairSpawner), "PushToMinimap")]
public static class InteractableLairSpawner_Push_Patch
{
[HarmonyPostfix]
public static void Postfix(InteractableLairSpawner __instance)
{
if ((Object)(object)__instance != (Object)null && !__instance.IsFinalBossLair)
{
Plugin.HandleObjectPushed(Plugin.Lairs, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(InteractableLairSpawner), "RemoveIcon")]
public static class InteractableLairSpawner_Remove_Patch
{
[HarmonyPostfix]
public static void Postfix(InteractableLairSpawner __instance)
{
if ((Object)(object)__instance != (Object)null && !__instance.IsFinalBossLair)
{
Plugin.HandleObjectCompleted(Plugin.Lairs, ((Object)__instance).GetInstanceID());
}
}
}
[HarmonyPatch(typeof(InteractableObjectsGenerator), "RegenerateObjects")]
public static class InteractableObjectsGenerator_RegenerateObjects_Patch
{
[HarmonyPrefix]
[HarmonyPostfix]
public static void ResetTrackers()
{
Plugin.ResetAllTrackers();
}
}
[HarmonyPatch(typeof(InteractableObjectsGenerator), "DestroyAllSceneBuffChests")]
public static class InteractableObjectsGenerator_DestroyChests_Patch
{
[HarmonyPrefix]
public static void Prefix()
{
Plugin.Chests.Reset();
}
}
[HarmonyPatch(typeof(GameStageManager), "GoToNextStage")]
public static class GameStageManager_GoToNextStage_Patch
{
[HarmonyPrefix]
[HarmonyPostfix]
public static void ResetTrackers()
{
Plugin.ResetAllTrackers();
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte b)
{
NullableFlags = new byte[1] { b };
}
public NullableAttribute(byte[] flags)
{
NullableFlags = flags;
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
}