diff --git a/MiraAPI/Hud/Tools/TextInput.cs b/MiraAPI/Hud/Tools/TextInput.cs deleted file mode 100644 index 62a20517..00000000 --- a/MiraAPI/Hud/Tools/TextInput.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using Reactor.Utilities.Attributes; -using UnityEngine; -using UnityEngine.UI; - -namespace MiraAPI.Hud.Tools; - -[RegisterInIl2Cpp] -public class TextInput : MonoBehaviour -{ - public TextBoxTMP textBox; - - public Action? OnTextChanged; - - public delegate bool ValidateInput(string input); - public ValidateInput? Validate; - - public static void Create(Action? onTextChanged = null, ValidateInput? validate = null) - { - var source = FindObjectOfType(true); - var input = Instantiate(source); - var inputBox = input.gameObject.AddComponent(); - inputBox.textBox = source.nameSource; - inputBox.OnTextChanged = onTextChanged; - inputBox.Validate = validate; - - inputBox.textBox.OnChange = new Button.ButtonClickedEvent(); - inputBox.textBox.OnChange.AddListener((UnityEngine.Events.UnityAction)(() => - { - var text = inputBox.textBox.text; - if (inputBox.Validate != null && !inputBox.Validate(text)) - { - return; - } - - inputBox.OnTextChanged?.Invoke(text); - })); - } -} diff --git a/MiraAPI/Patches/Options/GamePresetsTabPatches.cs b/MiraAPI/Patches/Options/GamePresetsTabPatches.cs index 07aca240..bffc3734 100644 --- a/MiraAPI/Patches/Options/GamePresetsTabPatches.cs +++ b/MiraAPI/Patches/Options/GamePresetsTabPatches.cs @@ -35,7 +35,6 @@ internal static class GamePresetsTabPatches saveButton.OnClick.AddListener( (UnityAction)(() => { - })); var holder = new GameObject("PresetHolder");