Added character limit for chat (#1586)

* Added character limit for chat

* Changed buffer reading from Int16 to Int32

Co-authored-by: Clément <clement.orlandini@gmail.com>
This commit is contained in:
Clement-O
2020-08-17 14:45:02 +02:00
committed by GitHub
parent b051261485
commit 0e6f55a23d
4 changed files with 151 additions and 3 deletions

View File

@@ -35,6 +35,8 @@ namespace Content.Client.Chat
public bool ReleaseFocusOnEnter { get; set; } = true;
public bool ClearOnEnter { get; set; } = true;
public ChatBox()
{
/*MarginLeft = -475.0f;
@@ -166,12 +168,18 @@ namespace Content.Client.Chat
private void Input_OnTextEntered(LineEdit.LineEditEventArgs args)
{
// We set it there to true so it's set to false by TextSubmitted.Invoke if necessary
ClearOnEnter = true;
if (!string.IsNullOrWhiteSpace(args.Text))
{
TextSubmitted?.Invoke(this, args.Text);
}
Input.Clear();
if (ClearOnEnter)
{
Input.Clear();
}
if (ReleaseFocusOnEnter)
{