Properly setting serverlog scrollbar size, clown gear

This commit is contained in:
Regalis
2016-02-16 22:25:06 +02:00
parent f3112e29b4
commit dd73887aa1
12 changed files with 140 additions and 34 deletions

View File

@@ -39,6 +39,8 @@ namespace Barotrauma.Networking
if (LogFrame != null)
{
AddLine(newText);
listBox.UpdateScrollBarSize();
}
if (lines.Count >= LinesPerFile)
@@ -64,6 +66,8 @@ namespace Barotrauma.Networking
AddLine(line);
}
listBox.UpdateScrollBarSize();
if (listBox.BarScroll==0.0f || listBox.BarScroll==1.0f) listBox.BarScroll = 1.0f;
GUIButton closeButton = new GUIButton(new Rectangle(0,0,100, 15), "Close", Alignment.BottomRight, GUI.Style, innerFrame);
@@ -77,7 +81,7 @@ namespace Barotrauma.Networking
private void AddLine(ColoredText line)
{
var textBlock = new GUITextBlock(new Rectangle(0, 0, 0, 0), line.Text, GUI.Style, Alignment.TopLeft, Alignment.TopLeft, listBox, true, GUI.SmallFont);
//textBlock.Rect = new Rectangle(textBlock.Rect.X, textBlock.Rect.Y, textBlock.Rect.Width, (line.Text.Count(c => c == '\n') + 1) * 15);
textBlock.Rect = new Rectangle(textBlock.Rect.X, textBlock.Rect.Y, textBlock.Rect.Width, Math.Max(13, textBlock.Rect.Height));
textBlock.TextColor = line.Color;
textBlock.CanBeFocused = false;