Decompiled source of BetterUI v2.8.4
plugins/BetterUI/BetterUI.dll
Decompiled 6 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BetterAPI; using BetterUI.ModCompatibility; using BetterUI.Properties; using BetterUnityPlugin; using LeTai.Asset.TranslucentImage; using Mono.Cecil.Cil; using MonoMod.Cil; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using R2API.Utils; using RoR2; using RoR2.Skills; using RoR2.UI; using RoR2.UI.MainMenu; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: ManualNetworkRegistration] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")] [assembly: AssemblyCompany("BetterUI")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("2.8.4.0")] [assembly: AssemblyInformationalVersion("2.8.4+Branch.tags-v2.8.4.Sha.b5e6224d3b2cb35f6f57d9b0fe270e4b307b93a0")] [assembly: AssemblyProduct("BetterUI")] [assembly: AssemblyTitle("BetterUI")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.8.4.0")] [module: UnverifiableCode] namespace R2API.Utils { [AttributeUsage(AttributeTargets.Assembly)] public class ManualNetworkRegistrationAttribute : Attribute { } } namespace BetterUI { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.xoxfaby.BetterUI", "BetterUI", "2.8.4")] public class BetterUIPlugin : BetterUnityPlugin<BetterUIPlugin> { internal delegate void HUDAwakeEvent(HUD self); public const string GUID = "com.xoxfaby.BetterUI"; public const string Name = "BetterUI"; public const string Version = "2.8.4"; internal static BetterUIPlugin instance; internal static bool BetterAPIModIntegration = false; internal static HUD hud; internal static ObjectivePanelController objectivePanelController; public static StringBuilder sharedStringBuilder = new StringBuilder(); public override BaseUnityPlugin typeReference { get { throw new NotImplementedException(); } } internal static event HUDAwakeEvent onHUDAwake; protected override void Awake() { //IL_0013: 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) base.Awake(); instance = this; GameObject gameObject = ((Component)this).gameObject; ((Object)gameObject).hideFlags = (HideFlags)(((Object)gameObject).hideFlags | 0x3D); ((Component)this).gameObject.AddComponent<Language.UpdateChecker>(); Language.LoadLanguages(); if (ConfigManager.ComponentsItemSorting.Value) { ItemSorting.Hook(); } if (ConfigManager.ComponentsStatsDisplay.Value) { StatsDisplay.Hook(); } if (ConfigManager.ComponentsCommandImprovements.Value) { CommandImprovements.Hook(); } if (ConfigManager.ComponentsDPSMeter.Value) { DPSMeter.Initialize(); } if (ConfigManager.ComponentsBuffTimers.Value) { Buffs.Hook(); } if (ConfigManager.ComponentsAdvancedIcons.Value) { AdvancedIcons.Hook(); } if (ConfigManager.ComponentsItemCounters.Value) { ItemCounters.Hook(); } if (ConfigManager.ComponentsMisc.Value) { Misc.Hook(); } BetterUIWindow.Init(); ((ResourceAvailability)(ref ItemCatalog.availability)).CallWhenAvailable((Action)ItemStats.Initialize); } protected override void OnEnable() { base.OnEnable(); BetterAPIModIntegration = Chainloader.PluginInfos.ContainsKey("com.xoxfaby.BetterAPI"); BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<HUD>("Awake", (Action<Action<HUD>, HUD>)HUD_Awake, BindingFlags.Default); } internal static void HUD_Awake(Action<HUD> orig, HUD self) { orig(self); hud = self; objectivePanelController = ((Component)self).GetComponentInChildren<ObjectivePanelController>(true); if (BetterUIPlugin.onHUDAwake != null) { BetterUIPlugin.onHUDAwake(hud); } } } internal static class BetterUIWindow { private static AssetBundle bundle; private static GameObject modPanelPrefab; private static GameObject modButtonPrefab; private static GameObject betterUIWindowPrefab; internal static Transform menuParent; static BetterUIWindow() { bundle = AssetBundle.LoadFromMemory(Resources.betteruiassets); modPanelPrefab = bundle.LoadAsset<GameObject>("Assets/ModPanel.prefab"); modButtonPrefab = bundle.LoadAsset<GameObject>("Assets/ModButton.prefab"); betterUIWindowPrefab = bundle.LoadAsset<GameObject>("Assets/BetterUIWindow.prefab"); } internal static void Init() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<BaseMainMenuScreen>("Awake", (Action<Action<BaseMainMenuScreen>, BaseMainMenuScreen>)BaseMainMenuScreen_Awake, BindingFlags.Default); Node val = new Node("BetterUI", true, (Node)null); Node buttonNode = new Node("Donate", false, val); buttonNode.shouldShowUnviewed = (UserProfile userProfile) => !userProfile.HasViewedViewable(buttonNode.fullName); ViewablesCatalog.AddNodeToRoot(val); } private static void BaseMainMenuScreen_Awake(Action<BaseMainMenuScreen> orig, BaseMainMenuScreen self) { menuParent = ((Component)self).transform; Transform val = ((Component)self).transform.Find("SafeZone/GenericMenuButtonPanel"); Transform val2 = ((Component)self).transform.Find("SafeZone/GenericMenuButtonPanel/JuicePanel/DescriptionPanel, Naked/ContentSizeFitter/DescriptionText"); if ((Object)(object)val != (Object)null || (Object)(object)val2 != (Object)null) { LanguageTextMeshController component = ((Component)val2).GetComponent<LanguageTextMeshController>(); HGButton[] componentsInChildren = Object.Instantiate<GameObject>(modPanelPrefab, val).GetComponentsInChildren<HGButton>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].hoverLanguageTextMeshController = component; } } orig(self); } } public class BetterUIEventFunctions : MonoBehaviour { private static Dictionary<GameObject, GameObject> spawnedGameObjects = new Dictionary<GameObject, GameObject>(); public void createWindow(GameObject prefab) { if ((Object)(object)BetterUIWindow.menuParent != (Object)null && (!spawnedGameObjects.TryGetValue(prefab, out var value) || (Object)(object)value == (Object)null)) { spawnedGameObjects[prefab] = Object.Instantiate<GameObject>(prefab, BetterUIWindow.menuParent); } } } [ExecuteAlways] internal class PrefabLoader : MonoBehaviour { public string prefabAddress; private string loadedPrefab; private bool loading; private GameObject instance; private void Start() { LoadPrefab(); } private void OnValidate() { LoadPrefab(); } private void LoadPrefab() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (!string.IsNullOrEmpty(prefabAddress) && !loading) { loading = true; AsyncOperationHandle<GameObject> val = Addressables.LoadAssetAsync<GameObject>((object)prefabAddress); val.Completed += PrefabLoaded; } } private void PrefabLoaded(AsyncOperationHandle<GameObject> obj) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 AsyncOperationStatus status = obj.Status; if ((int)status != 1) { if ((int)status == 2) { if ((Object)(object)instance != (Object)null) { Object.DestroyImmediate((Object)(object)instance); } Debug.LogError((object)"Prefab load failed."); loading = false; } } else if (!(loadedPrefab == prefabAddress)) { if ((Object)(object)instance != (Object)null) { Object.DestroyImmediate((Object)(object)instance); } GameObject result = obj.Result; instance = Object.Instantiate<GameObject>(result); SetRecursiveFlags(instance.transform); instance.transform.SetParent(((Component)this).gameObject.transform, false); loadedPrefab = prefabAddress; loading = false; } } private static void SetRecursiveFlags(Transform transform) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown GameObject gameObject = ((Component)transform).gameObject; ((Object)gameObject).hideFlags = (HideFlags)(((Object)gameObject).hideFlags | 0x34); foreach (Transform item in transform) { SetRecursiveFlags(item); } } } [ExecuteAlways] internal class AddressableAssetLoader : MonoBehaviour { public Component component; public string fieldName; public string assetAddress; private static readonly MethodInfo LoadAssetAsyncInfo = typeof(Addressables).GetMethod("LoadAssetAsync", new Type[1] { typeof(string) }); private void LoadAsset(bool dontSave = false) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) Type type = ((object)component).GetType(); FieldInfo field = type.GetField(fieldName, BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); PropertyInfo propertyInfo = null; if (field == null) { propertyInfo = type.GetProperty(fieldName, BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (propertyInfo == null) { return; } } object obj = LoadAssetAsyncInfo.MakeGenericMethod(field?.FieldType ?? propertyInfo.PropertyType).Invoke(null, new object[1] { assetAddress }); object obj2 = obj.GetType().GetMethod("WaitForCompletion", BindingFlags.Instance | BindingFlags.Public).Invoke(obj, null); Object val = (Object)obj2; if (val != (Object)null) { if (dontSave) { val.hideFlags = (HideFlags)(val.hideFlags | 0x34); } field?.SetValue(component, obj2); propertyInfo?.SetValue(component, obj2); } } private IEnumerator WaitAndLoadAsset() { yield return (object)new WaitUntil((Func<bool>)(() => Addressables.InternalIdTransformFunc != null)); LoadAsset(dontSave: true); } private void Start() { LoadAsset(); } private void OnValidate() { if (((Component)this).gameObject.activeInHierarchy) { ((MonoBehaviour)this).StartCoroutine(WaitAndLoadAsset()); } } } internal static class ConfigManager { public static ConfigFile ConfigFileComponents; public static ConfigFile ConfigFileMisc; public static ConfigFile ConfigFileAdvancedIcons; public static ConfigFile ConfigFileBuffs; public static ConfigFile ConfigFileCommandImprovements; public static ConfigFile ConfigFileDPSMeter; public static ConfigFile ConfigFileItemCounters; public static ConfigFile ConfigFileStatsDisplay; public static ConfigFile ConfigFileSorting; public static ConfigEntry<bool> ComponentsAdvancedIcons; public static ConfigEntry<bool> ComponentsBuffTimers; public static ConfigEntry<bool> ComponentsCommandImprovements; public static ConfigEntry<bool> ComponentsDPSMeter; public static ConfigEntry<bool> ComponentsItemCounters; public static ConfigEntry<bool> ComponentsItemSorting; public static ConfigEntry<bool> ComponentsMisc; public static ConfigEntry<bool> ComponentsStatsDisplay; public static ConfigEntry<bool> MiscShowHidden; public static ConfigEntry<bool> MiscAdvancedPickupNotificationsItems; public static ConfigEntry<bool> MiscAdvancedPickupNotificationsEquipements; public static ConfigEntry<bool> MiscHidePickupNotificiationsItems; public static ConfigEntry<bool> MiscHidePickupNotificiationsEquipements; public static ConfigEntry<bool> MiscHidePickupNotificiationsArtifacts; public static ConfigEntry<bool> MiscShowPickupDescription; public static ConfigEntry<bool> MiscPickupDescriptionAdvanced; public static ConfigEntry<bool> AdvancedIconsItemAdvancedDescriptions; public static ConfigEntry<bool> AdvancedIconsItemItemStatsIntegration; public static ConfigEntry<bool> AdvancedIconsEquipementShowCooldownStacks; public static ConfigEntry<bool> AdvancedIconsEquipementAdvancedDescriptions; public static ConfigEntry<bool> AdvancedIconsEquipementShowBaseCooldown; public static ConfigEntry<bool> AdvancedIconsEquipementShowCalculatedCooldown; public static ConfigEntry<bool> AdvancedIconsSkillShowCooldownStacks; public static ConfigEntry<bool> AdvancedIconsSkillShowBaseCooldown; public static ConfigEntry<bool> AdvancedIconsSkillShowCalculatedCooldown; public static ConfigEntry<bool> AdvancedIconsSkillShowProcCoefficient; public static ConfigEntry<bool> AdvancedIconsSkillCalculateSkillProcEffects; public static ConfigEntry<bool> BuffTimers; public static ConfigEntry<bool> BuffTimersDecimal; public static ConfigEntry<bool> BuffTooltips; public static ConfigEntry<string> BuffTimersPosition; public static TextAlignmentOptions BuffTimersTextAlignmentOption; public static ConfigEntry<float> BuffTimersFontSize; public static ConfigEntry<bool> CommandResizeCommandWindow; public static ConfigEntry<bool> CommandRemoveBackgroundBlur; public static ConfigEntry<bool> CommandCloseOnEscape; public static ConfigEntry<bool> CommandCloseOnWASD; public static ConfigEntry<string> CommandCloseOnCustom; public static ConfigEntry<bool> CommandTooltipsShow; public static ConfigEntry<bool> CommandTooltipsItemStatsBeforeAfter; public static ConfigEntry<bool> CommandCountersShow; public static ConfigEntry<bool> CommandCountersHideOnZero; public static ConfigEntry<string> CommandCountersPosition; public static TextAlignmentOptions CommandCountersTextAlignmentOption; public static ConfigEntry<float> CommandCountersFontSize; public static ConfigEntry<string> CommandCountersPrefix; public static ConfigEntry<float> DPSMeterTimespan; public static ConfigEntry<bool> DPSMeterWindowShow; public static ConfigEntry<bool> DPSMeterWindowIncludeMinions; public static ConfigEntry<bool> DPSMeterWindowBackground; public static ConfigEntry<bool> DPSMeterWindowHideWhenTyping; public static ConfigEntry<Vector2> DPSMeterWindowAnchorMin; public static ConfigEntry<Vector2> DPSMeterWindowAnchorMax; public static ConfigEntry<Vector2> DPSMeterWindowPosition; public static ConfigEntry<Vector2> DPSMeterWindowPivot; public static ConfigEntry<Vector2> DPSMeterWindowSize; public static ConfigEntry<Vector3> DPSMeterWindowAngle; public static ConfigEntry<bool> ItemCountersShowItemCounters; public static ConfigEntry<bool> ItemCountersShowItemScore; public static ConfigEntry<bool> ItemCountersItemScoreFromTier; public static ConfigEntry<bool> ItemCountersShowItemSum; public static ConfigEntry<string> ItemCountersItemSumTiersString; public static List<ItemTier> ItemCountersItemSumTiers; public static ConfigEntry<bool> ItemCountersShowItemsByTier; public static ConfigEntry<string> ItemCountersItemsByTierOrderString; public static List<ItemTier> ItemCountersItemsByTierOrder; public static ConfigEntry<float> ItemCountersTierScoreTier1; public static ConfigEntry<float> ItemCountersTierScoreTier2; public static ConfigEntry<float> ItemCountersTierScoreTier3; public static ConfigEntry<float> ItemCountersTierScoreLunar; public static ConfigEntry<float> ItemCountersTierScoreBoss; public static ConfigEntry<float> ItemCountersTierScoreNoTier; public static Dictionary<ItemTier, float> ItemCountersTierScores; public static Dictionary<ItemDef, float> ItemCountersItemScores; public static ConfigEntry<bool> StatsDisplayEnable; public static ConfigEntry<string> StatsDisplayStatString; public static ConfigEntry<string> StatsDisplayStatStringCustomBind; public static ConfigEntry<string> StatsDisplayCustomBind; public static ConfigEntry<bool> StatsDisplayShowCustomBindOnly; public static ConfigEntry<bool> StatsDisplayToggleOnBind; public static ConfigEntry<bool> StatsDisplayPanelBackground; public static ConfigEntry<bool> StatsDisplayAttachToObjectivePanel; public static ConfigEntry<Vector2> StatsDisplayWindowAnchorMin; public static ConfigEntry<Vector2> StatsDisplayWindowAnchorMax; public static ConfigEntry<Vector2> StatsDisplayWindowPosition; public static ConfigEntry<Vector2> StatsDisplayWindowPivot; public static ConfigEntry<Vector2> StatsDisplayWindowSize; public static ConfigEntry<Vector3> StatsDisplayWindowAngle; public static ConfigEntry<bool> SortingSortItemsInventory; public static ConfigEntry<bool> SortingSortItemsCommand; public static ConfigEntry<bool> SortingSortItemsScrapper; public static ConfigEntry<string> SortingTierOrderString; public static int[] SortingTierOrder; public static ConfigEntry<string> SortingSortOrder; public static ConfigEntry<string> SortingSortOrderCommand; public static ConfigEntry<string> SortingSortOrderScrapper; private static IReadOnlyDictionary<(string, string), (string, string)> previousEntryMap; static ConfigManager() { //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Expected O, but got Unknown //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Expected O, but got Unknown //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Expected O, but got Unknown //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Expected O, but got Unknown //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Expected O, but got Unknown //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Expected O, but got Unknown //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Expected O, but got Unknown //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_07c0: Unknown result type (might be due to invalid IL or missing references) //IL_07c5: Unknown result type (might be due to invalid IL or missing references) //IL_08c8: Unknown result type (might be due to invalid IL or missing references) //IL_08f5: Unknown result type (might be due to invalid IL or missing references) //IL_0922: Unknown result type (might be due to invalid IL or missing references) //IL_094f: Unknown result type (might be due to invalid IL or missing references) //IL_097c: Unknown result type (might be due to invalid IL or missing references) //IL_09ae: Unknown result type (might be due to invalid IL or missing references) //IL_0dc6: Unknown result type (might be due to invalid IL or missing references) //IL_0df3: Unknown result type (might be due to invalid IL or missing references) //IL_0e20: Unknown result type (might be due to invalid IL or missing references) //IL_0e4d: Unknown result type (might be due to invalid IL or missing references) //IL_0e7a: Unknown result type (might be due to invalid IL or missing references) //IL_0eac: Unknown result type (might be due to invalid IL or missing references) previousEntryMap = new Dictionary<(string, string), (string, string)> { { ("Components", "AdvancedIcons"), ("Components", "AdvanedIcons") }, { ("Misc", "AdvancedPickupNotificationsEquipment"), ("Misc", "AdvancedPickupNotificationsEquipements") }, { ("Misc", "HidePickupNotificationsItems"), ("Misc", "HidePickupNotificiationsItems") }, { ("Misc", "HidePickupNotificationsEquipment"), ("Misc", "HidePickupNotificiationsEquipements") }, { ("Misc", "HidePickupNotificationsArtifacts"), ("Misc", "HidePickupNotificiationsArtifacts") }, { ("Equipment Improvements", "ShowCooldownStacks"), ("Equipement Improvements", "ShowCooldownStacks") }, { ("Equipment Improvements", "AdvancedDescriptions"), ("Equipement Improvements", "AdvancedDescriptions") }, { ("Equipment Improvements", "BaseCooldown"), ("Equipement Improvements", "BaseCooldown") }, { ("Equipment Improvements", "CalculatedCooldown"), ("Equipement Improvements", "CalculatedCooldown") }, { ("Components", "Buffs"), ("Components", "BuffTimers") } }; ConfigFileComponents = new ConfigFile(Paths.ConfigPath + "\\BetterUI-Components.cfg", true); ConfigFileMisc = new ConfigFile(Paths.ConfigPath + "\\BetterUI-Misc.cfg", true); ConfigFileAdvancedIcons = new ConfigFile(Paths.ConfigPath + "\\BetterUI-AdvancedIcons.cfg", true); ConfigFileBuffs = new ConfigFile(Paths.ConfigPath + "\\BetterUI-Buffs.cfg", true); ConfigFileCommandImprovements = new ConfigFile(Paths.ConfigPath + "\\BetterUI-CommandImprovements.cfg", true); ConfigFileDPSMeter = new ConfigFile(Paths.ConfigPath + "\\BetterUI-DPSMeter.cfg", true); ConfigFileItemCounters = new ConfigFile(Paths.ConfigPath + "\\BetterUI-ItemCounters.cfg", true); ConfigFileStatsDisplay = new ConfigFile(Paths.ConfigPath + "\\BetterUI-StatsDisplay.cfg", true); ConfigFileSorting = new ConfigFile(Paths.ConfigPath + "\\BetterUI-Sorting.cfg", true); ComponentsAdvancedIcons = Bind(ConfigFileComponents, "Components", "AdvancedIcons", defaultValue: true, "Enable/Disable the component entirely, stopping it from hooking any game functions."); ComponentsBuffTimers = Bind(ConfigFileComponents, "Components", "Buffs", defaultValue: true, "Enable/Disable the component entirely, stopping it from hooking any game functions."); ComponentsCommandImprovements = Bind(ConfigFileComponents, "Components", "CommandImprovements", defaultValue: true, "Enable/Disable the component entirely, stopping it from hooking any game functions."); ComponentsDPSMeter = Bind(ConfigFileComponents, "Components", "DPSMeter", defaultValue: true, "Enable/Disable the component entirely, stopping it from hooking any game functions."); ComponentsItemCounters = Bind(ConfigFileComponents, "Components", "ItemCounters", defaultValue: true, "Enable/Disable the component entirely, stopping it from hooking any game functions."); ComponentsItemSorting = Bind(ConfigFileComponents, "Components", "ItemSorting", defaultValue: true, "Enable/Disable the component entirely, stopping it from hooking any game functions."); ComponentsMisc = Bind(ConfigFileComponents, "Components", "Misc", defaultValue: true, "Enable/Disable the component entirely, stopping it from hooking any game functions."); ComponentsStatsDisplay = Bind(ConfigFileComponents, "Components", "StatsDisplay", defaultValue: true, "Enable/Disable the component entirely, stopping it from hooking any game functions."); MiscShowHidden = Bind(ConfigFileMisc, "Misc", "ShowHidden", defaultValue: false, "Show hidden items in the item inventory."); MiscAdvancedPickupNotificationsItems = Bind(ConfigFileMisc, "Misc", "AdvancedPickupNotificationsItems", defaultValue: false, "Show advanced descriptions when picking up an item."); MiscAdvancedPickupNotificationsEquipements = Bind(ConfigFileMisc, "Misc", "AdvancedPickupNotificationsEquipment", defaultValue: false, "Show advanced descriptions when picking up equipment."); MiscHidePickupNotificiationsItems = Bind(ConfigFileMisc, "Misc", "HidePickupNotificationsItems", defaultValue: false, "Hide pickup notifications for items."); MiscHidePickupNotificiationsEquipements = Bind(ConfigFileMisc, "Misc", "HidePickupNotificationsEquipment", defaultValue: false, "Hide pickup notifications for equipment."); MiscHidePickupNotificiationsArtifacts = Bind(ConfigFileMisc, "Misc", "HidePickupNotificationsArtifacts", defaultValue: false, "Hide pickup notifications for artifacts."); MiscShowPickupDescription = Bind(ConfigFileMisc, "Misc", "ShowPickupDescription", defaultValue: true, "Show the item description on the interaction pop-up."); MiscPickupDescriptionAdvanced = Bind(ConfigFileMisc, "Misc", "PickupDescriptionAdvanced", defaultValue: false, "Show advanced descriptions for the interaction pop-up."); AdvancedIconsItemAdvancedDescriptions = Bind(ConfigFileAdvancedIcons, "Item Improvements", "AdvancedDescriptions", defaultValue: true, "Show advanced descriptions when hovering over an item."); AdvancedIconsItemItemStatsIntegration = Bind(ConfigFileAdvancedIcons, "Item Improvements", "ItemStatsIntegration", defaultValue: true, "Show ItemStats where applicable."); AdvancedIconsEquipementShowCooldownStacks = Bind(ConfigFileAdvancedIcons, "Equipment Improvements", "ShowCooldownStacks", defaultValue: true, "Show the cooldown for your equipment when charging multiple stacks."); AdvancedIconsEquipementAdvancedDescriptions = Bind(ConfigFileAdvancedIcons, "Equipment Improvements", "AdvancedDescriptions", defaultValue: true, "Show advanced descriptions when hovering over equipment."); AdvancedIconsEquipementShowBaseCooldown = Bind(ConfigFileAdvancedIcons, "Equipment Improvements", "BaseCooldown", defaultValue: true, "Show the base cooldown when hovering over equipment."); AdvancedIconsEquipementShowCalculatedCooldown = Bind(ConfigFileAdvancedIcons, "Equipment Improvements", "CalculatedCooldown", defaultValue: true, "Show the calculated cooldown based on your items when hovering over equipment."); AdvancedIconsSkillShowCooldownStacks = Bind(ConfigFileAdvancedIcons, "Skill Improvements", "ShowCooldownStacks", defaultValue: true, "Show the cooldown for skills when charging multiple stacks."); AdvancedIconsSkillShowBaseCooldown = Bind(ConfigFileAdvancedIcons, "Skill Improvements", "BaseCooldown", defaultValue: true, "Show the base cooldown when hovering over a skill."); AdvancedIconsSkillShowCalculatedCooldown = Bind(ConfigFileAdvancedIcons, "Skill Improvements", "CalculatedCooldown", defaultValue: true, "Show the calculated cooldown based on your items when hovering over a skill."); AdvancedIconsSkillShowProcCoefficient = Bind(ConfigFileAdvancedIcons, "Skill Improvements", "ShowProcCoefficient", defaultValue: true, "Show the proc coefficient when hovering over a skill."); AdvancedIconsSkillCalculateSkillProcEffects = Bind(ConfigFileAdvancedIcons, "Skill Improvements", "CalculateProcEffects", defaultValue: true, "Show the effects of carried items, adjusted for each skill's proc coefficient."); BuffTimers = Bind(ConfigFileBuffs, "Buffs", "BuffTimers", defaultValue: true, "Show buff timers (host only)."); BuffTimersDecimal = Bind(ConfigFileBuffs, "Buffs", "BuffTimersDecimal", defaultValue: true, "Show 1 decimal point when timer is below 10."); BuffTooltips = Bind(ConfigFileBuffs, "Buffs", "BuffTooltips", defaultValue: true, "Show buff tooltips."); BuffTimersPosition = Bind(ConfigFileBuffs, "Buffs", "CountersPosition", "TopRight", "Location of buff timer text.\nValid options:\nTopLeft\nTopRight\nBottomLeft\nBottomRight\nCenter\n"); BuffTimersTextAlignmentOption = (TextAlignmentOptions)Enum.Parse(typeof(TextAlignmentOptions), BuffTimersPosition.Value, ignoreCase: true); BuffTimersFontSize = Bind(ConfigFileBuffs, "Buffs", "CountersFontSize", 23f, "Size of the buff timer text."); CommandResizeCommandWindow = Bind(ConfigFileCommandImprovements, "Command / Scrapper Improvements", "ResizeCommandWindow", defaultValue: true, "Resize the command window depending on the number of items."); CommandRemoveBackgroundBlur = Bind(ConfigFileCommandImprovements, "Command / Scrapper Improvements", "RemoveBackgroundBlur", defaultValue: true, "Remove the blur behind the command window that hides the rest of the UI."); CommandCloseOnEscape = Bind(ConfigFileCommandImprovements, "Command / Scrapper Improvements", "CloseOnEscape", defaultValue: true, "Close the command/scrapper window when you press escape."); CommandCloseOnWASD = Bind(ConfigFileCommandImprovements, "Command / Scrapper Improvements", "CloseOnWASD", defaultValue: true, "Close the command/scrapper window when you press W, A, S, or D."); CommandCloseOnCustom = Bind(ConfigFileCommandImprovements, "Command / Scrapper Improvements", "CloseOnCustom", "", "Close the command/scrapper window when you press the key selected here.\nExample: space\nMust be lowercase. Leave blank to disable."); CommandTooltipsShow = Bind(ConfigFileCommandImprovements, "Command / Scrapper Improvements", "TooltipsShow", defaultValue: true, "Show tooltips in the command and scrapper windows."); CommandTooltipsItemStatsBeforeAfter = Bind(ConfigFileCommandImprovements, "Command / Scrapper Improvements", "TooltipsItemStatsBeforeAfter", defaultValue: true, "Show the ItemStats before and after picking up the item."); CommandCountersShow = Bind(ConfigFileCommandImprovements, "Command / Scrapper Improvements", "CountersShow", defaultValue: true, "Show counters in the command and scrapper windows."); CommandCountersHideOnZero = Bind(ConfigFileCommandImprovements, "Command / Scrapper Improvements", "CountersHideOnZero", defaultValue: false, "Hide counters when they are zero."); CommandCountersPosition = Bind(ConfigFileCommandImprovements, "Command / Scrapper Improvements", "CountersPosition", "TopRight", "Location of the command item counter.\nValid options:\nTopLeft\nTopRight\nBottomLeft\nBottomRight\nCenter\n"); CommandCountersTextAlignmentOption = (TextAlignmentOptions)Enum.Parse(typeof(TextAlignmentOptions), CommandCountersPosition.Value, ignoreCase: true); CommandCountersFontSize = Bind(ConfigFileCommandImprovements, "Command / Scrapper Improvements", "CountersFontSize", 20f, "Size of the command item counter text."); CommandCountersPrefix = Bind(ConfigFileCommandImprovements, "Command / Scrapper Improvements", "CountersPrefix", "x", "Prefix for the command item counter. Example 'x' will show x0, x1, x2, etc.\nCan be empty."); DPSMeterTimespan = Bind(ConfigFileDPSMeter, "DPSMeter", "Timespan", 5f, "Calculate DPS across this many seconds."); DPSMeterWindowShow = Bind(ConfigFileDPSMeter, "DPSMeter", "WindowShow", defaultValue: true, "Show a dedicated DPSMeter."); DPSMeterWindowIncludeMinions = Bind(ConfigFileDPSMeter, "DPSMeter", "WindowIncludeMinions", defaultValue: true, "Include minions such as turrets and drones in the DPS meter."); DPSMeterWindowBackground = Bind(ConfigFileDPSMeter, "DPSMeter", "WindowBackground", defaultValue: true, "Whether or not the DPS window should have a background."); DPSMeterWindowHideWhenTyping = Bind(ConfigFileDPSMeter, "DPSMeter", "WindowHideWhenTyping", defaultValue: true, "Whether or not the DPS window should be hidden when typing into the chat box."); DPSMeterWindowAnchorMin = Bind<Vector2>(ConfigFileDPSMeter, "DPSMeter", "WindowAnchorMin", new Vector2(0f, 0f), "Screen position the lower left window corner is anchored to.\nX & Y can be any number from 0.0 to 1.0 (inclusive).\nScreen position starts at the bottom-left (0.0, 0.0) and increases toward the top-right (1.0, 1.0)."); DPSMeterWindowAnchorMax = Bind<Vector2>(ConfigFileDPSMeter, "DPSMeter", "WindowAnchorMax", new Vector2(0f, 0f), "Screen position the upper right window corner is anchored to.\nX & Y can be any number from 0.0 to 1.0 (inclusive).\nScreen position starts at the bottom-left (0.0, 0.0) and increases toward the top-right (1.0, 1.0)."); DPSMeterWindowPosition = Bind<Vector2>(ConfigFileDPSMeter, "DPSMeter", "WindowPosition", new Vector2(120f, 240f), "Position of the DPSMeter window relative to the anchor."); DPSMeterWindowPivot = Bind<Vector2>(ConfigFileDPSMeter, "DPSMeter", "WindowPivot", new Vector2(0f, 1f), "Pivot of the DPSMeter window.\nWindow Position is from the anchor to the pivot."); DPSMeterWindowSize = Bind<Vector2>(ConfigFileDPSMeter, "DPSMeter", "WindowSize", new Vector2(350f, 45f), "Size of the DPSMeter window."); DPSMeterWindowAngle = Bind<Vector3>(ConfigFileDPSMeter, "DPSMeter", "WindowAngle", new Vector3(0f, -6f, 0f), "Angle of the DPSMeter window."); ItemCountersShowItemCounters = Bind(ConfigFileItemCounters, "ItemCounters", "ShowItemCounters", defaultValue: true, "Enable/Disable ItemCounters entirely."); ItemCountersShowItemScore = Bind(ConfigFileItemCounters, "ItemCounters", "ShowItemScore", defaultValue: true, "Show your item score."); ItemCountersItemScoreFromTier = Bind(ConfigFileItemCounters, "ItemCounters", "ItemScoreFromTier", defaultValue: true, "Whether or not the ItemScore should be based on tier. If disabled, the per-item settings will be used."); ItemCountersShowItemSum = Bind(ConfigFileItemCounters, "ItemCounters", "ShowItemSum", defaultValue: true, "Show the how many items you have."); ItemCountersItemSumTiersString = Bind(ConfigFileItemCounters, "ItemCounters", "ItemSumTiersString", "01234", "Which tiers to include in the ItemSum.\n0 = White, 1 = Green, 2 = Red, 3 = Lunar, 4 = Boss, 5 = NoTier"); ItemCountersItemSumTiers = (from c in ItemCountersItemSumTiersString.Value.ToCharArray() select (ItemTier)(int)char.GetNumericValue(c)).ToList(); ItemCountersShowItemsByTier = Bind(ConfigFileItemCounters, "ItemCounters", "ShowItemsByTier", defaultValue: true, "Show how many items you have, by tier."); ItemCountersItemsByTierOrderString = Bind(ConfigFileItemCounters, "ItemCounters", "ItemsByTierOrderString", "43210", "Which tiers to include in the ItemsByTier, in order.\n0 = White, 1 = Green, 2 = Red, 3 = Lunar, 4 = Boss, 5 = NoTier"); ItemCountersItemsByTierOrder = (from c in ItemCountersItemsByTierOrderString.Value.ToCharArray() select (ItemTier)(int)char.GetNumericValue(c)).ToList(); ItemCountersTierScoreTier1 = Bind(ConfigFileItemCounters, "ItemCounters Tier Score", "Tier1", 1f, "Score for Tier 1 items."); ItemCountersTierScoreTier2 = Bind(ConfigFileItemCounters, "ItemCounters Tier Score", "Tier2", 3f, "Score for Tier 2 items."); ItemCountersTierScoreTier3 = Bind(ConfigFileItemCounters, "ItemCounters Tier Score", "Tier3", 12f, "Score for Tier 3 items."); ItemCountersTierScoreLunar = Bind(ConfigFileItemCounters, "ItemCounters Tier Score", "Lunar", 0f, "Score for Lunar items."); ItemCountersTierScoreBoss = Bind(ConfigFileItemCounters, "ItemCounters Tier Score", "Boss", 4f, "Score for Boss items."); ItemCountersTierScoreNoTier = Bind(ConfigFileItemCounters, "ItemCounters Tier Score", "NoTier", 0f, "Score for items without a tier."); ItemCountersTierScores = new Dictionary<ItemTier, float> { { (ItemTier)0, ItemCountersTierScoreTier1.Value }, { (ItemTier)6, ItemCountersTierScoreTier1.Value }, { (ItemTier)1, ItemCountersTierScoreTier2.Value }, { (ItemTier)7, ItemCountersTierScoreTier2.Value }, { (ItemTier)2, ItemCountersTierScoreTier3.Value }, { (ItemTier)8, ItemCountersTierScoreTier3.Value }, { (ItemTier)3, ItemCountersTierScoreLunar.Value }, { (ItemTier)4, ItemCountersTierScoreBoss.Value }, { (ItemTier)9, ItemCountersTierScoreBoss.Value }, { (ItemTier)5, ItemCountersTierScoreNoTier.Value } }; ItemCountersItemScores = new Dictionary<ItemDef, float>(); StatsDisplayEnable = Bind(ConfigFileStatsDisplay, "StatsDisplay", "Enable", defaultValue: true, "Enable/Disable the StatsDisplay entirely."); StatsDisplayStatString = Bind(ConfigFileStatsDisplay, "StatsDisplay", "StatString", "<color=#FFFFFF><size=18><b>Stats</b></size>\n<size=14>Luck: $luck\nBase Damage: $dmg\nCrit Chance: $luckcrit%\nAttack Speed: $atkspd\nArmor: $armor | $armordmgreduction%\nRegen: $regen\nSpeed: $velocity\nJumps: $jumps/$maxjumps\nKills: $killcount\nMountain Shrines: $mountainshrines\n", "You may format the StatString using formatting tags such as color, size, bold, underline, italics. See Readme for more.\nValid Parameters:\n" + string.Join(" ", StatsDisplay.regexmap.Keys)); StatsDisplayStatStringCustomBind = Bind(ConfigFileStatsDisplay, "StatsDisplay", "StatStringCustomBind", "<color=#FFFFFF><size=18><b>Stats</b></size>\n<size=14>Luck: $luck\nExperience: $exp/$maxexp\nBase Damage: $dmg\nCrit Chance: $crit%\nCrit w/ Luck: $luckcrit%\nCrit Damage: $critdamage\nAttack Speed: $atkspd\nArmor: $armor | $armordmgreduction%\nRegen: $regen\nSpeed: $velocity\nJumps: $jumps/$maxjumps\nKills: $killcount\nMountain Shrines: $mountainshrines\nDifficulty: $difficulty\nBlue Portal: $blueportal\nGold Portal: $goldportal\nCelestial Portal: $celestialportal\nVoid Portal: $voidportal\n", "StatDisplay string to show when the custom bind is being pressed. This can be the same or different from the normal StatString."); StatsDisplayCustomBind = Bind(ConfigFileStatsDisplay, "StatsDisplay", "CustomBind", "tab", "Bind to show secondary StatsDisplay string.\nExample: space\nMust be lowercase. Leave blank to disable."); StatsDisplayShowCustomBindOnly = Bind(ConfigFileStatsDisplay, "StatsDisplay", "ShowCustomBindOnly", defaultValue: false, "Only show the StatsDisplay when the scoreboard is open."); StatsDisplayToggleOnBind = Bind(ConfigFileStatsDisplay, "StatsDisplay", "ToggleOnBind", defaultValue: false, "Toggle the StatsDisplay when the bind is pressed rather than showing it when it is held."); StatsDisplayPanelBackground = Bind(ConfigFileStatsDisplay, "StatsDisplay", "PanelBackground", defaultValue: true, "Whether or not the StatsDisplay panel should have a background."); StatsDisplayAttachToObjectivePanel = Bind(ConfigFileStatsDisplay, "StatsDisplay", "AttachToObjectivePanel", defaultValue: true, "Whether to attach the stats display to the objective panel.\nIf not, it will be a free-floating window that can be moved with the options below."); StatsDisplayWindowAnchorMin = Bind<Vector2>(ConfigFileStatsDisplay, "StatsDisplay", "WindowAnchorMin", new Vector2(1f, 0.5f), "Screen position the lower left window corner is anchored to.\nX & Y can be any number from 0.0 to 1.0 (inclusive).\nScreen position starts at the bottom-left (0.0, 0.0) and increases toward the top-right (1.0, 1.0)."); StatsDisplayWindowAnchorMax = Bind<Vector2>(ConfigFileStatsDisplay, "StatsDisplay", "WindowAnchorMax", new Vector2(1f, 0.5f), "Screen position the upper right window corner is anchored to.\nX & Y can be any number from 0.0 to 1.0 (inclusive).\nScreen position starts at the bottom-left (0.0, 0.0) and increases toward the top-right (1.0, 1.0)."); StatsDisplayWindowPosition = Bind<Vector2>(ConfigFileStatsDisplay, "StatsDisplay", "WindowPosition", new Vector2(-210f, 100f), "Position of the StatsDisplay window relative to the anchor."); StatsDisplayWindowPivot = Bind<Vector2>(ConfigFileStatsDisplay, "StatsDisplay", "WindowPivot", new Vector2(0f, 0.5f), "Pivot of the StatsDisplay window.\nWindow Position is from the anchor to the pivot."); StatsDisplayWindowSize = Bind<Vector2>(ConfigFileStatsDisplay, "StatsDisplay", "WindowSize", new Vector2(200f, 600f), "Size of the StatsDisplay window."); StatsDisplayWindowAngle = Bind<Vector3>(ConfigFileStatsDisplay, "StatsDisplay", "WindowAngle", new Vector3(0f, 6f, 0f), "Angle of the StatsDisplay window."); SortingSortItemsInventory = Bind(ConfigFileSorting, "Sorting", "SortItemsInventory", defaultValue: true, "Sort items in the inventory and scoreboard."); SortingSortItemsCommand = Bind(ConfigFileSorting, "Sorting", "SortItemsCommand", defaultValue: true, "Sort items in the command window."); SortingSortItemsScrapper = Bind(ConfigFileSorting, "Sorting", "SortItemsScrapper", defaultValue: true, "Sort items in the scrapper window."); SortingTierOrderString = Bind(ConfigFileSorting, "Sorting", "TierOrder", "012345", "Tiers in ascending order, left to right.\n0 = White, 1 = Green, 2 = Red, 3 = Lunar, 4 = Boss, 5 = NoTier"); SortingTierOrder = new int[6] { SortingTierOrderString.Value.IndexOf('0'), SortingTierOrderString.Value.IndexOf('1'), SortingTierOrderString.Value.IndexOf('2'), SortingTierOrderString.Value.IndexOf('3'), SortingTierOrderString.Value.IndexOf('4'), SortingTierOrderString.Value.IndexOf('5') }; SortingSortOrder = Bind(ConfigFileSorting, "Sorting", "SortOrder", "S134", "What to sort the items by, most important to least important.\nFind the full details and an example in the Readme on Thunderstore/Github.\n0 = Tier Ascending\n1 = Tier Descending\n2 = Stack Size Ascending\n3 = Stack Size Descending\n4 = Pickup Order\n5 = Pickup Order Reversed\n6 = Alphabetical\n7 = Alphabetical Reversed\n8 = Random\ni = ItemIndex\nI = ItemIndex Descending\n\nTag Based:\ns = Scrap First\nS = Scrap Last\nd = Damage First\nD = Damage Last\nh = Healing First\nH = Healing Last\nu = Utility First\nU = Utility Last\no = On Kill Effect First\nO = On Kill Effect Last\ne = Equipment Related First\nE = Equipment Related Last\np = Sprint Related First\nP = Sprint Related Last"); SortingSortOrderCommand = Bind(ConfigFileSorting, "Sorting", "SortOrderCommand", "6", "Sort order for the command window.\nThe command window has a special sort option \"C\" which will place the last selected item in the middle.\nNote: This option must be the last one in the SortOrderCommand option."); SortingSortOrderScrapper = Bind(ConfigFileSorting, "Sorting", "SortOrderScrapper", "134", "Sort order for the scrapper window."); } private static ConfigEntry<T> Bind<T>(ConfigFile config, string section, string key, T defaultValue, string description) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown ConfigEntry<T> val = config.Bind<T>(section, key, defaultValue, description); if (previousEntryMap.ContainsKey((section, key))) { (string, string) tuple = previousEntryMap[(section, key)]; ConfigDefinition val2 = new ConfigDefinition(tuple.Item1, tuple.Item2); ConfigEntry<string> val3 = config.Bind<string>(val2, "If you ever set your config option to this, it's your own fault", new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>())); if (val3.Value != "If you ever set your config option to this, it's your own fault") { ((ConfigEntryBase)val).SetSerializedValue(((ConfigEntryBase)val3).GetSerializedValue()); } config.Remove(val2); } return val; } } internal static class AdvancedIcons { internal delegate void LoadoutPanelController_Row_AddButton_Delegate(Action<Row, LoadoutPanelController, Sprite, string, string, Color, UnityAction, string, Node, bool> orig, Row self, LoadoutPanelController owner, Sprite icon, string titleToken, string bodyToken, Color tooltipColor, UnityAction callback, string unlockableName, Node viewableNode, bool isWIP = false); private static Dictionary<EquipmentIcon, bool> EquipmentIconDirty; private static Dictionary<EquipmentIcon, EquipmentDef> lastEquipment; private static Dictionary<SkillIcon, bool> SkillIconDirty; private static Dictionary<SkillIcon, SkillDef> lastSkill; private static List<ProcCoefficientCatalog.ProcCoefficientInfo> procCoefficientInfos; private static Inventory inventory; private static CharacterBody targetbody; public static CharacterMaster updateDisplayMaster; internal static SkillDef skillDef; static AdvancedIcons() { EquipmentIconDirty = new Dictionary<EquipmentIcon, bool>(); lastEquipment = new Dictionary<EquipmentIcon, EquipmentDef>(); SkillIconDirty = new Dictionary<SkillIcon, bool>(); lastSkill = new Dictionary<SkillIcon, SkillDef>(); BetterUIPlugin.onHUDAwake += onHUDAwake; RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(onRoR2ApplicationLoad)); } internal static void Hook() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown if (ConfigManager.AdvancedIconsSkillShowProcCoefficient.Value || ConfigManager.AdvancedIconsSkillCalculateSkillProcEffects.Value || ConfigManager.AdvancedIconsSkillShowBaseCooldown.Value || ConfigManager.AdvancedIconsEquipementShowCalculatedCooldown.Value) { BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<Row>("FromSkillSlot", new Manipulator(LoadoutPanelController_Row_FromSkillSlot), BindingFlags.Default); BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<Row>("AddButton", (Delegate)new LoadoutPanelController_Row_AddButton_Delegate(LoadoutPanelController_Row_AddButton), BindingFlags.Default); BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<SkillIcon>("Update", (Action<Action<SkillIcon>, SkillIcon>)SkillIcon_Update, BindingFlags.Default); BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<CharacterMaster>("OnInventoryChanged", (Action<Action<CharacterMaster>, CharacterMaster>)CharacterMaster_OnInventoryChanged, BindingFlags.Default); } if (ConfigManager.AdvancedIconsItemAdvancedDescriptions.Value) { BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<ItemIcon, ItemIndex, int>("SetItemIndex", (Action<Action<ItemIcon, ItemIndex, int>, ItemIcon, ItemIndex, int>)ItemIcon_SetItemIndex, BindingFlags.Default); BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<ItemInventoryDisplay>("UpdateDisplay", (Action<Action<ItemInventoryDisplay>, ItemInventoryDisplay>)ItemInventoryDisplay_UpdateDisplay, BindingFlags.Default); } if (ConfigManager.AdvancedIconsEquipementAdvancedDescriptions.Value || ConfigManager.AdvancedIconsEquipementShowBaseCooldown.Value || ConfigManager.AdvancedIconsEquipementShowCalculatedCooldown.Value) { BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<EquipmentIcon>("Update", (Action<Action<EquipmentIcon>, EquipmentIcon>)EquipmentIcon_Update, BindingFlags.Default); } } private static void onHUDAwake(HUD self) { EquipmentIconDirty.Clear(); lastEquipment.Clear(); SkillIconDirty.Clear(); lastSkill.Clear(); } private static void onRoR2ApplicationLoad() { SkillCatalog.GetSkillDef(Utils.TheREALFindSkillIndexByName("FireCorruptBeam")).skillDescriptionToken = "VOIDSURVIVOR_PRIMARY_ALT_DESCRIPTION"; SkillCatalog.GetSkillDef(Utils.TheREALFindSkillIndexByName("FireCorruptDisk")).skillDescriptionToken = "VOIDSURVIVOR_SECONDARY_ALT_DESCRIPTION"; SkillCatalog.GetSkillDef(Utils.TheREALFindSkillIndexByName("VoidBlinkDown")).skillDescriptionToken = "VOIDSURVIVOR_UTILITY_ALT_DESCRIPTION"; SkillCatalog.GetSkillDef(Utils.TheREALFindSkillIndexByName("CrushHealth")).skillDescriptionToken = "VOIDSURVIVOR_SPECIAL_ALT_DESCRIPTION"; } internal static void ItemInventoryDisplay_UpdateDisplay(Action<ItemInventoryDisplay> orig, ItemInventoryDisplay self) { object obj; if (self == null) { obj = null; } else { Inventory obj2 = self.inventory; obj = ((obj2 != null) ? ((Component)obj2).gameObject.GetComponent<CharacterMaster>() : null); } updateDisplayMaster = (CharacterMaster)obj; orig(self); updateDisplayMaster = null; } private static void ItemIcon_SetItemIndex(Action<ItemIcon, ItemIndex, int> orig, ItemIcon self, ItemIndex itemIndex, int itemCount) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) orig(self, itemIndex, itemCount); if (ConfigManager.AdvancedIconsItemItemStatsIntegration.Value && (Object)(object)updateDisplayMaster != (Object)null) { ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex); BetterUIPlugin.sharedStringBuilder.Clear(); BetterUIPlugin.sharedStringBuilder.Append(Language.GetString(itemDef.descriptionToken ?? itemDef.pickupToken ?? "")); BetterUIPlugin.sharedStringBuilder.Append("</style>\n"); ItemStats.GetItemStats(BetterUIPlugin.sharedStringBuilder, itemDef, itemCount, updateDisplayMaster); self.tooltipProvider.overrideBodyText = BetterUIPlugin.sharedStringBuilder.ToString(); } else { self.tooltipProvider.bodyToken = ItemCatalog.GetItemDef(itemIndex).descriptionToken; } } private static void CharacterMaster_OnInventoryChanged(Action<CharacterMaster> orig, CharacterMaster self) { orig(self); if (!Object.op_Implicit((Object)(object)self.inventory)) { return; } foreach (EquipmentIcon item in new List<EquipmentIcon>(EquipmentIconDirty.Keys)) { if (Object.op_Implicit((Object)(object)item) && (Object)(object)item.targetInventory == (Object)(object)self.inventory) { EquipmentIconDirty[item] = true; } } foreach (SkillIcon item2 in new List<SkillIcon>(SkillIconDirty.Keys)) { if (Object.op_Implicit((Object)(object)item2) && Object.op_Implicit((Object)(object)item2.playerCharacterMasterController) && (Object)(object)item2.playerCharacterMasterController.master == (Object)(object)self) { SkillIconDirty[item2] = true; } } } internal static void LoadoutPanelController_Row_FromSkillSlot(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld<Variant>(x, "skillDef") })) { val.Emit(OpCodes.Dup); val.EmitDelegate<Action<SkillDef>>((Action<SkillDef>)delegate(SkillDef x) { skillDef = x; }); } } internal static void LoadoutPanelController_Row_AddButton(Action<Row, LoadoutPanelController, Sprite, string, string, Color, UnityAction, string, Node, bool> orig, Row self, LoadoutPanelController owner, Sprite icon, string titleToken, string bodyToken, Color tooltipColor, UnityAction callback, string unlockableName, Node viewableNode, bool isWIP = false) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) orig(self, owner, icon, titleToken, bodyToken, tooltipColor, callback, unlockableName, viewableNode, isWIP); UserProfile userProfile = self.userProfile; if ((ConfigManager.AdvancedIconsSkillShowProcCoefficient.Value || ConfigManager.AdvancedIconsSkillShowBaseCooldown.Value) && userProfile != null && userProfile.HasUnlockable(unlockableName)) { BetterUIPlugin.sharedStringBuilder.Clear(); BetterUIPlugin.sharedStringBuilder.Append(Language.GetString(bodyToken)); if (ConfigManager.AdvancedIconsSkillShowBaseCooldown.Value && (Object)(object)skillDef != (Object)null) { BetterUIPlugin.sharedStringBuilder.Append("\n\n").Append(Language.GetString("BETTERUI_COOLDOWN")).Append(": <style=cIsDamage>") .Append(skillDef.baseRechargeInterval) .Append("</style> ") .Append(Language.GetString(Language.GetPluralToken("BETTERUI_SECOND", skillDef.baseRechargeInterval))); } if (ConfigManager.AdvancedIconsSkillShowProcCoefficient.Value && (Object)(object)skillDef != (Object)null) { List<ProcCoefficientCatalog.ProcCoefficientInfo> procCoefficientInfo = ProcCoefficientCatalog.GetProcCoefficientInfo(SkillCatalog.GetSkillName(skillDef.skillIndex)); if (procCoefficientInfo != null) { foreach (ProcCoefficientCatalog.ProcCoefficientInfo item in procCoefficientInfo) { BetterUIPlugin.sharedStringBuilder.Append("\n\n<size=110%>").Append(Language.GetString(item.name)).Append(":</size>"); if (ConfigManager.AdvancedIconsSkillShowProcCoefficient.Value) { BetterUIPlugin.sharedStringBuilder.Append("\n <style=cIsUtility>").Append(Language.GetString("BETTERUI_PROCCOEFFICIENT")).Append(": ") .Append(item.procCoefficient) .Append("</style>"); } } } } TooltipProvider component = ((Component)self.buttons[self.buttons.Count - 1]).GetComponent<TooltipProvider>(); if ((Object)(object)component != (Object)null) { component.overrideBodyText = BetterUIPlugin.sharedStringBuilder.ToString(); } } skillDef = null; } internal static void SkillIcon_Update(Action<SkillIcon> orig, SkillIcon self) { orig(self); if (!SkillIconDirty.ContainsKey(self)) { SkillIconDirty.Add(self, value: true); lastSkill.Add(self, null); } if (Object.op_Implicit((Object)(object)self.targetSkill) && ((Object)(object)self.targetSkill.skillDef != (Object)(object)lastSkill[self] || SkillIconDirty[self])) { lastSkill[self] = self.targetSkill.skillDef; SkillIconDirty[self] = false; BetterUIPlugin.sharedStringBuilder.Clear(); BetterUIPlugin.sharedStringBuilder.Append(Language.GetString(self.targetSkill.skillDescriptionToken)); if (ConfigManager.AdvancedIconsSkillShowBaseCooldown.Value || ConfigManager.AdvancedIconsSkillShowCalculatedCooldown.Value) { BetterUIPlugin.sharedStringBuilder.Append("\n"); } if (ConfigManager.AdvancedIconsSkillShowBaseCooldown.Value) { BetterUIPlugin.sharedStringBuilder.Append("\n").Append(Language.GetString("BETTERUI_BASECOOLDOWN")).Append(": <style=cIsDamage>") .Append(self.targetSkill.baseRechargeInterval) .Append("</style> ") .Append(Language.GetString(Language.GetPluralToken("BETTERUI_SECOND", self.targetSkill.baseRechargeInterval))); } if (ConfigManager.AdvancedIconsSkillShowCalculatedCooldown.Value && self.targetSkill.baseRechargeInterval > self.targetSkill.finalRechargeInterval) { BetterUIPlugin.sharedStringBuilder.Append("\n").Append(Language.GetString("BETTERUI_EFFECTIVECOOLDOWN")).Append(": <style=cIsHealing>") .Append(self.targetSkill.finalRechargeInterval) .Append("</style> ") .Append(Language.GetString(Language.GetPluralToken("BETTERUI_SECOND", self.targetSkill.baseRechargeInterval))); } if (ConfigManager.AdvancedIconsSkillShowProcCoefficient.Value || ConfigManager.AdvancedIconsSkillCalculateSkillProcEffects.Value) { procCoefficientInfos = ProcCoefficientCatalog.GetProcCoefficientInfo(SkillCatalog.GetSkillName(self.targetSkill.skillDef.skillIndex)); if (procCoefficientInfos != null) { foreach (ProcCoefficientCatalog.ProcCoefficientInfo procCoefficientInfo in procCoefficientInfos) { BetterUIPlugin.sharedStringBuilder.Append("\n\n<size=110%>").Append(Language.GetString(procCoefficientInfo.name)).Append("</size>"); if (ConfigManager.AdvancedIconsSkillShowProcCoefficient.Value) { BetterUIPlugin.sharedStringBuilder.Append("\n <style=cIsUtility>").Append(Language.GetString("BETTERUI_PROCCOEFFICIENT")).Append(": ") .Append(procCoefficientInfo.procCoefficient) .Append("</style>"); } if (!(procCoefficientInfo.procCoefficient > 0f) || !ConfigManager.AdvancedIconsSkillCalculateSkillProcEffects.Value) { continue; } foreach (KeyValuePair<ItemDef, ItemStats.ItemProcInfo> itemProcInfo in ItemStats.itemProcInfos) { int itemCount = self.targetSkill.characterBody.inventory.GetItemCount(itemProcInfo.Key); if (itemCount > 0) { BetterUIPlugin.sharedStringBuilder.Append("\n ").Append(Language.GetString(itemProcInfo.Key.nameToken)).Append(": "); itemProcInfo.Value.GetOutputString(BetterUIPlugin.sharedStringBuilder, itemCount, self.targetSkill.characterBody.master, procCoefficientInfo.procCoefficient); } } } } } self.tooltipProvider.overrideBodyText = BetterUIPlugin.sharedStringBuilder.ToString(); } if (ConfigManager.AdvancedIconsSkillShowCooldownStacks.Value && Object.op_Implicit((Object)(object)self.targetSkill) && self.targetSkill.cooldownRemaining > 0f) { BetterUIPlugin.sharedStringBuilder.Clear(); StringBuilderExtensions.AppendInt(BetterUIPlugin.sharedStringBuilder, Mathf.CeilToInt(self.targetSkill.cooldownRemaining), 0u, uint.MaxValue); ((TMP_Text)self.cooldownText).SetText(BetterUIPlugin.sharedStringBuilder); ((Component)self.cooldownText).gameObject.SetActive(true); } } internal static void EquipmentIcon_Update(Action<EquipmentIcon> orig, EquipmentIcon self) { //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) orig(self); if (!EquipmentIconDirty.ContainsKey(self)) { EquipmentIconDirty.Add(self, value: true); lastEquipment.Add(self, null); } if ((ConfigManager.AdvancedIconsEquipementAdvancedDescriptions.Value || ConfigManager.AdvancedIconsEquipementShowBaseCooldown.Value || ConfigManager.AdvancedIconsEquipementShowCalculatedCooldown.Value) && ((Object)(object)self.currentDisplayData.equipmentDef != (Object)(object)lastEquipment[self] || EquipmentIconDirty[self]) && ((DisplayData)(ref self.currentDisplayData)).hasEquipment && Object.op_Implicit((Object)(object)self.tooltipProvider)) { lastEquipment[self] = self.currentDisplayData.equipmentDef; EquipmentIconDirty[self] = false; BetterUIPlugin.sharedStringBuilder.Clear(); BetterUIPlugin.sharedStringBuilder.Append(Language.GetString(ConfigManager.AdvancedIconsEquipementAdvancedDescriptions.Value ? self.currentDisplayData.equipmentDef.descriptionToken : self.currentDisplayData.equipmentDef.pickupToken)); if (ConfigManager.AdvancedIconsEquipementShowBaseCooldown.Value || ConfigManager.AdvancedIconsEquipementShowCalculatedCooldown.Value) { BetterUIPlugin.sharedStringBuilder.Append("\n"); } if (ConfigManager.AdvancedIconsEquipementShowBaseCooldown.Value) { BetterUIPlugin.sharedStringBuilder.Append("\n").Append(Language.GetString("BETTERUI_BASECOOLDOWN")).Append(": <style=cIsDamage>") .Append(self.currentDisplayData.equipmentDef.cooldown) .Append("</style> ") .Append(Language.GetString(Language.GetPluralToken("BETTERUI_SECOND", self.currentDisplayData.equipmentDef.cooldown))); } if (ConfigManager.AdvancedIconsEquipementShowCalculatedCooldown.Value) { inventory = self.targetInventory; if (!Object.op_Implicit((Object)(object)inventory) && Object.op_Implicit((Object)(object)BetterUIPlugin.hud.targetBodyObject)) { targetbody = BetterUIPlugin.hud.targetBodyObject.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)targetbody)) { inventory = targetbody.inventory; } } if (Object.op_Implicit((Object)(object)inventory)) { float num = (float)Math.Pow(0.85, inventory.GetItemCount(Items.EquipmentMagazine)); if (inventory.GetItemCount(Items.AutoCastEquipment.itemIndex) > 0) { num *= 0.5f * (float)Math.Pow(0.85, inventory.GetItemCount(Items.AutoCastEquipment.itemIndex) - 1); } if (num < 1f) { BetterUIPlugin.sharedStringBuilder.Append("\n").Append(Language.GetString("BETTERUI_EFFECTIVECOOLDOWN")).Append(": <style=cIsHealing>") .Append((self.currentDisplayData.equipmentDef.cooldown * num).ToString("0.###")) .Append("</style> ") .Append(Language.GetString(Language.GetPluralToken("BETTERUI_SECOND", self.currentDisplayData.equipmentDef.cooldown))); } } } self.tooltipProvider.overrideBodyText = BetterUIPlugin.sharedStringBuilder.ToString(); } if (ConfigManager.AdvancedIconsEquipementShowCooldownStacks.Value && Object.op_Implicit((Object)(object)self.cooldownText) && self.currentDisplayData.cooldownValue > 0) { ((Component)self.cooldownText).gameObject.SetActive(true); } } } public static class Buffs { public struct BuffInfo { public string nameToken; public string descriptionToken; } private static IEnumerable<TimedBuff> timedBuffs; private static TimedBuff thisBuff; private static readonly Dictionary<BuffDef, BuffInfo> buffInfos; static Buffs() { buffInfos = new Dictionary<BuffDef, BuffInfo>(); ((ResourceAvailability)(ref ItemCatalog.availability)).CallWhenAvailable((Action)delegate { RegisterBuffInfo(Buffs.AffixRed, "BUFF_AFFIXRED_NAME", "BUFF_AFFIXRED_DESC"); RegisterBuffInfo(Buffs.AffixBlue, "BUFF_AFFIXBLUE_NAME", "BUFF_AFFIXBLUE_DESC"); RegisterBuffInfo(Buffs.AffixWhite, "BUFF_AFFIXWHITE_NAME", "BUFF_AFFIXWHITE_DESC"); RegisterBuffInfo(Buffs.AffixPoison, "BUFF_AFFIXPOISON_NAME", "BUFF_AFFIXPOISON_DESC"); RegisterBuffInfo(Buffs.AffixHaunted, "BUFF_AFFIXHAUNTED_NAME", "BUFF_AFFIXHAUNTED_DESC"); RegisterBuffInfo(Buffs.AffixLunar, "BUFF_AFFIXLUNAR_NAME", "BUFF_AFFIXLUNAR_DESC"); RegisterBuffInfo(Buffs.ArmorBoost, "BUFF_ARMORBOOST_NAME", "BUFF_ARMORBOOST_DESC"); RegisterBuffInfo(Buffs.AttackSpeedOnCrit, "BUFF_ATTACKSPEEDONCRIT_NAME", "BUFF_ATTACKSPEEDONCRIT_DESC"); RegisterBuffInfo(Buffs.BugWings, "BUFF_BUGWINGS_NAME", "BUFF_BUGWINGS_DESC"); RegisterBuffInfo(Buffs.Cloak, "BUFF_CLOAK_NAME", "BUFF_CLOAK_DESC"); RegisterBuffInfo(Buffs.CloakSpeed, "BUFF_CLOAKSPEED_NAME", "BUFF_CLOAKSPEED_DESC"); RegisterBuffInfo(Buffs.AffixHauntedRecipient, "BUFF_AFFIXHAUNTEDRECIPIENT_NAME", "BUFF_AFFIXHAUNTEDRECIPIENT_DESC"); RegisterBuffInfo(Buffs.ElephantArmorBoost, "BUFF_ELEPHANTARMORBOOST_NAME", "BUFF_ELEPHANTARMORBOOST_DESC"); RegisterBuffInfo(Buffs.Energized, "BUFF_ENERGIZED_NAME", "BUFF_ENERGIZED_DESC"); RegisterBuffInfo(Buffs.FullCrit, "BUFF_FULLCRIT_NAME", "BUFF_FULLCRIT_DESC"); RegisterBuffInfo(Buffs.HiddenInvincibility, "BUFF_HIDDENINVINCIBILITY_NAME", "BUFF_HIDDENINVINCIBILITY_DESC"); RegisterBuffInfo(Buffs.Immune, "BUFF_IMMUNE_NAME", "BUFF_IMMUNE_DESC"); RegisterBuffInfo(Buffs.CrocoRegen, "BUFF_CROCOREGEN_NAME", "BUFF_CROCOREGEN_DESC"); RegisterBuffInfo(Buffs.MedkitHeal, "BUFF_MEDKITHEAL_NAME", "BUFF_MEDKITHEAL_DESC"); RegisterBuffInfo(Buffs.NoCooldowns, "BUFF_NOCOOLDOWNS_NAME", "BUFF_NOCOOLDOWNS_DESC"); RegisterBuffInfo(Buffs.TeslaField, "BUFF_TESLAFIELD_NAME", "BUFF_TESLAFIELD_DESC"); RegisterBuffInfo(Buffs.TonicBuff, "BUFF_TONICBUFF_NAME", "BUFF_TONICBUFF_DESC"); RegisterBuffInfo(Buffs.Warbanner, "BUFF_WARBANNER_NAME", "BUFF_WARBANNER_DESC"); RegisterBuffInfo(Buffs.WarCryBuff, "BUFF_WARCRYBUFF_NAME", "BUFF_WARCRYBUFF_DESC"); RegisterBuffInfo(Buffs.TeamWarCry, "BUFF_TEAMWARCRY_NAME", "BUFF_TEAMWARCRY_DESC"); RegisterBuffInfo(Buffs.WhipBoost, "BUFF_WHIPBOOST_NAME", "BUFF_WHIPBOOST_DESC"); RegisterBuffInfo(Buffs.LifeSteal, "BUFF_LIFESTEAL_NAME", "BUFF_LIFESTEAL_DESC"); RegisterBuffInfo(Buffs.PowerBuff, "BUFF_POWERBUFF_NAME", "BUFF_POWERBUFF_DESC"); RegisterBuffInfo(Buffs.ElementalRingsReady, "BUFF_ELEMENTALRINGSREADY_NAME", "BUFF_ELEMENTALRINGSREADY_DESC"); RegisterBuffInfo(Buffs.BanditSkull, "BUFF_BANDITSKULL_NAME", "BUFF_BANDITSKULL_DESC"); RegisterBuffInfo(Buffs.LaserTurbineKillCharge, "BUFF_LASERTURBINEKILLCHARGE_NAME", "BUFF_LASERTURBINEKILLCHARGE_DESC"); RegisterBuffInfo(Buffs.OnFire, "BUFF_ONFIRE_NAME", "BUFF_ONFIRE_DESC"); RegisterBuffInfo(Buffs.Bleeding, "BUFF_BLEEDING_NAME", "BUFF_BLEEDING_DESC"); RegisterBuffInfo(Buffs.SuperBleed, "BUFF_SUPERBLEED_NAME", "BUFF_SUPERBLEED_DESC"); RegisterBuffInfo(Buffs.Poisoned, "BUFF_POISONED_NAME", "BUFF_POISONED_DESC"); RegisterBuffInfo(Buffs.Blight, "BUFF_BLIGHT_NAME", "BUFF_BLIGHT_DESC"); RegisterBuffInfo(Buffs.MercExpose, "BUFF_MERCEXPOSE_NAME", "BUFF_MERCEXPOSE_DESC"); RegisterBuffInfo(Buffs.DeathMark, "BUFF_DEATHMARK_NAME", "BUFF_DEATHMARK_DESC"); RegisterBuffInfo(Buffs.PulverizeBuildup, "BUFF_PULVERIZEBUILDUP_NAME", "BUFF_PULVERIZEBUILDUP_DESC"); RegisterBuffInfo(Buffs.Pulverized, "BUFF_PULVERIZED_NAME", "BUFF_PULVERIZED_DESC"); RegisterBuffInfo(Buffs.Cripple, "BUFF_CRIPPLE_NAME", "BUFF_CRIPPLE_DESC"); RegisterBuffInfo(Buffs.Weak, "BUFF_WEAK_NAME", "BUFF_WEAK_DESC"); RegisterBuffInfo(Buffs.BeetleJuice, "BUFF_BEETLEJUICE_NAME", "BUFF_BEETLEJUICE_DESC"); RegisterBuffInfo(Buffs.ClayGoo, "BUFF_CLAYGOO_NAME", "BUFF_CLAYGOO_DESC"); RegisterBuffInfo(Buffs.Slow50, "BUFF_SLOW50_NAME", "BUFF_SLOW50_DESC"); RegisterBuffInfo(Buffs.Slow60, "BUFF_SLOW60_NAME", "BUFF_SLOW60_DESC"); RegisterBuffInfo(Buffs.Slow80, "BUFF_SLOW80_NAME", "BUFF_SLOW80_DESC"); RegisterBuffInfo(Buffs.NullifyStack, "BUFF_NULLIFYSTACK_NAME", "BUFF_NULLIFYSTACK_DESC"); RegisterBuffInfo(Buffs.Nullified, "BUFF_NULLIFIED_NAME", "BUFF_NULLIFIED_DESC"); RegisterBuffInfo(Buffs.Entangle, "BUFF_ENTANGLE_NAME", "BUFF_ENTANGLE_DESC"); RegisterBuffInfo(Buffs.Fruiting, "BUFF_FRUITING_NAME", "BUFF_FRUITING_DESC"); RegisterBuffInfo(Buffs.HealingDisabled, "BUFF_HEALINGDISABLED_NAME", "BUFF_HEALINGDISABLED_DESC"); RegisterBuffInfo(Buffs.ElementalRingsCooldown, "BUFF_ELEMENTALRINGSCOOLDOWN_NAME", "BUFF_ELEMENTALRINGSCOOLDOWN_DESC"); RegisterBuffInfo(Buffs.PermanentCurse, "BUFF_PERMANENTCURSE_NAME", "BUFF_PERMANENTCURSE_DESC"); RegisterBuffInfo(Buffs.Overheat, "BUFF_OVERHEAT_NAME", "BUFF_OVERHEAT_DESC"); RegisterBuffInfo(Buffs.LunarSecondaryRoot, "BUFF_LUNARSECONDARYROOT_NAME", "BUFF_LUNARSECONDARYROOT_DESC"); RegisterBuffInfo(Buffs.LunarDetonationCharge, "BUFF_LUNARDETONATIONCHARGE_NAME", "BUFF_LUNARDETONATIONCHARGE_DESC"); RegisterBuffInfo(Buffs.EngiShield, "BUFF_ENGISHIELD_NAME", "BUFF_ENGISHIELD_DESC"); RegisterBuffInfo(Buffs.LunarShell, "BUFF_LUNARSHELL_NAME", "BUFF_LUNARSHELL_DESC"); RegisterBuffInfo(Buffs.VoidFogMild, "BUFF_VOIDFOGMILD_NAME", "BUFF_VOIDFOGMILD_DESC"); RegisterBuffInfo(Buffs.VoidFogStrong, "BUFF_VOIDFOGSTRONG_NAME", "BUFF_VOIDFOGSTRONG_DESC"); RegisterBuffInfo(Buffs.BodyArmor, "BUFF_BODYARMOR_NAME", "BUFF_BODYARMOR_DESC"); RegisterBuffInfo(Buffs.Deafened, "BUFF_DEAFENED_NAME", "BUFF_DEAFENED_DESC"); RegisterBuffInfo(Buffs.EngiTeamShield, "BUFF_ENGITEAMSHIELD_NAME", "BUFF_ENGITEAMSHIELD_DESC"); RegisterBuffInfo(Buffs.EnrageAncientWisp, "BUFF_ENRAGEANCIENTWISP_NAME", "BUFF_ENRAGEANCIENTWISP_DESC"); RegisterBuffInfo(Buffs.GoldEmpowered, "BUFF_GOLDEMPOWERED_NAME", "BUFF_GOLDEMPOWERED_DESC"); RegisterBuffInfo(Buffs.LightningShield, "BUFF_LIGHTNINGSHIELD_NAME", "BUFF_LIGHTNINGSHIELD_DESC"); RegisterBuffInfo(Buffs.LoaderOvercharged, "BUFF_LOADEROVERCHARGED_NAME", "BUFF_LOADEROVERCHARGED_DESC"); RegisterBuffInfo(Buffs.LoaderPylonPowered, "BUFF_LOADERPYLONPOWERED_NAME", "BUFF_LOADERPYLONPOWERED_DESC"); RegisterBuffInfo(Buffs.MeatRegenBoost, "BUFF_MEATREGENBOOST_NAME", "BUFF_MEATREGENBOOST_DESC"); RegisterBuffInfo(Buffs.Slow30, "BUFF_SLOW30_NAME", "BUFF_SLOW30_DESC"); RegisterBuffInfo(Buffs.BearVoidCooldown, "BUFF_BEARVOIDCOOLDOWN_NAME", "BUFF_BEARVOIDCOOLDOWN_DESC"); RegisterBuffInfo(Buffs.BearVoidReady, "BUFF_BEARVOIDREADY_NAME", "BUFF_BEARVOIDREADY_DESC"); RegisterBuffInfo(Buffs.Blinded, "BUFF_BLINDED_NAME", "BUFF_BLINDED_DESC"); RegisterBuffInfo(Buffs.ElementalRingVoidCooldown, "BUFF_ELEMENTALRINGVOIDCOOLDOWN_NAME", "BUFF_ELEMENTALRINGVOIDCOOLDOWN_DESC"); RegisterBuffInfo(Buffs.ElementalRingVoidReady, "BUFF_ELEMENTALRINGVOIDREADY_NAME", "BUFF_ELEMENTALRINGVOIDREADY_DESC"); RegisterBuffInfo(Buffs.EliteEarth, "BUFF_ELITEEARTH_NAME", "BUFF_ELITEEARTH_DESC"); RegisterBuffInfo(Buffs.EliteVoid, "BUFF_ELITEVOID_NAME", "BUFF_ELITEVOID_DESC"); RegisterBuffInfo(Buffs.Fracture, "BUFF_FRACTURE_NAME", "BUFF_FRACTURE_DESC"); RegisterBuffInfo(Buffs.JailerSlow, "BUFF_JAILERSLOW_NAME", "BUFF_JAILERSLOW_DESC"); RegisterBuffInfo(Buffs.JailerTether, "BUFF_JAILERTETHER_NAME", "BUFF_JAILERTETHER_DESC"); RegisterBuffInfo(Buffs.KillMoveSpeed, "BUFF_KILLMOVESPEED_NAME", "BUFF_KILLMOVESPEED_DESC"); RegisterBuffInfo(Buffs.MushroomVoidActive, "BUFF_MUSHROOMVOIDACTIVE_NAME", "BUFF_MUSHROOMVOIDACTIVE_DESC"); RegisterBuffInfo(Buffs.OutOfCombatArmorBuff, "BUFF_OUTOFCOMBATARMORBUFF_NAME", "BUFF_OUTOFCOMBATARMORBUFF_DESC"); RegisterBuffInfo(Buffs.PermanentDebuff, "BUFF_PERMANENTDEBUFF_NAME", "BUFF_PERMANENTDEBUFF_DESC"); RegisterBuffInfo(Buffs.PrimarySkillShurikenBuff, "BUFF_PRIMARYSKILLSHURIKENBUFF_NAME", "BUFF_PRIMARYSKILLSHURIKENBUFF_DESC"); RegisterBuffInfo(Buffs.StrongerBurn, "BUFF_STRONGERBURN_NAME", "BUFF_STRONGERBURN_DESC"); RegisterBuffInfo(Buffs.VoidRaidCrabWardWipeFog, "BUFF_VOIDRAIDCRABWARDWIPEFOG_NAME", "BUFF_VOIDRAIDCRABWARDWIPEFOG_DESC"); RegisterBuffInfo(Buffs.VoidSurvivorCorruptMode, "BUFF_VOIDSURVIVORCORRUPTMODE_NAME", "BUFF_VOIDSURVIVORCORRUPTMODE_DESC"); RegisterBuffInfo(Buffs.ImmuneToDebuffReady, "BUFF_RAINCOATREADY_NAME", "BUFF_RAINCOATREADY_DESC"); RegisterBuffInfo(Buffs.ImmuneToDebuffCooldown, "BUFF_RAINCOATCOOLDOWN_NAME", "BUFF_RAINCOATCOOLDOWN_DESC"); }); } public static void RegisterName(BuffDef buffDef, string nameToken) { RegisterBuffInfo(buffDef, nameToken); } public static void RegisterDescription(BuffDef buffDef, string descriptionToken) { RegisterBuffInfo(buffDef, null, descriptionToken); } public static void RegisterBuffInfo(BuffDef buffDef, string nameToken = null, string descriptionToken = null) { if ((Object)(object)buffDef == (Object)null) { Debug.LogError((object)("Unable to register BuffInfo for " + Language.GetString(nameToken))); return; } buffInfos.TryGetValue(buffDef, out var value); value.nameToken = value.nameToken ?? nameToken; value.descriptionToken = value.descriptionToken ?? descriptionToken; RegisterBuffInfo(buffDef, value); } public static void RegisterBuffInfo(BuffDef buffDef, BuffInfo buffInfo) { if ((Object)(object)buffDef == (Object)null) { Debug.LogError((object)("Unable to register BuffInfo for " + Language.GetString("nameToken"))); } else if (BetterUIPlugin.BetterAPIModIntegration) { BetterAPICompatibility.Buffs.AddInfo(buffDef, buffInfo); } else { buffInfos[buffDef] = buffInfo; } } public static string GetName(BuffDef buffDef) { if (BetterUIPlugin.BetterAPIModIntegration) { return BetterAPICompatibility.Buffs.GetName(buffDef); } buffInfos.TryGetValue(buffDef, out var value); if (!string.IsNullOrEmpty(value.nameToken)) { return Language.GetString(value.nameToken); } return ((Object)buffDef).name; } public static string GetDescription(BuffDef buffDef) { if (BetterUIPlugin.BetterAPIModIntegration) { return BetterAPICompatibility.Buffs.GetDescription(buffDef); } buffInfos.TryGetValue(buffDef, out var value); if (!string.IsNullOrEmpty(value.descriptionToken)) { return Language.GetString(value.descriptionToken); } return string.Empty; } internal static void Hook() { if (ConfigManager.BuffTimers.Value || ConfigManager.BuffTooltips.Value) { BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<BuffIcon>("Awake", (Action<Action<BuffIcon>, BuffIcon>)BuffIcon_Awake, BindingFlags.Default); BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<BuffIcon>("UpdateIcon", (Action<Action<BuffIcon>, BuffIcon>)BuffIcon_UpdateIcon, BindingFlags.Default); } } internal static void BuffIcon_Awake(Action<BuffIcon> orig, BuffIcon self) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) orig(self); if (!(((Object)((Component)self).transform.parent).name == "BuffDisplayRoot")) { return; } if (ConfigManager.BuffTooltips.Value) { if ((Object)(object)((Component)((Component)self).transform.parent).GetComponent<GraphicRaycaster>() == (Object)null) { ((Component)((Component)self).transform.parent).gameObject.AddComponent<GraphicRaycaster>(); } ((Component)self).gameObject.AddComponent<TooltipProvider>(); } if (ConfigManager.BuffTimers.Value) { GameObject val = new GameObject("TimerText"); RectTransform val2 = val.AddComponent<RectTransform>(); HGTextMeshProUGUI val3 = val.AddComponent<HGTextMeshProUGUI>(); val.transform.SetParent(((Component)self).transform); ((TMP_Text)val3).enableWordWrapping = false; ((TMP_Text)val3).alignment = ConfigManager.BuffTimersTextAlignmentOption; ((TMP_Text)val3).fontSize = ConfigManager.BuffTimersFontSize.Value; ((TMP_Text)val3).faceColor = Color32.op_Implicit(Color.white); ((TMP_Text)val3).text = ""; ((Transform)val2).localPosition = Vector3.zero; val2.anchorMin = new Vector2(1f, 0f); val2.anchorMax = new Vector2(1f, 0f); ((Transform)val2).localScale = Vector3.one; val2.sizeDelta = new Vector2(48f, 48f); val2.anchoredPosition = new Vector2(-24f, 24f); } } internal static void BuffIcon_UpdateIcon(Action<BuffIcon> orig, BuffIcon self) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) orig(self); if (!Object.op_Implicit((Object)(object)self.buffDef) || !(((Object)((Component)self).transform.parent).name == "BuffDisplayRoot")) { return; } if (ConfigManager.BuffTooltips.Value) { TooltipProvider component = ((Component)self).GetComponent<TooltipProvider>(); component.titleToken = GetName(self.buffDef); component.bodyToken = GetDescription(self.buffDef); component.titleColor = self.buffDef.buffColor; } if (!ConfigManager.BuffTimers.Value) { return; } Transform val = ((Component)self).transform.Find("TimerText"); if (!((Object)(object)val != (Object)null)) { return; } if ((Object)(object)BetterUIPlugin.hud != (Object)null) { CharacterBody val2 = (Object.op_Implicit((Object)(object)BetterUIPlugin.hud.targetBodyObject) ? BetterUIPlugin.hud.targetBodyObject.GetComponent<CharacterBody>() : null); if ((Object)(object)val2 != (Object)null && val2.timedBuffs.Count > 0) { timedBuffs = val2.timedBuffs.Where((TimedBuff b) => b.buffIndex == self.buffDef.buffIndex); if (timedBuffs.Any()) { thisBuff = timedBuffs.OrderByDescending((TimedBuff b) => b.timer).First(); ((TMP_Text)((Component)val).GetComponent<HGTextMeshProUGUI>()).text = ((thisBuff.timer < 10f && ConfigManager.BuffTimersDecimal.Value) ? thisBuff.timer.ToString("N1") : thisBuff.timer.ToString("N0")); return; } } } ((TMP_Text)((Component)val).GetComponent<HGTextMeshProUGUI>()).text = ""; } } internal static class CommandImprovements { private static PickupPickerPanel currentPanel; private static int[] optionMap; private static bool[] availableIndex; private static Option[] sortedOptions; private static string sortOrder; internal static ItemIndex[] lastItem; static CommandImprovements() { ItemIndex[] array = new ItemIndex[6]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); lastItem = (ItemIndex[])(object)array; BetterUnityPlugin<BetterUIPlugin>.onStart += onStart; BetterUnityPlugin<BetterUIPlugin>.onUpdate += onUpdate; } internal static void Hook() { if (ConfigManager.CommandResizeCommandWindow.Value || ConfigManager.SortingSortItemsCommand.Value || ConfigManager.SortingSortItemsScrapper.Value) { BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<PickupPickerPanel, Option[]>("SetPickupOptions", (Action<Action<PickupPickerPanel, Option[]>, PickupPickerPanel, Option[]>)PickupPickerPanel_SetPickupOptions, BindingFlags.Default); } if (ConfigManager.CommandCloseOnEscape.Value || ConfigManager.CommandCloseOnWASD.Value || ConfigManager.CommandCloseOnCustom.Value != "") { BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<PickupPickerPanel>("Awake", (Action<Action<PickupPickerPanel>, PickupPickerPanel>)PickupPickerPanel_Awake, BindingFlags.Default); } if (ConfigManager.CommandTooltipsShow.Value || ConfigManager.CommandCountersShow.Value) { BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<PickupPickerPanel, int, MPButton>("OnCreateButton", (Action<Action<PickupPickerPanel, int, MPButton>, PickupPickerPanel, int, MPButton>)PickupPickerPanel_OnCreateButton, BindingFlags.Default); } } private static void onStart() { ((ResourceAvailability)(ref ItemCatalog.availability)).CallWhenAvailable((Action)Init); ((ResourceAvailability)(ref EquipmentCatalog.availability)).CallWhenAvailable((Action)Init); } private static void onUpdate() { if (Object.op_Implicit((Object)(object)currentPanel) && Object.op_Implicit((Object)(object)((Component)currentPanel).gameObject) && ((ConfigManager.CommandCloseOnEscape.Value && Input.GetKeyDown("escape")) || (ConfigManager.CommandCloseOnWASD.Value && (Input.GetKeyDown("w") || Input.GetKeyDown("a") || Input.GetKeyDown("s") || Input.GetKeyDown("d"))) || (ConfigManager.CommandCloseOnCustom.Value != "" && Input.GetKeyDown(ConfigManager.CommandCloseOnCustom.Value)))) { if (Input.GetKeyDown("escape")) { Console.instance.SubmitCmd((NetworkUser)null, "pause", false); } Object.Destroy((Object)(object)((Component)currentPanel).gameObject); } } private static void Init() { if (((ResourceAvailability)(ref ItemCatalog.availability)).available && ((ResourceAvailability)(ref EquipmentCatalog.availability)).available) { int num = ItemCatalog.itemCount + EquipmentCatalog.equipmentCount; optionMap = new int[num]; optionMap[0] = -1; availableIndex = new bool[num]; sortedOptions = (Option[])(object)new Option[num]; } } public static void PickupPickerPanel_Awake(Action<PickupPickerPanel> orig, PickupPickerPanel self) { currentPanel = self; orig(self); } public static void PickupPickerController_SubmitChoice(Action<PickupPickerController, int> orig, PickupPickerController self, int index) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0030: Invalid comparison between Unknown and I4 //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected I4, but got Unknown orig(self, index); ItemDef itemDef = ItemCatalog.GetItemDef(PickupCatalog.GetPickupDef(self.options[index].pickupIndex).itemIndex); if ((int)itemDef.itemIndex != -1) { lastItem[itemDef.tier] = (ItemIndex)(int)itemDef.itemIndex; } } public static void PickupPickerPanel_SetPickupOptions(Action<PickupPickerPanel, Option[]> orig, PickupPickerPanel self, Option[] options) { //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0235: 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_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) if (options == null || options.Length == 0) { orig(self, options); return; } self.buttonAllocator.AllocateElements(0); optionMap[0] = -1; string contextString = self.pickerController.contextString; if (!(contextString == "ARTIFACT_COMMAND_CUBE_INTERACTION_PROMPT")) { if (!(contextString == "SCRAPPER_CONTEXT") || !ConfigManager.SortingSortItemsScrapper.Value) { goto IL_01c6; } sortOrder = ConfigManager.SortingSortOrderScrapper.Value; } else { if (ConfigManager.CommandResizeCommandWindow.Value) { RectTransform component = ((Component)((Component)self).transform.Find("MainPanel")).GetComponent<RectTransform>(); RectTransform component2 = ((Component)((Component)self).transform.parent).GetComponent<RectTransform>(); int num = (int)Math.Ceiling(Math.Sqrt(options.Length)); float num2 = 166 + 82 * (int)Math.Ceiling((float)options.Length / (float)num); Rect rect = component2.rect; if (num2 > ((Rect)(ref rect)).height - 120f) { double num3 = options.Length; rect = component2.rect; num = (int)Math.Ceiling(num3 / Math.Floor((((Rect)(ref rect)).height - 286f) / 82f)); } self.gridlayoutGroup.constraintCount = (self.maxColumnCount = num); component.sizeDelta = new Vector2((float)(166 + 82 * num), 166f + 82f * (float)Math.Ceiling((float)options.Length / (float)num)); } if (ConfigManager.CommandRemoveBackgroundBlur.Value) { ((Behaviour)((Component)((Component)self).transform).GetComponent<TranslucentImage>()).enabled = false; } if (!ConfigManager.SortingSortItemsCommand.Value) { goto IL_01c6; } sortOrder = ConfigManager.SortingSortOrderCommand.Value; } Inventory inventory = LocalUserManager.GetFirstLocalUser().cachedMasterController.master.inventory; if (options.All((Option option) => (int)PickupCatalog.GetPickupDef(option.pickupIndex).equipmentIndex != -1)) { Option[] array = options; foreach (Option val in array) { availableIndex[PickupCatalog.GetPickupDef(val.pickupIndex).equipmentIndex] = val.available; } ItemSorting.sortItems(options.Select((Option option) => PickupCatalog.GetPickupDef(option.pickupIndex).equipmentIndex).ToList(), sortOrder).Select(delegate(EquipmentIndex equipemntIndex) { //IL_0002: 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_000b: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) Option result2 = default(Option); result2.pickupIndex = PickupCatalog.FindPickupIndex(equipemntIndex); result2.available = availableIndex[equipemntIndex]; return result2; }).ToArray() .CopyTo(sortedOptions, 0); sortedOptions.Select((Option option) => Array.IndexOf(options, option)).ToArray().CopyTo(optionMap, 0); options = sortedOptions.Take(options.Length).ToArray(); } else if (options.All((Option option) => (int)PickupCatalog.GetPickupDef(option.pickupIndex).itemIndex != -1)) { Option[] array = options; foreach (Option val2 in array) { availableIndex[PickupCatalog.GetPickupDef(val2.pickupIndex).itemIndex] = val2.available; } ItemSorting.sortItems(options.Select((Option option) => PickupCatalog.GetPickupDef(option.pickupIndex).itemIndex).ToList(), inventory, sortOrder).Select(delegate(ItemIndex itemIndex) { //IL_0002: 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_000b: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) Option result = default(Option); result.pickupIndex = PickupCatalog.FindPickupIndex(itemIndex); result.available = availableIndex[itemIndex]; return result; }).ToArray() .CopyTo(sortedOptions, 0); sortedOptions.Select((Option option) => Array.IndexOf(options, option)).ToArray().CopyTo(optionMap, 0); options = sortedOptions.Take(options.Length).ToArray(); } orig(self, options); return; IL_01c6: orig(self, options); } public static void PickupPickerPanel_OnCreateButton(Action<PickupPickerPanel, int, MPButton> orig, PickupPickerPanel self, int index, MPButton button) { //IL_006b: 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_007d: Invalid comparison between Unknown and I4 //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Invalid comparison between Unknown and I4 //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Invalid comparison between Unknown and I4 //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_010d: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) orig(self, (optionMap[0] >= 0) ? optionMap[index] : index, button); if (!ConfigManager.CommandTooltipsShow.Value && !ConfigManager.CommandCountersShow.Value) { return; } CharacterMaster master = LocalUserManager.GetFirstLocalUser().cachedMasterController.master; PickupDef pickupDef = PickupCatalog.GetPickupDef(self.pickerController.options[(optionMap[0] >= 0) ? optionMap[index] : index].pickupIndex); if ((int)pickupDef.itemIndex != -1 && ConfigManager.CommandCountersShow.Value) { int num = master.inventory.itemStacks[pickupDef.itemIndex]; if (!ConfigManager.CommandCountersHideOnZero.Value || num > 0) { GameObject val = new GameObject("StackText"); val.transform.SetParent(((Component)button).transform); val.layer = 5; RectTransform val2 = val.AddComponent<RectTransform>(); HGTextMeshProUGUI obj = val.AddComponent<HGTextMeshProUGUI>(); ((TMP_Text)obj).enableWordWrapping = false; ((TMP_Text)obj).alignment = ConfigManager.CommandCountersTextAlignmentOption; ((TMP_Text)obj).fontSize = ConfigManager.CommandCountersFontSize.Value; ((TMP_Text)obj).faceColor = Color32.op_Implicit(Color.white); ((TMP_Text)obj).outlineWidth = 0.2f; ((TMP_Text)obj).text = ConfigManager.CommandCountersPrefix.Value + num; ((Transform)val2).localPosition = Vector3.zero; val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; ((Transform)val2).localScale = Vector3.one; val2.sizeDelta = new Vector2(-10f, -4f); val2.anchoredPosition = Vector2.zero; } } if (!ConfigManager.CommandTooltipsShow.Value) { return; } TooltipProvider val3 = ((Component)button).gameObject.AddComponent<TooltipProvider>(); if ((int)pickupDef.itemIndex != -1) { ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex); if (ConfigManager.AdvancedIconsItemItemStatsIntegration.Value) { int num2 = master.inventory.itemStacks[pickupDef.itemIndex]; StringBuilder sharedStringBuilder = BetterUIPlugin.sharedStringBuilder; sharedStringBuilder.Clear(); sharedStringBuilder.Append(Language.GetString(itemDef.descriptionToken)); sharedStringBuilder.Append("</style>\n"); if (self.pickerController.contextString == "ARTIFACT_COMMAND_CUBE_INTERACTION_PROMPT" && ConfigManager.CommandTooltipsItemStatsBeforeAfter.Value && num2 > 0) { sharedStringBuilder.Append("\n<align=left>"); sharedStringBuilder.AppendFormat((num2 > 1) ? Language.GetString("BETTERUI_BEFORE_SINGULAR") : Language.GetString("BETTERUI_BEFORE_PLURAL"), num2); ItemStats.GetItemStats(sharedStringBuilder, itemDef, num2, master); sharedStringBuilder.Append("\n\n<align=left>"); sharedStringBuilder.AppendFormat((num2 > 1) ? Language.GetString("BETTERUI_AFTER_SINGULAR") : Language.GetString("BETTERUI_AFTER_PLURAL"), num2 + 1); ItemStats.GetItemStats(sharedStringBuilder, itemDef, num2 + 1, master); } else { if (self.pickerController.contextString == "ARTIFACT_COMMAND_CUBE_INTERACTION_PROMPT") { num2++; } ItemStats.GetItemStats(sharedStringBuilder, itemDef, num2, master); } val3.overrideBodyText = sharedStringBuilder.ToString(); } else { val3.bodyToken = itemDef.descriptionToken; } val3.titleToken = itemDef.nameToken; val3.titleColor = Color32.op_Implicit(ColorCatalog.GetColor(itemDef.darkColorIndex)); val3.bodyColor = new Color(0.6f, 0.6f, 0.6f, 1f); } else if ((int)pickupDef.equipmentIndex != -1) { EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(pickupDef.equipmentIndex); val3.titleToken = equipmentDef.nameToken; val3.bodyToken = equipmentDef.descriptionToken; val3.titleColor = Color32.op_Implicit(ColorCatalog.GetColor(equipmentDef.colorIndex)); val3.bodyColor = Color.gray; } } } internal static class DPSMeter { internal struct DamageLog { public float damage; public float time; public DamageLog(float dmg) { damage = dmg; time = Time.time; } } private static readonly Queue<DamageLog> characterDamageLog = new Queue<DamageLog>(); private static float characterDamageSum = 0f; private static readonly Queue<DamageLog> minionDamageLog = new Queue<DamageLog>(); private static float minionDamageSum = 0f; private static GameObject DPSMeterPanel; private static ChatBox chatBox; private static HGTextMeshProUGUI textMesh; public static float DPS => MinionDPS + CharacterDPS; public static float CharacterDPS { get { if (characterDamageLog.Count <= 0) { return 0f; } return characterDamageSum / Clamp(Time.time - characterDamageLog.Peek().time); } } public static float MinionDPS { get { if (minionDamageLog.Count <= 0) { return 0f; } return minionDamageSum / Clamp(Time.time - minionDamageLog.Peek().time); } } internal static void Initialize() { BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<GlobalEventManager, DamageDealtMessage>("ClientDamageNotified", (Action<Action<DamageDealtMessage>, DamageDealtMessage>)DamageDealtMessage_ClientDamageNotified, BindingFlags.Default); BetterUnityPlugin<BetterUIPlugin>.onEnable += delegate { BetterUnityPlugin<BetterUIPlugin>.onUpdate += onUpdate; }; BetterUnityPlugin<BetterUIPlugin>.onDisable += delegate { BetterUnityPlugin<BetterUIPlugin>.onUpdate -= onUpdate; }; if (ConfigManager.DPSMeterWindowShow.Value) { BetterUnityPlugin<BetterUIPlugin>.onEnable += delegate { BetterUIPlugin.onHUDAwake += onHUDAwake; }; BetterUnityPlugin<BetterUIPlugin>.onDisable += delegate { BetterUIPlugin.onHUDAwake -= onHUDAwake; }; if (ConfigManager.DPSMeterWindowHideWhenTyping.Value) { BetterUnityPlugin<BetterUIPlugin>.Hooks.Add<ChatBox>("Awake", (Action<Action<ChatBox>, ChatBox>)ChatBox_Awake, BindingFlags.Default); } } } public static float Clamp(float value) { return Math.Min(Math.Max(1f, value), ConfigManager.DPSMeterTimespan.Value); } private static void onUpdate() { while (characterDamageLog.Count > 0 && characterDamageLog.Peek().time < Time.time - ConfigManager.DPSMeterTimespan.Value) { characterDamageSum -= characterDamageLog.Dequeue().damage; } while (minionDamageLog.Count > 0 && minionDamageLog.Peek().time < Time.time - ConfigManager.DPSMeterTimespan.Value) { minionDamageSum -= minionDamageLog.Dequeue().damage; } if ((Object)(object)textMesh != (Object)null) { BetterUIPlugin.sharedStringBuilder.Clear(); BetterUIPlugin.sharedStringBuilder.Append(Language.GetString("BETTERUI_DPS")); BetterUIPlugin.sharedStringBuilder.Append(": "); BetterUIPlugin.sharedStringBuilder.Append((ConfigManager.DPSMeterWindowIncludeMinions.Value ? DPS : CharacterDPS).ToString("N0")); ((TMP_Text)textMesh).SetText(BetterUIPlugin.sharedStringBuilder); } if ((Object)(object)chatBox != (Object)null && (Object)(object)DPSMeterPanel != (Object)null) { DPSMeterPanel.gameObject.SetActive(!chatBox.showInput); } } public static void ChatBox_Awake(Action<ChatBox> orig, ChatBox self) { orig(self); chatBox = self; } public static void DamageDealtMessage_ClientDamageNotified(Action<DamageDealtMessage> orig, DamageDealtMessage dmgMsg) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Invalid comparison between Unknown and I4 //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) orig(dmgMsg); CharacterMaster master = LocalUserManager.GetFirstLocalUser().cachedMasterController.master; if (!Object.op_Implicit((Object)(object)dmgMsg.attacker) || !Object.op_Implicit((Object)(object)dmgMsg.victim)) { return; } CharacterBody component = dmgMsg.victim.gameObject.GetComponent<CharacterBody>(); if (!Object.op_Implicit((Object)(object)component) || (int)component.teamComponent.teamIndex == 1) { return; } if ((Object)(object)dmgMsg.attacker == (Object)(object)master.GetBodyObject()) { characterDamageSum += dmgMsg.damage; characterDamageLog.Enqueue(new DamageLog(dmgMsg.damage)); return; } CharacterBody component2 = dmgMsg.attacker.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.master) && Object.op_Implicit((Object)(object)component2.master.minionOwnership) && component2.master.minionOwnership.ownerMasterId == ((NetworkBehaviour)master).netId) { minionDamageSum += dmgMsg.damage; minionDamageLog.Enqueue(new DamageLog(dmgMsg.damage)); } } private static void onHUDAwake(HUD self) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)DPSMeterPanel == (Object)null)) { return; } DPSMeterPanel = new GameObject("DPSMeterPanel"); RectTransform obj = DPSMeterPanel.AddComponent<RectTransform>(); DPSMeterPanel.transform.SetParent(BetterUIPlugin.hud.mainContainer.transform); DPSMeterPanel.transform.SetAsFirstSibling(); GameObject val = new GameObject("DPSMeterText"); RectTransform val2 = val.AddComponent<RectTransform>(); textMesh = val.AddComponent<HGTextMeshProUGUI>(); val.transform.SetParent(DPSMeterPanel.transform); ((Transform)obj).localPosition = V
plugins/BetterUI/BetterUnityPlugin.dll
Decompiled 6 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using MonoMod.Cil; using MonoMod.RuntimeDetour; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")] [assembly: AssemblyCompany("BetterUnityPlugin")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.1.0")] [assembly: AssemblyInformationalVersion("1.1.1+Branch.tags-v1.1.1.Sha.89bbfc2f44403bc6ceeff78b8a0a1d2401c458f0")] [assembly: AssemblyProduct("BetterUnityPlugin")] [assembly: AssemblyTitle("BetterUnityPlugin")] [assembly: AssemblyVersion("1.1.1.0")] namespace BetterUnityPlugin; public abstract class BetterUnityPlugin<T> : BaseUnityPlugin { public class HookManager { private List<(MethodInfo methodFrom, MethodInfo methodTo)> hookSignatures = new List<(MethodInfo, MethodInfo)>(); private List<(MethodInfo methodFrom, Manipulator ILHookMethod)> ILHookMethods = new List<(MethodInfo, Manipulator)>(); private List<Hook> hooks = new List<Hook>(); private List<ILHook> ILHooks = new List<ILHook>(); private bool enabled; public HookManager() { BetterUnityPlugin<T>.onEnable += BetterUnityPlugin_onEnable; BetterUnityPlugin<T>.onDisable += BetterUnityPlugin_onDisable; } private void BetterUnityPlugin_onEnable() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown enabled = true; foreach (var hookSignature in hookSignatures) { hooks.Add(new Hook((MethodBase)hookSignature.methodFrom, hookSignature.methodTo)); } foreach (var iLHookMethod in ILHookMethods) { ILHooks.Add(new ILHook((MethodBase)iLHookMethod.methodFrom, iLHookMethod.ILHookMethod)); } } private void BetterUnityPlugin_onDisable() { enabled = false; foreach (Hook hook in hooks) { hook.Dispose(); } foreach (ILHook iLHook in ILHooks) { iLHook.Dispose(); } } public static MethodInfo FindMethod(Type type, string methodName, Type[] types, BindingFlags bindings = BindingFlags.Default) { if (bindings != 0) { return type.GetMethod(methodName, bindings, null, types, null) ?? type.GetMethod(methodName, bindings); } return type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public, null, types, null) ?? type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic, null, types, null) ?? type.GetMethod(methodName, BindingFlags.Static | BindingFlags.Public, null, types, null) ?? type.GetMethod(methodName, BindingFlags.Static | BindingFlags.NonPublic, null, types, null) ?? type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public) ?? type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic) ?? type.GetMethod(methodName, BindingFlags.Static | BindingFlags.Public) ?? type.GetMethod(methodName, BindingFlags.Static | BindingFlags.NonPublic); } public static Type[] getParameterTypes(MethodInfo methodInfo) { List<Type> list = new List<Type>(); ParameterInfo[] parameters = methodInfo.GetParameters(); for (int i = 1; i < parameters.Length; i++) { list.Add(parameters[i].ParameterType); } return list.ToArray(); } public void Add(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[0], ILHookMethod, bindings); } public void Add(Type type, string methodName, Delegate hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[0], hookMethod.Method, bindings); } public void Add(Type type, string methodName, Action<Action> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[0], hookMethod.Method, bindings); } public void Add<T1>(string methodName, Delegate hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, getParameterTypes(hookMethod.Method), hookMethod.Method, bindings); } public void Add<T1>(Type type, string methodName, Action<Action<T1>, T1> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[1] { typeof(T1) }, hookMethod.Method, bindings); } public void Add<T1>(Type type, string methodName, Func<Func<T1>, T1> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[0], hookMethod.Method, bindings); } public void Add<T1>(string methodName, Action<Action> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[0], hookMethod.Method, bindings); } public void Add<T1>(string methodName, Action<Action<T1>, T1> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[0], hookMethod.Method, bindings); } public void Add<T1>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[0], ILHookMethod, bindings); } public void Add<T1>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[1] { typeof(T1) }, ILHookMethod, bindings); } public void Add<T1, T2>(Type type, string methodName, Action<Action<T1, T2>, T1, T2> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[2] { typeof(T1), typeof(T2) }, hookMethod.Method, bindings); } public void Add<T1, T2>(Type type, string methodName, Func<Func<T1, T2>, T1, T2> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[1] { typeof(T1) }, hookMethod.Method, bindings); } public void Add<T1, T2>(string methodName, Action<Action<T2>, T2> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[1] { typeof(T2) }, hookMethod.Method, bindings); } public void Add<T1, T2>(string methodName, Func<Func<T2>, T2> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[0], hookMethod.Method, bindings); } public void Add<T1, T2>(string methodName, Action<Action<T1, T2>, T1, T2> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[1] { typeof(T2) }, hookMethod.Method, bindings); } public void Add<T1, T2>(string methodName, Func<Func<T1, T2>, T1, T2> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[0], hookMethod.Method, bindings); } public void Add<T1, T2>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[1] { typeof(T2) }, ILHookMethod, bindings); } public void Add<T1, T2>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[1] { typeof(T2) }, ILHookMethod, bindings); } public void Add<T1, T2, T3>(Type type, string methodName, Action<Action<T1, T2, T3>, T1, T2, T3> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[3] { typeof(T1), typeof(T2), typeof(T3) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3>(Type type, string methodName, Func<Func<T1, T2, T3>, T1, T2, T3> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[2] { typeof(T1), typeof(T2) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3>(string methodName, Action<Action<T2, T3>, T2, T3> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[2] { typeof(T2), typeof(T3) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3>(string methodName, Func<Func<T2, T3>, T2, T3> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[1] { typeof(T2) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3>(string methodName, Action<Action<T1, T2, T3>, T1, T2, T3> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[2] { typeof(T2), typeof(T3) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3>(string methodName, Func<Func<T1, T2, T3>, T1, T2, T3> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[1] { typeof(T2) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[2] { typeof(T2), typeof(T3) }, ILHookMethod, bindings); } public void Add<T1, T2, T3>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[2] { typeof(T2), typeof(T3) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4>(Type type, string methodName, Action<Action<T1, T2, T3, T4>, T1, T2, T3, T4> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[4] { typeof(T1), typeof(T2), typeof(T3), typeof(T4) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4>(Type type, string methodName, Func<Func<T1, T2, T3, T4>, T1, T2, T3, T4> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[3] { typeof(T1), typeof(T2), typeof(T3) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4>(string methodName, Action<Action<T2, T3, T4>, T2, T3, T4> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[3] { typeof(T2), typeof(T3), typeof(T4) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4>(string methodName, Func<Func<T2, T3, T4>, T2, T3, T4> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[2] { typeof(T2), typeof(T3) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4>(string methodName, Action<Action<T1, T2, T3, T4>, T1, T2, T3, T4> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[3] { typeof(T2), typeof(T3), typeof(T4) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4>(string methodName, Func<Func<T1, T2, T3, T4>, T1, T2, T3, T4> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[2] { typeof(T2), typeof(T3) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[3] { typeof(T2), typeof(T3), typeof(T4) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[3] { typeof(T2), typeof(T3), typeof(T4) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5>(Type type, string methodName, Action<Action<T1, T2, T3, T4, T5>, T1, T2, T3, T4, T5> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[5] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5>(Type type, string methodName, Func<Func<T1, T2, T3, T4, T5>, T1, T2, T3, T4, T5> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[4] { typeof(T1), typeof(T2), typeof(T3), typeof(T4) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5>(string methodName, Action<Action<T2, T3, T4, T5>, T2, T3, T4, T5> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[4] { typeof(T2), typeof(T3), typeof(T4), typeof(T5) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5>(string methodName, Func<Func<T2, T3, T4, T5>, T2, T3, T4, T5> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[3] { typeof(T2), typeof(T3), typeof(T4) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5>(string methodName, Action<Action<T1, T2, T3, T4, T5>, T1, T2, T3, T4, T5> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[4] { typeof(T2), typeof(T3), typeof(T4), typeof(T5) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5>(string methodName, Func<Func<T1, T2, T3, T4, T5>, T1, T2, T3, T4, T5> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[3] { typeof(T2), typeof(T3), typeof(T4) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[4] { typeof(T2), typeof(T3), typeof(T4), typeof(T5) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[4] { typeof(T2), typeof(T3), typeof(T4), typeof(T5) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6>(Type type, string methodName, Action<Action<T1, T2, T3, T4, T5, T6>, T1, T2, T3, T4, T5, T6> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[6] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6>(Type type, string methodName, Func<Func<T1, T2, T3, T4, T5, T6>, T1, T2, T3, T4, T5, T6> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[5] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6>(string methodName, Action<Action<T2, T3, T4, T5, T6>, T2, T3, T4, T5, T6> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[5] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6>(string methodName, Func<Func<T2, T3, T4, T5, T6>, T2, T3, T4, T5, T6> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[4] { typeof(T2), typeof(T3), typeof(T4), typeof(T5) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6>(string methodName, Action<Action<T1, T2, T3, T4, T5, T6>, T1, T2, T3, T4, T5, T6> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[5] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6>(string methodName, Func<Func<T1, T2, T3, T4, T5, T6>, T1, T2, T3, T4, T5, T6> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[4] { typeof(T2), typeof(T3), typeof(T4), typeof(T5) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[5] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[5] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7>(Type type, string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7>, T1, T2, T3, T4, T5, T6, T7> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[7] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7>(Type type, string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7>, T1, T2, T3, T4, T5, T6, T7> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[6] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7>(string methodName, Action<Action<T2, T3, T4, T5, T6, T7>, T2, T3, T4, T5, T6, T7> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[6] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7>(string methodName, Func<Func<T2, T3, T4, T5, T6, T7>, T2, T3, T4, T5, T6, T7> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[5] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7>(string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7>, T1, T2, T3, T4, T5, T6, T7> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[6] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7>(string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7>, T1, T2, T3, T4, T5, T6, T7> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[5] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[6] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[6] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8>(Type type, string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8>, T1, T2, T3, T4, T5, T6, T7, T8> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[8] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8>(Type type, string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8>, T1, T2, T3, T4, T5, T6, T7, T8> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[7] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8>(string methodName, Action<Action<T2, T3, T4, T5, T6, T7, T8>, T2, T3, T4, T5, T6, T7, T8> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[7] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8>(string methodName, Func<Func<T2, T3, T4, T5, T6, T7, T8>, T2, T3, T4, T5, T6, T7, T8> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[6] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8>(string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8>, T1, T2, T3, T4, T5, T6, T7, T8> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[7] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8>(string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8>, T1, T2, T3, T4, T5, T6, T7, T8> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[6] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[7] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[7] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Type type, string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>, T1, T2, T3, T4, T5, T6, T7, T8, T9> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[9] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Type type, string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9>, T1, T2, T3, T4, T5, T6, T7, T8, T9> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[8] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9>(string methodName, Action<Action<T2, T3, T4, T5, T6, T7, T8, T9>, T2, T3, T4, T5, T6, T7, T8, T9> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[8] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9>(string methodName, Func<Func<T2, T3, T4, T5, T6, T7, T8, T9>, T2, T3, T4, T5, T6, T7, T8, T9> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[7] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9>(string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>, T1, T2, T3, T4, T5, T6, T7, T8, T9> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[8] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9>(string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9>, T1, T2, T3, T4, T5, T6, T7, T8, T9> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[7] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[8] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[8] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Type type, string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[10] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Type type, string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[9] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(string methodName, Action<Action<T2, T3, T4, T5, T6, T7, T8, T9, T10>, T2, T3, T4, T5, T6, T7, T8, T9, T10> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[9] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(string methodName, Func<Func<T2, T3, T4, T5, T6, T7, T8, T9, T10>, T2, T3, T4, T5, T6, T7, T8, T9, T10> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[8] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[9] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[8] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[9] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[9] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Type type, string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[11] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Type type, string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[10] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(string methodName, Action<Action<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[10] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(string methodName, Func<Func<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[9] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[10] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[9] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[10] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[10] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Type type, string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[12] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Type type, string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[11] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(string methodName, Action<Action<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[11] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(string methodName, Func<Func<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[10] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[11] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[10] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[11] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[11] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Type type, string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[13] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Type type, string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[12] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(string methodName, Action<Action<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[12] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(string methodName, Func<Func<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[11] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[12] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[11] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[12] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[12] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Type type, string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[14] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Type type, string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[13] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(string methodName, Action<Action<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[13] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(string methodName, Func<Func<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[12] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[13] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[12] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[13] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[13] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Type type, string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[15] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14), typeof(T15) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Type type, string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[14] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(string methodName, Action<Action<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[14] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14), typeof(T15) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(string methodName, Func<Func<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[13] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(string methodName, Action<Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[14] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14), typeof(T15) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(string methodName, Func<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> hookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[13] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14) }, hookMethod.Method, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(typeof(T1), methodName, new Type[14] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14), typeof(T15) }, ILHookMethod, bindings); } public void Add<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Type type, string methodName, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { Add(type, methodName, new Type[14] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14), typeof(T15) }, ILHookMethod, bindings); } public void Add(Type type, string methodName, Type[] types, Manipulator ILHookMethod, BindingFlags bindings = BindingFlags.Default) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown MethodInfo methodInfo = FindMethod(type, methodName, types, bindings); if (methodInfo == null) { Debug.LogError((object)$"Could not hook method {methodName} of {type}, method not found."); return; } ILHookMethods.Add((methodInfo, ILHookMethod)); if (enabled) { ILHooks.Add(new ILHook((MethodBase)methodInfo, ILHookMethod)); } } public void Add(Type type, string methodName, Type[] types, MethodInfo hookMethod, BindingFlags bindings = BindingFlags.Default) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown MethodInfo methodInfo = FindMethod(type, methodName, types, bindings); if (methodInfo == null) { Debug.LogError((object)$"Could not hook method {methodName} of {type}, method not found."); return; } hookSignatures.Add((methodInfo, hookMethod)); if (enabled) { hooks.Add(new Hook((MethodBase)methodInfo, hookMethod)); } } } public static HookManager Hooks = new HookManager(); public abstract BaseUnityPlugin typeReference { get; } public static event Action onAwake; public static event Action onStart; public static event Action onEnable; public static event Action onDisable; public static event Action onUpdate; public static event Action onReset; public static event Action onFixedUpdate; public static event Action onLateUpdate; public static event Action onDestroy; protected virtual void Awake() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)this).gameObject; ((Object)gameObject).hideFlags = (HideFlags)(((Object)gameObject).hideFlags | 0x3D); if (BetterUnityPlugin<T>.onAwake != null) { BetterUnityPlugin<T>.onAwake(); } } protected virtual void Start() { if (BetterUnityPlugin<T>.onStart != null) { BetterUnityPlugin<T>.onStart(); } } protected virtual void OnEnable() { if (BetterUnityPlugin<T>.onEnable != null) { BetterUnityPlugin<T>.onEnable(); } } protected virtual void OnDisable() { if (BetterUnityPlugin<T>.onDisable != null) { BetterUnityPlugin<T>.onDisable(); } } protected virtual void Update() { if (BetterUnityPlugin<T>.onUpdate != null) { BetterUnityPlugin<T>.onUpdate(); } } protected virtual void FixedUpdate() { if (BetterUnityPlugin<T>.onFixedUpdate != null) { BetterUnityPlugin<T>.onFixedUpdate(); } } protected virtual void LateUpdate() { if (BetterUnityPlugin<T>.onLateUpdate != null) { BetterUnityPlugin<T>.onLateUpdate(); } } protected virtual void OnDestroy() { if (BetterUnityPlugin<T>.onDestroy != null) { BetterUnityPlugin<T>.onDestroy(); } } protected virtual void Reset() { if (BetterUnityPlugin<T>.onReset != null) { BetterUnityPlugin<T>.onReset(); } } }