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.IgnoreSymbolStoreSequencePoints)] [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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: 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_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Expected O, but got Unknown //IL_02a5: 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