Fixed scrollable area of GUIListBoxes not changing when children are hidden (e.g. when filtering messages in the server log), fixed new log messages appearing in the server log even if the type of message has been filtered out.
This commit is contained in:
@@ -355,7 +355,7 @@ namespace Barotrauma
|
||||
totalSize = (int)(padding.Y + padding.W);
|
||||
foreach (GUIComponent child in children)
|
||||
{
|
||||
if (child == frame) continue;
|
||||
if (child == frame || !child.Visible) continue;
|
||||
totalSize += (scrollBar.IsHorizontal) ? child.Rect.Width : child.Rect.Height;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ namespace Barotrauma.Networking
|
||||
var textBlock = new GUITextBlock(new Rectangle(0, 0, 0, 0), line.Text, "", Alignment.TopLeft, Alignment.TopLeft, listBox, true, GUI.SmallFont);
|
||||
textBlock.Rect = new Rectangle(textBlock.Rect.X, textBlock.Rect.Y, textBlock.Rect.Width, Math.Max(13, textBlock.Rect.Height));
|
||||
textBlock.TextColor = messageColor[(int)line.Type];
|
||||
textBlock.Visible = !msgTypeHidden[(int)line.Type];
|
||||
textBlock.CanBeFocused = false;
|
||||
textBlock.UserData = line;
|
||||
|
||||
@@ -108,7 +109,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
textBlock.Visible = string.IsNullOrEmpty(filter) || textBlock.Text.ToLower().Contains(filter);
|
||||
}
|
||||
|
||||
listBox.UpdateScrollBarSize();
|
||||
listBox.BarScroll = 0.0f;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user