Merge branch 'master' into new-netcode

Conflicts:
	Subsurface/Source/GUI/GUIButton.cs
	Subsurface/Source/GameSession/CrewManager.cs
	Subsurface/Source/GameSession/GameSession.cs
	Subsurface/Source/Items/Item.cs
	Subsurface/Source/Networking/GameServer.cs
	Subsurface/Source/Screens/MainMenuScreen.cs
	Subsurface/Source/Screens/ServerListScreen.cs
This commit is contained in:
Regalis
2017-04-23 21:40:11 +03:00
70 changed files with 1147 additions and 858 deletions
+17 -13
View File
@@ -26,21 +26,21 @@ namespace Barotrauma
set { (children[0].children[1] as GUITextBlock).Text = value; }
}
public GUIMessageBox(string header, string text)
: this(header, text, new string[] {"OK"})
public GUIMessageBox(string headerText, string text)
: this(headerText, text, new string[] {"OK"})
{
this.Buttons[0].OnClicked = Close;
}
public GUIMessageBox(string header, string text, int width, int height)
: this(header, text, new string[] { "OK" }, width, height)
public GUIMessageBox(string headerText, string text, int width, int height)
: this(headerText, text, new string[] { "OK" }, width, height)
{
this.Buttons[0].OnClicked = Close;
}
public GUIMessageBox(string header, string text, string[] buttons, int width=DefaultWidth, int height=DefaultHeight, Alignment textAlignment = Alignment.TopLeft, GUIComponent parent = null)
: base(new Rectangle(0,0, GameMain.GraphicsWidth, GameMain.GraphicsHeight),
Color.Black*0.5f, Alignment.TopLeft, null, parent)
public GUIMessageBox(string headerText, string text, string[] buttons, int width = DefaultWidth, int height = DefaultHeight, Alignment textAlignment = Alignment.TopLeft, GUIComponent parent = null)
: base(new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight),
Color.Black * 0.5f, Alignment.TopLeft, null, parent)
{
if (height == 0)
{
@@ -53,20 +53,24 @@ namespace Barotrauma
height += 220;
}
var frame = new GUIFrame(new Rectangle(0,0,width,height), null, Alignment.Center, GUI.Style, this);
var frame = new GUIFrame(new Rectangle(0, 0, width, height), null, Alignment.Center, "", this);
GUI.Style.Apply(frame, "", this);
var header = new GUITextBlock(new Rectangle(0, 0, 0, 30), headerText, null, null, textAlignment, "", frame, true);
GUI.Style.Apply(header, "", this);
new GUITextBlock(new Rectangle(0, 0, 0, 30), header, Color.Transparent, Color.White, textAlignment, GUI.Style, frame, true);
if (!string.IsNullOrWhiteSpace(text))
{
new GUITextBlock(new Rectangle(0, 30, 0, height - 70), text,
Color.Transparent, Color.White, textAlignment, GUI.Style, frame, true);
var textBlock = new GUITextBlock(new Rectangle(0, 30, 0, height - 70), text,
null, null, textAlignment, "", frame, true);
GUI.Style.Apply(textBlock, "", this);
}
int x = 0;
this.Buttons = new GUIButton[buttons.Length];
for (int i = 0; i < buttons.Length; i++)
{
this.Buttons[i] = new GUIButton(new Rectangle(x, 0, 150, 30), buttons[i], Alignment.Left | Alignment.Bottom, GUI.Style, frame);
this.Buttons[i] = new GUIButton(new Rectangle(x, 0, 150, 30), buttons[i], Alignment.Left | Alignment.Bottom, "", frame);
x += this.Buttons[i].Rect.Width + 20;
}