Friendlier serverlog message type labels
This commit is contained in:
@@ -29,7 +29,7 @@ namespace Barotrauma.Networking
|
|||||||
Error
|
Error
|
||||||
}
|
}
|
||||||
|
|
||||||
private Color[] MessageColor = new Color[]
|
private Color[] messageColor = new Color[]
|
||||||
{
|
{
|
||||||
Color.LightBlue,
|
Color.LightBlue,
|
||||||
new Color(238, 208, 0),
|
new Color(238, 208, 0),
|
||||||
@@ -38,6 +38,15 @@ namespace Barotrauma.Networking
|
|||||||
Color.Red
|
Color.Red
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private string[] messageTypeName = new string[]
|
||||||
|
{
|
||||||
|
"Chat message",
|
||||||
|
"Item interaction",
|
||||||
|
"Attack & death",
|
||||||
|
"Server message",
|
||||||
|
"Error"
|
||||||
|
};
|
||||||
|
|
||||||
private int linesPerFile = 800;
|
private int linesPerFile = 800;
|
||||||
|
|
||||||
public const string SavePath = "ServerLogs";
|
public const string SavePath = "ServerLogs";
|
||||||
@@ -126,9 +135,9 @@ namespace Barotrauma.Networking
|
|||||||
int y = 30;
|
int y = 30;
|
||||||
foreach (MessageType msgType in Enum.GetValues(typeof(MessageType)))
|
foreach (MessageType msgType in Enum.GetValues(typeof(MessageType)))
|
||||||
{
|
{
|
||||||
var tickBox = new GUITickBox(new Rectangle(0,y,20,20), msgType.ToString(), Alignment.TopLeft, GUI.SmallFont, innerFrame);
|
var tickBox = new GUITickBox(new Rectangle(0, y, 20, 20), messageTypeName[(int)msgType], Alignment.TopLeft, GUI.SmallFont, innerFrame);
|
||||||
tickBox.Selected = true;
|
tickBox.Selected = true;
|
||||||
tickBox.TextColor = MessageColor[(int)msgType];
|
tickBox.TextColor = messageColor[(int)msgType];
|
||||||
|
|
||||||
tickBox.OnSelected += (GUITickBox tb) =>
|
tickBox.OnSelected += (GUITickBox tb) =>
|
||||||
{
|
{
|
||||||
@@ -167,7 +176,7 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
var textBlock = new GUITextBlock(new Rectangle(0, 0, 0, 0), line.Text, "", Alignment.TopLeft, Alignment.TopLeft, listBox, true, GUI.SmallFont);
|
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.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.TextColor = messageColor[(int)line.Type];
|
||||||
textBlock.CanBeFocused = false;
|
textBlock.CanBeFocused = false;
|
||||||
textBlock.UserData = line;
|
textBlock.UserData = line;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user