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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user