that def doesnt work

This commit is contained in:
XtraCube committed 2025-03-23 15:34:20 -04:00
1 parent b2137230da
commit bf5dadc6a0
2 files changed
-40

No files matched your search

-39
View File
@@ -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<string>? OnTextChanged;
public delegate bool ValidateInput(string input);
public ValidateInput? Validate;
public static void Create(Action<string>? onTextChanged = null, ValidateInput? validate = null)
{
var source = FindObjectOfType<NameTextBehaviour>(true);
var input = Instantiate(source);
var inputBox = input.gameObject.AddComponent<TextInput>();
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);
}));
}
}
@@ -35,7 +35,6 @@ internal static class GamePresetsTabPatches
saveButton.OnClick.AddListener(
(UnityAction)(() =>
{
}));
var holder = new GameObject("PresetHolder");