Merged branch master into master

This commit is contained in:
juanjp600
2016-08-30 17:36:11 -03:00
6 changed files with 49 additions and 9 deletions

View File

@@ -1522,7 +1522,7 @@ namespace Barotrauma.Networking
}
else
{
GameServer.Log(message.Text, message.Color);
GameServer.Log(message.TextWithSender, message.Color);
}
sender.ChatSpamSpeed += 5.0f;

View File

@@ -264,6 +264,7 @@ namespace Barotrauma.Networking
public void AddChatMessage(ChatMessage message)
{
if (message.Type == ChatMessageType.Radio &&
Character.Controlled != null &&
message.Sender != null && message.Sender != myCharacter)
@@ -278,6 +279,8 @@ namespace Barotrauma.Networking
return;
}
GameServer.Log(message.TextWithSender, message.Color);
string displayedText = message.Text;
if (message.Sender != null)
@@ -293,8 +296,6 @@ namespace Barotrauma.Networking
GameMain.NetLobbyScreen.NewChatMessage(message);
GameServer.Log(message.Text, message.Color);
while (chatBox.CountChildren > 20)
{
chatBox.RemoveChild(chatBox.children[1]);
@@ -304,7 +305,7 @@ namespace Barotrauma.Networking
{
displayedText = message.SenderName + ": " + displayedText;
}
GUITextBlock msg = new GUITextBlock(new Rectangle(0, 0, 0, 20), displayedText,
((chatBox.CountChildren % 2) == 0) ? Color.Transparent : Color.Black * 0.1f, message.Color,
Alignment.Left, null, null, true);

View File

@@ -98,10 +98,10 @@ namespace Barotrauma.Networking
{
float prevSize = listBox.BarSize;
var textBlock = new GUITextBlock(new Rectangle(0, 0, 0, 0), line.Text, GUI.Style, Alignment.TopLeft, Alignment.TopLeft, null, true, GUI.SmallFont);
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, Math.Max(13, textBlock.Rect.Height));
listBox.AddChild(textBlock);
//listBox.AddChild(textBlock);
textBlock.TextColor = line.Color;
textBlock.CanBeFocused = false;