using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using HarmonyLib; using Landfall.TABS; using LevelCreator; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("0.0.0.0")] namespace TABSUXMod; public static class AutoConfirmLoadModsPatch { private static MethodInfo setPermission; private static MethodInfo onCheckedPermission; public static void Apply(Harmony harmony) { //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Expected O, but got Unknown Assembly assembly = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly2 in assemblies) { if (assembly2.GetName().Name == "Assembly-CSharp") { assembly = assembly2; break; } } if (assembly == null) { Debug.LogWarning((object)"[TABSUXMod] Assembly-CSharp not found — load-mods auto-confirm skipped."); return; } Type type = assembly.GetType("Landfall.TABS.Workshop.CustomContentLoaderModIO"); if (type == null) { Debug.LogWarning((object)"[TABSUXMod] CustomContentLoaderModIO not found — load-mods auto-confirm skipped."); return; } BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic; PropertyInfo property = type.GetProperty("DidGivePermissionToLoadMods", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); setPermission = ((property != null) ? property.GetSetMethod(nonPublic: true) : null); onCheckedPermission = type.GetMethod("OnCheckedPermissionToLoadMods", bindingAttr); MethodInfo method = type.GetMethod("CheckPermissionToLoadMods", BindingFlags.Instance | BindingFlags.Public); if (setPermission == null || onCheckedPermission == null || method == null) { Debug.LogWarning((object)"[TABSUXMod] CustomContentLoaderModIO members not found — load-mods auto-confirm skipped."); return; } MethodInfo method2 = typeof(AutoConfirmLoadModsPatch).GetMethod("CheckPermissionPrefix", BindingFlags.Static | BindingFlags.NonPublic); harmony.Patch((MethodBase)method, new HarmonyMethod(method2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Debug.Log((object)"[TABSUXMod] Load-mods warning auto-confirm active."); } private static bool CheckPermissionPrefix(object __instance, bool refresh, object doneCallback) { Debug.Log((object)"[TABSUXMod] Auto-confirming 'load mods?' warning."); setPermission.Invoke(__instance, new object[1] { true }); onCheckedPermission.Invoke(__instance, new object[2] { refresh, doneCallback }); return false; } } public static class BulkDeletePatch { private static readonly HashSet selected = new HashSet(); private static readonly List overlays = new List(); private static bool selectMode = false; private static Button deleteButton; private static TextMeshProUGUI deleteButtonLabel; private static MonoBehaviour sideBarInstance; private static MethodInfo deleteBCSCMethod; private static Type contentTypeFilterType; private static Type customContentFilePathsType; [HarmonyPostfix] [HarmonyPatch(typeof(CustomContentGridBrowser), "OnEnable")] public static void OnBrowserOpen(CustomContentGridBrowser __instance) { ExitSelectMode(); } [HarmonyPostfix] [HarmonyPatch(typeof(CustomContentGridBrowser), "Populate")] public static void OnBrowserPopulate(CustomContentGridBrowser __instance) { EnsureDeleteButton(__instance); RefreshDeleteButton(); } [HarmonyPostfix] [HarmonyPatch(typeof(UnitButtonBase), "Setup")] public static void OnUnitButtonSetup(UnitButtonBase __instance, UnitBlueprint unit) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Expected O, but got Unknown //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Expected O, but got Unknown //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Expected O, but got Unknown //IL_02f1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)unit == (Object)null) { return; } GameObject gameObject = ((Component)__instance).gameObject; if ((Object)(object)gameObject.transform.Find("BulkSelectOverlay") != (Object)null) { return; } GameObject val = new GameObject("BulkSelectOverlay", new Type[1] { typeof(RectTransform) }); val.transform.SetParent(gameObject.transform, false); val.SetActive(selectMode); overlays.Add(val); RectTransform component = val.GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; Image val2 = val.AddComponent(); ((Graphic)val2).color = new Color(0f, 0f, 0f, 0f); Button val3 = val.AddComponent