4fb2439...4d2bcb1

commit 4d2bcb1ad79f552c5c79a6b93a483c0410cf8531
Author: Joonas Rikkonen <poe.regalis@gmail.com>
Date:   Thu Mar 21 20:39:14 2019 +0200

    Changelog additions

commit 5339b414bef868639641e5a92697d1eea4de9f5c
Merge: e07db1ab1 69a6cdb6a
Author: Joonas Rikkonen <poe.regalis@gmail.com>
Date:   Thu Mar 21 20:17:01 2019 +0200

    Merge branch 'dev' of https://github.com/Regalis11/Barotrauma-development into dev

commit e07db1ab1d4c2627a74b1318822b79fcfd69e072
Author: Joonas Rikkonen <poe.regalis@gmail.com>
Date:   Thu Mar 21 20:16:44 2019 +0200

    Fixed dedicated server crashing when typing in more text than can fit on one line. Closes #1321

commit 69a6cdb6a7d1b8f2f2e819145ced9ae4fcc38f28
Author: Joonas Rikkonen <poe.regalis@gmail.com>
Date:   Thu Mar 21 16:46:32 2019 +0200

    Made crafting materials combinable
This commit is contained in:
Joonas Rikkonen
2019-03-21 20:58:24 +02:00
parent e501bcdf53
commit 2ef3184574
2 changed files with 53 additions and 9 deletions
@@ -81,11 +81,12 @@ namespace Barotrauma
//dequeue messages
lock (queuedMessages)
{
if (queuedMessages.Count>0)
if (queuedMessages.Count > 0)
{
int inputLines = Math.Max((int)Math.Ceiling(input.Length / (float)Console.WindowWidth), 1);
Console.CursorLeft = 0;
Console.Write(new string(' ', consoleWidth));
Console.CursorTop--; Console.CursorLeft = 0;
Console.CursorTop -= inputLines; Console.CursorLeft = 0;
while (queuedMessages.Count > 0)
{
ColoredText msg = queuedMessages.Dequeue();
@@ -177,11 +178,11 @@ namespace Barotrauma
private static void RewriteInputToCommandLine(string input)
{
Console.WriteLine(""); Console.CursorTop--;
int consoleWidth = Console.WindowWidth;
if (consoleWidth < 5) consoleWidth = 5;
int consoleHeight = Console.WindowHeight;
if (consoleHeight < 5) consoleHeight = 5;
int consoleWidth = Math.Max(Console.WindowWidth, 5);
int inputLines = Math.Max((int)Math.Ceiling(input.Length / (float)consoleWidth), 1);
int cursorLine = Math.Max((int)Math.Ceiling((input.Length + 1) / (float)consoleWidth), 1);
Console.WriteLine(""); Console.CursorTop -= inputLines;
string ln = input.Length > 0 ? AutoComplete(input, 0) : "";
ln += new string(' ', consoleWidth - (ln.Length % consoleWidth));
@@ -190,9 +191,9 @@ namespace Barotrauma
Console.Write(ln);
Console.ForegroundColor = ConsoleColor.White;
Console.CursorLeft = 0;
Console.CursorTop--;
Console.CursorTop -= cursorLine;
Console.Write(input);
Console.CursorLeft = input.Length;
Console.CursorLeft = input.Length % Console.WindowWidth;
}
private static void AssignOnClientRequestExecute(string names, Action<Client, Vector2, string[]> onClientRequestExecute)