Merge branch 'master' into new-netcode

Conflicts:
	Subsurface/Source/GameMain.cs
	Subsurface/Source/Networking/ChatMessage.cs
	Subsurface/Source/Networking/NetworkMember.cs
	Subsurface/Source/Screens/NetLobbyScreen.cs
This commit is contained in:
Regalis
2017-05-01 19:25:07 +03:00
17 changed files with 94 additions and 122 deletions

View File

@@ -2,8 +2,6 @@
using Lidgren.Network;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Barotrauma.Networking
@@ -17,15 +15,15 @@ namespace Barotrauma.Networking
class ChatMessage
{
public const float SpeakRange = 2000.0f;
public static Color[] MessageColor =
{
Color.White, //default
Color.Red, //error
{
new Color(125, 140, 153), //default
new Color(204, 74, 78), //error
new Color(63, 72, 204), //dead
Color.LightGreen, //server
Color.Yellow, //radio
new Color(153, 217, 234) //private
new Color(157, 225, 160), //server
new Color(148, 230, 7), //radio
new Color(228, 199, 27) //private
};
public readonly string Text;

View File

@@ -158,6 +158,7 @@ namespace Barotrauma.Networking
new Rectangle(chatBox.Rect.X, chatBox.Rect.Y + chatBox.Rect.Height + 20, chatBox.Rect.Width, 25),
Color.White * 0.5f, Color.Black, Alignment.TopLeft, Alignment.Left, "", inGameHUD);
chatMsgBox.Font = GUI.SmallFont;
chatMsgBox.MaxTextWidth = chatBox.Rect.Width * 2;
chatMsgBox.Padding = Vector4.Zero;
chatMsgBox.OnEnterPressed = EnterChatMessage;
chatMsgBox.OnTextChanged = TypingChatMessage;
@@ -247,10 +248,9 @@ namespace Barotrauma.Networking
displayedText = message.SenderName + ": " + displayedText;
}
GUITextBlock msg = new GUITextBlock(new Rectangle(0, 0, chatBox.Rect.Width, 0), displayedText,
GUITextBlock msg = new GUITextBlock(new Rectangle(0, 0, chatBox.Rect.Width - 40, 0), displayedText,
((chatBox.CountChildren % 2) == 0) ? Color.Transparent : Color.Black * 0.1f, message.Color,
Alignment.Left, null, null, true);
msg.Font = GUI.SmallFont;
Alignment.Left, Alignment.TopLeft, "", null, true, GUI.SmallFont);
msg.UserData = message.SenderName;
msg.Padding = new Vector4(20.0f, 0, 0, 0);

View File

@@ -59,21 +59,21 @@ namespace Barotrauma.Networking
{
LogFrame = new GUIFrame(new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.Black * 0.5f);
GUIFrame innerFrame = new GUIFrame(new Rectangle(0,0,400, 400), null, Alignment.Center, "", LogFrame);
innerFrame.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
GUIFrame innerFrame = new GUIFrame(new Rectangle(0, 0, 500, 400), null, Alignment.Center, "", LogFrame);
innerFrame.Padding = new Vector4(10.0f, 20.0f, 10.0f, 20.0f);
new GUITextBlock(new Rectangle(-200,0,100,15), "Filter", "", Alignment.TopRight, Alignment.TopRight, innerFrame, false, GUI.SmallFont);
new GUITextBlock(new Rectangle(-200, 0, 100, 15), "Filter", "", Alignment.TopRight, Alignment.TopRight, innerFrame, false, GUI.SmallFont);
GUITextBox searchBox = new GUITextBox(new Rectangle(-20,0,180,15), Alignment.TopRight, "", innerFrame);
GUITextBox searchBox = new GUITextBox(new Rectangle(-20, 0, 180, 15), Alignment.TopRight, "", innerFrame);
searchBox.Font = GUI.SmallFont;
searchBox.OnTextChanged = FilterMessages;
GUIComponent.KeyboardDispatcher.Subscriber = searchBox;
var clearButton = new GUIButton(new Rectangle(0,0,15,15), "x", Alignment.TopRight, "", innerFrame);
var clearButton = new GUIButton(new Rectangle(0, 0, 15, 15), "x", Alignment.TopRight, "", innerFrame);
clearButton.OnClicked = ClearFilter;
clearButton.UserData = searchBox;
listBox = new GUIListBox(new Rectangle(0,20,0,335), "", innerFrame);
listBox = new GUIListBox(new Rectangle(0, 30, 0, 310), "", innerFrame);
var currLines = lines.ToList();