添加了标识更新

但是只有界面没有功能
This commit is contained in:
CortexCore
2023-07-11 00:14:36 +08:00
parent d8d34766c0
commit ca824c3b32
21 changed files with 742 additions and 126 deletions

View File

@@ -0,0 +1,28 @@
using Godot;
using System;
using BITKit;
namespace BITFactory;
public partial class UXLineEdit : LineEdit
{
[Export] private TextValidationResource textValidation;
[Export] private RichTextLabel hints;
public override void _Ready()
{
TextChanged += OnTextChanged;
}
private void OnTextChanged(string newText)
{
if (textValidation is not null && textValidation.IsTextValid(newText,out var errorReason) is false)
{
hints.Text = $"[color=red]{errorReason}[/color]";
}
else
{
hints.Text = string.Empty;
}
}
}