- the server log view is not cleared when saving the log (but old messages are removed when going over the max number of lines)

- log can be viewed in the server lobby, not just in-game
- logging pump, reactor & battery state usage
- GUIListBox.MouseRect doesn't return an empty rect anymore -> listboxes without selectable content can be scrolled with the mouse wheel
This commit is contained in:
Regalis
2017-05-08 21:30:54 +03:00
parent 7dad837733
commit bee570e2e3
7 changed files with 123 additions and 20 deletions

View File

@@ -341,7 +341,22 @@ namespace Barotrauma
serverMessage = new GUITextBox(new Rectangle(0, 30, 360, 70), null, null, Alignment.TopLeft, Alignment.TopLeft, "", infoFrame);
serverMessage.Wrap = true;
serverMessage.OnTextChanged = UpdateServerMessage;
var showLogButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Server Log", Alignment.TopRight, "", infoFrame);
showLogButton.UserData = "showlog";
showLogButton.OnClicked = (GUIButton button, object userData) =>
{
if (GameMain.Server.ServerLog.LogFrame == null)
{
GameMain.Server.ServerLog.CreateLogFrame();
}
else
{
GameMain.Server.ServerLog.LogFrame = null;
GUIComponent.KeyboardDispatcher.Subscriber = null;
}
return true;
};
}
public override void Deselect()
@@ -383,6 +398,8 @@ namespace Barotrauma
infoFrame.RemoveChild(infoFrame.children.Find(c => c.UserData as string == "settingsButton"));
infoFrame.RemoveChild(infoFrame.children.Find(c => c.UserData as string == "spectateButton"));
InfoFrame.FindChild("showlog").Visible = GameMain.Server != null;
//playerList.Parent.RemoveChild(playerList.Parent.children.Find(c => c.UserData as string == "banListButton"));
if (IsServer && GameMain.Server != null)