Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of PartialProgress v1.2.1
VPartialProgress.dll
Decompiled 2 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("VPartialProgress")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("VPartialProgress")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("317F6D38-CB91-4E3E-A052-3DE469E22F98")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace VPartialProgress { [BepInPlugin("Yorimor-PartialProgress", "PartialProgress", "1.2.0")] public class Main : BaseUnityPlugin { private const string pluginGUID = "Yorimor-PartialProgress"; private const string pluginName = "PartialProgress"; private const string pluginVersion = "1.2.0"; private readonly Harmony HarmonyInstance = new Harmony("Yorimor-PartialProgress"); public static ManualLogSource logger = Logger.CreateLogSource("PartialProgress"); public static ConfigEntry<bool> showSecrets; public static ConfigEntry<bool> showNoProgress; public void Awake() { showSecrets = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "showSecrets", false, "Show achievements that only Odin knows"); showNoProgress = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "showNoProgress", false, "Show achievement objectives that have 0 progress towards them"); Assembly executingAssembly = Assembly.GetExecutingAssembly(); HarmonyInstance.PatchAll(executingAssembly); logger.LogInfo((object)"Plugin loaded!"); } } } namespace VPartialProgress.Patches { [HarmonyPatch(typeof(AchievementsGui))] [HarmonyPatch("CreateStatRow")] public class AchievementsGuiPatches { [HarmonyTranspiler] private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown int num = -1; float num2 = 1f; if (Main.showNoProgress.Value) { num2 = 0f; } MethodInfo methodInfo = AccessTools.Method(typeof(AchievementsGuiPatches), "MyGetColor", (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(Color), "get_green", (Type[])null, (Type[])null); List<CodeInstruction> list = new List<CodeInstruction>(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode.Equals(OpCodes.Blt_Un) && i > 1) { num = i; if (list[i - 1].opcode.Equals(OpCodes.Ldarg_3)) { list[i - 1] = new CodeInstruction(OpCodes.Ldc_R4, (object)num2); } } if (num != -1 && list[i].opcode.Equals(OpCodes.Call) && list[i].operand is MethodInfo methodInfo3 && methodInfo3 == methodInfo2) { list[i] = new CodeInstruction(OpCodes.Call, (object)methodInfo); list.InsertRange(i, (IEnumerable<CodeInstruction>)(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Ldarg_2, (object)null), new CodeInstruction(OpCodes.Ldarg_3, (object)null) }); } } return list; } public static Color MyGetColor(float current, float total) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Color result = Color.gray; if (current >= total) { result = Color.green; } else if (current >= 1f) { result = Color.red; } else if (current <= 0f) { result = Color.grey; } return result; } } [HarmonyPatch(typeof(Achievements))] [HarmonyPatch("Initialize")] public class AchievementsPatches { [HarmonyPrefix] public static void InitPatch(Achievements __instance) { if (!Main.showSecrets.Value) { return; } foreach (AchievementList achievementList in __instance.m_achievementLists) { foreach (Achievement achievement in achievementList.m_achievements) { achievement.m_clickable = true; achievement.m_isSecret = false; } } } } }