From 9b9cb54a7954595c10508dfd82c246ab1d1606fd Mon Sep 17 00:00:00 2001 From: Sinai <49360850+sinai-dev@users.noreply.github.com> Date: Fri, 22 Apr 2022 22:19:43 +1000 Subject: [PATCH] Fix a typo --- src/Hooks/HookCreator.cs | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/Hooks/HookCreator.cs b/src/Hooks/HookCreator.cs index e1725ac..acb628f 100644 --- a/src/Hooks/HookCreator.cs +++ b/src/Hooks/HookCreator.cs @@ -20,11 +20,11 @@ namespace UnityExplorer.Hooks { public class HookCreator : ICellPoolDataSource { - public int ItemCount => filteredEligableMethods.Count; + public int ItemCount => filteredEligibleMethods.Count; - static readonly List currentAddEligableMethods = new(); - static readonly List filteredEligableMethods = new(); - static readonly List currentEligableNamesForFiltering = new(); + static readonly List currentAddEligibleMethods = new(); + static readonly List filteredEligibleMethods = new(); + static readonly List currentEligibleNamesForFiltering = new(); // hook editor static readonly LexerBuilder Lexer = new(); @@ -74,16 +74,16 @@ namespace UnityExplorer.Hooks AddHooksMethodFilterInput.Text = string.Empty; - filteredEligableMethods.Clear(); - currentAddEligableMethods.Clear(); - currentEligableNamesForFiltering.Clear(); + filteredEligibleMethods.Clear(); + currentAddEligibleMethods.Clear(); + currentEligibleNamesForFiltering.Clear(); foreach (MethodInfo method in type.GetMethods(ReflectionUtility.FLAGS)) { if (UERuntimeHelper.IsBlacklisted(method)) continue; - currentAddEligableMethods.Add(method); - currentEligableNamesForFiltering.Add(SignatureHighlighter.RemoveHighlighting(SignatureHighlighter.ParseMethod(method))); - filteredEligableMethods.Add(method); + currentAddEligibleMethods.Add(method); + currentEligibleNamesForFiltering.Add(SignatureHighlighter.RemoveHighlighting(SignatureHighlighter.ParseMethod(method))); + filteredEligibleMethods.Add(method); } AddHooksScrollPool.Refresh(true, true); @@ -112,10 +112,10 @@ namespace UnityExplorer.Hooks public static void AddHookClicked(int index) { - if (index >= filteredEligableMethods.Count) + if (index >= filteredEligibleMethods.Count) return; - MethodInfo method = filteredEligableMethods[index]; + MethodInfo method = filteredEligibleMethods[index]; if (!method.IsGenericMethod && HookList.hookedSignatures.Contains(method.FullDescription())) { ExplorerCore.Log($"Non-generic methods can only be hooked once."); @@ -129,7 +129,7 @@ namespace UnityExplorer.Hooks return; } - AddHook(filteredEligableMethods[index]); + AddHook(filteredEligibleMethods[index]); } static void OnGenericMethodChosen(Type[] arguments) @@ -168,38 +168,38 @@ namespace UnityExplorer.Hooks public void OnAddHookFilterInputChanged(string input) { - filteredEligableMethods.Clear(); + filteredEligibleMethods.Clear(); if (string.IsNullOrEmpty(input)) - filteredEligableMethods.AddRange(currentAddEligableMethods); + filteredEligibleMethods.AddRange(currentAddEligibleMethods); else { - for (int i = 0; i < currentAddEligableMethods.Count; i++) + for (int i = 0; i < currentAddEligibleMethods.Count; i++) { - MethodInfo eligable = currentAddEligableMethods[i]; - string sig = currentEligableNamesForFiltering[i]; + MethodInfo eligible = currentAddEligibleMethods[i]; + string sig = currentEligibleNamesForFiltering[i]; if (sig.ContainsIgnoreCase(input)) - filteredEligableMethods.Add(eligable); + filteredEligibleMethods.Add(eligible); } } AddHooksScrollPool.Refresh(true, true); } - // Set eligable method cell + // Set eligible method cell public void OnCellBorrowed(AddHookCell cell) { } public void SetCell(AddHookCell cell, int index) { - if (index >= filteredEligableMethods.Count) + if (index >= filteredEligibleMethods.Count) { cell.Disable(); return; } cell.CurrentDisplayedIndex = index; - MethodInfo method = filteredEligableMethods[index]; + MethodInfo method = filteredEligibleMethods[index]; cell.MethodNameLabel.text = SignatureHighlighter.ParseMethod(method); }