Skip to content

Commit

Permalink
Trim messages over 100 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Jun 14, 2024
1 parent 4a742fe commit ba7ba12
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Fika.Core/Coop/Custom/FikaChat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ private void SendMessage()
string message = textField;
textField = string.Empty;

if (message.Length > 100)
{
message = message.Substring(0, 100);
}

TextMessagePacket packet = new(nickname, message);
writer.Reset();

Expand Down Expand Up @@ -119,7 +124,7 @@ private void DrawWindow(int windowId)
GUI.Label(rect, chatText);
rect.y += rect.height;
Rect textRect = new(rect.x, rect.y, rect.width - 55, 25);
textField = GUI.TextField(textRect, textField, 64);
textField = GUI.TextField(textRect, textField);
rect.x += 535;
Rect buttonRect = new(rect.x, rect.y, 50, 25);
if (GUI.Button(buttonRect, "SEND"))
Expand Down

0 comments on commit ba7ba12

Please sign in to comment.