using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using DM; using GamepadUI.StateManager.Core; using HarmonyLib; using InControl; using Landfall.TABS; using Landfall.TABS.AI; using Landfall.TABS.AI.Components; using Landfall.TABS.GameState; using Landfall.TABS_Input; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using TFBGames; using Unity.Mathematics; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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 FreeAim { internal static class AimExclusionIcons { private static readonly Dictionary UnitIconCache = new Dictionary(); internal static Sprite GetUnitIcon(UnitBlueprint blueprint) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (((blueprint != null) ? blueprint.Entity : null) == null) { return null; } string text = AimExclusionStore.Key(blueprint.Entity.GUID); if (string.IsNullOrEmpty(text)) { return TryGetLoadedSprite(blueprint.Entity); } if (UnitIconCache.TryGetValue(text, out var value)) { return value; } Sprite val = TryGetLoadedSprite(blueprint.Entity); if ((Object)(object)val != (Object)null) { UnitIconCache[text] = val; } return val; } internal static Sprite TryGetLoadedSprite(object entity) { if (entity == null) { return null; } try { object? obj = entity.GetType().GetProperty("SpriteIcon", BindingFlags.Instance | BindingFlags.Public)?.GetValue(entity, null); return (Sprite)((obj is Sprite) ? obj : null); } catch { return null; } } } internal static class AimExclusionMenu { private enum SourceFilter { All, BuiltIn, Custom } private enum CombatFilter { All, Melee, Ranged } private enum TextAlignment { Left = 513, Center } private class VirtualRow { internal GameObject Row; internal Image RowImage; internal Image IconImage; internal Component TextComponent; internal Button ExcludeButton; internal Button RangeButton; internal Button SpreadButton; internal Button VerticalButton; internal Button DashButton; internal AimExclusionStore.UnitEntry BoundEntry; internal int DataIndex = -1; } private class PanelLayoutMarker : MonoBehaviour { internal int Version; } private class SearchInputBehaviour : MonoBehaviour { private void Update() { HandleSearchInput(); } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__47_0; public static UnityAction <>9__58_0; public static Action <>9__61_0; public static Action <>9__61_1; public static Action <>9__61_2; public static Action <>9__61_3; public static Action <>9__61_4; public static Action <>9__61_5; public static Action <>9__61_6; public static Action <>9__61_7; public static Action <>9__61_8; public static Action <>9__61_9; public static Action <>9__61_10; public static Action <>9__62_0; public static Action <>9__62_1; public static Action <>9__63_0; public static Action <>9__63_1; public static Func <>9__72_1; public static Func <>9__84_0; public static UnityAction <>9__116_0; internal void b__47_0() { try { Open(); } catch (Exception arg) { Plugin.LogWarning($"Aim exclusions: menu open failed: {arg}"); } } internal void b__58_0(Vector2 _) { BindVisibleRows(); } internal void b__61_0() { AimExclusionStore.SetAllExcluded(excluded: true); Refresh(resetScroll: true); } internal void b__61_1() { AimExclusionStore.SetAllExcluded(excluded: false); Refresh(resetScroll: true); } internal void b__61_2() { AimExclusionStore.SetAllRangeGate(enabled: false); Refresh(resetScroll: true); } internal void b__61_3() { AimExclusionStore.SetAllRangeGate(enabled: true); Refresh(resetScroll: true); } internal void b__61_4() { AimExclusionStore.SetAllVolleySpread(enabled: false); Refresh(resetScroll: true); } internal void b__61_5() { AimExclusionStore.SetAllVolleySpread(enabled: true); Refresh(resetScroll: true); } internal void b__61_6() { AimExclusionStore.SetAllMeleeDash(enabled: false); Refresh(resetScroll: true); } internal void b__61_7() { AimExclusionStore.SetAllMeleeDash(enabled: true); Refresh(resetScroll: true); } internal void b__61_8() { AimExclusionStore.ResetToDefaults(); Refresh(resetScroll: true); } internal void b__61_9() { AimExclusionStore.SetAllVerticalAim(enabled: false); Refresh(resetScroll: true); } internal void b__61_10() { AimExclusionStore.SetAllVerticalAim(enabled: true); Refresh(resetScroll: true); } internal void b__62_0() { } internal void b__62_1() { SetMenuInputEnabled(enabled: true); _listeningForBattleDashKey = true; UpdateBattleDashKeyButtonLabel(); } internal void b__63_0() { } internal void b__63_1() { SetMenuInputEnabled(enabled: true); _listeningForAutoShootKey = true; UpdateAutoShootKeyButtonLabel(); } internal string b__72_1(AimExclusionStore.UnitEntry u) { return u.name; } internal bool b__84_0(AimExclusionStore.UnitEntry u) { return u.excluded; } internal void b__116_0() { _searchFocused = true; UpdateSearchLabel(); } } private const int PanelLayoutVersion = 16; private const float HeaderHeight = 448f; private const int RowPoolExtra = 4; private const int MinRowPoolSize = 12; private static readonly FieldInfo MainMenuButtonsContainerField = AccessTools.Field(typeof(MainMenuButtons), "m_ButtonsContainer"); private const float RowHeight = 56f; private const float IconSize = 40f; private const float TextLeft = 56f; private const float ActionButtonWidth = 84f; private static readonly Color RowEven = new Color(0.11f, 0.11f, 0.11f, 0.92f); private static readonly Color RowOdd = new Color(0.145f, 0.145f, 0.145f, 0.92f); private static readonly Color RowExcluded = new Color(0.26f, 0.12f, 0.12f, 0.96f); private static readonly Color ActionOn = new Color(0.2f, 0.48f, 0.28f, 0.98f); private static readonly Color ActionOff = new Color(0.18f, 0.18f, 0.18f, 0.96f); private static readonly Color SubtitleColor = new Color(0.62f, 0.66f, 0.7f, 1f); private static GameObject _canvasRoot; private static Canvas _canvas; private static GameObject _panel; private static Transform _listRoot; private static ScrollRect _scroll; private static Component _searchText; private static Component _summaryText; private static Component _textTemplate; private static GameObject _menuButtonSource; private static GameObject _rowButtonTemplate; private static SearchInputBehaviour _searchInputBehaviour; private static bool _listeningForBattleDashKey; private static Button _battleDashKeyButton; private static Component _battleDashKeyLabel; private static bool _listeningForAutoShootKey; private static Button _autoShootKeyButton; private static Component _autoShootKeyLabel; private static string _search = ""; private static bool _searchFocused; private static SourceFilter _sourceFilter = SourceFilter.All; private static CombatFilter _combatFilter = CombatFilter.All; private static bool _scrollListenerRegistered; private static int _firstVisibleIndex = -1; private static readonly List FilteredEntries = new List(); private static readonly List<(Button button, SourceFilter filter)> SourceFilterChips = new List<(Button, SourceFilter)>(); private static readonly List<(Button button, CombatFilter filter)> CombatFilterChips = new List<(Button, CombatFilter)>(); private static readonly List RowPool = new List(); internal static bool IsOpen { get { if ((Object)(object)_panel != (Object)null) { return _panel.activeSelf; } return false; } } internal static void MainMenuButtons_Start_Postfix(MainMenuButtons __instance) { TryAddButton(__instance); } private static void TryAddButton(MainMenuButtons menu) { //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_014e: 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_0159: Expected O, but got Unknown if ((Object)(object)menu == (Object)null) { return; } object? obj = MainMenuButtonsContainerField?.GetValue(menu); Transform val = (Transform)((obj is Transform) ? obj : null); if ((Object)(object)val == (Object)null) { return; } Transform val2 = FindMenuButtonRow(val); bool flag = false; if ((Object)(object)val2 == (Object)null) { RemoveStaleMenuButtons(((Component)menu).transform); Transform val3 = null; foreach (Transform item in val) { Transform val4 = item; if ((Object)(object)((Component)val4).GetComponentInChildren