GUIStyle logic changes: instead of having a predetermined GUIComponentStyle for each type of GUIComponent, any GUIComponent can use any style. The GUIComponent constructors take the name of the style as a parameter, and if no style is specified, the default style for the GUIComponent in question will be used.
This commit is contained in:
@@ -107,7 +107,7 @@ namespace Launcher2
|
||||
guiRoot = new GUIFrame(new Rectangle(0,0,graphicsWidth, graphicsHeight), Color.Transparent);
|
||||
guiRoot.Padding = new Vector4(40.0f, 40.0f, 40.0f, 40.0f);
|
||||
|
||||
launchButton = new GUIButton(new Rectangle(0,0,100,30), "START", Alignment.BottomRight, GUI.Style, guiRoot);
|
||||
launchButton = new GUIButton(new Rectangle(0,0,100,30), "START", Alignment.BottomRight, "", guiRoot);
|
||||
launchButton.OnClicked = LaunchClick;
|
||||
|
||||
int y = 50;
|
||||
@@ -115,15 +115,15 @@ namespace Launcher2
|
||||
var checkForUpdates = new GUITickBox(new Rectangle(0, y, 20, 20), "Automatically check for updates", Alignment.TopLeft, guiRoot);
|
||||
checkForUpdates.Selected = settings.AutoCheckUpdates;
|
||||
|
||||
updateInfoText = new GUITextBlock(new Rectangle(0,y+30,100,20), "", GUI.Style, guiRoot);
|
||||
updateInfoText = new GUITextBlock(new Rectangle(0,y+30,100,20), "", "", guiRoot);
|
||||
|
||||
updateInfoBox = new GUIListBox(new Rectangle(0, y + 55, 330, graphicsHeight-y-55-30-80), GUI.Style, guiRoot);
|
||||
updateInfoBox = new GUIListBox(new Rectangle(0, y + 55, 330, graphicsHeight-y-55-30-80), "", guiRoot);
|
||||
updateInfoBox.Visible = false;
|
||||
|
||||
progressBar = new GUIProgressBar(new Rectangle(110,0,220,20), Color.Green, 0.0f, Alignment.BottomLeft, guiRoot);
|
||||
progressBar.Visible = false;
|
||||
|
||||
downloadButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Download", Alignment.BottomLeft, GUI.Style, guiRoot);
|
||||
downloadButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Download", Alignment.BottomLeft, "", guiRoot);
|
||||
downloadButton.OnClicked = DownloadButtonClicked;
|
||||
downloadButton.Visible = false;
|
||||
|
||||
@@ -131,8 +131,8 @@ namespace Launcher2
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
int x = 360;
|
||||
new GUITextBlock(new Rectangle(x, y, 20, 20), "Resolution", GUI.Style, Alignment.TopLeft, Alignment.TopLeft, guiRoot);
|
||||
resolutionDD = new GUIDropDown(new Rectangle(x, y + 20, 200, 20), "", GUI.Style, guiRoot);
|
||||
new GUITextBlock(new Rectangle(x, y, 20, 20), "Resolution", "", Alignment.TopLeft, Alignment.TopLeft, guiRoot);
|
||||
resolutionDD = new GUIDropDown(new Rectangle(x, y + 20, 200, 20), "", "", guiRoot);
|
||||
|
||||
foreach (DisplayMode mode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes)
|
||||
{
|
||||
@@ -149,8 +149,8 @@ namespace Launcher2
|
||||
resolutionDD.SelectItem(GraphicsAdapter.DefaultAdapter.SupportedDisplayModes.Last());
|
||||
}
|
||||
|
||||
new GUITextBlock(new Rectangle(x, y + 50, 20, 20), "Content package", GUI.Style, Alignment.TopLeft, Alignment.TopLeft, guiRoot);
|
||||
contentPackageDD = new GUIDropDown(new Rectangle(x, y + 70, 200, 20), "", GUI.Style, guiRoot);
|
||||
new GUITextBlock(new Rectangle(x, y + 50, 20, 20), "Content package", "", Alignment.TopLeft, Alignment.TopLeft, guiRoot);
|
||||
contentPackageDD = new GUIDropDown(new Rectangle(x, y + 70, 200, 20), "", "", guiRoot);
|
||||
|
||||
foreach (ContentPackage contentPackage in ContentPackage.list)
|
||||
{
|
||||
@@ -161,8 +161,8 @@ namespace Launcher2
|
||||
|
||||
//new GUIButton(new Rectangle(x,y+120,150,20), "Package Manager", GUI.Style, guiRoot);
|
||||
|
||||
new GUITextBlock(new Rectangle(x, y + 130, 20, 20), "Display mode", GUI.Style, Alignment.TopLeft, Alignment.TopLeft, guiRoot);
|
||||
displayModeDD = new GUIDropDown(new Rectangle(x, y + 150, 200, 20), "", GUI.Style, guiRoot);
|
||||
new GUITextBlock(new Rectangle(x, y + 130, 20, 20), "Display mode", "", Alignment.TopLeft, Alignment.TopLeft, guiRoot);
|
||||
displayModeDD = new GUIDropDown(new Rectangle(x, y + 150, 200, 20), "", "", guiRoot);
|
||||
displayModeDD.AddItem("Fullscreen", WindowMode.Fullscreen);
|
||||
displayModeDD.AddItem("Windowed", WindowMode.Windowed);
|
||||
displayModeDD.AddItem("Borderless windowed", WindowMode.BorderlessWindowed);
|
||||
@@ -318,7 +318,7 @@ namespace Launcher2
|
||||
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(indent, 0, 0, heigth),
|
||||
line, GUI.Style,
|
||||
line, "",
|
||||
Alignment.TopLeft, Alignment.TopLeft,
|
||||
updateInfoBox, true, GUI.SmallFont);
|
||||
textBlock.Padding = new Vector4(indent, 0, 0, 0);
|
||||
@@ -559,7 +559,7 @@ namespace Launcher2
|
||||
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, 0, 17),
|
||||
"Downloading " + filesToDownload[filesDownloaded] + "...", GUI.Style,
|
||||
"Downloading " + filesToDownload[filesDownloaded] + "...", "",
|
||||
Alignment.TopLeft, Alignment.TopLeft,
|
||||
updateInfoBox, false, GUI.SmallFont);
|
||||
textBlock.CanBeFocused = false;
|
||||
@@ -599,7 +599,7 @@ namespace Launcher2
|
||||
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, 0, 0),
|
||||
errorMsg, GUI.Style,
|
||||
errorMsg, "",
|
||||
Alignment.TopLeft, Alignment.TopLeft,
|
||||
updateInfoBox, true, GUI.SmallFont);
|
||||
textBlock.TextColor = Color.Red;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 560 KiB |
@@ -2,29 +2,38 @@
|
||||
<style>
|
||||
<GUIFrame
|
||||
padding="40.0, 40.0, 40.0, 40.0"
|
||||
color="0.8, 0.8, 0.8, 0.85"
|
||||
color="1.0,1.0,1.0,1.0"
|
||||
|
||||
textcolor="0.0, 0.0, 0.0, 1.0"
|
||||
|
||||
hovercolor="0.8, 0.8, 0.8, 1.0"
|
||||
selectedcolor="1.0, 0.82, 0.05, 1.0"
|
||||
|
||||
outlinecolor="0.5, 0.57, 0.6, 1.0">
|
||||
selectedcolor="1.0, 0.82, 0.05, 1.0">
|
||||
|
||||
<Sprite texture="Content/UI/UI_Atlas.png" size="0.0, 0.0" sourcerect ="13, 6, 420, 647" slice="208,88,238,585"/>
|
||||
<Sprite texture="Content/UI/UI_Atlas.png" size="0.0, 0.0" sourcerect ="32, 541, 420, 454" slice="87,576,430,960"/>
|
||||
</GUIFrame>
|
||||
|
||||
<GUIButton
|
||||
color="0.88, 0.25, 0.15, 0.8"
|
||||
color="1.0,1.0,1.0,1.0"
|
||||
|
||||
textcolor="1.0, 1.0, 1.0, 1.0"
|
||||
|
||||
hovercolor="0.88, 0.25, 0.15, 1.0"
|
||||
selectedcolor="1.0, 0.0, 0.0, 1.0">
|
||||
|
||||
<Sprite texture="Content/UI/UI_Atlas.png" sourcerect ="13, 667, 220, 59" slice="27,673,226,718"/>
|
||||
<Sprite texture="Content/UI/UI_Atlas.png" sourcerect ="888, 91, 129, 41" slice="897, 98, 1009, 125"/>
|
||||
</GUIButton>
|
||||
|
||||
<GUIButtonLarge
|
||||
color="1.0,1.0,1.0,1.0"
|
||||
|
||||
textcolor="1.0, 1.0, 1.0, 1.0"
|
||||
|
||||
hovercolor="0.88, 0.25, 0.15, 1.0"
|
||||
selectedcolor="1.0, 0.0, 0.0, 1.0">
|
||||
|
||||
<Sprite texture="Content/UI/UI_Atlas.png" sourcerect ="13, 667, 220, 59" slice="27, 673, 226, 718"/>
|
||||
</GUIButtonLarge>
|
||||
|
||||
<GUITextBlock
|
||||
textcolor="1.0, 1.0, 1.0, 1.0"
|
||||
hovercolor="0.3, 0.3, 0.3, 0.5"
|
||||
@@ -53,17 +62,15 @@
|
||||
</GUIDropDown>
|
||||
|
||||
<GUITextBox
|
||||
color="0.0, 0.0, 0.0, 1.0"
|
||||
color="1.0, 1.0, 1.0, 1.0"
|
||||
hovercolor="0.5, 0.5, 0.5, 0.7"
|
||||
textcolor="1.0, 1.0, 1.0, 1.0"
|
||||
outlinecolor="0.5, 0.57, 0.6, 1.0">
|
||||
textcolor="1.0, 1.0, 1.0, 1.0">
|
||||
<Sprite texture="Content/UI/UI_Atlas.png" sourcerect ="494, 574, 332, 51" slice="497, 578, 823, 620"/>
|
||||
</GUITextBox>
|
||||
|
||||
<GUITickBox
|
||||
color="0.5, 0.5, 0.5, 1.0"
|
||||
|
||||
outlinecolor="0.5, 0.57, 0.6, 1.0">
|
||||
<Sprite texture="Content/UI/uiBackground.png" size="0.0, 0.0" sourcerect ="0.0, 90.0, 0.0, 100.0"/>
|
||||
color="1.0, 1.0, 1.0, 1.0">
|
||||
<Sprite texture="Content/UI/UI_Atlas.png" sourcerect ="992, 814, 21, 22" slice="995, 817, 1008, 830"/>
|
||||
</GUITickBox>
|
||||
|
||||
<GUIMessageBox
|
||||
@@ -77,8 +84,7 @@
|
||||
|
||||
outlinecolor="0.5, 0.57, 0.6, 1.0">
|
||||
|
||||
<Sprite texture="Content/UI/uiBackground.png" size="0.0, 0.0" sourcerect ="0.0, 90.0, 0.0, 100.0"/>
|
||||
<Sprite texture="Content/UI/uiBackground.png" size="0.0, 1.0" sourcerect ="0.0, 0.0, 0.0, 90.0"/>
|
||||
<Sprite texture="Content/UI/UI_Atlas.png" sourcerect ="32, 541, 420, 454" slice="87,576,430,960"/>
|
||||
</GUIMessageBox>
|
||||
|
||||
<GUIProgressBar
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace Barotrauma
|
||||
frame = new GUIFrame(Rectangle.Empty, Color.Black * 0.6f);
|
||||
frame.Padding = new Vector4(200.0f, 100.0f, 200.0f, 100.0f);
|
||||
|
||||
GUIButton closeButton = new GUIButton(new Rectangle(0, 50, 100, 20), "Close", Alignment.BottomCenter, GUI.Style, frame);
|
||||
GUIButton closeButton = new GUIButton(new Rectangle(0, 50, 100, 20), "Close", Alignment.BottomCenter, "", frame);
|
||||
closeButton.OnClicked = (GUIButton button, object userData) =>
|
||||
{
|
||||
ToggleGUIFrame();
|
||||
@@ -269,7 +269,7 @@ namespace Barotrauma
|
||||
img.Color = order.Color;
|
||||
img.CanBeFocused = false;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 20), order.DoingText, GUI.Style, Alignment.TopLeft, Alignment.TopCenter, orderFrame);
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 20), order.DoingText, "", Alignment.TopLeft, Alignment.TopCenter, orderFrame);
|
||||
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@ namespace Barotrauma
|
||||
|
||||
for (int i = 0; i < order.Options.Length; i++ )
|
||||
{
|
||||
var optionBox = new GUITextBlock(new Rectangle(0, 0, 0, 15), order.Options[i], GUI.Style, optionList);
|
||||
var optionBox = new GUITextBlock(new Rectangle(0, 0, 0, 15), order.Options[i], "", optionList);
|
||||
optionBox.Font = GUI.SmallFont;
|
||||
optionBox.UserData = order.Options[i];
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace Barotrauma
|
||||
if (cprButton == null)
|
||||
{
|
||||
cprButton = new GUIButton(
|
||||
new Rectangle(character.SelectedCharacter.Inventory.SlotPositions[0].ToPoint() + new Point(320, -30), new Point(130, 20)), "Perform CPR", GUI.Style);
|
||||
new Rectangle(character.SelectedCharacter.Inventory.SlotPositions[0].ToPoint() + new Point(320, -30), new Point(130, 20)), "Perform CPR", "");
|
||||
|
||||
cprButton.OnClicked = (button, userData) =>
|
||||
{
|
||||
@@ -249,7 +249,7 @@ namespace Barotrauma
|
||||
if (suicideButton == null)
|
||||
{
|
||||
suicideButton = new GUIButton(
|
||||
new Rectangle(new Point(GameMain.GraphicsWidth / 2 - 60, 20), new Point(120, 20)), "Give in", GUI.Style);
|
||||
new Rectangle(new Point(GameMain.GraphicsWidth / 2 - 60, 20), new Point(120, 20)), "Give in", "");
|
||||
|
||||
|
||||
suicideButton.ToolTip = GameMain.NetworkMember == null ?
|
||||
@@ -279,10 +279,10 @@ namespace Barotrauma
|
||||
{
|
||||
int width = 100, height = 20;
|
||||
|
||||
drowningBar = new GUIProgressBar(new Rectangle(30, GameMain.GraphicsHeight - 200, width, height), Color.Blue, GUI.Style, 1.0f, Alignment.TopLeft);
|
||||
drowningBar = new GUIProgressBar(new Rectangle(30, GameMain.GraphicsHeight - 200, width, height), Color.Blue, "", 1.0f, Alignment.TopLeft);
|
||||
new GUIImage(new Rectangle(-27, -7, 20, 20), new Rectangle(17, 0, 20, 24), statusIcons, Alignment.TopLeft, drowningBar);
|
||||
|
||||
healthBar = new GUIProgressBar(new Rectangle(30, GameMain.GraphicsHeight - 230, width, height), Color.Red, GUI.Style, 1.0f, Alignment.TopLeft);
|
||||
healthBar = new GUIProgressBar(new Rectangle(30, GameMain.GraphicsHeight - 230, width, height), Color.Red, "", 1.0f, Alignment.TopLeft);
|
||||
new GUIImage(new Rectangle(-26, -7, 20, 20), new Rectangle(0, 0, 13, 24), statusIcons, Alignment.TopLeft, healthBar);
|
||||
}
|
||||
|
||||
|
||||
@@ -226,24 +226,24 @@ namespace Barotrauma
|
||||
ScalableFont font = frame.Rect.Width<280 ? GUI.SmallFont : GUI.Font;
|
||||
|
||||
int x = 0, y = 0;
|
||||
new GUITextBlock(new Rectangle(x+60, y, 200, 20), Name, GUI.Style, frame, font);
|
||||
new GUITextBlock(new Rectangle(x+60, y, 200, 20), Name, "", frame, font);
|
||||
y += 20;
|
||||
|
||||
if (Job!=null)
|
||||
{
|
||||
new GUITextBlock(new Rectangle(x + 60, y, 200, 20), Job.Name, GUI.Style, frame, font);
|
||||
new GUITextBlock(new Rectangle(x + 60, y, 200, 20), Job.Name, "", frame, font);
|
||||
y += 30;
|
||||
|
||||
var skills = Job.Skills;
|
||||
skills.Sort((s1, s2) => -s1.Level.CompareTo(s2.Level));
|
||||
|
||||
new GUITextBlock(new Rectangle(x, y, 200, 20), "Skills:", GUI.Style, frame, font);
|
||||
new GUITextBlock(new Rectangle(x, y, 200, 20), "Skills:", "", frame, font);
|
||||
y += 20;
|
||||
foreach (Skill skill in skills)
|
||||
{
|
||||
Color textColor = Color.White * (0.5f + skill.Level/200.0f);
|
||||
new GUITextBlock(new Rectangle(x, y, 200, 20), skill.Name, Color.Transparent, textColor, Alignment.Left, GUI.Style, frame).Font = font;
|
||||
new GUITextBlock(new Rectangle(x, y, 200, 20), skill.Level.ToString(), Color.Transparent, textColor, Alignment.Right, GUI.Style, frame).Font = font;
|
||||
new GUITextBlock(new Rectangle(x, y, 200, 20), skill.Name, Color.Transparent, textColor, Alignment.Left, "", frame).Font = font;
|
||||
new GUITextBlock(new Rectangle(x, y, 200, 20), skill.Level.ToString(), Color.Transparent, textColor, Alignment.Right, "", frame).Font = font;
|
||||
y += 20;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,14 +108,14 @@ namespace Barotrauma
|
||||
|
||||
GUIFrame backFrame = new GUIFrame(Rectangle.Empty, Color.Black*0.5f);
|
||||
|
||||
GUIFrame frame = new GUIFrame(new Rectangle(GameMain.GraphicsWidth / 2 - width / 2, GameMain.GraphicsHeight / 2 - height / 2, width, height), GUI.Style, backFrame);
|
||||
GUIFrame frame = new GUIFrame(new Rectangle(GameMain.GraphicsWidth / 2 - width / 2, GameMain.GraphicsHeight / 2 - height / 2, width, height), "", backFrame);
|
||||
frame.Padding = new Vector4(30.0f, 30.0f, 30.0f, 30.0f);
|
||||
|
||||
new GUITextBlock(new Rectangle(0,0,100,20), Name, GUI.Style, Alignment.TopLeft, Alignment.TopLeft, frame, false, GUI.LargeFont);
|
||||
new GUITextBlock(new Rectangle(0,0,100,20), Name, "", Alignment.TopLeft, Alignment.TopLeft, frame, false, GUI.LargeFont);
|
||||
|
||||
var descriptionBlock = new GUITextBlock(new Rectangle(0, 40, 0, 0), Description, GUI.Style, Alignment.TopLeft, Alignment.TopLeft, frame, true, GUI.SmallFont);
|
||||
var descriptionBlock = new GUITextBlock(new Rectangle(0, 40, 0, 0), Description, "", Alignment.TopLeft, Alignment.TopLeft, frame, true, GUI.SmallFont);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 40 + descriptionBlock.Rect.Height + 20, 100, 20), "Skills: ", GUI.Style, Alignment.TopLeft, Alignment.TopLeft, frame, false, GUI.LargeFont);
|
||||
new GUITextBlock(new Rectangle(0, 40 + descriptionBlock.Rect.Height + 20, 100, 20), "Skills: ", "", Alignment.TopLeft, Alignment.TopLeft, frame, false, GUI.LargeFont);
|
||||
|
||||
int y = 40 + descriptionBlock.Rect.Height + 50;
|
||||
foreach (SkillPrefab skill in Skills)
|
||||
@@ -128,18 +128,18 @@ namespace Barotrauma
|
||||
skillDescription += "/"+skillDescription2;
|
||||
}
|
||||
new GUITextBlock(new Rectangle(0, y, 100, 20),
|
||||
" - " + skill.Name + ": " + skillDescription, GUI.Style, Alignment.TopLeft, Alignment.TopLeft, frame, false, GUI.SmallFont);
|
||||
" - " + skill.Name + ": " + skillDescription, "", Alignment.TopLeft, Alignment.TopLeft, frame, false, GUI.SmallFont);
|
||||
|
||||
y += 20;
|
||||
}
|
||||
|
||||
new GUITextBlock(new Rectangle(250, 40 + descriptionBlock.Rect.Height + 20, 0, 20), "Items: ", GUI.Style, Alignment.TopLeft, Alignment.TopLeft, frame, false, GUI.LargeFont);
|
||||
new GUITextBlock(new Rectangle(250, 40 + descriptionBlock.Rect.Height + 20, 0, 20), "Items: ", "", Alignment.TopLeft, Alignment.TopLeft, frame, false, GUI.LargeFont);
|
||||
|
||||
y = 40 + descriptionBlock.Rect.Height + 50;
|
||||
foreach (string itemName in ItemNames)
|
||||
{
|
||||
new GUITextBlock(new Rectangle(250, y, 100, 20),
|
||||
" - " + itemName, GUI.Style, Alignment.TopLeft, Alignment.TopLeft, frame, false, GUI.SmallFont);
|
||||
" - " + itemName, "", Alignment.TopLeft, Alignment.TopLeft, frame, false, GUI.SmallFont);
|
||||
|
||||
y += 20;
|
||||
}
|
||||
|
||||
@@ -59,10 +59,10 @@ namespace Barotrauma
|
||||
frame.Color = Color.White * 0.4f;
|
||||
frame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||
|
||||
listBox = new GUIListBox(new Rectangle(0, 0, 0, frame.Rect.Height - 40), Color.Black, GUI.Style, frame);
|
||||
listBox = new GUIListBox(new Rectangle(0, 0, 0, frame.Rect.Height - 40), Color.Black, "", frame);
|
||||
listBox.Color = Color.Black * 0.7f;
|
||||
|
||||
textBox = new GUITextBox(new Rectangle(0,0,0,20), Color.Black, Color.White, Alignment.BottomLeft, Alignment.Left, GUI.Style, frame);
|
||||
textBox = new GUITextBox(new Rectangle(0,0,0,20), Color.Black, Color.White, Alignment.BottomLeft, Alignment.Left, "", frame);
|
||||
textBox.Color = Color.Black * 0.7f;
|
||||
|
||||
//messages already added before initialization -> add them to the listbox
|
||||
@@ -830,7 +830,7 @@ namespace Barotrauma
|
||||
|
||||
try
|
||||
{
|
||||
var textBlock = new GUITextBlock(new Rectangle(0, 0, listBox.Rect.Width, 0), msg, GUI.Style, Alignment.TopLeft, Alignment.Left, null, true, GUI.SmallFont);
|
||||
var textBlock = new GUITextBlock(new Rectangle(0, 0, listBox.Rect.Width, 0), msg, "", Alignment.TopLeft, Alignment.Left, null, true, GUI.SmallFont);
|
||||
textBlock.CanBeFocused = false;
|
||||
textBlock.TextColor = color;
|
||||
|
||||
|
||||
@@ -136,15 +136,15 @@ namespace Barotrauma
|
||||
|
||||
if (pauseMenuOpen)
|
||||
{
|
||||
pauseMenu = new GUIFrame(new Rectangle(0, 0, 200, 300), null, Alignment.Center, Style);
|
||||
pauseMenu = new GUIFrame(new Rectangle(0, 0, 200, 300), null, Alignment.Center, "");
|
||||
|
||||
int y = 0;
|
||||
var button = new GUIButton(new Rectangle(0, y, 0, 30), "Resume", Alignment.CenterX, Style, pauseMenu);
|
||||
var button = new GUIButton(new Rectangle(0, y, 0, 30), "Resume", Alignment.CenterX, "", pauseMenu);
|
||||
button.OnClicked = TogglePauseMenu;
|
||||
|
||||
y += 60;
|
||||
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 30), "Settings", Alignment.CenterX, Style, pauseMenu);
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 30), "Settings", Alignment.CenterX, "", pauseMenu);
|
||||
button.OnClicked = (btn, userData) =>
|
||||
{
|
||||
TogglePauseMenu();
|
||||
@@ -161,7 +161,7 @@ namespace Barotrauma
|
||||
SinglePlayerMode spMode = GameMain.GameSession.gameMode as SinglePlayerMode;
|
||||
if (spMode != null)
|
||||
{
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 30), "Load previous", Alignment.CenterX, Style, pauseMenu);
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 30), "Load previous", Alignment.CenterX, "", pauseMenu);
|
||||
button.OnClicked += TogglePauseMenu;
|
||||
button.OnClicked += GameMain.GameSession.LoadPrevious;
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace Barotrauma
|
||||
SinglePlayerMode spMode = GameMain.GameSession.gameMode as SinglePlayerMode;
|
||||
if (spMode != null)
|
||||
{
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 30), "Save & quit", Alignment.CenterX, Style, pauseMenu);
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 30), "Save & quit", Alignment.CenterX, "", pauseMenu);
|
||||
button.OnClicked += QuitClicked;
|
||||
button.OnClicked += TogglePauseMenu;
|
||||
button.UserData = "save";
|
||||
@@ -184,7 +184,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 30), "Quit", Alignment.CenterX, Style, pauseMenu);
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 30), "Quit", Alignment.CenterX, "", pauseMenu);
|
||||
button.OnClicked += QuitClicked;
|
||||
button.OnClicked += TogglePauseMenu;
|
||||
}
|
||||
|
||||
@@ -133,29 +133,29 @@ namespace Barotrauma
|
||||
|
||||
public bool Selected { get; set; }
|
||||
|
||||
public GUIButton(Rectangle rect, string text, GUIStyle style, GUIComponent parent = null)
|
||||
public GUIButton(Rectangle rect, string text, string style, GUIComponent parent = null)
|
||||
: this(rect, text, null, Alignment.Left, style, parent)
|
||||
{
|
||||
}
|
||||
|
||||
public GUIButton(Rectangle rect, string text, Alignment alignment, GUIStyle style, GUIComponent parent = null)
|
||||
public GUIButton(Rectangle rect, string text, Alignment alignment, string style, GUIComponent parent = null)
|
||||
: this(rect, text, null, alignment, style, parent)
|
||||
{
|
||||
}
|
||||
|
||||
public GUIButton(Rectangle rect, string text, Color? color, GUIStyle style, GUIComponent parent = null)
|
||||
public GUIButton(Rectangle rect, string text, Color? color, string style, GUIComponent parent = null)
|
||||
: this(rect, text, color, (Alignment.Left | Alignment.Top), style, parent)
|
||||
{
|
||||
}
|
||||
|
||||
public GUIButton(Rectangle rect, string text, Color? color, Alignment alignment, GUIStyle style, GUIComponent parent = null)
|
||||
:this(rect, text, color, alignment, Alignment.Center, style, parent)
|
||||
public GUIButton(Rectangle rect, string text, Color? color, Alignment alignment, string style = "", GUIComponent parent = null)
|
||||
: this(rect, text, color, alignment, Alignment.Center, style, parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public GUIButton(Rectangle rect, string text, Color? color, Alignment alignment, Alignment textAlignment, GUIStyle style, GUIComponent parent = null)
|
||||
:base (style)
|
||||
public GUIButton(Rectangle rect, string text, Color? color, Alignment alignment, Alignment textAlignment, string style = "", GUIComponent parent = null)
|
||||
: base (style)
|
||||
{
|
||||
this.rect = rect;
|
||||
if (color!=null) this.color = (Color)color;
|
||||
@@ -164,7 +164,7 @@ namespace Barotrauma
|
||||
if (parent != null) parent.AddChild(this);
|
||||
|
||||
frame = new GUIFrame(Rectangle.Empty, style, this);
|
||||
if (style != null) style.Apply(frame, this);
|
||||
GUI.Style.Apply(frame, style, this);
|
||||
|
||||
textBlock = new GUITextBlock(Rectangle.Empty, text,
|
||||
Color.Transparent, (this.style == null) ? Color.Black : this.style.textColor,
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace Barotrauma
|
||||
get { return keyboardDispatcher; }
|
||||
}
|
||||
|
||||
protected GUIComponent(GUIStyle style)
|
||||
protected GUIComponent(string style)
|
||||
{
|
||||
Visible = true;
|
||||
|
||||
@@ -228,7 +228,8 @@ namespace Barotrauma
|
||||
|
||||
CanBeFocused = true;
|
||||
|
||||
if (style!=null) style.Apply(this);
|
||||
if (style != null)
|
||||
GUI.Style.Apply(this, style);
|
||||
}
|
||||
|
||||
public static void Init(GameWindow window)
|
||||
@@ -294,7 +295,7 @@ namespace Barotrauma
|
||||
|
||||
if (currColor.A>0.0f && !sprites.Any()) GUI.DrawRectangle(spriteBatch, rect, currColor * (currColor.A / 255.0f), true);
|
||||
|
||||
if (sprites != null)
|
||||
if (sprites != null && currColor.A > 0.0f)
|
||||
{
|
||||
foreach (UISprite uiSprite in sprites)
|
||||
{
|
||||
@@ -372,7 +373,7 @@ namespace Barotrauma
|
||||
int width = 400;
|
||||
if (toolTipBlock==null || (string)toolTipBlock.userData != ToolTip)
|
||||
{
|
||||
toolTipBlock = new GUITextBlock(new Rectangle(0,0,width, 18), ToolTip, GUI.Style, Alignment.TopLeft, Alignment.TopLeft, null, true, GUI.SmallFont);
|
||||
toolTipBlock = new GUITextBlock(new Rectangle(0,0,width, 18), ToolTip, "", Alignment.TopLeft, Alignment.TopLeft, null, true, GUI.SmallFont);
|
||||
toolTipBlock.padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||
toolTipBlock.rect.Width = (int)(GUI.SmallFont.MeasureString(toolTipBlock.WrappedText).X + 20);
|
||||
toolTipBlock.rect.Height = toolTipBlock.WrappedText.Split('\n').Length * 18;
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public GUIDropDown(Rectangle rect, string text, GUIStyle style, GUIComponent parent = null)
|
||||
public GUIDropDown(Rectangle rect, string text, string style, GUIComponent parent = null)
|
||||
: base(style)
|
||||
{
|
||||
this.rect = rect;
|
||||
@@ -101,7 +101,7 @@ namespace Barotrauma
|
||||
|
||||
public void AddItem(string text, object userData = null)
|
||||
{
|
||||
GUITextBlock textBlock = new GUITextBlock(new Rectangle(0,0,0,20), text, GUI.Style, listBox);
|
||||
GUITextBlock textBlock = new GUITextBlock(new Rectangle(0,0,0,20), text, "", listBox);
|
||||
textBlock.UserData = userData;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,18 +5,18 @@ namespace Barotrauma
|
||||
{
|
||||
public class GUIFrame : GUIComponent
|
||||
{
|
||||
public GUIFrame(Rectangle rect, GUIStyle style = null, GUIComponent parent = null)
|
||||
public GUIFrame(Rectangle rect, string style = "", GUIComponent parent = null)
|
||||
: this(rect, null, (Alignment.Left | Alignment.Top), style, parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public GUIFrame(Rectangle rect, Color color, GUIStyle style = null, GUIComponent parent = null)
|
||||
public GUIFrame(Rectangle rect, Color color, string style = "", GUIComponent parent = null)
|
||||
: this(rect, color, (Alignment.Left | Alignment.Top), style, parent)
|
||||
{
|
||||
}
|
||||
|
||||
public GUIFrame(Rectangle rect, Color? color, Alignment alignment, GUIStyle style = null, GUIComponent parent = null)
|
||||
public GUIFrame(Rectangle rect, Color? color, Alignment alignment, string style = "", GUIComponent parent = null)
|
||||
: base(style)
|
||||
{
|
||||
this.rect = rect;
|
||||
|
||||
@@ -107,22 +107,22 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public GUIListBox(Rectangle rect, GUIStyle style, GUIComponent parent = null)
|
||||
public GUIListBox(Rectangle rect, string style, GUIComponent parent = null)
|
||||
: this(rect, style, Alignment.TopLeft, parent)
|
||||
{
|
||||
}
|
||||
|
||||
public GUIListBox(Rectangle rect, GUIStyle style, Alignment alignment, GUIComponent parent = null)
|
||||
public GUIListBox(Rectangle rect, string style, Alignment alignment, GUIComponent parent = null)
|
||||
: this(rect, null, alignment, style, parent, false)
|
||||
{
|
||||
}
|
||||
|
||||
public GUIListBox(Rectangle rect, Color? color, GUIStyle style = null, GUIComponent parent = null)
|
||||
public GUIListBox(Rectangle rect, Color? color, string style = null, GUIComponent parent = null)
|
||||
: this(rect, color, (Alignment.Left | Alignment.Top), style, parent)
|
||||
{
|
||||
}
|
||||
|
||||
public GUIListBox(Rectangle rect, Color? color, Alignment alignment, GUIStyle style = null, GUIComponent parent = null, bool isHorizontal = false)
|
||||
public GUIListBox(Rectangle rect, Color? color, Alignment alignment, string style = null, GUIComponent parent = null, bool isHorizontal = false)
|
||||
: base(style)
|
||||
{
|
||||
this.rect = rect;
|
||||
@@ -140,18 +140,18 @@ namespace Barotrauma
|
||||
if (isHorizontal)
|
||||
{
|
||||
scrollBar = new GUIScrollBar(
|
||||
new Rectangle(this.rect.X, this.rect.Bottom - 20, this.rect.Width, 20), null, 1.0f, GUI.Style);
|
||||
new Rectangle(this.rect.X, this.rect.Bottom - 20, this.rect.Width, 20), null, 1.0f, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
scrollBar = new GUIScrollBar(
|
||||
new Rectangle(this.rect.Right - 20, this.rect.Y, 20, this.rect.Height), null, 1.0f, GUI.Style);
|
||||
new Rectangle(this.rect.Right - 20, this.rect.Y, 20, this.rect.Height), null, 1.0f, "");
|
||||
}
|
||||
|
||||
scrollBar.IsHorizontal = isHorizontal;
|
||||
|
||||
frame = new GUIFrame(Rectangle.Empty, style, this);
|
||||
if (style != null) style.Apply(frame, this);
|
||||
GUI.Style.Apply(frame, "", this);
|
||||
|
||||
UpdateScrollBarSize();
|
||||
|
||||
|
||||
@@ -53,20 +53,20 @@ 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);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 30), header, Color.Transparent, Color.White, textAlignment, GUI.Style, frame, true);
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 30), header, Color.Transparent, Color.White, textAlignment, "", 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);
|
||||
Color.Transparent, Color.White, textAlignment, "", frame, true);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Barotrauma
|
||||
|
||||
}
|
||||
|
||||
public GUIProgressBar(Rectangle rect, Color color, GUIStyle style, float barSize, Alignment alignment, GUIComponent parent = null)
|
||||
public GUIProgressBar(Rectangle rect, Color color, string style, float barSize, Alignment alignment, GUIComponent parent = null)
|
||||
: base(style)
|
||||
{
|
||||
this.rect = rect;
|
||||
@@ -61,8 +61,6 @@ namespace Barotrauma
|
||||
|
||||
this.barSize = barSize;
|
||||
UpdateRect();
|
||||
|
||||
if (style != null) style.Apply(this);
|
||||
}
|
||||
|
||||
public override void ApplyStyle(GUIComponentStyle style)
|
||||
|
||||
@@ -88,18 +88,18 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public GUIScrollBar(Rectangle rect, GUIStyle style, float barSize, GUIComponent parent = null)
|
||||
public GUIScrollBar(Rectangle rect, string style, float barSize, GUIComponent parent = null)
|
||||
: this(rect, null, barSize, style, parent)
|
||||
{
|
||||
}
|
||||
|
||||
public GUIScrollBar(Rectangle rect, Color? color, float barSize, GUIStyle style = null, GUIComponent parent = null)
|
||||
public GUIScrollBar(Rectangle rect, Color? color, float barSize, string style = "", GUIComponent parent = null)
|
||||
: this(rect, color, barSize, Alignment.TopLeft, style, parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public GUIScrollBar(Rectangle rect, Color? color, float barSize, Alignment alignment, GUIStyle style = null, GUIComponent parent = null)
|
||||
public GUIScrollBar(Rectangle rect, Color? color, float barSize, Alignment alignment, string style = "", GUIComponent parent = null)
|
||||
: base(style)
|
||||
{
|
||||
this.rect = rect;
|
||||
@@ -118,7 +118,7 @@ namespace Barotrauma
|
||||
|
||||
this.barSize = barSize;
|
||||
|
||||
bar = new GUIButton(new Rectangle(0, 0, 0, 0), "", color, style, this);
|
||||
bar = new GUIButton(new Rectangle(0, 0, 0, 0), "", color, "", this);
|
||||
|
||||
bar.OnPressed = SelectBar;
|
||||
//AddChild(bar);
|
||||
|
||||
@@ -10,7 +10,6 @@ namespace Barotrauma
|
||||
|
||||
public GUIStyle(string file)
|
||||
{
|
||||
|
||||
componentStyles = new Dictionary<string, GUIComponentStyle>();
|
||||
|
||||
XDocument doc;
|
||||
@@ -32,15 +31,18 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public void Apply(GUIComponent targetComponent, GUIComponent parent = null)
|
||||
public void Apply(GUIComponent targetComponent, string styleName = "", GUIComponent parent = null)
|
||||
{
|
||||
GUIComponentStyle componentStyle = null;
|
||||
string name = (parent == null) ? targetComponent.GetType().Name.ToLowerInvariant() : parent.GetType().Name.ToLowerInvariant();
|
||||
componentStyles.TryGetValue(name, out componentStyle);
|
||||
|
||||
if (componentStyle==null)
|
||||
if (string.IsNullOrEmpty(styleName))
|
||||
{
|
||||
DebugConsole.ThrowError("Couldn't find a GUI style for "+targetComponent.GetType().Name);
|
||||
styleName = parent == null ? targetComponent.GetType().Name.ToLowerInvariant() : parent.GetType().Name.ToLowerInvariant();
|
||||
}
|
||||
|
||||
GUIComponentStyle componentStyle = null;
|
||||
|
||||
if (!componentStyles.TryGetValue(styleName, out componentStyle))
|
||||
{
|
||||
DebugConsole.ThrowError("Couldn't find a GUI style \""+ styleName+"\"");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -125,18 +125,18 @@ namespace Barotrauma
|
||||
get { return caretPos; }
|
||||
}
|
||||
|
||||
public GUITextBlock(Rectangle rect, string text, GUIStyle style, GUIComponent parent, ScalableFont font)
|
||||
public GUITextBlock(Rectangle rect, string text, string style, GUIComponent parent, ScalableFont font)
|
||||
: this(rect, text, style, Alignment.TopLeft, Alignment.TopLeft, parent, false, font)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public GUITextBlock(Rectangle rect, string text, GUIStyle style, GUIComponent parent = null, bool wrap = false)
|
||||
public GUITextBlock(Rectangle rect, string text, string style, GUIComponent parent = null, bool wrap = false)
|
||||
: this(rect, text, style, Alignment.TopLeft, Alignment.TopLeft, parent, wrap)
|
||||
{
|
||||
}
|
||||
|
||||
public GUITextBlock(Rectangle rect, string text, Color? color, Color? textColor, Alignment textAlignment = Alignment.Left, GUIStyle style = null, GUIComponent parent = null, bool wrap = false)
|
||||
public GUITextBlock(Rectangle rect, string text, Color? color, Color? textColor, Alignment textAlignment = Alignment.Left, string style = null, GUIComponent parent = null, bool wrap = false)
|
||||
: this(rect, text,color, textColor, Alignment.TopLeft, textAlignment, style, parent, wrap)
|
||||
{
|
||||
}
|
||||
@@ -156,15 +156,15 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
|
||||
public GUITextBlock(Rectangle rect, string text, Color? color, Color? textColor, Alignment alignment, Alignment textAlignment = Alignment.Left, GUIStyle style = null, GUIComponent parent = null, bool wrap = false)
|
||||
public GUITextBlock(Rectangle rect, string text, Color? color, Color? textColor, Alignment alignment, Alignment textAlignment = Alignment.Left, string style = null, GUIComponent parent = null, bool wrap = false)
|
||||
: this (rect, text, style, alignment, textAlignment, parent, wrap, null)
|
||||
{
|
||||
if (color != null) this.color = (Color)color;
|
||||
if (textColor != null) this.textColor = (Color)textColor;
|
||||
}
|
||||
|
||||
public GUITextBlock(Rectangle rect, string text, GUIStyle style, Alignment alignment = Alignment.TopLeft, Alignment textAlignment = Alignment.TopLeft, GUIComponent parent = null, bool wrap = false, ScalableFont font = null)
|
||||
:base (style)
|
||||
public GUITextBlock(Rectangle rect, string text, string style, Alignment alignment = Alignment.TopLeft, Alignment textAlignment = Alignment.TopLeft, GUIComponent parent = null, bool wrap = false, ScalableFont font = null)
|
||||
: base(style)
|
||||
{
|
||||
this.Font = font == null ? GUI.Font : font;
|
||||
|
||||
@@ -278,7 +278,7 @@ namespace Barotrauma
|
||||
Rectangle drawRect = rect;
|
||||
if (offset != Vector2.Zero) drawRect.Location += offset.ToPoint();
|
||||
|
||||
if (currColor.A * currColor.A > 0.0f) GUI.DrawRectangle(spriteBatch, rect, currColor * (currColor.A / 255.0f), true);
|
||||
//if (currColor.A * currColor.A > 0.0f) GUI.DrawRectangle(spriteBatch, rect, currColor * (currColor.A / 255.0f), true);
|
||||
|
||||
base.Draw(spriteBatch);
|
||||
|
||||
|
||||
@@ -152,19 +152,19 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public GUITextBox(Rectangle rect, GUIStyle style = null, GUIComponent parent = null)
|
||||
public GUITextBox(Rectangle rect, string style = null, GUIComponent parent = null)
|
||||
: this(rect, null, null, Alignment.Left, Alignment.Left, style, parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public GUITextBox(Rectangle rect, Alignment alignment = Alignment.Left, GUIStyle style = null, GUIComponent parent = null)
|
||||
public GUITextBox(Rectangle rect, Alignment alignment = Alignment.Left, string style = null, GUIComponent parent = null)
|
||||
: this(rect, null, null, alignment, Alignment.Left, style, parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public GUITextBox(Rectangle rect, Color? color, Color? textColor, Alignment alignment, Alignment textAlignment = Alignment.Left, GUIStyle style = null, GUIComponent parent = null)
|
||||
public GUITextBox(Rectangle rect, Color? color, Color? textColor, Alignment alignment, Alignment textAlignment = Alignment.Left, string style = null, GUIComponent parent = null)
|
||||
: base(style)
|
||||
{
|
||||
Enabled = true;
|
||||
@@ -184,7 +184,7 @@ namespace Barotrauma
|
||||
|
||||
Font = GUI.Font;
|
||||
|
||||
if (style != null) style.Apply(textBlock, this);
|
||||
GUI.Style.Apply(textBlock, "", this);
|
||||
textBlock.Padding = new Vector4(3.0f, 0.0f, 3.0f, 0.0f);
|
||||
|
||||
//previousMouse = PlayerInput.GetMouseState;
|
||||
|
||||
@@ -71,13 +71,15 @@ namespace Barotrauma
|
||||
if (parent != null)
|
||||
parent.AddChild(this);
|
||||
|
||||
box = new GUIFrame(rect, Color.DarkGray, null, this);
|
||||
box = new GUIFrame(rect, Color.DarkGray, "", this);
|
||||
box.HoverColor = Color.Gray;
|
||||
box.SelectedColor = Color.DarkGray;
|
||||
box.CanBeFocused = false;
|
||||
|
||||
text = new GUITextBlock(new Rectangle(rect.Right + 10, rect.Y+2, 20, rect.Height), label, GUI.Style, this, font);
|
||||
|
||||
GUI.Style.Apply(box, "", this);
|
||||
|
||||
text = new GUITextBlock(new Rectangle(rect.Right + 10, rect.Y+2, 20, rect.Height), label, "", this, font);
|
||||
|
||||
this.rect = new Rectangle(box.Rect.X, box.Rect.Y, 240, rect.Height);
|
||||
|
||||
Enabled = true;
|
||||
|
||||
@@ -226,10 +226,10 @@ namespace Barotrauma
|
||||
{
|
||||
if (teamIDs.Count > 1)
|
||||
{
|
||||
new GUITextBlock(new Rectangle(0, y - 20, 100, 20), CombatMission.GetTeamName(teamIDs[i]), GUI.Style, crewFrame);
|
||||
new GUITextBlock(new Rectangle(0, y - 20, 100, 20), CombatMission.GetTeamName(teamIDs[i]), "", crewFrame);
|
||||
}
|
||||
|
||||
GUIListBox crewList = new GUIListBox(new Rectangle(0, y, 280, listBoxHeight), Color.White * 0.7f, GUI.Style, crewFrame);
|
||||
GUIListBox crewList = new GUIListBox(new Rectangle(0, y, 280, listBoxHeight), Color.White * 0.7f, "", crewFrame);
|
||||
crewList.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
|
||||
crewList.OnSelected = SelectCrewCharacter;
|
||||
|
||||
@@ -275,7 +275,7 @@ namespace Barotrauma
|
||||
|
||||
var previewPlayer = new GUIFrame(
|
||||
new Rectangle(0, 0, 230, 300),
|
||||
new Color(0.0f, 0.0f, 0.0f, 0.8f), Alignment.TopRight, GUI.Style, crewFrame);
|
||||
new Color(0.0f, 0.0f, 0.0f, 0.8f), Alignment.TopRight, "", crewFrame);
|
||||
previewPlayer.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||
previewPlayer.UserData = "selectedcharacter";
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Barotrauma
|
||||
|
||||
CargoManager = new CargoManager();
|
||||
|
||||
endShiftButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 220, 20, 200, 25), "End shift", Alignment.TopLeft, GUI.Style);
|
||||
endShiftButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 220, 20, 200, 25), "End shift", Alignment.TopLeft, "");
|
||||
endShiftButton.Font = GUI.SmallFont;
|
||||
endShiftButton.OnClicked = TryEndShift;
|
||||
|
||||
@@ -301,11 +301,11 @@ namespace Barotrauma
|
||||
summaryScreen = summaryScreen.children[0];
|
||||
summaryScreen.RemoveChild(summaryScreen.children.Find(c => c is GUIButton));
|
||||
|
||||
var okButton = new GUIButton(new Rectangle(-120, 0, 100, 30), "Load game", Alignment.BottomRight, GUI.Style, summaryScreen);
|
||||
var okButton = new GUIButton(new Rectangle(-120, 0, 100, 30), "Load game", Alignment.BottomRight, "", summaryScreen);
|
||||
okButton.OnClicked += GameMain.GameSession.LoadPrevious;
|
||||
okButton.OnClicked += (GUIButton button, object obj) => { GUIMessageBox.MessageBoxes.Dequeue(); return true; };
|
||||
|
||||
var quitButton = new GUIButton(new Rectangle(0, 0, 100, 30), "Quit", Alignment.BottomRight, GUI.Style, summaryScreen);
|
||||
var quitButton = new GUIButton(new Rectangle(0, 0, 100, 30), "Quit", Alignment.BottomRight, "", summaryScreen);
|
||||
quitButton.OnClicked += GameMain.LobbyScreen.QuitToMainMenu;
|
||||
quitButton.OnClicked += (GUIButton button, object obj) => { GUIMessageBox.MessageBoxes.Dequeue(); return true; };
|
||||
}
|
||||
|
||||
@@ -151,16 +151,16 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
height += wrappedText.Split('\n').Length * 25;
|
||||
|
||||
var infoBlock = new GUIFrame(new Rectangle(-20, 20, width, height), null, Alignment.TopRight, GUI.Style);
|
||||
var infoBlock = new GUIFrame(new Rectangle(-20, 20, width, height), null, Alignment.TopRight, "");
|
||||
//infoBlock.Color = infoBlock.Color * 0.8f;
|
||||
infoBlock.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
|
||||
infoBlock.Flash(Color.Green);
|
||||
|
||||
var textBlock = new GUITextBlock(new Rectangle(10, 10, width - 40, height), text, GUI.Style, infoBlock, true);
|
||||
var textBlock = new GUITextBlock(new Rectangle(10, 10, width - 40, height), text, "", infoBlock, true);
|
||||
|
||||
if (hasButton)
|
||||
{
|
||||
var okButton = new GUIButton(new Rectangle(0, -40, 80, 25), "OK", Alignment.BottomCenter, GUI.Style, textBlock);
|
||||
var okButton = new GUIButton(new Rectangle(0, -40, 80, 25), "OK", Alignment.BottomCenter, "", textBlock);
|
||||
okButton.OnClicked = CloseInfoFrame;
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace Barotrauma
|
||||
|
||||
this.saveFile = saveFile;
|
||||
|
||||
infoButton = new GUIButton(new Rectangle(10, 10, 100, 20), "Info", GUI.Style, null);
|
||||
infoButton = new GUIButton(new Rectangle(10, 10, 100, 20), "Info", "", null);
|
||||
infoButton.OnClicked = ToggleInfoFrame;
|
||||
|
||||
if (gameModePreset != null) gameMode = gameModePreset.Instantiate(missionType);
|
||||
@@ -245,7 +245,7 @@ namespace Barotrauma
|
||||
{
|
||||
GUIFrame summaryFrame = shiftSummary.CreateSummaryFrame(endMessage);
|
||||
GUIMessageBox.MessageBoxes.Enqueue(summaryFrame);
|
||||
var okButton = new GUIButton(new Rectangle(0, 0, 100, 30), "Ok", Alignment.BottomRight, GUI.Style, summaryFrame.children[0]);
|
||||
var okButton = new GUIButton(new Rectangle(0, 0, 100, 30), "Ok", Alignment.BottomRight, "", summaryFrame.children[0]);
|
||||
okButton.OnClicked = (GUIButton button, object obj) => { GUIMessageBox.MessageBoxes.Dequeue(); return true; };
|
||||
}
|
||||
|
||||
@@ -298,26 +298,26 @@ namespace Barotrauma
|
||||
int width = 600, height = 400;
|
||||
|
||||
infoFrame = new GUIFrame(
|
||||
new Rectangle(GameMain.GraphicsWidth / 2 - width / 2, GameMain.GraphicsHeight / 2 - height / 2, width, height), GUI.Style);
|
||||
new Rectangle(GameMain.GraphicsWidth / 2 - width / 2, GameMain.GraphicsHeight / 2 - height / 2, width, height), "");
|
||||
|
||||
infoFrame.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
|
||||
|
||||
var crewButton = new GUIButton(new Rectangle(0, -30, 100, 20), "Crew", GUI.Style, infoFrame);
|
||||
var crewButton = new GUIButton(new Rectangle(0, -30, 100, 20), "Crew", "", infoFrame);
|
||||
crewButton.UserData = InfoFrameTab.Crew;
|
||||
crewButton.OnClicked = SelectInfoFrameTab;
|
||||
|
||||
var missionButton = new GUIButton(new Rectangle(100, -30, 100, 20), "Mission", GUI.Style, infoFrame);
|
||||
var missionButton = new GUIButton(new Rectangle(100, -30, 100, 20), "Mission", "", infoFrame);
|
||||
missionButton.UserData = InfoFrameTab.Mission;
|
||||
missionButton.OnClicked = SelectInfoFrameTab;
|
||||
|
||||
if (GameMain.Server != null)
|
||||
{
|
||||
var manageButton = new GUIButton(new Rectangle(200, -30, 130, 20), "Manage players", GUI.Style, infoFrame);
|
||||
var manageButton = new GUIButton(new Rectangle(200, -30, 130, 20), "Manage players", "", infoFrame);
|
||||
manageButton.UserData = InfoFrameTab.ManagePlayers;
|
||||
manageButton.OnClicked = SelectInfoFrameTab;
|
||||
}
|
||||
|
||||
var closeButton = new GUIButton(new Rectangle(0, 0, 80, 20), "Close", Alignment.BottomCenter, GUI.Style, infoFrame);
|
||||
var closeButton = new GUIButton(new Rectangle(0, 0, 80, 20), "Close", Alignment.BottomCenter, "", infoFrame);
|
||||
closeButton.OnClicked = ToggleInfoFrame;
|
||||
|
||||
}
|
||||
@@ -348,14 +348,14 @@ namespace Barotrauma
|
||||
{
|
||||
if (Mission == null)
|
||||
{
|
||||
new GUITextBlock(new Rectangle(0,0,0,50), "No mission", GUI.Style, infoFrame, true);
|
||||
new GUITextBlock(new Rectangle(0,0,0,50), "No mission", "", infoFrame, true);
|
||||
return;
|
||||
}
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 40), Mission.Name, GUI.Style, infoFrame, GUI.LargeFont);
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 40), Mission.Name, "", infoFrame, GUI.LargeFont);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 50, 0, 20), "Reward: "+Mission.Reward, GUI.Style, infoFrame, true);
|
||||
new GUITextBlock(new Rectangle(0, 70, 0, 50), Mission.Description, GUI.Style, infoFrame, true);
|
||||
new GUITextBlock(new Rectangle(0, 50, 0, 20), "Reward: "+Mission.Reward, "", infoFrame, true);
|
||||
new GUITextBlock(new Rectangle(0, 70, 0, 50), Mission.Description, "", infoFrame, true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Barotrauma
|
||||
GUIFrame frame = new GUIFrame(new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.Black * 0.8f);
|
||||
|
||||
int width = 760, height = 400;
|
||||
GUIFrame innerFrame = new GUIFrame(new Rectangle(0, 0, width, height), null, Alignment.Center, GUI.Style, frame);
|
||||
GUIFrame innerFrame = new GUIFrame(new Rectangle(0, 0, width, height), null, Alignment.Center, "", frame);
|
||||
|
||||
int y = 0;
|
||||
|
||||
@@ -46,22 +46,22 @@ namespace Barotrauma
|
||||
string summaryText = InfoTextManager.GetInfoText(gameOver ? "gameover" :
|
||||
(progress ? "progress" : "return"));
|
||||
|
||||
var infoText = new GUITextBlock(new Rectangle(0, y, 0, 50), summaryText, GUI.Style, innerFrame, true);
|
||||
var infoText = new GUITextBlock(new Rectangle(0, y, 0, 50), summaryText, "", innerFrame, true);
|
||||
y += infoText.Rect.Height;
|
||||
}
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(endMessage))
|
||||
{
|
||||
var endText = new GUITextBlock(new Rectangle(0, y, 0, 30), endMessage, GUI.Style, innerFrame, true);
|
||||
var endText = new GUITextBlock(new Rectangle(0, y, 0, 30), endMessage, "", innerFrame, true);
|
||||
|
||||
y += 30 + endText.Text.Split('\n').Length * 20;
|
||||
}
|
||||
|
||||
new GUITextBlock(new Rectangle(0, y, 0, 20), "Crew status:", GUI.Style, innerFrame, GUI.LargeFont);
|
||||
new GUITextBlock(new Rectangle(0, y, 0, 20), "Crew status:", "", innerFrame, GUI.LargeFont);
|
||||
y += 30;
|
||||
|
||||
GUIListBox listBox = new GUIListBox(new Rectangle(0,y,0,90), null, Alignment.TopLeft, GUI.Style, innerFrame, true);
|
||||
GUIListBox listBox = new GUIListBox(new Rectangle(0,y,0,90), null, Alignment.TopLeft, "", innerFrame, true);
|
||||
|
||||
int x = 0;
|
||||
foreach (Character character in gameSession.CrewManager.characters)
|
||||
@@ -72,7 +72,7 @@ namespace Barotrauma
|
||||
continue;
|
||||
}
|
||||
|
||||
var characterFrame = new GUIFrame(new Rectangle(x, y, 170, 70), Color.Transparent, GUI.Style, listBox);
|
||||
var characterFrame = new GUIFrame(new Rectangle(x, y, 170, 70), Color.Transparent, "", listBox);
|
||||
characterFrame.OutlineColor = Color.Transparent;
|
||||
characterFrame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||
characterFrame.CanBeFocused = false;
|
||||
@@ -105,7 +105,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 20), statusText,
|
||||
GUI.Style, Alignment.BottomLeft, Alignment.TopCenter, characterFrame, true, GUI.SmallFont).Color = statusColor * 0.7f;
|
||||
"", Alignment.BottomLeft, Alignment.TopCenter, characterFrame, true, GUI.SmallFont).Color = statusColor * 0.7f;
|
||||
|
||||
x += characterFrame.Rect.Width + 10;
|
||||
}
|
||||
@@ -114,17 +114,17 @@ namespace Barotrauma
|
||||
|
||||
if (GameMain.GameSession.Mission != null)
|
||||
{
|
||||
new GUITextBlock(new Rectangle(0, y, 0, 20), "Mission: " + GameMain.GameSession.Mission.Name, GUI.Style, innerFrame, GUI.LargeFont);
|
||||
new GUITextBlock(new Rectangle(0, y, 0, 20), "Mission: " + GameMain.GameSession.Mission.Name, "", innerFrame, GUI.LargeFont);
|
||||
y += 30;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, y, innerFrame.Rect.Width - 170, 0),
|
||||
(GameMain.GameSession.Mission.Completed) ? GameMain.GameSession.Mission.SuccessMessage : GameMain.GameSession.Mission.FailureMessage,
|
||||
GUI.Style, innerFrame, true);
|
||||
"", innerFrame, true);
|
||||
//y += 50;
|
||||
|
||||
if (GameMain.GameSession.Mission.Completed && singleplayer)
|
||||
{
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 30), "Reward: " + GameMain.GameSession.Mission.Reward, GUI.Style, Alignment.BottomLeft, Alignment.BottomLeft, innerFrame);
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 30), "Reward: " + GameMain.GameSession.Mission.Reward, "", Alignment.BottomLeft, Alignment.BottomLeft, innerFrame);
|
||||
//y += 30;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,14 +317,14 @@ namespace Barotrauma
|
||||
|
||||
private void CreateSettingsFrame()
|
||||
{
|
||||
settingsFrame = new GUIFrame(new Rectangle(0, 0, 500, 500), null, Alignment.Center, GUI.Style);
|
||||
settingsFrame = new GUIFrame(new Rectangle(0, 0, 500, 500), null, Alignment.Center, "");
|
||||
|
||||
new GUITextBlock(new Rectangle(0,-30,0,30), "Settings",GUI.Style,Alignment.TopCenter, Alignment.TopCenter, settingsFrame, false, GUI.LargeFont);
|
||||
new GUITextBlock(new Rectangle(0, -30, 0, 30), "Settings", "", Alignment.TopCenter, Alignment.TopCenter, settingsFrame, false, GUI.LargeFont);
|
||||
|
||||
int x=0, y = 10;
|
||||
int x = 0, y = 10;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, y, 20, 20), "Resolution", GUI.Style, Alignment.TopLeft, Alignment.TopLeft, settingsFrame);
|
||||
var resolutionDD = new GUIDropDown(new Rectangle(0, y + 20, 180, 20), "", GUI.Style, settingsFrame);
|
||||
new GUITextBlock(new Rectangle(0, y, 20, 20), "Resolution", "", Alignment.TopLeft, Alignment.TopLeft, settingsFrame);
|
||||
var resolutionDD = new GUIDropDown(new Rectangle(0, y + 20, 180, 20), "", "", settingsFrame);
|
||||
resolutionDD.OnSelected = SelectResolution;
|
||||
|
||||
var supportedModes = new List<DisplayMode>();
|
||||
@@ -349,8 +349,8 @@ namespace Barotrauma
|
||||
//fullScreenTick.OnSelected = ToggleFullScreen;
|
||||
//fullScreenTick.Selected = FullScreenEnabled;
|
||||
|
||||
new GUITextBlock(new Rectangle(x, y, 20, 20), "Display mode", GUI.Style, Alignment.TopLeft, Alignment.TopLeft, settingsFrame);
|
||||
var displayModeDD = new GUIDropDown(new Rectangle(x, y + 20, 180, 20), "", GUI.Style, settingsFrame);
|
||||
new GUITextBlock(new Rectangle(x, y, 20, 20), "Display mode", "", Alignment.TopLeft, Alignment.TopLeft, settingsFrame);
|
||||
var displayModeDD = new GUIDropDown(new Rectangle(x, y + 20, 180, 20), "", "", settingsFrame);
|
||||
displayModeDD.AddItem("Fullscreen", WindowMode.Fullscreen);
|
||||
displayModeDD.AddItem("Windowed", WindowMode.Windowed);
|
||||
displayModeDD.AddItem("Borderless windowed", WindowMode.BorderlessWindowed);
|
||||
@@ -375,14 +375,14 @@ namespace Barotrauma
|
||||
|
||||
y += 70;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, y, 100, 20), "Sound volume:", GUI.Style, settingsFrame);
|
||||
GUIScrollBar soundScrollBar = new GUIScrollBar(new Rectangle(0, y + 20, 150, 20), GUI.Style, 0.1f, settingsFrame);
|
||||
new GUITextBlock(new Rectangle(0, y, 100, 20), "Sound volume:", "", settingsFrame);
|
||||
GUIScrollBar soundScrollBar = new GUIScrollBar(new Rectangle(0, y + 20, 150, 20), "", 0.1f, settingsFrame);
|
||||
soundScrollBar.BarScroll = SoundVolume;
|
||||
soundScrollBar.OnMoved = ChangeSoundVolume;
|
||||
soundScrollBar.Step = 0.05f;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, y + 40, 100, 20), "Music volume:", GUI.Style, settingsFrame);
|
||||
GUIScrollBar musicScrollBar = new GUIScrollBar(new Rectangle(0, y + 60, 150, 20), GUI.Style, 0.1f, settingsFrame);
|
||||
new GUITextBlock(new Rectangle(0, y + 40, 100, 20), "Music volume:", "", settingsFrame);
|
||||
GUIScrollBar musicScrollBar = new GUIScrollBar(new Rectangle(0, y + 60, 150, 20), "", 0.1f, settingsFrame);
|
||||
musicScrollBar.BarScroll = MusicVolume;
|
||||
musicScrollBar.OnMoved = ChangeMusicVolume;
|
||||
musicScrollBar.Step = 0.05f;
|
||||
@@ -390,8 +390,8 @@ namespace Barotrauma
|
||||
x = 200;
|
||||
y = 10;
|
||||
|
||||
new GUITextBlock(new Rectangle(x, y, 20, 20), "Content package", GUI.Style, Alignment.TopLeft, Alignment.TopLeft, settingsFrame);
|
||||
var contentPackageDD = new GUIDropDown(new Rectangle(x, y + 20, 200, 20), "", GUI.Style, settingsFrame);
|
||||
new GUITextBlock(new Rectangle(x, y, 20, 20), "Content package", "", Alignment.TopLeft, Alignment.TopLeft, settingsFrame);
|
||||
var contentPackageDD = new GUIDropDown(new Rectangle(x, y + 20, 200, 20), "", "", settingsFrame);
|
||||
|
||||
foreach (ContentPackage contentPackage in ContentPackage.list)
|
||||
{
|
||||
@@ -401,13 +401,13 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
y += 50;
|
||||
new GUITextBlock(new Rectangle(x, y, 100, 20), "Controls:", GUI.Style, settingsFrame);
|
||||
new GUITextBlock(new Rectangle(x, y, 100, 20), "Controls:", "", settingsFrame);
|
||||
y += 30;
|
||||
var inputNames = Enum.GetNames(typeof(InputType));
|
||||
for (int i = 0; i< inputNames.Length; i++)
|
||||
{
|
||||
new GUITextBlock(new Rectangle(x, y, 100, 20), inputNames[i]+": ", GUI.Style, settingsFrame);
|
||||
var keyBox = new GUITextBox(new Rectangle(x + 100, y, 120, 15), GUI.Style, settingsFrame);
|
||||
new GUITextBlock(new Rectangle(x, y, 100, 20), inputNames[i]+": ", "", settingsFrame);
|
||||
var keyBox = new GUITextBox(new Rectangle(x + 100, y, 120, 15), "", settingsFrame);
|
||||
|
||||
keyBox.Text = keyMapping[i].ToString();
|
||||
keyBox.UserData = i;
|
||||
@@ -417,7 +417,7 @@ namespace Barotrauma
|
||||
y += 20;
|
||||
}
|
||||
|
||||
applyButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Apply", Alignment.BottomRight, GUI.Style, settingsFrame);
|
||||
applyButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Apply", Alignment.BottomRight, "", settingsFrame);
|
||||
applyButton.OnClicked = ApplyClicked;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Barotrauma
|
||||
|
||||
useOnSelfButton[i - 3] = new GUIButton(
|
||||
new Rectangle((int) SlotPositions[i].X, (int) (SlotPositions[i].Y - spacing - rectHeight),
|
||||
rectWidth, rectHeight), "Use", GUI.Style)
|
||||
rectWidth, rectHeight), "Use", "")
|
||||
{
|
||||
UserData = i,
|
||||
OnClicked = UseItemOnSelf
|
||||
|
||||
@@ -308,7 +308,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
guiFrame = new GUIFrame(
|
||||
new Rectangle((int)rect.X, (int)rect.Y, (int)rect.Z, (int)rect.W),
|
||||
new Color(color.X, color.Y, color.Z) * color.W, alignment, GUI.Style);
|
||||
new Color(color.X, color.Y, color.Z) * color.W, alignment, "");
|
||||
//guiFrame.Alpha = color.W;
|
||||
|
||||
break;
|
||||
|
||||
@@ -22,9 +22,9 @@ namespace Barotrauma.Items.Components
|
||||
public Deconstructor(Item item, XElement element)
|
||||
: base(item, element)
|
||||
{
|
||||
progressBar = new GUIProgressBar(new Rectangle(0,0,200,20), Color.Green, GUI.Style, 0.0f, Alignment.BottomCenter, GuiFrame);
|
||||
progressBar = new GUIProgressBar(new Rectangle(0,0,200,20), Color.Green, "", 0.0f, Alignment.BottomCenter, GuiFrame);
|
||||
|
||||
activateButton = new GUIButton(new Rectangle(0, 0, 200, 20), "Deconstruct", Alignment.TopCenter, GUI.Style, GuiFrame);
|
||||
activateButton = new GUIButton(new Rectangle(0, 0, 200, 20), "Deconstruct", Alignment.TopCenter, "", GuiFrame);
|
||||
activateButton.OnClicked = ToggleActive;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
IsActive = true;
|
||||
|
||||
var button = new GUIButton(new Rectangle(160, 50, 30, 30), "-", GUI.Style, GuiFrame);
|
||||
var button = new GUIButton(new Rectangle(160, 50, 30, 30), "-", "", GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
targetForce -= 1.0f;
|
||||
@@ -58,7 +58,7 @@ namespace Barotrauma.Items.Components
|
||||
return true;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(200, 50, 30, 30), "+", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(200, 50, 30, 30), "+", "", GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
targetForce += 1.0f;
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
GuiFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
|
||||
|
||||
itemList = new GUIListBox(new Rectangle(0,0,GuiFrame.Rect.Width/2-20,0), GUI.Style, GuiFrame);
|
||||
itemList = new GUIListBox(new Rectangle(0,0,GuiFrame.Rect.Width/2-20,0), "", GuiFrame);
|
||||
itemList.OnSelected = SelectItem;
|
||||
|
||||
foreach (FabricableItem fi in fabricableItems)
|
||||
@@ -158,7 +158,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
selectedItemFrame.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
|
||||
|
||||
progressBar = new GUIProgressBar(new Rectangle(0, 0, 0, 20), Color.Green, GUI.Style, 0.0f, Alignment.BottomCenter, selectedItemFrame);
|
||||
progressBar = new GUIProgressBar(new Rectangle(0, 0, 0, 20), Color.Green, "", 0.0f, Alignment.BottomCenter, selectedItemFrame);
|
||||
progressBar.IsHorizontal = true;
|
||||
|
||||
if (targetItem.TargetItem.sprite != null)
|
||||
@@ -184,7 +184,7 @@ namespace Barotrauma.Items.Components
|
||||
var description = new GUITextBlock(
|
||||
new Rectangle(0, y, 0, 0),
|
||||
targetItem.TargetItem.Description,
|
||||
GUI.Style, Alignment.TopLeft, Alignment.TopLeft,
|
||||
"", Alignment.TopLeft, Alignment.TopLeft,
|
||||
selectedItemFrame, true, GUI.SmallFont);
|
||||
|
||||
y += description.Rect.Height + 10;
|
||||
@@ -228,7 +228,7 @@ namespace Barotrauma.Items.Components
|
||||
Alignment.TopLeft, null,
|
||||
selectedItemFrame);
|
||||
|
||||
activateButton = new GUIButton(new Rectangle(0, -30, 100, 20), "Create", Color.White, Alignment.CenterX | Alignment.Bottom, GUI.Style, selectedItemFrame);
|
||||
activateButton = new GUIButton(new Rectangle(0, -30, 100, 20), "Create", Color.White, Alignment.CenterX | Alignment.Bottom, "", selectedItemFrame);
|
||||
activateButton.OnClicked = StartButtonClicked;
|
||||
activateButton.UserData = targetItem;
|
||||
activateButton.Enabled = false;
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Barotrauma.Items.Components
|
||||
return true;
|
||||
};
|
||||
|
||||
var button = new GUIButton(new Rectangle(160, 40, 35, 30), "OUT", GUI.Style, GuiFrame);
|
||||
var button = new GUIButton(new Rectangle(160, 40, 35, 30), "OUT", "", GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
FlowPercentage -= 10.0f;
|
||||
@@ -88,7 +88,7 @@ namespace Barotrauma.Items.Components
|
||||
return true;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(210, 40, 35, 30), "IN", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(210, 40, 35, 30), "IN", "", GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
FlowPercentage += 10.0f;
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
IsActive = true;
|
||||
|
||||
var button = new GUIButton(new Rectangle(410, 70, 40, 40), "-", GUI.Style, GuiFrame);
|
||||
var button = new GUIButton(new Rectangle(410, 70, 40, 40), "-", "", GuiFrame);
|
||||
button.OnPressed = () =>
|
||||
{
|
||||
unsentChanges = true;
|
||||
@@ -170,7 +170,7 @@ namespace Barotrauma.Items.Components
|
||||
return false;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(460, 70, 40,40), "+", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(460, 70, 40,40), "+", "", GuiFrame);
|
||||
button.OnPressed = () =>
|
||||
{
|
||||
unsentChanges = true;
|
||||
@@ -182,7 +182,7 @@ namespace Barotrauma.Items.Components
|
||||
autoTempTickBox = new GUITickBox(new Rectangle(410, 170, 20, 20), "Automatic temperature control", Alignment.TopLeft, GuiFrame);
|
||||
autoTempTickBox.OnSelected = ToggleAutoTemp;
|
||||
|
||||
button = new GUIButton(new Rectangle(210, 290, 40, 40), "+", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(210, 290, 40, 40), "+", "", GuiFrame);
|
||||
button.OnPressed = () =>
|
||||
{
|
||||
unsentChanges = true;
|
||||
@@ -191,7 +191,7 @@ namespace Barotrauma.Items.Components
|
||||
return false;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(210, 340, 40, 40), "-", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(210, 340, 40, 40), "-", "", GuiFrame);
|
||||
button.OnPressed = () =>
|
||||
{
|
||||
unsentChanges = true;
|
||||
@@ -200,7 +200,7 @@ namespace Barotrauma.Items.Components
|
||||
return false;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(500, 290, 40, 40), "+", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(500, 290, 40, 40), "+", "", GuiFrame);
|
||||
button.OnPressed = () =>
|
||||
{
|
||||
unsentChanges = true;
|
||||
@@ -209,7 +209,7 @@ namespace Barotrauma.Items.Components
|
||||
return false;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(500, 340, 40, 40), "-", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(500, 340, 40, 40), "-", "", GuiFrame);
|
||||
button.OnPressed = () =>
|
||||
{
|
||||
unsentChanges = true;
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (canBeSelected)
|
||||
{
|
||||
var button = new GUIButton(new Rectangle(160, 50, 30,30), "-", GUI.Style, GuiFrame);
|
||||
var button = new GUIButton(new Rectangle(160, 50, 30,30), "-", "", GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
RechargeSpeed = Math.Max(rechargeSpeed - maxRechargeSpeed * 0.1f, 0.0f);
|
||||
@@ -93,7 +93,7 @@ namespace Barotrauma.Items.Components
|
||||
return true;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(200, 50, 30, 30), "+", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(200, 50, 30, 30), "+", "", GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
RechargeSpeed = Math.Max(rechargeSpeed + maxRechargeSpeed * 0.1f, 0.0f);
|
||||
|
||||
@@ -83,11 +83,11 @@ namespace Barotrauma
|
||||
int width = 400, height = 500;
|
||||
int y = 0;
|
||||
|
||||
frame = new GUIFrame(new Rectangle(0, 0, width, height), null, Alignment.Center, GUI.Style);
|
||||
frame = new GUIFrame(new Rectangle(0, 0, width, height), null, Alignment.Center, "");
|
||||
frame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
|
||||
frame.UserData = item;
|
||||
|
||||
new GUITextBlock(new Rectangle(0,0,200,20), "Attempting to fix " + item.Name, GUI.Style, frame);
|
||||
new GUITextBlock(new Rectangle(0,0,200,20), "Attempting to fix " + item.Name, "", frame);
|
||||
|
||||
y = y + 40;
|
||||
foreach (FixRequirement requirement in item.FixRequirements)
|
||||
@@ -98,7 +98,7 @@ namespace Barotrauma
|
||||
reqFrame.UserData = requirement;
|
||||
|
||||
|
||||
var fixButton = new GUIButton(new Rectangle(0, 0, 50, 20), "Fix", GUI.Style, reqFrame);
|
||||
var fixButton = new GUIButton(new Rectangle(0, 0, 50, 20), "Fix", "", reqFrame);
|
||||
fixButton.OnClicked = FixButtonPressed;
|
||||
fixButton.UserData = requirement;
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace Barotrauma
|
||||
int y2 = 20;
|
||||
foreach (string itemName in requirement.requiredItems)
|
||||
{
|
||||
var itemBlock = new GUITextBlock(new Rectangle(30, y2, 200, 15), itemName, GUI.Style, reqFrame);
|
||||
var itemBlock = new GUITextBlock(new Rectangle(30, y2, 200, 15), itemName, "", reqFrame);
|
||||
itemBlock.Font = GUI.SmallFont;
|
||||
itemBlock.UserData = itemName;
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace Barotrauma
|
||||
y2 = 20;
|
||||
foreach (Skill skill in requirement.requiredSkills)
|
||||
{
|
||||
var skillBlock = new GUITextBlock(new Rectangle(0, y2, 200, 15), skill.Name + " - " + skill.Level, GUI.Style, Alignment.Right, Alignment.TopLeft, reqFrame);
|
||||
var skillBlock = new GUITextBlock(new Rectangle(0, y2, 200, 15), skill.Name + " - " + skill.Level, "", Alignment.Right, Alignment.TopLeft, reqFrame);
|
||||
skillBlock.Font = GUI.SmallFont;
|
||||
skillBlock.UserData = skill;
|
||||
|
||||
|
||||
@@ -1051,11 +1051,11 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
editingHUD = new GUIFrame(new Rectangle(x, y, width, 70 + (editableProperties.Count + requiredItemCount) * 30), GUI.Style);
|
||||
editingHUD = new GUIFrame(new Rectangle(x, y, width, 70 + (editableProperties.Count + requiredItemCount) * 30), "");
|
||||
editingHUD.Padding = new Vector4(10, 10, 0, 0);
|
||||
editingHUD.UserData = this;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 100, 20), prefab.Name, GUI.Style,
|
||||
new GUITextBlock(new Rectangle(0, 0, 100, 20), prefab.Name, "",
|
||||
Alignment.TopLeft, Alignment.TopLeft, editingHUD, false, GUI.LargeFont);
|
||||
|
||||
y += 20;
|
||||
@@ -1065,15 +1065,15 @@ namespace Barotrauma
|
||||
if (prefab.IsLinkable)
|
||||
{
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 20), "Hold space to link to another item",
|
||||
GUI.Style, Alignment.TopRight, Alignment.TopRight, editingHUD).Font = GUI.SmallFont;
|
||||
"", Alignment.TopRight, Alignment.TopRight, editingHUD).Font = GUI.SmallFont;
|
||||
y += 25;
|
||||
}
|
||||
foreach (ItemComponent ic in components)
|
||||
{
|
||||
foreach (RelatedItem relatedItem in ic.requiredItems)
|
||||
{
|
||||
new GUITextBlock(new Rectangle(0, y, 100, 20), ic.Name + ": " + relatedItem.Type.ToString() + " required", GUI.Style, editingHUD);
|
||||
GUITextBox namesBox = new GUITextBox(new Rectangle(-10, y, 160, 20), Alignment.Right, GUI.Style, editingHUD);
|
||||
new GUITextBlock(new Rectangle(0, y, 100, 20), ic.Name + ": " + relatedItem.Type.ToString() + " required", "", editingHUD);
|
||||
GUITextBox namesBox = new GUITextBox(new Rectangle(-10, y, 160, 20), Alignment.Right, "", editingHUD);
|
||||
|
||||
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (relatedItem);
|
||||
PropertyDescriptor property = properties.Find("JoinedNames", false);
|
||||
@@ -1110,9 +1110,9 @@ namespace Barotrauma
|
||||
else
|
||||
{
|
||||
|
||||
new GUITextBlock(new Rectangle(0, y, 100, 20), objectProperty.Name, Color.Transparent, Color.White, Alignment.Left, GUI.Style, editingHUD);
|
||||
new GUITextBlock(new Rectangle(0, y, 100, 20), objectProperty.Name, Color.Transparent, Color.White, Alignment.Left, "", editingHUD);
|
||||
|
||||
GUITextBox propertyBox = new GUITextBox(new Rectangle(180, y, 250, height), GUI.Style, editingHUD);
|
||||
GUITextBox propertyBox = new GUITextBox(new Rectangle(180, y, 250, height), "", editingHUD);
|
||||
if (height > 20) propertyBox.Wrap = true;
|
||||
|
||||
if (value != null)
|
||||
|
||||
@@ -187,18 +187,18 @@ namespace Barotrauma
|
||||
int width = 450;
|
||||
int x = GameMain.GraphicsWidth / 2 - width / 2, y = 10;
|
||||
|
||||
editingHUD = new GUIFrame(new Rectangle(x, y, width, 100), GUI.Style);
|
||||
editingHUD = new GUIFrame(new Rectangle(x, y, width, 100), "");
|
||||
editingHUD.Padding = new Vector4(10, 10, 0, 0);
|
||||
editingHUD.UserData = this;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 100, 20), "Linked submarine", GUI.Style,
|
||||
new GUITextBlock(new Rectangle(0, 0, 100, 20), "Linked submarine", "",
|
||||
Alignment.TopLeft, Alignment.TopLeft, editingHUD, false, GUI.LargeFont);
|
||||
|
||||
var pathBox = new GUITextBox(new Rectangle(10,30,300,20), GUI.Style, editingHUD);
|
||||
var pathBox = new GUITextBox(new Rectangle(10,30,300,20), "", editingHUD);
|
||||
pathBox.Font = GUI.SmallFont;
|
||||
pathBox.Text = filePath;
|
||||
|
||||
var reloadButton = new GUIButton(new Rectangle(320,30,80,20), "Refresh", GUI.Style, editingHUD);
|
||||
var reloadButton = new GUIButton(new Rectangle(320,30,80,20), "Refresh", "", editingHUD);
|
||||
reloadButton.OnClicked = Reload;
|
||||
reloadButton.UserData = pathBox;
|
||||
|
||||
@@ -209,7 +209,7 @@ namespace Barotrauma
|
||||
if (!inGame)
|
||||
{
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 20), "Hold space to link to a docking port",
|
||||
GUI.Style, Alignment.TopRight, Alignment.TopRight, editingHUD, false, GUI.SmallFont);
|
||||
"", Alignment.TopRight, Alignment.TopRight, editingHUD, false, GUI.SmallFont);
|
||||
y += 25;
|
||||
|
||||
}
|
||||
|
||||
@@ -657,7 +657,7 @@ namespace Barotrauma
|
||||
|
||||
highlightedListBox = new GUIListBox(
|
||||
new Rectangle((int)PlayerInput.MousePosition.X+15, (int)PlayerInput.MousePosition.Y+15, 150, highlightedEntities.Count * 15),
|
||||
null, Alignment.TopLeft, GUI.Style, null, false);
|
||||
null, Alignment.TopLeft, "", null, false);
|
||||
|
||||
highlightedListBox.Color = Color.Black * 0.6f;
|
||||
|
||||
@@ -665,7 +665,7 @@ namespace Barotrauma
|
||||
{
|
||||
var textBlock = new GUITextBlock(
|
||||
new Rectangle(0,0,0,15),
|
||||
ToolBox.LimitString(entity.Name, GUI.SmallFont, 140), GUI.Style, highlightedListBox, GUI.SmallFont);
|
||||
ToolBox.LimitString(entity.Name, GUI.SmallFont, 140), "", highlightedListBox, GUI.SmallFont);
|
||||
|
||||
textBlock.UserData = entity;
|
||||
}
|
||||
|
||||
@@ -272,28 +272,28 @@ namespace Barotrauma
|
||||
|
||||
if (spawnType == SpawnType.Path)
|
||||
{
|
||||
new GUITextBlock(new Rectangle(0, 0, 100, 20), "Editing waypoint", GUI.Style, editingHUD);
|
||||
new GUITextBlock(new Rectangle(0, 20, 100, 20), "Hold space to link to another waypoint", GUI.Style, editingHUD);
|
||||
new GUITextBlock(new Rectangle(0, 0, 100, 20), "Editing waypoint", "", editingHUD);
|
||||
new GUITextBlock(new Rectangle(0, 20, 100, 20), "Hold space to link to another waypoint", "", editingHUD);
|
||||
}
|
||||
else
|
||||
{
|
||||
new GUITextBlock(new Rectangle(0, 0, 100, 20), "Editing spawnpoint", GUI.Style, editingHUD);
|
||||
new GUITextBlock(new Rectangle(0, 25, 100, 20), "Spawn type: ", GUI.Style, editingHUD);
|
||||
new GUITextBlock(new Rectangle(0, 0, 100, 20), "Editing spawnpoint", "", editingHUD);
|
||||
new GUITextBlock(new Rectangle(0, 25, 100, 20), "Spawn type: ", "", editingHUD);
|
||||
|
||||
var spawnTypeText = new GUITextBlock(new Rectangle(0, 25, 200, 20), spawnType.ToString(), GUI.Style, Alignment.Right, Alignment.TopLeft, editingHUD);
|
||||
var spawnTypeText = new GUITextBlock(new Rectangle(0, 25, 200, 20), spawnType.ToString(), "", Alignment.Right, Alignment.TopLeft, editingHUD);
|
||||
|
||||
var button = new GUIButton(new Rectangle(-30,0,20,20), "-", Alignment.Right, GUI.Style, spawnTypeText);
|
||||
var button = new GUIButton(new Rectangle(-30,0,20,20), "-", Alignment.Right, "", spawnTypeText);
|
||||
button.UserData = -1;
|
||||
button.OnClicked = ChangeSpawnType;
|
||||
|
||||
button = new GUIButton(new Rectangle(0, 0, 20, 20), "+", Alignment.Right, GUI.Style, spawnTypeText);
|
||||
button = new GUIButton(new Rectangle(0, 0, 20, 20), "+", Alignment.Right, "", spawnTypeText);
|
||||
button.UserData = 1;
|
||||
button.OnClicked = ChangeSpawnType;
|
||||
|
||||
y = 40 + 20;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, y, 100, 20), "ID Card tags:", Color.Transparent, Color.White, Alignment.TopLeft, null, editingHUD);
|
||||
GUITextBox propertyBox = new GUITextBox(new Rectangle(100, y, 200, 20), GUI.Style, editingHUD);
|
||||
GUITextBox propertyBox = new GUITextBox(new Rectangle(100, y, 200, 20), "", editingHUD);
|
||||
propertyBox.Text = string.Join(", ", idCardTags);
|
||||
propertyBox.OnEnterPressed = EnterIDCardTags;
|
||||
propertyBox.OnTextChanged = TextBoxChanged;
|
||||
@@ -302,7 +302,7 @@ namespace Barotrauma
|
||||
y = y + 30;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, y, 100, 20), "Assigned job:", Color.Transparent, Color.White, Alignment.TopLeft, null, editingHUD);
|
||||
propertyBox = new GUITextBox(new Rectangle(100, y, 200, 20), GUI.Style, editingHUD);
|
||||
propertyBox = new GUITextBox(new Rectangle(100, y, 200, 20), "", editingHUD);
|
||||
propertyBox.Text = (assignedJob == null) ? "None" : assignedJob.Name;
|
||||
propertyBox.OnEnterPressed = EnterAssignedJob;
|
||||
propertyBox.OnTextChanged = TextBoxChanged;
|
||||
|
||||
@@ -93,24 +93,24 @@ namespace Barotrauma.Networking
|
||||
|
||||
public GUIComponent CreateBanFrame(GUIComponent parent)
|
||||
{
|
||||
banFrame = new GUIListBox(new Rectangle(0, 0, 0, 0), GUI.Style, parent);
|
||||
banFrame = new GUIListBox(new Rectangle(0, 0, 0, 0), "", parent);
|
||||
|
||||
foreach (BannedPlayer bannedPlayer in bannedPlayers)
|
||||
{
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, 0, 25),
|
||||
bannedPlayer.IP + " (" + bannedPlayer.Name + ")",
|
||||
GUI.Style,
|
||||
"",
|
||||
Alignment.Left, Alignment.Left, banFrame);
|
||||
textBlock.Padding = new Vector4(10.0f, 10.0f, 0.0f, 0.0f);
|
||||
textBlock.UserData = banFrame;
|
||||
|
||||
var removeButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Remove", Alignment.Right | Alignment.CenterY, GUI.Style, textBlock);
|
||||
var removeButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Remove", Alignment.Right | Alignment.CenterY, "", textBlock);
|
||||
removeButton.UserData = bannedPlayer;
|
||||
removeButton.OnClicked = RemoveBan;
|
||||
if (bannedPlayer.IP.IndexOf(".x") <= -1)
|
||||
{
|
||||
var rangeBanButton = new GUIButton(new Rectangle(-100, 0, 100, 20), "Ban range", Alignment.Right | Alignment.CenterY, GUI.Style, textBlock);
|
||||
var rangeBanButton = new GUIButton(new Rectangle(-100, 0, 100, 20), "Ban range", Alignment.Right | Alignment.CenterY, "", textBlock);
|
||||
rangeBanButton.UserData = bannedPlayer;
|
||||
rangeBanButton.OnClicked = RangeBan;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace Barotrauma.Networking
|
||||
endVoteTickBox.OnSelected = ToggleEndRoundVote;
|
||||
endVoteTickBox.Visible = false;
|
||||
|
||||
endRoundButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 170 - 170, 20, 150, 20), "End round", Alignment.TopLeft, GUI.Style, inGameHUD);
|
||||
endRoundButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 170 - 170, 20, 150, 20), "End round", Alignment.TopLeft, "", inGameHUD);
|
||||
endRoundButton.OnClicked = (btn, userdata) =>
|
||||
{
|
||||
if (!permissions.HasFlag(ClientPermissions.EndRound)) return false;
|
||||
@@ -924,19 +924,19 @@ namespace Barotrauma.Networking
|
||||
|
||||
if (HasPermission(ClientPermissions.Ban))
|
||||
{
|
||||
var banButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Ban", Alignment.BottomRight, GUI.Style, characterFrame);
|
||||
var banButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Ban", Alignment.BottomRight, "", characterFrame);
|
||||
banButton.UserData = character.Name;
|
||||
banButton.OnClicked += GameMain.NetLobbyScreen.BanPlayer;
|
||||
}
|
||||
if (HasPermission(ClientPermissions.Kick))
|
||||
{
|
||||
var kickButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Kick", Alignment.BottomLeft, GUI.Style, characterFrame);
|
||||
var kickButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Kick", Alignment.BottomLeft, "", characterFrame);
|
||||
kickButton.UserData = character.Name;
|
||||
kickButton.OnClicked += GameMain.NetLobbyScreen.KickPlayer;
|
||||
}
|
||||
else if (Voting.AllowVoteKick)
|
||||
{
|
||||
var kickVoteButton = new GUIButton(new Rectangle(0, 0, 120, 20), "Vote to Kick", Alignment.BottomLeft, GUI.Style, characterFrame);
|
||||
var kickVoteButton = new GUIButton(new Rectangle(0, 0, 120, 20), "Vote to Kick", Alignment.BottomLeft, "", characterFrame);
|
||||
|
||||
if (GameMain.NetworkMember.ConnectedClients != null)
|
||||
{
|
||||
|
||||
@@ -96,11 +96,11 @@ namespace Barotrauma.Networking
|
||||
|
||||
//----------------------------------------
|
||||
|
||||
var endRoundButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 170, 20, 150, 20), "End round", Alignment.TopLeft, GUI.Style, inGameHUD);
|
||||
var endRoundButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 170, 20, 150, 20), "End round", Alignment.TopLeft, "", inGameHUD);
|
||||
endRoundButton.OnClicked = (btn, userdata) => { EndGame(); return true; };
|
||||
|
||||
log = new ServerLog(name);
|
||||
showLogButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 170 - 170, 20, 150, 20), "Server Log", Alignment.TopLeft, GUI.Style, inGameHUD);
|
||||
showLogButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 170 - 170, 20, 150, 20), "Server Log", Alignment.TopLeft, "", inGameHUD);
|
||||
showLogButton.OnClicked = (GUIButton button, object userData) =>
|
||||
{
|
||||
if (log.LogFrame == null)
|
||||
@@ -115,7 +115,7 @@ namespace Barotrauma.Networking
|
||||
return true;
|
||||
};
|
||||
|
||||
GUIButton settingsButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 170 - 170 - 170, 20, 150, 20), "Settings", Alignment.TopLeft, GUI.Style, inGameHUD);
|
||||
GUIButton settingsButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 170 - 170 - 170, 20, 150, 20), "Settings", Alignment.TopLeft, "", inGameHUD);
|
||||
settingsButton.OnClicked = ToggleSettingsFrame;
|
||||
settingsButton.UserData = "settingsButton";
|
||||
|
||||
@@ -1340,10 +1340,10 @@ namespace Barotrauma.Networking
|
||||
|
||||
clientInfo = new GUIFrame(new Rectangle(0, 0, 180, 0), Color.Transparent, Alignment.TopRight, null, clientNameBox);
|
||||
clientInfo.UserData = client.FileStreamSender;
|
||||
new GUIProgressBar(new Rectangle(0, 4, 160, clientInfo.Rect.Height - 8), Color.Green, GUI.Style, 0.0f, Alignment.Left, clientInfo).IsHorizontal = true;
|
||||
new GUITextBlock(new Rectangle(0, 2, 160, 0), "", GUI.Style, Alignment.TopLeft, Alignment.Left | Alignment.CenterY, clientInfo, true, GUI.SmallFont);
|
||||
new GUIProgressBar(new Rectangle(0, 4, 160, clientInfo.Rect.Height - 8), Color.Green, "", 0.0f, Alignment.Left, clientInfo).IsHorizontal = true;
|
||||
new GUITextBlock(new Rectangle(0, 2, 160, 0), "", "", Alignment.TopLeft, Alignment.Left | Alignment.CenterY, clientInfo, true, GUI.SmallFont);
|
||||
|
||||
var cancelButton = new GUIButton(new Rectangle(20, 0, 14, 0), "X", Alignment.Right, GUI.Style, clientInfo);
|
||||
var cancelButton = new GUIButton(new Rectangle(20, 0, 14, 0), "X", Alignment.Right, "", clientInfo);
|
||||
cancelButton.OnClicked = (GUIButton button, object userdata) =>
|
||||
{
|
||||
(cancelButton.Parent.UserData as FileStreamSender).CancelTransfer();
|
||||
@@ -1428,7 +1428,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
if (clientListScrollBar == null)
|
||||
{
|
||||
clientListScrollBar = new GUIScrollBar(new Rectangle(x + width - 10, y, 10, height), GUI.Style, 1.0f);
|
||||
clientListScrollBar = new GUIScrollBar(new Rectangle(x + width - 10, y, 10, height), "", 1.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -1555,15 +1555,15 @@ namespace Barotrauma.Networking
|
||||
|
||||
if (character != myCharacter)
|
||||
{
|
||||
var banButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Ban", Alignment.BottomRight, GUI.Style, characterFrame);
|
||||
var banButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Ban", Alignment.BottomRight, "", characterFrame);
|
||||
banButton.UserData = character.Name;
|
||||
banButton.OnClicked += GameMain.NetLobbyScreen.BanPlayer;
|
||||
|
||||
var rangebanButton = new GUIButton(new Rectangle(0, -25, 100, 20), "Ban range", Alignment.BottomRight, GUI.Style, characterFrame);
|
||||
var rangebanButton = new GUIButton(new Rectangle(0, -25, 100, 20), "Ban range", Alignment.BottomRight, "", characterFrame);
|
||||
rangebanButton.UserData = character.Name;
|
||||
rangebanButton.OnClicked += GameMain.NetLobbyScreen.BanPlayerRange;
|
||||
|
||||
var kickButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Kick", Alignment.BottomLeft, GUI.Style, characterFrame);
|
||||
var kickButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Kick", Alignment.BottomLeft, "", characterFrame);
|
||||
kickButton.UserData = character.Name;
|
||||
kickButton.OnClicked += GameMain.NetLobbyScreen.KickPlayer;
|
||||
}
|
||||
|
||||
@@ -306,19 +306,19 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
settingsFrame = new GUIFrame(new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.Black * 0.5f);
|
||||
|
||||
GUIFrame innerFrame = new GUIFrame(new Rectangle(0, 0, 400, 430), null, Alignment.Center, GUI.Style, settingsFrame);
|
||||
GUIFrame innerFrame = new GUIFrame(new Rectangle(0, 0, 400, 430), null, Alignment.Center, "", settingsFrame);
|
||||
innerFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, -5, 0, 20), "Settings", GUI.Style, innerFrame, GUI.LargeFont);
|
||||
new GUITextBlock(new Rectangle(0, -5, 0, 20), "Settings", "", innerFrame, GUI.LargeFont);
|
||||
|
||||
string[] tabNames = { "Rounds", "Server", "Banlist", "Whitelist" };
|
||||
settingsTabs = new GUIFrame[tabNames.Length];
|
||||
for (int i = 0; i < tabNames.Length; i++)
|
||||
{
|
||||
settingsTabs[i] = new GUIFrame(new Rectangle(0, 15, 0, innerFrame.Rect.Height - 120), null, Alignment.Center, GUI.Style, innerFrame);
|
||||
settingsTabs[i] = new GUIFrame(new Rectangle(0, 15, 0, innerFrame.Rect.Height - 120), null, Alignment.Center, "", innerFrame);
|
||||
settingsTabs[i].Padding = new Vector4(40.0f, 20.0f, 40.0f, 40.0f);
|
||||
|
||||
var tabButton = new GUIButton(new Rectangle(85 * i, 35, 80, 20), tabNames[i], GUI.Style, innerFrame);
|
||||
var tabButton = new GUIButton(new Rectangle(85 * i, 35, 80, 20), tabNames[i], "", innerFrame);
|
||||
tabButton.UserData = i;
|
||||
tabButton.OnClicked = SelectSettingsTab;
|
||||
}
|
||||
@@ -327,7 +327,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
SelectSettingsTab(null, 0);
|
||||
|
||||
var closeButton = new GUIButton(new Rectangle(10, 10, 100, 20), "Close", Alignment.BottomRight, GUI.Style, innerFrame);
|
||||
var closeButton = new GUIButton(new Rectangle(10, 10, 100, 20), "Close", Alignment.BottomRight, "", innerFrame);
|
||||
closeButton.OnClicked = ToggleSettingsFrame;
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
@@ -338,7 +338,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
settingsTabs[0].Padding = new Vector4(40.0f, 5.0f, 40.0f, 40.0f);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, y, 100, 20), "Submarine selection:", GUI.Style, settingsTabs[0]);
|
||||
new GUITextBlock(new Rectangle(0, y, 100, 20), "Submarine selection:", "", settingsTabs[0]);
|
||||
var selectionFrame = new GUIFrame(new Rectangle(0, y + 20, 300, 20), null, settingsTabs[0]);
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
@@ -350,7 +350,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
y += 45;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, y, 100, 20), "Mode selection:", GUI.Style, settingsTabs[0]);
|
||||
new GUITextBlock(new Rectangle(0, y, 100, 20), "Mode selection:", "", settingsTabs[0]);
|
||||
selectionFrame = new GUIFrame(new Rectangle(0, y + 20, 300, 20), null, settingsTabs[0]);
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
@@ -378,9 +378,9 @@ namespace Barotrauma.Networking
|
||||
};
|
||||
|
||||
|
||||
var votesRequiredText = new GUITextBlock(new Rectangle(20, y + 20, 20, 20), "Votes required: 50 %", GUI.Style, settingsTabs[0], GUI.SmallFont);
|
||||
var votesRequiredText = new GUITextBlock(new Rectangle(20, y + 20, 20, 20), "Votes required: 50 %", "", settingsTabs[0], GUI.SmallFont);
|
||||
|
||||
var votesRequiredSlider = new GUIScrollBar(new Rectangle(150, y + 22, 100, 10), GUI.Style, 0.1f, settingsTabs[0]);
|
||||
var votesRequiredSlider = new GUIScrollBar(new Rectangle(150, y + 22, 100, 10), "", 0.1f, settingsTabs[0]);
|
||||
votesRequiredSlider.UserData = votesRequiredText;
|
||||
votesRequiredSlider.Step = 0.2f;
|
||||
votesRequiredSlider.BarScroll = (EndVoteRequiredRatio - 0.5f) * 2.0f;
|
||||
@@ -405,9 +405,9 @@ namespace Barotrauma.Networking
|
||||
};
|
||||
|
||||
|
||||
var respawnIntervalText = new GUITextBlock(new Rectangle(20, y + 18, 20, 20), "Respawn interval", GUI.Style, settingsTabs[0], GUI.SmallFont);
|
||||
var respawnIntervalText = new GUITextBlock(new Rectangle(20, y + 18, 20, 20), "Respawn interval", "", settingsTabs[0], GUI.SmallFont);
|
||||
|
||||
var respawnIntervalSlider = new GUIScrollBar(new Rectangle(150, y + 20, 100, 10), GUI.Style, 0.1f, settingsTabs[0]);
|
||||
var respawnIntervalSlider = new GUIScrollBar(new Rectangle(150, y + 20, 100, 10), "", 0.1f, settingsTabs[0]);
|
||||
respawnIntervalSlider.UserData = respawnIntervalText;
|
||||
respawnIntervalSlider.Step = 0.05f;
|
||||
respawnIntervalSlider.BarScroll = RespawnInterval / 600.0f;
|
||||
@@ -423,10 +423,10 @@ namespace Barotrauma.Networking
|
||||
|
||||
y += 35;
|
||||
|
||||
var minRespawnText = new GUITextBlock(new Rectangle(0, y, 200, 20), "Minimum players to respawn", GUI.Style, settingsTabs[0]);
|
||||
var minRespawnText = new GUITextBlock(new Rectangle(0, y, 200, 20), "Minimum players to respawn", "", settingsTabs[0]);
|
||||
minRespawnText.ToolTip = "What percentage of players has to be dead/spectating until a respawn shuttle is dispatched";
|
||||
|
||||
var minRespawnSlider = new GUIScrollBar(new Rectangle(150, y + 20, 100, 10), GUI.Style, 0.1f, settingsTabs[0]);
|
||||
var minRespawnSlider = new GUIScrollBar(new Rectangle(150, y + 20, 100, 10), "", 0.1f, settingsTabs[0]);
|
||||
minRespawnSlider.ToolTip = minRespawnText.ToolTip;
|
||||
minRespawnSlider.UserData = minRespawnText;
|
||||
minRespawnSlider.Step = 0.1f;
|
||||
@@ -443,11 +443,11 @@ namespace Barotrauma.Networking
|
||||
|
||||
y += 30;
|
||||
|
||||
var respawnDurationText = new GUITextBlock(new Rectangle(0, y, 200, 20), "Duration of respawn transport", GUI.Style, settingsTabs[0]);
|
||||
var respawnDurationText = new GUITextBlock(new Rectangle(0, y, 200, 20), "Duration of respawn transport", "", settingsTabs[0]);
|
||||
respawnDurationText.ToolTip = "The amount of time respawned players have to navigate the respawn shuttle to the main submarine. " +
|
||||
"After the duration expires, the shuttle will automatically head back out of the level.";
|
||||
|
||||
var respawnDurationSlider = new GUIScrollBar(new Rectangle(150, y + 20, 100, 10), GUI.Style, 0.1f, settingsTabs[0]);
|
||||
var respawnDurationSlider = new GUIScrollBar(new Rectangle(150, y + 20, 100, 10), "", 0.1f, settingsTabs[0]);
|
||||
respawnDurationSlider.ToolTip = minRespawnText.ToolTip;
|
||||
respawnDurationSlider.UserData = respawnDurationText;
|
||||
respawnDurationSlider.Step = 0.1f;
|
||||
@@ -473,9 +473,9 @@ namespace Barotrauma.Networking
|
||||
|
||||
y += 35;
|
||||
|
||||
var monsterButton = new GUIButton(new Rectangle(0, y, 130, 20), "Monster Spawns", GUI.Style, settingsTabs[0]);
|
||||
var monsterButton = new GUIButton(new Rectangle(0, y, 130, 20), "Monster Spawns", "", settingsTabs[0]);
|
||||
monsterButton.Enabled = !GameStarted;
|
||||
var monsterFrame = new GUIListBox(new Rectangle(-290, 60, 280, 250), GUI.Style, settingsTabs[0]);
|
||||
var monsterFrame = new GUIListBox(new Rectangle(-290, 60, 280, 250), "", settingsTabs[0]);
|
||||
monsterFrame.Visible = false;
|
||||
monsterButton.UserData = monsterFrame;
|
||||
monsterButton.OnClicked = (button, obj) =>
|
||||
@@ -495,7 +495,7 @@ namespace Barotrauma.Networking
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, 260, 25),
|
||||
s,
|
||||
GUI.Style,
|
||||
"",
|
||||
Alignment.Left, Alignment.Left, monsterFrame);
|
||||
textBlock.Padding = new Vector4(35.0f, 3.0f, 0.0f, 0.0f);
|
||||
textBlock.UserData = monsterFrame;
|
||||
@@ -516,10 +516,10 @@ namespace Barotrauma.Networking
|
||||
};
|
||||
}
|
||||
|
||||
var cargoButton = new GUIButton(new Rectangle(160, y, 130, 20), "Additional Cargo", GUI.Style, settingsTabs[0]);
|
||||
var cargoButton = new GUIButton(new Rectangle(160, y, 130, 20), "Additional Cargo", "", settingsTabs[0]);
|
||||
cargoButton.Enabled = !GameStarted;
|
||||
|
||||
var cargoFrame = new GUIListBox(new Rectangle(300, 60, 280, 250), GUI.Style, settingsTabs[0]);
|
||||
var cargoFrame = new GUIListBox(new Rectangle(300, 60, 280, 250), "", settingsTabs[0]);
|
||||
cargoFrame.Visible = false;
|
||||
cargoButton.UserData = cargoFrame;
|
||||
cargoButton.OnClicked = (button, obj) =>
|
||||
@@ -542,7 +542,7 @@ namespace Barotrauma.Networking
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, 260, 25),
|
||||
pf.Name,
|
||||
GUI.Style,
|
||||
"",
|
||||
Alignment.Left, Alignment.Left, cargoFrame);
|
||||
textBlock.Padding = new Vector4(30.0f, 3.0f, 0.0f, 0.0f);
|
||||
textBlock.UserData = cargoFrame;
|
||||
@@ -561,10 +561,10 @@ namespace Barotrauma.Networking
|
||||
var countText = new GUITextBlock(
|
||||
new Rectangle(180, 0, 50, 25),
|
||||
cargoVal.ToString(),
|
||||
GUI.Style,
|
||||
"",
|
||||
Alignment.Left, Alignment.Center, textBlock);
|
||||
|
||||
var incButton = new GUIButton(new Rectangle(220, 5, 10, 15), ">", GUI.Style, textBlock);
|
||||
var incButton = new GUIButton(new Rectangle(220, 5, 10, 15), ">", "", textBlock);
|
||||
incButton.UserData = countText;
|
||||
incButton.OnClicked = (button, obj) =>
|
||||
{
|
||||
@@ -582,7 +582,7 @@ namespace Barotrauma.Networking
|
||||
return true;
|
||||
};
|
||||
|
||||
var decButton = new GUIButton(new Rectangle(180, 5, 10, 15), "<", GUI.Style, textBlock);
|
||||
var decButton = new GUIButton(new Rectangle(180, 5, 10, 15), "<", "", textBlock);
|
||||
decButton.UserData = countText;
|
||||
decButton.OnClicked = (button, obj) =>
|
||||
{
|
||||
@@ -612,8 +612,8 @@ namespace Barotrauma.Networking
|
||||
y = 0;
|
||||
|
||||
|
||||
var startIntervalText = new GUITextBlock(new Rectangle(-10, y, 100, 20), "Autorestart delay", GUI.Style, settingsTabs[1]);
|
||||
var startIntervalSlider = new GUIScrollBar(new Rectangle(10, y + 22, 100, 10), GUI.Style, 0.1f, settingsTabs[1]);
|
||||
var startIntervalText = new GUITextBlock(new Rectangle(-10, y, 100, 20), "Autorestart delay", "", settingsTabs[1]);
|
||||
var startIntervalSlider = new GUIScrollBar(new Rectangle(10, y + 22, 100, 10), "", 0.1f, settingsTabs[1]);
|
||||
startIntervalSlider.UserData = startIntervalText;
|
||||
startIntervalSlider.Step = 0.05f;
|
||||
startIntervalSlider.BarScroll = AutoRestartInterval / 300.0f;
|
||||
@@ -649,9 +649,9 @@ namespace Barotrauma.Networking
|
||||
return true;
|
||||
};
|
||||
|
||||
var kickVotesRequiredText = new GUITextBlock(new Rectangle(20, y + 20, 20, 20), "Votes required: 50 %", GUI.Style, settingsTabs[1], GUI.SmallFont);
|
||||
var kickVotesRequiredText = new GUITextBlock(new Rectangle(20, y + 20, 20, 20), "Votes required: 50 %", "", settingsTabs[1], GUI.SmallFont);
|
||||
|
||||
var kickVoteSlider = new GUIScrollBar(new Rectangle(150, y + 22, 100, 10), GUI.Style, 0.1f, settingsTabs[1]);
|
||||
var kickVoteSlider = new GUIScrollBar(new Rectangle(150, y + 22, 100, 10), "", 0.1f, settingsTabs[1]);
|
||||
kickVoteSlider.UserData = kickVotesRequiredText;
|
||||
kickVoteSlider.Step = 0.2f;
|
||||
kickVoteSlider.BarScroll = (KickVoteRequiredRatio - 0.5f) * 2.0f;
|
||||
@@ -835,7 +835,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
public void ManagePlayersFrame(GUIFrame infoFrame)
|
||||
{
|
||||
GUIListBox cList = new GUIListBox(new Rectangle(0, 0, 0, 300), Color.White * 0.7f, GUI.Style, infoFrame);
|
||||
GUIListBox cList = new GUIListBox(new Rectangle(0, 0, 0, 300), Color.White * 0.7f, "", infoFrame);
|
||||
cList.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
|
||||
//crewList.OnSelected = SelectCrewCharacter;
|
||||
|
||||
@@ -854,15 +854,15 @@ namespace Barotrauma.Networking
|
||||
Alignment.Left, Alignment.Left,
|
||||
null, frame);
|
||||
|
||||
var banButton = new GUIButton(new Rectangle(-110, 0, 100, 20), "Ban", Alignment.Right | Alignment.CenterY, GUI.Style, frame);
|
||||
var banButton = new GUIButton(new Rectangle(-110, 0, 100, 20), "Ban", Alignment.Right | Alignment.CenterY, "", frame);
|
||||
banButton.UserData = c.name;
|
||||
banButton.OnClicked = GameMain.NetLobbyScreen.BanPlayer;
|
||||
|
||||
var rangebanButton = new GUIButton(new Rectangle(-220, 0, 100, 20), "Ban range", Alignment.Right | Alignment.CenterY, GUI.Style, frame);
|
||||
var rangebanButton = new GUIButton(new Rectangle(-220, 0, 100, 20), "Ban range", Alignment.Right | Alignment.CenterY, "", frame);
|
||||
rangebanButton.UserData = c.name;
|
||||
rangebanButton.OnClicked = GameMain.NetLobbyScreen.BanPlayerRange;
|
||||
|
||||
var kickButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Kick", Alignment.Right | Alignment.CenterY, GUI.Style, frame);
|
||||
var kickButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Kick", Alignment.Right | Alignment.CenterY, "", frame);
|
||||
kickButton.UserData = c.name;
|
||||
kickButton.OnClicked = GameMain.NetLobbyScreen.KickPlayer;
|
||||
|
||||
|
||||
@@ -140,12 +140,12 @@ namespace Barotrauma.Networking
|
||||
GameMain.GraphicsWidth - 20 - width,
|
||||
GameMain.GraphicsHeight - 40 - 25 - height,
|
||||
width, height),
|
||||
Color.White * 0.5f, GUI.Style, inGameHUD);
|
||||
Color.White * 0.5f, "", inGameHUD);
|
||||
chatBox.Padding = Vector4.Zero;
|
||||
|
||||
chatMsgBox = new GUITextBox(
|
||||
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, GUI.Style, inGameHUD);
|
||||
Color.White * 0.5f, Color.Black, Alignment.TopLeft, Alignment.Left, "", inGameHUD);
|
||||
chatMsgBox.Font = GUI.SmallFont;
|
||||
chatMsgBox.Padding = Vector4.Zero;
|
||||
chatMsgBox.OnEnterPressed = EnterChatMessage;
|
||||
|
||||
@@ -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, GUI.Style, LogFrame);
|
||||
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);
|
||||
|
||||
new GUITextBlock(new Rectangle(-200,0,100,15), "Filter", GUI.Style, 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, GUI.Style, 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, GUI.Style, 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), GUI.Style, innerFrame);
|
||||
listBox = new GUIListBox(new Rectangle(0,20,0,335), "", innerFrame);
|
||||
|
||||
var currLines = lines.ToList();
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
if (listBox.BarScroll==0.0f || listBox.BarScroll==1.0f) listBox.BarScroll = 1.0f;
|
||||
|
||||
GUIButton closeButton = new GUIButton(new Rectangle(0,0,100, 15), "Close", Alignment.BottomRight, GUI.Style, innerFrame);
|
||||
GUIButton closeButton = new GUIButton(new Rectangle(0,0,100, 15), "Close", Alignment.BottomRight, "", innerFrame);
|
||||
closeButton.OnClicked = (GUIButton button, object userData) =>
|
||||
{
|
||||
LogFrame = null;
|
||||
@@ -98,7 +98,7 @@ 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, 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));
|
||||
|
||||
//listBox.AddChild(textBlock);
|
||||
|
||||
@@ -154,18 +154,18 @@ namespace Barotrauma.Networking
|
||||
return true;
|
||||
};
|
||||
|
||||
new GUITextBlock(new Rectangle(0, -25, 90, 20), "Name:", GUI.Style, Alignment.BottomLeft, Alignment.TopLeft, parent, false, GUI.Font);
|
||||
nameBox = new GUITextBox(new Rectangle(100, -25, 170, 20), Alignment.BottomLeft, GUI.Style, parent);
|
||||
new GUITextBlock(new Rectangle(0, -25, 90, 20), "Name:", "", Alignment.BottomLeft, Alignment.TopLeft, parent, false, GUI.Font);
|
||||
nameBox = new GUITextBox(new Rectangle(100, -25, 170, 20), Alignment.BottomLeft, "", parent);
|
||||
nameBox.Font = GUI.Font;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 5, 90, 20), "IP Address:", GUI.Style, Alignment.BottomLeft, Alignment.TopLeft, parent, false, GUI.Font);
|
||||
ipBox = new GUITextBox(new Rectangle(100, 5, 170, 20), Alignment.BottomLeft, GUI.Style, parent);
|
||||
new GUITextBlock(new Rectangle(0, 5, 90, 20), "IP Address:", "", Alignment.BottomLeft, Alignment.TopLeft, parent, false, GUI.Font);
|
||||
ipBox = new GUITextBox(new Rectangle(100, 5, 170, 20), Alignment.BottomLeft, "", parent);
|
||||
ipBox.Font = GUI.Font;
|
||||
|
||||
var addnewButton = new GUIButton(new Rectangle(0, 45, 150, 20), "Add to whitelist", Alignment.BottomLeft, GUI.Style, parent);
|
||||
var addnewButton = new GUIButton(new Rectangle(0, 45, 150, 20), "Add to whitelist", Alignment.BottomLeft, "", parent);
|
||||
addnewButton.OnClicked = AddToWhiteList;
|
||||
|
||||
whitelistFrame = new GUIListBox(new Rectangle(0, 30, 0, parent.Rect.Height-100), GUI.Style, parent);
|
||||
whitelistFrame = new GUIListBox(new Rectangle(0, 30, 0, parent.Rect.Height-100), "", parent);
|
||||
|
||||
foreach (WhiteListedPlayer wlp in whitelistedPlayers)
|
||||
{
|
||||
@@ -174,12 +174,12 @@ namespace Barotrauma.Networking
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, 0, 25),
|
||||
blockText,
|
||||
GUI.Style,
|
||||
"",
|
||||
Alignment.Left, Alignment.Left, whitelistFrame);
|
||||
textBlock.Padding = new Vector4(10.0f, 10.0f, 0.0f, 0.0f);
|
||||
textBlock.UserData = wlp;
|
||||
|
||||
var removeButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Remove", Alignment.Right | Alignment.CenterY, GUI.Style, textBlock);
|
||||
var removeButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Remove", Alignment.Right | Alignment.CenterY, "", textBlock);
|
||||
removeButton.UserData = wlp;
|
||||
removeButton.OnClicked = RemoveFromWhiteList;
|
||||
}
|
||||
|
||||
@@ -43,18 +43,18 @@ namespace Barotrauma
|
||||
|
||||
cam = new Camera();
|
||||
|
||||
GUIpanel = new GUIFrame(new Rectangle(0, 0, 300, GameMain.GraphicsHeight), GUI.Style);
|
||||
GUIpanel = new GUIFrame(new Rectangle(0, 0, 300, GameMain.GraphicsHeight), "");
|
||||
GUIpanel.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
|
||||
|
||||
physicsButton = new GUIButton(new Rectangle(0, 50, 200, 25), "Physics", Alignment.Left, GUI.Style, GUIpanel);
|
||||
physicsButton = new GUIButton(new Rectangle(0, 50, 200, 25), "Physics", Alignment.Left, "", GUIpanel);
|
||||
physicsButton.OnClicked += TogglePhysics;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 80, 0, 25), "Limbs:", GUI.Style, GUIpanel);
|
||||
limbList = new GUIListBox(new Rectangle(0, 110, 0, 250), Color.White * 0.7f, GUI.Style, GUIpanel);
|
||||
new GUITextBlock(new Rectangle(0, 80, 0, 25), "Limbs:", "", GUIpanel);
|
||||
limbList = new GUIListBox(new Rectangle(0, 110, 0, 250), Color.White * 0.7f, "", GUIpanel);
|
||||
limbList.OnSelected = SelectLimb;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 360, 0, 25), "Joints:", GUI.Style, GUIpanel);
|
||||
jointList = new GUIListBox(new Rectangle(0, 390, 0, 250), Color.White * 0.7f, GUI.Style, GUIpanel);
|
||||
new GUITextBlock(new Rectangle(0, 360, 0, 25), "Joints:", "", GUIpanel);
|
||||
jointList = new GUIListBox(new Rectangle(0, 390, 0, 250), Color.White * 0.7f, "", GUIpanel);
|
||||
|
||||
while (Character.CharacterList.Count > 1)
|
||||
{
|
||||
|
||||
@@ -126,23 +126,23 @@ namespace Barotrauma
|
||||
|
||||
selectedTab = -1;
|
||||
|
||||
topPanel = new GUIFrame(new Rectangle(0, 0, 0, 31), GUI.Style);
|
||||
topPanel = new GUIFrame(new Rectangle(0, 0, 0, 31), "");
|
||||
topPanel.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||
|
||||
hullVolumeFrame = new GUIFrame(new Rectangle(145, 26, 280, 70), GUI.Style, topPanel);
|
||||
hullVolumeFrame = new GUIFrame(new Rectangle(145, 26, 280, 70), "", topPanel);
|
||||
hullVolumeFrame.Visible = false;
|
||||
hullVolumeFrame.Padding = new Vector4(3.0f, 3.0f, 3.0f, 3.0f);
|
||||
|
||||
GUITextBlock totalHullVolume = new GUITextBlock(new Rectangle(0, 0, 0, 20), "", GUI.Style, hullVolumeFrame, GUI.SmallFont);
|
||||
GUITextBlock totalHullVolume = new GUITextBlock(new Rectangle(0, 0, 0, 20), "", "", hullVolumeFrame, GUI.SmallFont);
|
||||
totalHullVolume.TextGetter = GetTotalHullVolume;
|
||||
|
||||
GUITextBlock selectedHullVolume = new GUITextBlock(new Rectangle(0, 30, 0, 20), "", GUI.Style, hullVolumeFrame, GUI.SmallFont);
|
||||
GUITextBlock selectedHullVolume = new GUITextBlock(new Rectangle(0, 30, 0, 20), "", "", hullVolumeFrame, GUI.SmallFont);
|
||||
selectedHullVolume.TextGetter = GetSelectedHullVolume;
|
||||
|
||||
var button = new GUIButton(new Rectangle(0, 0, 70, 20), "Open...", GUI.Style, topPanel);
|
||||
var button = new GUIButton(new Rectangle(0, 0, 70, 20), "Open...", "", topPanel);
|
||||
button.OnClicked = CreateLoadScreen;
|
||||
|
||||
button = new GUIButton(new Rectangle(80,0,70,20), "Save", GUI.Style, topPanel);
|
||||
button = new GUIButton(new Rectangle(80,0,70,20), "Save", "", topPanel);
|
||||
button.OnClicked = (GUIButton btn, object data) =>
|
||||
{
|
||||
CreateSaveScreen();
|
||||
@@ -150,10 +150,10 @@ namespace Barotrauma
|
||||
return true;
|
||||
};
|
||||
|
||||
var nameLabel = new GUITextBlock(new Rectangle(170, -4, 150, 20), "", GUI.Style, topPanel, GUI.LargeFont);
|
||||
var nameLabel = new GUITextBlock(new Rectangle(170, -4, 150, 20), "", "", topPanel, GUI.LargeFont);
|
||||
nameLabel.TextGetter = GetSubName;
|
||||
|
||||
linkedSubBox = new GUIDropDown(new Rectangle(750,0,200,20), "Add submarine", GUI.Style, topPanel);
|
||||
linkedSubBox = new GUIDropDown(new Rectangle(750,0,200,20), "Add submarine", "", topPanel);
|
||||
linkedSubBox.ToolTip =
|
||||
"Places another submarine into the current submarine file. "+
|
||||
"Can be used for adding things such as smaller vessels, "+
|
||||
@@ -165,13 +165,13 @@ namespace Barotrauma
|
||||
}
|
||||
linkedSubBox.OnSelected += SelectLinkedSub;
|
||||
|
||||
leftPanel = new GUIFrame(new Rectangle(0, 30, 150, GameMain.GraphicsHeight-30), GUI.Style);
|
||||
leftPanel = new GUIFrame(new Rectangle(0, 30, 150, GameMain.GraphicsHeight-30), "");
|
||||
leftPanel.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
|
||||
|
||||
GUITextBlock itemCount = new GUITextBlock(new Rectangle(0, 30, 0, 20), "", GUI.Style, leftPanel);
|
||||
GUITextBlock itemCount = new GUITextBlock(new Rectangle(0, 30, 0, 20), "", "", leftPanel);
|
||||
itemCount.TextGetter = GetItemCount;
|
||||
|
||||
GUITextBlock structureCount = new GUITextBlock(new Rectangle(0, 50, 0, 20), "", GUI.Style, leftPanel);
|
||||
GUITextBlock structureCount = new GUITextBlock(new Rectangle(0, 50, 0, 20), "", "", leftPanel);
|
||||
structureCount.TextGetter = GetStructureCount;
|
||||
|
||||
GUItabs = new GUIComponent[Enum.GetValues(typeof(MapEntityCategory)).Length];
|
||||
@@ -181,25 +181,25 @@ namespace Barotrauma
|
||||
int i = 0;
|
||||
foreach (MapEntityCategory category in Enum.GetValues(typeof(MapEntityCategory)))
|
||||
{
|
||||
var catButton = new GUIButton(new Rectangle(0, y, 0, 20), category.ToString(), Alignment.Left, GUI.Style, leftPanel);
|
||||
var catButton = new GUIButton(new Rectangle(0, y, 0, 20), category.ToString(), Alignment.Left, "", leftPanel);
|
||||
catButton.UserData = i;
|
||||
catButton.OnClicked = SelectTab;
|
||||
y+=25;
|
||||
|
||||
GUItabs[i] = new GUIFrame(new Rectangle(GameMain.GraphicsWidth / 2 - width / 2, GameMain.GraphicsHeight / 2 - height / 2, width, height), GUI.Style);
|
||||
GUItabs[i] = new GUIFrame(new Rectangle(GameMain.GraphicsWidth / 2 - width / 2, GameMain.GraphicsHeight / 2 - height / 2, width, height), "");
|
||||
GUItabs[i].Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
|
||||
|
||||
new GUITextBlock(new Rectangle(-200, 0, 100, 15), "Filter", GUI.Style, Alignment.TopRight, Alignment.TopRight, GUItabs[i], false, GUI.SmallFont);
|
||||
new GUITextBlock(new Rectangle(-200, 0, 100, 15), "Filter", "", Alignment.TopRight, Alignment.TopRight, GUItabs[i], false, GUI.SmallFont);
|
||||
|
||||
GUITextBox searchBox = new GUITextBox(new Rectangle(-20, 0, 180, 15), Alignment.TopRight, GUI.Style, GUItabs[i]);
|
||||
GUITextBox searchBox = new GUITextBox(new Rectangle(-20, 0, 180, 15), Alignment.TopRight, "", GUItabs[i]);
|
||||
searchBox.Font = GUI.SmallFont;
|
||||
searchBox.OnTextChanged = FilterMessages;
|
||||
|
||||
var clearButton = new GUIButton(new Rectangle(0, 0, 15, 15), "x", Alignment.TopRight, GUI.Style, GUItabs[i]);
|
||||
var clearButton = new GUIButton(new Rectangle(0, 0, 15, 15), "x", Alignment.TopRight, "", GUItabs[i]);
|
||||
clearButton.OnClicked = ClearFilter;
|
||||
clearButton.UserData = searchBox;
|
||||
|
||||
GUIListBox itemList = new GUIListBox(new Rectangle(0, 20, 0, 0), Color.White * 0.7f, GUI.Style, GUItabs[i]);
|
||||
GUIListBox itemList = new GUIListBox(new Rectangle(0, 20, 0, 0), Color.White * 0.7f, "", GUItabs[i]);
|
||||
itemList.OnSelected = SelectPrefab;
|
||||
itemList.CheckSelected = MapEntityPrefab.GetSelected;
|
||||
|
||||
@@ -243,23 +243,23 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
y+=50;
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 20), "Character mode", Alignment.Left, GUI.Style, leftPanel);
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 20), "Character mode", Alignment.Left, "", leftPanel);
|
||||
button.ToolTip = "Allows you to pick up and use items. Useful for things such as placing items inside closets, turning devices on/off and doing the wiring.";
|
||||
button.OnClicked = ToggleCharacterMode;
|
||||
|
||||
y += 35;
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 20), "Wiring mode", Alignment.Left, GUI.Style, leftPanel);
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 20), "Wiring mode", Alignment.Left, "", leftPanel);
|
||||
//button.ToolTip = "Allows you to pick up and use items. Useful for things such as placing items inside closets, turning devices on/off and doing the wiring.";
|
||||
button.OnClicked = ToggleWiringMode;
|
||||
|
||||
y+=50;
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 20), "Generate waypoints", Alignment.Left, GUI.Style, leftPanel);
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 20), "Generate waypoints", Alignment.Left, "", leftPanel);
|
||||
button.ToolTip = "AI controlled crew members require waypoints to navigate around the sub.";
|
||||
button.OnClicked = GenerateWaypoints;
|
||||
|
||||
y+=50;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, y, 0, 20), "Show:", GUI.Style, leftPanel);
|
||||
new GUITextBlock(new Rectangle(0, y, 0, 20), "Show:", "", leftPanel);
|
||||
|
||||
var tickBox = new GUITickBox(new Rectangle(0,y+20,20,20), "Waypoints", Alignment.TopLeft, leftPanel);
|
||||
tickBox.OnSelected = (GUITickBox obj) => { WayPoint.ShowWayPoints = !WayPoint.ShowWayPoints; return true; };
|
||||
@@ -281,9 +281,9 @@ namespace Barotrauma
|
||||
|
||||
if (y < GameMain.GraphicsHeight - 100)
|
||||
{
|
||||
new GUITextBlock(new Rectangle(0, y, 0, 15), "Previously used:", GUI.Style, leftPanel);
|
||||
new GUITextBlock(new Rectangle(0, y, 0, 15), "Previously used:", "", leftPanel);
|
||||
|
||||
previouslyUsedList = new GUIListBox(new Rectangle(0, y + 15, 0, Math.Min(GameMain.GraphicsHeight - y - 40, 150)), GUI.Style, leftPanel);
|
||||
previouslyUsedList = new GUIListBox(new Rectangle(0, y + 15, 0, Math.Min(GameMain.GraphicsHeight - y - 40, 150)), "", leftPanel);
|
||||
previouslyUsedList.OnSelected = SelectPrefab;
|
||||
}
|
||||
|
||||
@@ -425,33 +425,33 @@ namespace Barotrauma
|
||||
|
||||
int y = 0;
|
||||
|
||||
saveFrame = new GUIFrame(new Rectangle(GameMain.GraphicsWidth / 2 - width / 2, GameMain.GraphicsHeight / 2 - height / 2, width, height), GUI.Style, null);
|
||||
saveFrame = new GUIFrame(new Rectangle(GameMain.GraphicsWidth / 2 - width / 2, GameMain.GraphicsHeight / 2 - height / 2, width, height), "", null);
|
||||
saveFrame.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
|
||||
|
||||
new GUITextBlock(new Rectangle(0,0,200,30), "Save submarine", GUI.Style, saveFrame, GUI.LargeFont);
|
||||
new GUITextBlock(new Rectangle(0,0,200,30), "Save submarine", "", saveFrame, GUI.LargeFont);
|
||||
|
||||
y += 30;
|
||||
|
||||
new GUITextBlock(new Rectangle(0,y,150,20), "Name:", GUI.Style, saveFrame);
|
||||
new GUITextBlock(new Rectangle(0,y,150,20), "Name:", "", saveFrame);
|
||||
y += 20;
|
||||
|
||||
nameBox = new GUITextBox(new Rectangle(5, y, 250, 20), GUI.Style, saveFrame);
|
||||
nameBox = new GUITextBox(new Rectangle(5, y, 250, 20), "", saveFrame);
|
||||
nameBox.OnEnterPressed = ChangeSubName;
|
||||
nameBox.Text = GetSubName();
|
||||
|
||||
y += 30;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, y, 150, 20), "Description:", GUI.Style, saveFrame);
|
||||
new GUITextBlock(new Rectangle(0, y, 150, 20), "Description:", "", saveFrame);
|
||||
y += 20;
|
||||
|
||||
var descriptionBox = new GUITextBox(new Rectangle(5, y, 0, 100), null, null, Alignment.TopLeft,
|
||||
Alignment.TopLeft, GUI.Style, saveFrame);
|
||||
Alignment.TopLeft, "", saveFrame);
|
||||
descriptionBox.Wrap = true;
|
||||
descriptionBox.Text = Submarine.MainSub == null ? "" : Submarine.MainSub.Description;
|
||||
descriptionBox.OnTextChanged = ChangeSubDescription;
|
||||
|
||||
y += descriptionBox.Rect.Height + 15;
|
||||
new GUITextBlock(new Rectangle(0, y, 150, 20), "Settings:", GUI.Style, saveFrame);
|
||||
new GUITextBlock(new Rectangle(0, y, 150, 20), "Settings:", "", saveFrame);
|
||||
|
||||
y += 20;
|
||||
|
||||
@@ -491,10 +491,10 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
var saveButton = new GUIButton(new Rectangle(-90, 0, 80, 20), "Save", Alignment.Right | Alignment.Bottom, GUI.Style, saveFrame);
|
||||
var saveButton = new GUIButton(new Rectangle(-90, 0, 80, 20), "Save", Alignment.Right | Alignment.Bottom, "", saveFrame);
|
||||
saveButton.OnClicked = SaveSub;
|
||||
|
||||
var cancelButton = new GUIButton(new Rectangle(0, 0, 80, 20), "Cancel", Alignment.Right | Alignment.Bottom, GUI.Style, saveFrame);
|
||||
var cancelButton = new GUIButton(new Rectangle(0, 0, 80, 20), "Cancel", Alignment.Right | Alignment.Bottom, "", saveFrame);
|
||||
cancelButton.OnClicked = (GUIButton btn, object userdata) =>
|
||||
{
|
||||
saveFrame = null;
|
||||
@@ -511,10 +511,10 @@ namespace Barotrauma
|
||||
Submarine.RefreshSavedSubs();
|
||||
|
||||
int width = 300, height = 400;
|
||||
loadFrame = new GUIFrame(new Rectangle(GameMain.GraphicsWidth / 2 - width / 2, GameMain.GraphicsHeight / 2 - height / 2, width, height), GUI.Style, null);
|
||||
loadFrame = new GUIFrame(new Rectangle(GameMain.GraphicsWidth / 2 - width / 2, GameMain.GraphicsHeight / 2 - height / 2, width, height), "", null);
|
||||
loadFrame.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
|
||||
|
||||
var subList = new GUIListBox(new Rectangle(0, 0, 0, height - 50), Color.White, GUI.Style, loadFrame);
|
||||
var subList = new GUIListBox(new Rectangle(0, 0, 0, height - 50), Color.White, "", loadFrame);
|
||||
subList.OnSelected = (GUIComponent selected, object userData) =>
|
||||
{
|
||||
var deleteBtn = loadFrame.FindChild("delete") as GUIButton;
|
||||
@@ -528,7 +528,7 @@ namespace Barotrauma
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, 0, 25),
|
||||
ToolBox.LimitString(sub.Name, GUI.Font, subList.Rect.Width - 80),
|
||||
GUI.Style,
|
||||
"",
|
||||
Alignment.Left, Alignment.CenterY | Alignment.Left, subList);
|
||||
textBlock.Padding = new Vector4(10.0f, 0.0f, 0.0f, 0.0f);
|
||||
textBlock.UserData = sub;
|
||||
@@ -536,13 +536,13 @@ namespace Barotrauma
|
||||
|
||||
if (sub.HasTag(SubmarineTag.Shuttle))
|
||||
{
|
||||
var shuttleText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "Shuttle", GUI.Style, Alignment.Left, Alignment.CenterY | Alignment.Right, textBlock, false, GUI.SmallFont);
|
||||
var shuttleText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "Shuttle", "", Alignment.Left, Alignment.CenterY | Alignment.Right, textBlock, false, GUI.SmallFont);
|
||||
shuttleText.TextColor = textBlock.TextColor * 0.8f;
|
||||
shuttleText.ToolTip = textBlock.ToolTip;
|
||||
}
|
||||
}
|
||||
|
||||
var deleteButton = new GUIButton(new Rectangle(0, 0, 70, 20), "Delete", Alignment.BottomLeft, GUI.Style, loadFrame);
|
||||
var deleteButton = new GUIButton(new Rectangle(0, 0, 70, 20), "Delete", Alignment.BottomLeft, "", loadFrame);
|
||||
deleteButton.Enabled = false;
|
||||
deleteButton.UserData = "delete";
|
||||
deleteButton.OnClicked = (btn, userdata) =>
|
||||
@@ -567,10 +567,10 @@ namespace Barotrauma
|
||||
return true;
|
||||
};
|
||||
|
||||
var loadButton = new GUIButton(new Rectangle(-90, 0, 80, 20), "Load", Alignment.Right | Alignment.Bottom, GUI.Style, loadFrame);
|
||||
var loadButton = new GUIButton(new Rectangle(-90, 0, 80, 20), "Load", Alignment.Right | Alignment.Bottom, "", loadFrame);
|
||||
loadButton.OnClicked = LoadSub;
|
||||
|
||||
var cancelButton = new GUIButton(new Rectangle(0, 0, 80, 20), "Cancel", Alignment.Right | Alignment.Bottom, GUI.Style, loadFrame);
|
||||
var cancelButton = new GUIButton(new Rectangle(0, 0, 80, 20), "Cancel", Alignment.Right | Alignment.Bottom, "", loadFrame);
|
||||
cancelButton.OnClicked = (GUIButton btn, object userdata) =>
|
||||
{
|
||||
loadFrame = null;
|
||||
@@ -738,10 +738,10 @@ namespace Barotrauma
|
||||
|
||||
private GUIFrame CreateWiringPanel()
|
||||
{
|
||||
GUIFrame frame = new GUIFrame(new Rectangle(0,0,65,300), null, Alignment.Right | Alignment.CenterY, GUI.Style);
|
||||
GUIFrame frame = new GUIFrame(new Rectangle(0,0,65,300), null, Alignment.Right | Alignment.CenterY, "");
|
||||
frame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||
|
||||
GUIListBox listBox = new GUIListBox(Rectangle.Empty, GUI.Style, frame);
|
||||
GUIListBox listBox = new GUIListBox(Rectangle.Empty, "", frame);
|
||||
listBox.OnSelected = SelectWire;
|
||||
|
||||
foreach (MapEntityPrefab ep in MapEntityPrefab.list)
|
||||
@@ -880,7 +880,7 @@ namespace Barotrauma
|
||||
var textBlock = new GUITextBlock(
|
||||
new Rectangle(0,0,0,10),
|
||||
ToolBox.LimitString(name, GUI.SmallFont, previouslyUsedList.Rect.Width),
|
||||
GUI.Style, previouslyUsedList, GUI.SmallFont);
|
||||
"", previouslyUsedList, GUI.SmallFont);
|
||||
|
||||
textBlock.UserData = mapEntityPrefab;
|
||||
|
||||
|
||||
@@ -65,23 +65,23 @@ namespace Barotrauma
|
||||
GameMain.GraphicsWidth - 80,
|
||||
100);
|
||||
|
||||
topPanel = new GUIFrame(panelRect, GUI.Style);
|
||||
topPanel = new GUIFrame(panelRect, "");
|
||||
topPanel.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
|
||||
|
||||
GUITextBlock moneyText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "", GUI.Style,
|
||||
GUITextBlock moneyText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "", "",
|
||||
Alignment.BottomLeft, Alignment.BottomLeft, topPanel);
|
||||
moneyText.TextGetter = GetMoney;
|
||||
|
||||
GUIButton button = new GUIButton(new Rectangle(-240, 0, 100, 30), "Map", null, Alignment.BottomRight, GUI.Style, topPanel);
|
||||
GUIButton button = new GUIButton(new Rectangle(-240, 0, 100, 30), "Map", null, Alignment.BottomRight, "", topPanel);
|
||||
button.UserData = PanelTab.Map;
|
||||
button.OnClicked = SelectRightPanel;
|
||||
SelectRightPanel(button, button.UserData);
|
||||
|
||||
button = new GUIButton(new Rectangle(-120, 0, 100, 30), "Crew", null, Alignment.BottomRight, GUI.Style, topPanel);
|
||||
button = new GUIButton(new Rectangle(-120, 0, 100, 30), "Crew", null, Alignment.BottomRight, "", topPanel);
|
||||
button.UserData = PanelTab.Crew;
|
||||
button.OnClicked = SelectRightPanel;
|
||||
|
||||
button = new GUIButton(new Rectangle(0, 0, 100, 30), "Store", null, Alignment.BottomRight, GUI.Style, topPanel);
|
||||
button = new GUIButton(new Rectangle(0, 0, 100, 30), "Store", null, Alignment.BottomRight, "", topPanel);
|
||||
button.UserData = PanelTab.Store;
|
||||
button.OnClicked = SelectRightPanel;
|
||||
|
||||
@@ -96,44 +96,44 @@ namespace Barotrauma
|
||||
|
||||
bottomPanel = new GUIFrame[4];
|
||||
|
||||
bottomPanel[(int)PanelTab.Crew] = new GUIFrame(panelRect, GUI.Style);
|
||||
bottomPanel[(int)PanelTab.Crew] = new GUIFrame(panelRect, "");
|
||||
bottomPanel[(int)PanelTab.Crew].Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
|
||||
|
||||
//new GUITextBlock(new Rectangle(0, 0, 200, 25), "Crew:", Color.Transparent, Color.White, Alignment.Left, GUI.Style, bottomPanel[(int)PanelTab.Crew]);
|
||||
//new GUITextBlock(new Rectangle(0, 0, 200, 25), "Crew:", Color.Transparent, Color.White, Alignment.Left, "", bottomPanel[(int)PanelTab.Crew]);
|
||||
|
||||
int crewColumnWidth = Math.Min(300, (panelRect.Width - 40) / 2);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 100, 20), "Crew:", GUI.Style, bottomPanel[(int)PanelTab.Crew], GUI.LargeFont);
|
||||
characterList = new GUIListBox(new Rectangle(0, 40, crewColumnWidth, 0), GUI.Style, bottomPanel[(int)PanelTab.Crew]);
|
||||
new GUITextBlock(new Rectangle(0, 0, 100, 20), "Crew:", "", bottomPanel[(int)PanelTab.Crew], GUI.LargeFont);
|
||||
characterList = new GUIListBox(new Rectangle(0, 40, crewColumnWidth, 0), "", bottomPanel[(int)PanelTab.Crew]);
|
||||
characterList.OnSelected = SelectCharacter;
|
||||
|
||||
//---------------------------------------
|
||||
|
||||
bottomPanel[(int)PanelTab.Map] = new GUIFrame(panelRect, GUI.Style);
|
||||
bottomPanel[(int)PanelTab.Map] = new GUIFrame(panelRect, "");
|
||||
bottomPanel[(int)PanelTab.Map].Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
|
||||
|
||||
startButton = new GUIButton(new Rectangle(0, 0, 100, 30), "Start",
|
||||
Alignment.BottomRight, GUI.Style, bottomPanel[(int)PanelTab.Map]);
|
||||
Alignment.BottomRight, "", bottomPanel[(int)PanelTab.Map]);
|
||||
startButton.OnClicked = StartShift;
|
||||
startButton.Enabled = false;
|
||||
|
||||
//---------------------------------------
|
||||
|
||||
bottomPanel[(int)PanelTab.Store] = new GUIFrame(panelRect, GUI.Style);
|
||||
bottomPanel[(int)PanelTab.Store] = new GUIFrame(panelRect, "");
|
||||
bottomPanel[(int)PanelTab.Store].Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
|
||||
|
||||
int sellColumnWidth = (panelRect.Width - 40) / 2 - 20;
|
||||
|
||||
selectedItemList = new GUIListBox(new Rectangle(0, 30, sellColumnWidth, 400), Color.White * 0.7f, GUI.Style, bottomPanel[(int)PanelTab.Store]);
|
||||
selectedItemList = new GUIListBox(new Rectangle(0, 30, sellColumnWidth, 400), Color.White * 0.7f, "", bottomPanel[(int)PanelTab.Store]);
|
||||
selectedItemList.OnSelected = DeselectItem;
|
||||
|
||||
var costText = new GUITextBlock(new Rectangle(0, 0, 100, 25), "Cost: ", GUI.Style, Alignment.BottomLeft, Alignment.TopLeft, bottomPanel[(int)PanelTab.Store]);
|
||||
var costText = new GUITextBlock(new Rectangle(0, 0, 100, 25), "Cost: ", "", Alignment.BottomLeft, Alignment.TopLeft, bottomPanel[(int)PanelTab.Store]);
|
||||
costText.TextGetter = CostTextGetter;
|
||||
|
||||
buyButton = new GUIButton(new Rectangle(selectedItemList.Rect.Width - 100, 0, 100, 25), "Buy", Alignment.Bottom, GUI.Style, bottomPanel[(int)PanelTab.Store]);
|
||||
buyButton = new GUIButton(new Rectangle(selectedItemList.Rect.Width - 100, 0, 100, 25), "Buy", Alignment.Bottom, "", bottomPanel[(int)PanelTab.Store]);
|
||||
buyButton.OnClicked = BuyItems;
|
||||
|
||||
storeItemList = new GUIListBox(new Rectangle(0, 30, sellColumnWidth, 400), Color.White * 0.7f, Alignment.TopRight, GUI.Style, bottomPanel[(int)PanelTab.Store]);
|
||||
storeItemList = new GUIListBox(new Rectangle(0, 30, sellColumnWidth, 400), Color.White * 0.7f, Alignment.TopRight, "", bottomPanel[(int)PanelTab.Store]);
|
||||
storeItemList.OnSelected = SelectItem;
|
||||
|
||||
int x = selectedItemList.Rect.Width + 40;
|
||||
@@ -142,7 +142,7 @@ namespace Barotrauma
|
||||
var items = MapEntityPrefab.list.FindAll(ep => ep.Price>0.0f && ep.Category.HasFlag(category));
|
||||
if (!items.Any()) continue;
|
||||
|
||||
var categoryButton = new GUIButton(new Rectangle(x, 0, 100, 20), category.ToString(), GUI.Style, bottomPanel[(int)PanelTab.Store]);
|
||||
var categoryButton = new GUIButton(new Rectangle(x, 0, 100, 20), category.ToString(), "", bottomPanel[(int)PanelTab.Store]);
|
||||
categoryButton.UserData = category;
|
||||
categoryButton.OnClicked = SelectItemCategory;
|
||||
|
||||
@@ -169,15 +169,15 @@ namespace Barotrauma
|
||||
topPanel.UserData = location;
|
||||
|
||||
var locationTitle = new GUITextBlock(new Rectangle(0, 0, 200, 25),
|
||||
"Location: "+location.Name, Color.Transparent, Color.White, Alignment.TopLeft, GUI.Style, topPanel);
|
||||
"Location: "+location.Name, Color.Transparent, Color.White, Alignment.TopLeft, "", topPanel);
|
||||
locationTitle.UserData = "locationtitle";
|
||||
locationTitle.Font = GUI.LargeFont;
|
||||
|
||||
|
||||
if (hireList == null)
|
||||
{
|
||||
hireList = new GUIListBox(new Rectangle(0, 40, 300, 0), GUI.Style, Alignment.Right, bottomPanel[(int)PanelTab.Crew]);
|
||||
new GUITextBlock(new Rectangle(0, 0, 300, 20), "Hire:", GUI.Style, Alignment.Right, Alignment.Left, bottomPanel[(int)PanelTab.Crew], false, GUI.LargeFont);
|
||||
hireList = new GUIListBox(new Rectangle(0, 40, 300, 0), "", Alignment.Right, bottomPanel[(int)PanelTab.Crew]);
|
||||
new GUITextBlock(new Rectangle(0, 0, 300, 20), "Hire:", "", Alignment.Right, Alignment.Left, bottomPanel[(int)PanelTab.Crew], false, GUI.LargeFont);
|
||||
|
||||
hireList.OnSelected = SelectCharacter;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ namespace Barotrauma
|
||||
hireList.ClearChildren();
|
||||
hireList.Enabled = false;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 0), "No-one available for hire", Color.Transparent, Color.LightGray, Alignment.Center, Alignment.Center, GUI.Style, hireList);
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 0), "No-one available for hire", Color.Transparent, Color.LightGray, Alignment.Center, Alignment.Center, "", hireList);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace Barotrauma
|
||||
new Rectangle(0, 0, 0, 25),
|
||||
c.Salary.ToString(),
|
||||
null, null,
|
||||
Alignment.TopRight, GUI.Style, frame);
|
||||
Alignment.TopRight, "", frame);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -226,7 +226,7 @@ namespace Barotrauma
|
||||
|
||||
if (location == null) return;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 250, 0), location.Name, GUI.Style, Alignment.TopLeft, Alignment.TopCenter, locationPanel, true, GUI.LargeFont);
|
||||
new GUITextBlock(new Rectangle(0, 0, 250, 0), location.Name, "", Alignment.TopLeft, Alignment.TopCenter, locationPanel, true, GUI.LargeFont);
|
||||
|
||||
if (GameMain.GameSession.Map.SelectedConnection != null && GameMain.GameSession.Map.SelectedConnection.Mission != null)
|
||||
{
|
||||
@@ -290,7 +290,7 @@ namespace Barotrauma
|
||||
new Rectangle(width - 80, 0, 80, 25),
|
||||
ep.Price.ToString(),
|
||||
null, null, Alignment.TopLeft,
|
||||
Alignment.TopLeft, GUI.Style, frame);
|
||||
Alignment.TopLeft, "", frame);
|
||||
textBlock.Font = font;
|
||||
textBlock.ToolTip = ep.Description;
|
||||
|
||||
@@ -493,7 +493,7 @@ namespace Barotrauma
|
||||
|
||||
previewFrame = new GUIFrame(new Rectangle(0, 60, width, 300),
|
||||
new Color(0.0f, 0.0f, 0.0f, 0.8f),
|
||||
Alignment.TopCenter, GUI.Style, bottomPanel[selectedRightPanel]);
|
||||
Alignment.TopCenter, "", bottomPanel[selectedRightPanel]);
|
||||
previewFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
|
||||
previewFrame.UserData = characterInfo;
|
||||
|
||||
@@ -502,7 +502,7 @@ namespace Barotrauma
|
||||
|
||||
if (component.Parent == hireList)
|
||||
{
|
||||
GUIButton hireButton = new GUIButton(new Rectangle(0,0, 100, 20), "Hire", Alignment.BottomCenter, GUI.Style, previewFrame);
|
||||
GUIButton hireButton = new GUIButton(new Rectangle(0,0, 100, 20), "Hire", Alignment.BottomCenter, "", previewFrame);
|
||||
hireButton.UserData = characterInfo;
|
||||
hireButton.OnClicked = HireCharacter;
|
||||
}
|
||||
|
||||
@@ -43,40 +43,40 @@ namespace Barotrauma
|
||||
290, y,
|
||||
500, 360);
|
||||
|
||||
GUIButton button = new GUIButton(new Rectangle(50, y, 200, 30), "Tutorial", null, Alignment.TopLeft, Alignment.Left, GUI.Style, buttonsTab);
|
||||
GUIButton button = new GUIButton(new Rectangle(50, y, 200, 30), "Tutorial", null, Alignment.TopLeft, Alignment.Left, "", buttonsTab);
|
||||
button.Color = button.Color * 0.8f;
|
||||
button.OnClicked = TutorialButtonClicked;
|
||||
|
||||
button = new GUIButton(new Rectangle(50, y + 60, 200, 30), "New Game", null, Alignment.TopLeft, Alignment.Left, GUI.Style, buttonsTab);
|
||||
button = new GUIButton(new Rectangle(50, y + 60, 200, 30), "New Game", null, Alignment.TopLeft, Alignment.Left, "", buttonsTab);
|
||||
button.Color = button.Color * 0.8f;
|
||||
button.UserData = Tab.NewGame;
|
||||
button.OnClicked = SelectTab;
|
||||
|
||||
button = new GUIButton(new Rectangle(50, y + 100, 200, 30), "Load Game", null, Alignment.TopLeft, Alignment.Left, GUI.Style, buttonsTab);
|
||||
button = new GUIButton(new Rectangle(50, y + 100, 200, 30), "Load Game", null, Alignment.TopLeft, Alignment.Left, "", buttonsTab);
|
||||
button.Color = button.Color * 0.8f;
|
||||
button.UserData = Tab.LoadGame;
|
||||
button.OnClicked = SelectTab;
|
||||
|
||||
button = new GUIButton(new Rectangle(50, y + 160, 200, 30), "Join Server", null, Alignment.TopLeft, Alignment.Left, GUI.Style, buttonsTab);
|
||||
button = new GUIButton(new Rectangle(50, y + 160, 200, 30), "Join Server", null, Alignment.TopLeft, Alignment.Left, "", buttonsTab);
|
||||
button.Color = button.Color * 0.8f;
|
||||
//button.UserData = (int)Tabs.JoinServer;
|
||||
button.OnClicked = JoinServerClicked;
|
||||
|
||||
button = new GUIButton(new Rectangle(50, y + 200, 200, 30), "Host Server", null, Alignment.TopLeft, Alignment.Left, GUI.Style, buttonsTab);
|
||||
button = new GUIButton(new Rectangle(50, y + 200, 200, 30), "Host Server", null, Alignment.TopLeft, Alignment.Left, "", buttonsTab);
|
||||
button.Color = button.Color * 0.8f;
|
||||
button.UserData = Tab.HostServer;
|
||||
button.OnClicked = SelectTab;
|
||||
|
||||
button = new GUIButton(new Rectangle(50, y + 260, 200, 30), "Submarine Editor", null, Alignment.TopLeft, Alignment.Left, GUI.Style, buttonsTab);
|
||||
button = new GUIButton(new Rectangle(50, y + 260, 200, 30), "Submarine Editor", null, Alignment.TopLeft, Alignment.Left, "", buttonsTab);
|
||||
button.Color = button.Color * 0.8f;
|
||||
button.OnClicked = (GUIButton btn, object userdata) => { GameMain.EditMapScreen.Select(); return true; };
|
||||
|
||||
button = new GUIButton(new Rectangle(50, y + 320, 200, 30), "Settings", null, Alignment.TopLeft, Alignment.Left, GUI.Style, buttonsTab);
|
||||
button = new GUIButton(new Rectangle(50, y + 320, 200, 30), "Settings", null, Alignment.TopLeft, Alignment.Left, "", buttonsTab);
|
||||
button.Color = button.Color * 0.8f;
|
||||
button.UserData = Tab.Settings;
|
||||
button.OnClicked = SelectTab;
|
||||
|
||||
button = new GUIButton(new Rectangle(0, 0, 150, 30), "Quit", Alignment.BottomRight, GUI.Style, buttonsTab);
|
||||
button = new GUIButton(new Rectangle(0, 0, 150, 30), "Quit", Alignment.BottomRight, "", buttonsTab);
|
||||
button.Color = button.Color * 0.8f;
|
||||
button.OnClicked = QuitClicked;
|
||||
|
||||
@@ -84,31 +84,31 @@ namespace Barotrauma
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
menuTabs[(int)Tab.NewGame] = new GUIFrame(panelRect, GUI.Style);
|
||||
menuTabs[(int)Tab.NewGame] = new GUIFrame(panelRect, "");
|
||||
menuTabs[(int)Tab.NewGame].Padding = new Vector4(20.0f,20.0f,20.0f,20.0f);
|
||||
|
||||
//new GUITextBlock(new Rectangle(0, -20, 0, 30), "New Game", null, null, Alignment.CenterX, GUI.style, menuTabs[(int)Tabs.NewGame]);
|
||||
//new GUITextBlock(new Rectangle(0, -20, 0, 30), "New Game", null, null, Alignment.CenterX, "", menuTabs[(int)Tabs.NewGame]);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 30), "Selected submarine:", null, null, Alignment.Left, GUI.Style, menuTabs[(int)Tab.NewGame]);
|
||||
subList = new GUIListBox(new Rectangle(0, 30, 230, panelRect.Height-100), GUI.Style, menuTabs[(int)Tab.NewGame]);
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 30), "Selected submarine:", null, null, Alignment.Left, "", menuTabs[(int)Tab.NewGame]);
|
||||
subList = new GUIListBox(new Rectangle(0, 30, 230, panelRect.Height-100), "", menuTabs[(int)Tab.NewGame]);
|
||||
|
||||
UpdateSubList();
|
||||
|
||||
new GUITextBlock(new Rectangle((int)(subList.Rect.Width + 20), 0, 100, 20),
|
||||
"Save name: ", GUI.Style, Alignment.Left, Alignment.Left, menuTabs[(int)Tab.NewGame]);
|
||||
"Save name: ", "", Alignment.Left, Alignment.Left, menuTabs[(int)Tab.NewGame]);
|
||||
|
||||
saveNameBox = new GUITextBox(new Rectangle((int)(subList.Rect.Width + 30), 30, 180, 20),
|
||||
Alignment.TopLeft, GUI.Style, menuTabs[(int)Tab.NewGame]);
|
||||
Alignment.TopLeft, "", menuTabs[(int)Tab.NewGame]);
|
||||
|
||||
new GUITextBlock(new Rectangle((int)(subList.Rect.Width + 20), 60, 100, 20),
|
||||
"Map Seed: ", GUI.Style, Alignment.Left, Alignment.Left, menuTabs[(int)Tab.NewGame]);
|
||||
"Map Seed: ", "", Alignment.Left, Alignment.Left, menuTabs[(int)Tab.NewGame]);
|
||||
|
||||
seedBox = new GUITextBox(new Rectangle((int)(subList.Rect.Width + 30), 90, 180, 20),
|
||||
Alignment.TopLeft, GUI.Style, menuTabs[(int)Tab.NewGame]);
|
||||
Alignment.TopLeft, "", menuTabs[(int)Tab.NewGame]);
|
||||
seedBox.Text = ToolBox.RandomSeed(8);
|
||||
|
||||
|
||||
button = new GUIButton(new Rectangle(0, 0, 100, 30), "Start", Alignment.BottomRight, GUI.Style, menuTabs[(int)Tab.NewGame]);
|
||||
button = new GUIButton(new Rectangle(0, 0, 100, 30), "Start", Alignment.BottomRight, "", menuTabs[(int)Tab.NewGame]);
|
||||
button.OnClicked = (GUIButton btn, object userData) =>
|
||||
{
|
||||
Submarine selectedSub = subList.SelectedData as Submarine;
|
||||
@@ -135,38 +135,38 @@ namespace Barotrauma
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
menuTabs[(int)Tab.LoadGame] = new GUIFrame(panelRect, GUI.Style);
|
||||
menuTabs[(int)Tab.LoadGame] = new GUIFrame(panelRect, "");
|
||||
//menuTabs[(int)Tabs.LoadGame].Padding = GUI.style.smallPadding;
|
||||
|
||||
|
||||
menuTabs[(int)Tab.HostServer] = new GUIFrame(panelRect, GUI.Style);
|
||||
menuTabs[(int)Tab.HostServer] = new GUIFrame(panelRect, "");
|
||||
//menuTabs[(int)Tabs.JoinServer].Padding = GUI.style.smallPadding;
|
||||
|
||||
//new GUITextBlock(new Rectangle(0, -25, 0, 30), "Host Server", GUI.style, Alignment.CenterX, Alignment.CenterX, menuTabs[(int)Tabs.HostServer], false, GUI.LargeFont);
|
||||
//new GUITextBlock(new Rectangle(0, -25, 0, 30), "Host Server", "", Alignment.CenterX, Alignment.CenterX, menuTabs[(int)Tabs.HostServer], false, GUI.LargeFont);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 100, 30), "Server Name:", GUI.Style, Alignment.TopLeft, Alignment.Left, menuTabs[(int)Tab.HostServer]);
|
||||
serverNameBox = new GUITextBox(new Rectangle(160, 0, 200, 30), null, null, Alignment.TopLeft, Alignment.Left, GUI.Style, menuTabs[(int)Tab.HostServer]);
|
||||
new GUITextBlock(new Rectangle(0, 0, 100, 30), "Server Name:", "", Alignment.TopLeft, Alignment.Left, menuTabs[(int)Tab.HostServer]);
|
||||
serverNameBox = new GUITextBox(new Rectangle(160, 0, 200, 30), null, null, Alignment.TopLeft, Alignment.Left, "", menuTabs[(int)Tab.HostServer]);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 50, 100, 30), "Server port:", GUI.Style, Alignment.TopLeft, Alignment.Left, menuTabs[(int)Tab.HostServer]);
|
||||
portBox = new GUITextBox(new Rectangle(160, 50, 200, 30), null, null, Alignment.TopLeft, Alignment.Left, GUI.Style, menuTabs[(int)Tab.HostServer]);
|
||||
new GUITextBlock(new Rectangle(0, 50, 100, 30), "Server port:", "", Alignment.TopLeft, Alignment.Left, menuTabs[(int)Tab.HostServer]);
|
||||
portBox = new GUITextBox(new Rectangle(160, 50, 200, 30), null, null, Alignment.TopLeft, Alignment.Left, "", menuTabs[(int)Tab.HostServer]);
|
||||
portBox.Text = NetConfig.DefaultPort.ToString();
|
||||
portBox.ToolTip = "Server port";
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 100, 100, 30), "Max players:", GUI.Style, Alignment.TopLeft, Alignment.Left, menuTabs[(int)Tab.HostServer]);
|
||||
maxPlayersBox = new GUITextBox(new Rectangle(195, 100, 30, 30), null, null, Alignment.TopLeft, Alignment.Center, GUI.Style, menuTabs[(int)Tab.HostServer]);
|
||||
new GUITextBlock(new Rectangle(0, 100, 100, 30), "Max players:", "", Alignment.TopLeft, Alignment.Left, menuTabs[(int)Tab.HostServer]);
|
||||
maxPlayersBox = new GUITextBox(new Rectangle(195, 100, 30, 30), null, null, Alignment.TopLeft, Alignment.Center, "", menuTabs[(int)Tab.HostServer]);
|
||||
maxPlayersBox.Text = "8";
|
||||
maxPlayersBox.Enabled = false;
|
||||
|
||||
var minusPlayersBox = new GUIButton(new Rectangle(160, 100, 30, 30), "-", GUI.Style, menuTabs[(int)Tab.HostServer]);
|
||||
var minusPlayersBox = new GUIButton(new Rectangle(160, 100, 30, 30), "-", "", menuTabs[(int)Tab.HostServer]);
|
||||
minusPlayersBox.UserData = -1;
|
||||
minusPlayersBox.OnClicked = ChangeMaxPlayers;
|
||||
|
||||
var plusPlayersBox = new GUIButton(new Rectangle(230, 100, 30, 30), "+", GUI.Style, menuTabs[(int)Tab.HostServer]);
|
||||
var plusPlayersBox = new GUIButton(new Rectangle(230, 100, 30, 30), "+", "", menuTabs[(int)Tab.HostServer]);
|
||||
plusPlayersBox.UserData = 1;
|
||||
plusPlayersBox.OnClicked = ChangeMaxPlayers;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 150, 100, 30), "Password (optional):", GUI.Style, Alignment.TopLeft, Alignment.Left, menuTabs[(int)Tab.HostServer]);
|
||||
passwordBox = new GUITextBox(new Rectangle(160, 150, 200, 30), null, null, Alignment.TopLeft, Alignment.Left, GUI.Style, menuTabs[(int)Tab.HostServer]);
|
||||
new GUITextBlock(new Rectangle(0, 150, 100, 30), "Password (optional):", "", Alignment.TopLeft, Alignment.Left, menuTabs[(int)Tab.HostServer]);
|
||||
passwordBox = new GUITextBox(new Rectangle(160, 150, 200, 30), null, null, Alignment.TopLeft, Alignment.Left, "", menuTabs[(int)Tab.HostServer]);
|
||||
|
||||
isPublicBox = new GUITickBox(new Rectangle(10, 200, 20, 20), "Public server", Alignment.TopLeft, menuTabs[(int)Tab.HostServer]);
|
||||
isPublicBox.ToolTip = "Public servers are shown in the list of available servers in the \"Join Server\" -tab";
|
||||
@@ -177,7 +177,7 @@ namespace Barotrauma
|
||||
+ " However, UPnP isn't supported by all routers, so you may need to setup port forwards manually"
|
||||
+" if players are unable to join the server (see the readme for instructions).";
|
||||
|
||||
GUIButton hostButton = new GUIButton(new Rectangle(0, 0, 100, 30), "Start", Alignment.BottomRight, GUI.Style, menuTabs[(int)Tab.HostServer]);
|
||||
GUIButton hostButton = new GUIButton(new Rectangle(0, 0, 100, 30), "Start", Alignment.BottomRight, "", menuTabs[(int)Tab.HostServer]);
|
||||
hostButton.OnClicked = HostServerClicked;
|
||||
|
||||
this.game = game;
|
||||
@@ -211,7 +211,7 @@ namespace Barotrauma
|
||||
{
|
||||
var textBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, 0, 25),
|
||||
ToolBox.LimitString(sub.Name, GUI.Font, subList.Rect.Width - 65), GUI.Style,
|
||||
ToolBox.LimitString(sub.Name, GUI.Font, subList.Rect.Width - 65), "",
|
||||
Alignment.Left, Alignment.Left, subList)
|
||||
{
|
||||
Padding = new Vector4(10.0f, 0.0f, 0.0f, 0.0f),
|
||||
@@ -223,7 +223,7 @@ namespace Barotrauma
|
||||
{
|
||||
textBlock.TextColor = textBlock.TextColor * 0.85f;
|
||||
|
||||
var shuttleText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "Shuttle", GUI.Style, Alignment.Left, Alignment.CenterY | Alignment.Right, textBlock, false, GUI.SmallFont);
|
||||
var shuttleText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "Shuttle", "", Alignment.Left, Alignment.CenterY | Alignment.Right, textBlock, false, GUI.SmallFont);
|
||||
shuttleText.TextColor = textBlock.TextColor * 0.8f;
|
||||
shuttleText.ToolTip = textBlock.ToolTip;
|
||||
}
|
||||
@@ -388,7 +388,7 @@ namespace Barotrauma
|
||||
|
||||
string[] saveFiles = SaveUtil.GetSaveFiles();
|
||||
|
||||
saveList = new GUIListBox(new Rectangle(0, 0, 200, menuTabs[(int)Tab.LoadGame].Rect.Height - 80), Color.White, GUI.Style, menuTabs[(int)Tab.LoadGame]);
|
||||
saveList = new GUIListBox(new Rectangle(0, 0, 200, menuTabs[(int)Tab.LoadGame].Rect.Height - 80), Color.White, "", menuTabs[(int)Tab.LoadGame]);
|
||||
saveList.OnSelected = SelectSaveFile;
|
||||
|
||||
foreach (string saveFile in saveFiles)
|
||||
@@ -396,7 +396,7 @@ namespace Barotrauma
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, 0, 25),
|
||||
saveFile,
|
||||
GUI.Style,
|
||||
"",
|
||||
Alignment.Left,
|
||||
Alignment.Left,
|
||||
saveList);
|
||||
@@ -404,7 +404,7 @@ namespace Barotrauma
|
||||
textBlock.UserData = saveFile;
|
||||
}
|
||||
|
||||
var button = new GUIButton(new Rectangle(0, 0, 100, 30), "Start", Alignment.Right | Alignment.Bottom, GUI.Style, menuTabs[(int)Tab.LoadGame]);
|
||||
var button = new GUIButton(new Rectangle(0, 0, 100, 30), "Start", Alignment.Right | Alignment.Bottom, "", menuTabs[(int)Tab.LoadGame]);
|
||||
button.OnClicked = LoadGame;
|
||||
}
|
||||
|
||||
@@ -428,22 +428,22 @@ namespace Barotrauma
|
||||
|
||||
string mapseed = ToolBox.GetAttributeString(doc.Root, "mapseed", "unknown");
|
||||
|
||||
GUIFrame saveFileFrame = new GUIFrame(new Rectangle((int)(saveList.Rect.Width + 20), 0, 200, 230), Color.Black*0.4f, GUI.Style, menuTabs[(int)Tab.LoadGame]);
|
||||
GUIFrame saveFileFrame = new GUIFrame(new Rectangle((int)(saveList.Rect.Width + 20), 0, 200, 230), Color.Black*0.4f, "", menuTabs[(int)Tab.LoadGame]);
|
||||
saveFileFrame.UserData = "savefileframe";
|
||||
saveFileFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
|
||||
|
||||
new GUITextBlock(new Rectangle(0,0,0,20), fileName, GUI.Style, Alignment.TopLeft, Alignment.TopLeft, saveFileFrame, false, GUI.LargeFont);
|
||||
new GUITextBlock(new Rectangle(0,0,0,20), fileName, "", Alignment.TopLeft, Alignment.TopLeft, saveFileFrame, false, GUI.LargeFont);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 35, 0, 20), "Submarine: ", GUI.Style, saveFileFrame).Font = GUI.SmallFont;
|
||||
new GUITextBlock(new Rectangle(15, 52, 0, 20), subName, GUI.Style, saveFileFrame).Font = GUI.SmallFont;
|
||||
new GUITextBlock(new Rectangle(0, 35, 0, 20), "Submarine: ", "", saveFileFrame).Font = GUI.SmallFont;
|
||||
new GUITextBlock(new Rectangle(15, 52, 0, 20), subName, "", saveFileFrame).Font = GUI.SmallFont;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 70, 0, 20), "Last saved: ", GUI.Style, saveFileFrame).Font = GUI.SmallFont;
|
||||
new GUITextBlock(new Rectangle(15, 85, 0, 20), saveTime, GUI.Style, saveFileFrame).Font = GUI.SmallFont;
|
||||
new GUITextBlock(new Rectangle(0, 70, 0, 20), "Last saved: ", "", saveFileFrame).Font = GUI.SmallFont;
|
||||
new GUITextBlock(new Rectangle(15, 85, 0, 20), saveTime, "", saveFileFrame).Font = GUI.SmallFont;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 105, 0, 20), "Map seed: ", GUI.Style, saveFileFrame).Font = GUI.SmallFont;
|
||||
new GUITextBlock(new Rectangle(15, 120, 0, 20), mapseed, GUI.Style, saveFileFrame).Font = GUI.SmallFont;
|
||||
new GUITextBlock(new Rectangle(0, 105, 0, 20), "Map seed: ", "", saveFileFrame).Font = GUI.SmallFont;
|
||||
new GUITextBlock(new Rectangle(15, 120, 0, 20), mapseed, "", saveFileFrame).Font = GUI.SmallFont;
|
||||
|
||||
var deleteSaveButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Delete", Alignment.BottomCenter, GUI.Style, saveFileFrame);
|
||||
var deleteSaveButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Delete", Alignment.BottomCenter, "", saveFileFrame);
|
||||
deleteSaveButton.UserData = fileName;
|
||||
deleteSaveButton.OnClicked = DeleteSave;
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace Barotrauma
|
||||
|
||||
//server info panel ------------------------------------------------------------
|
||||
|
||||
infoFrame = new GUIFrame(new Rectangle(0, 0, (int)(panelRect.Width * 0.7f), (int)(panelRect.Height * 0.6f)), GUI.Style, menu);
|
||||
infoFrame = new GUIFrame(new Rectangle(0, 0, (int)(panelRect.Width * 0.7f), (int)(panelRect.Height * 0.6f)), "", menu);
|
||||
infoFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
|
||||
|
||||
//chatbox ----------------------------------------------------------------------
|
||||
@@ -183,11 +183,11 @@ namespace Barotrauma
|
||||
new Rectangle(0, (int)(panelRect.Height * 0.6f + 20),
|
||||
(int)(panelRect.Width * 0.7f),
|
||||
(int)(panelRect.Height * 0.4f - 20)),
|
||||
GUI.Style, menu);
|
||||
"", menu);
|
||||
chatFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 40.0f);
|
||||
|
||||
chatBox = new GUIListBox(new Rectangle(0,0,0,chatFrame.Rect.Height-80), Color.White, GUI.Style, chatFrame);
|
||||
textBox = new GUITextBox(new Rectangle(0, 25, 0, 25), Alignment.Bottom, GUI.Style, chatFrame);
|
||||
chatBox = new GUIListBox(new Rectangle(0,0,0,chatFrame.Rect.Height-80), Color.White, "", chatFrame);
|
||||
textBox = new GUITextBox(new Rectangle(0, 25, 0, 25), Alignment.Bottom, "", chatFrame);
|
||||
textBox.Font = GUI.SmallFont;
|
||||
|
||||
//player info panel ------------------------------------------------------------
|
||||
@@ -195,7 +195,7 @@ namespace Barotrauma
|
||||
myPlayerFrame = new GUIFrame(
|
||||
new Rectangle((int)(panelRect.Width * 0.7f + 20), 0,
|
||||
(int)(panelRect.Width * 0.3f - 20), (int)(panelRect.Height * 0.6f)),
|
||||
GUI.Style, menu);
|
||||
"", menu);
|
||||
myPlayerFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
|
||||
|
||||
//player list ------------------------------------------------------------------
|
||||
@@ -203,11 +203,11 @@ namespace Barotrauma
|
||||
GUIFrame playerListFrame = new GUIFrame(
|
||||
new Rectangle((int)(panelRect.Width * 0.7f + 20), (int)(panelRect.Height * 0.6f + 20),
|
||||
(int)(panelRect.Width * 0.3f - 20), (int)(panelRect.Height * 0.4f - 20)),
|
||||
GUI.Style, menu);
|
||||
"", menu);
|
||||
|
||||
playerListFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 40.0f);
|
||||
|
||||
playerList = new GUIListBox(new Rectangle(0,0,0,0), null, GUI.Style, playerListFrame);
|
||||
playerList = new GUIListBox(new Rectangle(0,0,0,0), null, "", playerListFrame);
|
||||
playerList.OnSelected = SelectPlayer;
|
||||
|
||||
//submarine list ------------------------------------------------------------------
|
||||
@@ -215,11 +215,11 @@ namespace Barotrauma
|
||||
int columnWidth = infoFrame.Rect.Width / 3 - 5;
|
||||
int columnX = 0;
|
||||
|
||||
new GUITextBlock(new Rectangle(columnX, 120, columnWidth, 30), "Submarine:", GUI.Style, infoFrame);
|
||||
subList = new GUIListBox(new Rectangle(columnX, 150, columnWidth, infoFrame.Rect.Height - 150 - 80), Color.White, GUI.Style, infoFrame);
|
||||
new GUITextBlock(new Rectangle(columnX, 120, columnWidth, 30), "Submarine:", "", infoFrame);
|
||||
subList = new GUIListBox(new Rectangle(columnX, 150, columnWidth, infoFrame.Rect.Height - 150 - 80), Color.White, "", infoFrame);
|
||||
subList.OnSelected = VotableClicked;
|
||||
|
||||
var voteText = new GUITextBlock(new Rectangle(columnX, 120, columnWidth, 30), "Votes: ", GUI.Style, Alignment.TopLeft, Alignment.TopRight, infoFrame);
|
||||
var voteText = new GUITextBlock(new Rectangle(columnX, 120, columnWidth, 30), "Votes: ", "", Alignment.TopLeft, Alignment.TopRight, infoFrame);
|
||||
voteText.UserData = "subvotes";
|
||||
voteText.Visible = false;
|
||||
|
||||
@@ -230,17 +230,17 @@ namespace Barotrauma
|
||||
|
||||
//respawn shuttle ------------------------------------------------------------------
|
||||
|
||||
new GUITextBlock(new Rectangle(columnX, 120, 20, 20), "Respawn shuttle:", GUI.Style, infoFrame);
|
||||
shuttleList = new GUIDropDown(new Rectangle(columnX, 150, 200, 20), "", GUI.Style, infoFrame);
|
||||
new GUITextBlock(new Rectangle(columnX, 120, 20, 20), "Respawn shuttle:", "", infoFrame);
|
||||
shuttleList = new GUIDropDown(new Rectangle(columnX, 150, 200, 20), "", "", infoFrame);
|
||||
|
||||
|
||||
//gamemode ------------------------------------------------------------------
|
||||
|
||||
new GUITextBlock(new Rectangle(columnX, 180, 0, 30), "Game mode: ", GUI.Style, infoFrame);
|
||||
modeList = new GUIListBox(new Rectangle(columnX, 200, columnWidth, infoFrame.Rect.Height - 300), GUI.Style, infoFrame);
|
||||
new GUITextBlock(new Rectangle(columnX, 180, 0, 30), "Game mode: ", "", infoFrame);
|
||||
modeList = new GUIListBox(new Rectangle(columnX, 200, columnWidth, infoFrame.Rect.Height - 300), "", infoFrame);
|
||||
modeList.OnSelected = VotableClicked;
|
||||
|
||||
voteText = new GUITextBlock(new Rectangle(columnX, 120, columnWidth, 30), "Votes: ", GUI.Style, Alignment.TopLeft, Alignment.TopRight, infoFrame);
|
||||
voteText = new GUITextBlock(new Rectangle(columnX, 120, columnWidth, 30), "Votes: ", "", Alignment.TopLeft, Alignment.TopRight, infoFrame);
|
||||
voteText.UserData = "modevotes";
|
||||
voteText.Visible = false;
|
||||
|
||||
@@ -250,7 +250,7 @@ namespace Barotrauma
|
||||
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, 0, 25),
|
||||
mode.Name, GUI.Style,
|
||||
mode.Name, "",
|
||||
Alignment.Left, Alignment.Left,
|
||||
modeList);
|
||||
textBlock.ToolTip = mode.Description;
|
||||
@@ -260,17 +260,17 @@ namespace Barotrauma
|
||||
|
||||
//mission type ------------------------------------------------------------------
|
||||
|
||||
missionTypeBlock = new GUITextBlock(new Rectangle(columnX, 0, 300, 20), "Mission type:", GUI.Style, Alignment.BottomLeft, Alignment.TopLeft, infoFrame);
|
||||
missionTypeBlock = new GUITextBlock(new Rectangle(columnX, 0, 300, 20), "Mission type:", "", Alignment.BottomLeft, Alignment.TopLeft, infoFrame);
|
||||
missionTypeBlock.UserData = 0;
|
||||
|
||||
missionTypeButtons = new GUIButton[2];
|
||||
|
||||
missionTypeButtons[0] = new GUIButton(new Rectangle(100, 0, 20, 20), "<", Alignment.BottomLeft, GUI.Style, missionTypeBlock);
|
||||
missionTypeButtons[0] = new GUIButton(new Rectangle(100, 0, 20, 20), "<", Alignment.BottomLeft, "", missionTypeBlock);
|
||||
missionTypeButtons[0].UserData = -1;
|
||||
|
||||
new GUITextBlock(new Rectangle(120, 0, 80, 20), "Random", GUI.Style, Alignment.BottomLeft, Alignment.TopCenter, missionTypeBlock).UserData = 0;
|
||||
new GUITextBlock(new Rectangle(120, 0, 80, 20), "Random", "", Alignment.BottomLeft, Alignment.TopCenter, missionTypeBlock).UserData = 0;
|
||||
|
||||
missionTypeButtons[1] = new GUIButton(new Rectangle(200, 0, 20, 20), ">", Alignment.BottomLeft, GUI.Style, missionTypeBlock);
|
||||
missionTypeButtons[1] = new GUIButton(new Rectangle(200, 0, 20, 20), ">", Alignment.BottomLeft, "", missionTypeBlock);
|
||||
missionTypeButtons[1].UserData = 1;
|
||||
|
||||
missionTypeBlock.Visible = false;
|
||||
@@ -281,7 +281,7 @@ namespace Barotrauma
|
||||
|
||||
//var modeDescription = new GUITextBlock(
|
||||
// new Rectangle(columnX, 150, (int)(columnWidth * 1.2f), infoFrame.Rect.Height - 150 - 80),
|
||||
// "", GUI.Style, Alignment.TopLeft, Alignment.TopLeft, infoFrame, true, GUI.SmallFont);
|
||||
// "", "", Alignment.TopLeft, Alignment.TopLeft, infoFrame, true, GUI.SmallFont);
|
||||
//modeDescription.Color = Color.Black * 0.3f;
|
||||
|
||||
//modeList.UserData = modeDescription;
|
||||
@@ -291,25 +291,25 @@ namespace Barotrauma
|
||||
//seed ------------------------------------------------------------------
|
||||
|
||||
new GUITextBlock(new Rectangle(columnX, 120, 180, 20),
|
||||
"Level Seed: ", GUI.Style, Alignment.Left, Alignment.TopLeft, infoFrame);
|
||||
"Level Seed: ", "", Alignment.Left, Alignment.TopLeft, infoFrame);
|
||||
|
||||
seedBox = new GUITextBox(new Rectangle(columnX, 150, columnWidth/2, 20),
|
||||
Alignment.TopLeft, GUI.Style, infoFrame);
|
||||
Alignment.TopLeft, "", infoFrame);
|
||||
seedBox.OnTextChanged = SelectSeed;
|
||||
LevelSeed = ToolBox.RandomSeed(8);
|
||||
|
||||
//traitor probability ------------------------------------------------------------------
|
||||
|
||||
new GUITextBlock(new Rectangle(columnX, 180, 20, 20), "Traitors:", GUI.Style, infoFrame);
|
||||
new GUITextBlock(new Rectangle(columnX, 180, 20, 20), "Traitors:", "", infoFrame);
|
||||
|
||||
traitorProbabilityButtons = new GUIButton[2];
|
||||
|
||||
traitorProbabilityButtons[0] = new GUIButton(new Rectangle(columnX, 205, 20, 20), "<", GUI.Style, infoFrame);
|
||||
traitorProbabilityButtons[0] = new GUIButton(new Rectangle(columnX, 205, 20, 20), "<", "", infoFrame);
|
||||
traitorProbabilityButtons[0].UserData = -1;
|
||||
|
||||
traitorProbabilityText = new GUITextBlock(new Rectangle(columnX+20, 205, 80, 20), "No", null,null, Alignment.TopCenter, GUI.Style, infoFrame);
|
||||
traitorProbabilityText = new GUITextBlock(new Rectangle(columnX+20, 205, 80, 20), "No", null,null, Alignment.TopCenter, "", infoFrame);
|
||||
|
||||
traitorProbabilityButtons[1] = new GUIButton(new Rectangle(columnX + 100, 205, 20, 20), ">", GUI.Style, infoFrame);
|
||||
traitorProbabilityButtons[1] = new GUIButton(new Rectangle(columnX + 100, 205, 20, 20), ">", "", infoFrame);
|
||||
traitorProbabilityButtons[1].UserData = 1;
|
||||
|
||||
|
||||
@@ -318,18 +318,18 @@ namespace Barotrauma
|
||||
autoRestartBox = new GUITickBox(new Rectangle(columnX, 240, 20, 20), "Automatic restart", Alignment.TopLeft, infoFrame);
|
||||
autoRestartBox.OnSelected = ToggleAutoRestart;
|
||||
|
||||
var restartText = new GUITextBlock(new Rectangle(columnX, 265, 20, 20), "", GUI.Style, infoFrame);
|
||||
var restartText = new GUITextBlock(new Rectangle(columnX, 265, 20, 20), "", "", infoFrame);
|
||||
restartText.Font = GUI.SmallFont;
|
||||
restartText.TextGetter = AutoRestartText;
|
||||
|
||||
//server info ------------------------------------------------------------------
|
||||
|
||||
var serverName = new GUITextBox(new Rectangle(0, 0, 200, 20), null, null, Alignment.TopLeft, Alignment.TopLeft, GUI.Style, infoFrame);
|
||||
var serverName = new GUITextBox(new Rectangle(0, 0, 200, 20), null, null, Alignment.TopLeft, Alignment.TopLeft, "", infoFrame);
|
||||
serverName.TextGetter = GetServerName;
|
||||
serverName.Enabled = GameMain.Server != null;
|
||||
serverName.OnTextChanged = ChangeServerName;
|
||||
|
||||
serverMessage = new GUITextBox(new Rectangle(0, 30, 360, 70), null, null, Alignment.TopLeft, Alignment.TopLeft, GUI.Style, infoFrame);
|
||||
serverMessage = new GUITextBox(new Rectangle(0, 30, 360, 70), null, null, Alignment.TopLeft, Alignment.TopLeft, "", infoFrame);
|
||||
serverMessage.Wrap = true;
|
||||
serverMessage.OnTextChanged = UpdateServerMessage;
|
||||
|
||||
@@ -397,10 +397,10 @@ namespace Barotrauma
|
||||
missionTypeButtons[0].OnClicked = ToggleMissionType;
|
||||
missionTypeButtons[1].OnClicked = ToggleMissionType;
|
||||
|
||||
StartButton = new GUIButton(new Rectangle(0, 0, 80, 30), "Start", Alignment.BottomRight, GUI.Style, infoFrame);
|
||||
StartButton = new GUIButton(new Rectangle(0, 0, 80, 30), "Start", Alignment.BottomRight, "", infoFrame);
|
||||
StartButton.OnClicked = GameMain.Server.StartGameClicked;
|
||||
|
||||
GUIButton settingsButton = new GUIButton(new Rectangle(-100, 0, 80, 30), "Settings", Alignment.BottomRight, GUI.Style, infoFrame);
|
||||
GUIButton settingsButton = new GUIButton(new Rectangle(-100, 0, 80, 30), "Settings", Alignment.BottomRight, "", infoFrame);
|
||||
settingsButton.OnClicked = GameMain.Server.ToggleSettingsFrame;
|
||||
settingsButton.UserData = "settingsButton";
|
||||
|
||||
@@ -442,7 +442,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (GameMain.Client.GameStarted)
|
||||
{
|
||||
GUIButton spectateButton = new GUIButton(new Rectangle(0, 0, 80, 30), "Spectate", Alignment.BottomRight, GUI.Style, infoFrame);
|
||||
GUIButton spectateButton = new GUIButton(new Rectangle(0, 0, 80, 30), "Spectate", Alignment.BottomRight, "", infoFrame);
|
||||
spectateButton.OnClicked = GameMain.Client.SpectateClicked;
|
||||
spectateButton.UserData = "spectateButton";
|
||||
}
|
||||
@@ -472,34 +472,34 @@ namespace Barotrauma
|
||||
playYourself.UserData = "playyourself";
|
||||
}
|
||||
|
||||
//new GUITextBlock(new Rectangle(100, 30, 200, 30), "Name: ", GUI.Style, myPlayerFrame);
|
||||
//new GUITextBlock(new Rectangle(100, 30, 200, 30), "Name: ", "", myPlayerFrame);
|
||||
|
||||
//GUITextBox playerName = new GUITextBox(new Rectangle(100, 55, 0, 20), Alignment.TopLeft, GUI.Style, myPlayerFrame);
|
||||
//GUITextBox playerName = new GUITextBox(new Rectangle(100, 55, 0, 20), Alignment.TopLeft, "", myPlayerFrame);
|
||||
//playerName.Text = characterInfo.Name;
|
||||
//playerName.OnEnterPressed += ChangeCharacterName;
|
||||
|
||||
GUIButton toggleHead = new GUIButton(new Rectangle(0, 50, 15, 15), "<", GUI.Style, myPlayerFrame);
|
||||
GUIButton toggleHead = new GUIButton(new Rectangle(0, 50, 15, 15), "<", "", myPlayerFrame);
|
||||
toggleHead.UserData = -1;
|
||||
toggleHead.OnClicked = ToggleHead;
|
||||
toggleHead = new GUIButton(new Rectangle(60, 50, 15, 15), ">", GUI.Style, myPlayerFrame);
|
||||
toggleHead = new GUIButton(new Rectangle(60, 50, 15, 15), ">", "", myPlayerFrame);
|
||||
toggleHead.UserData = 1;
|
||||
toggleHead.OnClicked = ToggleHead;
|
||||
|
||||
new GUITextBlock(new Rectangle(100, 30, 200, 30), "Gender: ", GUI.Style, myPlayerFrame);
|
||||
new GUITextBlock(new Rectangle(100, 30, 200, 30), "Gender: ", "", myPlayerFrame);
|
||||
|
||||
GUIButton maleButton = new GUIButton(new Rectangle(100, 50, 60, 20), "Male",
|
||||
Alignment.TopLeft, GUI.Style, myPlayerFrame);
|
||||
Alignment.TopLeft, "", myPlayerFrame);
|
||||
maleButton.UserData = Gender.Male;
|
||||
maleButton.OnClicked += SwitchGender;
|
||||
|
||||
GUIButton femaleButton = new GUIButton(new Rectangle(170, 50, 60, 20), "Female",
|
||||
Alignment.TopLeft, GUI.Style, myPlayerFrame);
|
||||
Alignment.TopLeft, "", myPlayerFrame);
|
||||
femaleButton.UserData = Gender.Female;
|
||||
femaleButton.OnClicked += SwitchGender;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 120, 20, 30), "Job preferences:", GUI.Style, myPlayerFrame);
|
||||
new GUITextBlock(new Rectangle(0, 120, 20, 30), "Job preferences:", "", myPlayerFrame);
|
||||
|
||||
jobList = new GUIListBox(new Rectangle(0, 150, 0, 0), GUI.Style, myPlayerFrame);
|
||||
jobList = new GUIListBox(new Rectangle(0, 150, 0, 0), "", myPlayerFrame);
|
||||
jobList.Enabled = false;
|
||||
|
||||
|
||||
@@ -507,22 +507,22 @@ namespace Barotrauma
|
||||
foreach (JobPrefab job in JobPrefab.List)
|
||||
{
|
||||
GUITextBlock jobText = new GUITextBlock(new Rectangle(0, 0, 0, 20), i + ". " + job.Name+" ",
|
||||
GUI.Style,Alignment.Left, Alignment.Right, jobList, false,
|
||||
"",Alignment.Left, Alignment.Right, jobList, false,
|
||||
GameMain.GraphicsWidth<1000 ? GUI.SmallFont : GUI.Font);
|
||||
jobText.UserData = job;
|
||||
|
||||
GUIButton infoButton = new GUIButton(new Rectangle(0, 2, 15, 15), "?", GUI.Style, jobText);
|
||||
GUIButton infoButton = new GUIButton(new Rectangle(0, 2, 15, 15), "?", "", jobText);
|
||||
infoButton.UserData = -1;
|
||||
infoButton.OnClicked += ViewJobInfo;
|
||||
|
||||
GUIButton upButton = new GUIButton(new Rectangle(30, 2, 15, 15), "", GUI.Style, jobText);
|
||||
GUIButton upButton = new GUIButton(new Rectangle(30, 2, 15, 15), "", "", jobText);
|
||||
//TODO: make GUIImages align correctly when scaled/rotated
|
||||
//so there's no need to do this ↓
|
||||
new GUIImage(new Rectangle(3,2,0,0), GUI.Arrow, Alignment.Center, upButton).Scale = 0.6f;
|
||||
upButton.UserData = -1;
|
||||
upButton.OnClicked += ChangeJobPreference;
|
||||
|
||||
GUIButton downButton = new GUIButton(new Rectangle(50, 2, 15, 15), "", GUI.Style, jobText);
|
||||
GUIButton downButton = new GUIButton(new Rectangle(50, 2, 15, 15), "", "", jobText);
|
||||
var downArrow = new GUIImage(new Rectangle(13,14,0,0), GUI.Arrow, Alignment.Center, downButton);
|
||||
downArrow.Rotation = MathHelper.Pi;
|
||||
downArrow.Scale = 0.6f;
|
||||
@@ -673,7 +673,7 @@ namespace Barotrauma
|
||||
public void AddSubmarine(GUIComponent subList, Submarine sub)
|
||||
{
|
||||
var subTextBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, 0, 25), ToolBox.LimitString(sub.Name, GUI.Font, subList.Rect.Width - 65), GUI.Style,
|
||||
new Rectangle(0, 0, 0, 25), ToolBox.LimitString(sub.Name, GUI.Font, subList.Rect.Width - 65), "",
|
||||
Alignment.Left, Alignment.CenterY | Alignment.Left, subList)
|
||||
{
|
||||
Padding = new Vector4(10.0f, 0.0f, 0.0f, 0.0f),
|
||||
@@ -703,7 +703,7 @@ namespace Barotrauma
|
||||
|
||||
if (sub.HasTag(SubmarineTag.Shuttle))
|
||||
{
|
||||
var shuttleText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "Shuttle", GUI.Style, Alignment.Left, Alignment.CenterY | Alignment.Right, subTextBlock, false, GUI.SmallFont);
|
||||
var shuttleText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "Shuttle", "", Alignment.Left, Alignment.CenterY | Alignment.Right, subTextBlock, false, GUI.SmallFont);
|
||||
shuttleText.TextColor = subTextBlock.TextColor * 0.8f;
|
||||
shuttleText.ToolTip = subTextBlock.ToolTip;
|
||||
}
|
||||
@@ -756,7 +756,7 @@ namespace Barotrauma
|
||||
{
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, playerList.Rect.Width-20, 25), name,
|
||||
GUI.Style, Alignment.Left, Alignment.Left,
|
||||
"", Alignment.Left, Alignment.Left,
|
||||
playerList);
|
||||
|
||||
textBlock.Padding = new Vector4(10.0f, 0.0f, 0.0f, 0.0f);
|
||||
@@ -783,24 +783,24 @@ namespace Barotrauma
|
||||
|
||||
playerFrame = new GUIFrame(new Rectangle(0, 0, 0, 0), Color.Black * 0.6f);
|
||||
|
||||
var playerFrameInner = new GUIFrame(new Rectangle(0, 0, 300, 280), null, Alignment.Center, GUI.Style, playerFrame);
|
||||
var playerFrameInner = new GUIFrame(new Rectangle(0, 0, 300, 280), null, Alignment.Center, "", playerFrame);
|
||||
playerFrameInner.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 200, 20), component.UserData.ToString(),
|
||||
GUI.Style, Alignment.TopLeft, Alignment.TopLeft,
|
||||
"", Alignment.TopLeft, Alignment.TopLeft,
|
||||
playerFrameInner, false, GUI.LargeFont);
|
||||
|
||||
if (GameMain.Server != null)
|
||||
{
|
||||
var selectedClient = GameMain.Server.ConnectedClients.Find(c => c.name == component.UserData.ToString());
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 25, 150, 15), selectedClient.Connection.RemoteEndPoint.Address.ToString(), GUI.Style, playerFrameInner);
|
||||
new GUITextBlock(new Rectangle(0, 25, 150, 15), selectedClient.Connection.RemoteEndPoint.Address.ToString(), "", playerFrameInner);
|
||||
|
||||
var permissionsBox = new GUIFrame(new Rectangle(0, 60, 0, 90), GUI.Style, playerFrameInner);
|
||||
var permissionsBox = new GUIFrame(new Rectangle(0, 60, 0, 90), "", playerFrameInner);
|
||||
permissionsBox.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||
permissionsBox.UserData = selectedClient;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 15), "Permissions:", GUI.Style, permissionsBox);
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 15), "Permissions:", "", permissionsBox);
|
||||
int x = 0, y = 0;
|
||||
foreach (ClientPermissions permission in Enum.GetValues(typeof(ClientPermissions)))
|
||||
{
|
||||
@@ -844,7 +844,7 @@ namespace Barotrauma
|
||||
|
||||
if (GameMain.Server != null || GameMain.Client.HasPermission(ClientPermissions.Kick))
|
||||
{
|
||||
var kickButton = new GUIButton(new Rectangle(0, -50, 100, 20), "Kick", Alignment.BottomLeft, GUI.Style, playerFrameInner);
|
||||
var kickButton = new GUIButton(new Rectangle(0, -50, 100, 20), "Kick", Alignment.BottomLeft, "", playerFrameInner);
|
||||
kickButton.UserData = obj;
|
||||
kickButton.OnClicked += KickPlayer;
|
||||
kickButton.OnClicked += ClosePlayerFrame;
|
||||
@@ -852,18 +852,18 @@ namespace Barotrauma
|
||||
|
||||
if (GameMain.Server != null || GameMain.Client.HasPermission(ClientPermissions.Ban))
|
||||
{
|
||||
var banButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Ban", Alignment.BottomLeft, GUI.Style, playerFrameInner);
|
||||
var banButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Ban", Alignment.BottomLeft, "", playerFrameInner);
|
||||
banButton.UserData = obj;
|
||||
banButton.OnClicked += BanPlayer;
|
||||
banButton.OnClicked += ClosePlayerFrame;
|
||||
|
||||
var rangebanButton = new GUIButton(new Rectangle(0, -25, 100, 20), "Ban range", Alignment.BottomLeft, GUI.Style, playerFrameInner);
|
||||
var rangebanButton = new GUIButton(new Rectangle(0, -25, 100, 20), "Ban range", Alignment.BottomLeft, "", playerFrameInner);
|
||||
rangebanButton.UserData = obj;
|
||||
rangebanButton.OnClicked += BanPlayerRange;
|
||||
rangebanButton.OnClicked += ClosePlayerFrame;
|
||||
}
|
||||
|
||||
var closeButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Close", Alignment.BottomRight, GUI.Style, playerFrameInner);
|
||||
var closeButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Close", Alignment.BottomRight, "", playerFrameInner);
|
||||
closeButton.OnClicked = ClosePlayerFrame;
|
||||
|
||||
return false;
|
||||
@@ -1036,7 +1036,7 @@ namespace Barotrauma
|
||||
GUITextBlock msg = new GUITextBlock(new Rectangle(0, 0, 0, 20),
|
||||
message.TextWithSender,
|
||||
((chatBox.CountChildren % 2) == 0) ? Color.Transparent : Color.Black*0.1f, message.Color,
|
||||
Alignment.Left, GUI.Style, null, true);
|
||||
Alignment.Left, "", null, true);
|
||||
msg.Font = GUI.SmallFont;
|
||||
msg.UserData = message.SenderName;
|
||||
msg.CanBeFocused = false;
|
||||
@@ -1142,7 +1142,7 @@ namespace Barotrauma
|
||||
if (jobPrefab == null) return false;
|
||||
|
||||
jobInfoFrame = jobPrefab.CreateInfoFrame();
|
||||
GUIButton closeButton = new GUIButton(new Rectangle(0,0,100,20), "Close", Alignment.BottomRight, GUI.Style, jobInfoFrame.children[0]);
|
||||
GUIButton closeButton = new GUIButton(new Rectangle(0,0,100,20), "Close", Alignment.BottomRight, "", jobInfoFrame.children[0]);
|
||||
closeButton.OnClicked = CloseJobInfo;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace Barotrauma
|
||||
GUITextBlock voteText = comp.FindChild("votes") as GUITextBlock;
|
||||
if (voteText == null)
|
||||
{
|
||||
voteText = new GUITextBlock(new Rectangle(0, 0, 30, 0), "", GUI.Style, Alignment.Right, Alignment.Right, comp);
|
||||
voteText = new GUITextBlock(new Rectangle(0, 0, 30, 0), "", "", Alignment.Right, Alignment.Right, comp);
|
||||
voteText.UserData = "votes";
|
||||
}
|
||||
|
||||
|
||||
@@ -36,20 +36,20 @@ namespace Barotrauma
|
||||
|
||||
Rectangle panelRect = new Rectangle(0, 0, width, height);
|
||||
|
||||
menu = new GUIFrame(panelRect, null, Alignment.Center, GUI.Style);
|
||||
menu = new GUIFrame(panelRect, null, Alignment.Center, "");
|
||||
menu.Padding = new Vector4(40.0f, 40.0f, 40.0f, 20.0f);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, -25, 0, 30), "Join Server", GUI.Style, Alignment.CenterX, Alignment.CenterX, menu, false, GUI.LargeFont);
|
||||
new GUITextBlock(new Rectangle(0, -25, 0, 30), "Join Server", "", Alignment.CenterX, Alignment.CenterX, menu, false, GUI.LargeFont);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 30, 0, 30), "Your Name:", GUI.Style, menu);
|
||||
clientNameBox = new GUITextBox(new Rectangle(0, 60, 200, 30), GUI.Style, menu);
|
||||
new GUITextBlock(new Rectangle(0, 30, 0, 30), "Your Name:", "", menu);
|
||||
clientNameBox = new GUITextBox(new Rectangle(0, 60, 200, 30), "", menu);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 100, 0, 30), "Server IP:", GUI.Style, menu);
|
||||
ipBox = new GUITextBox(new Rectangle(0, 130, 200, 30), GUI.Style, menu);
|
||||
new GUITextBlock(new Rectangle(0, 100, 0, 30), "Server IP:", "", menu);
|
||||
ipBox = new GUITextBox(new Rectangle(0, 130, 200, 30), "", menu);
|
||||
|
||||
int middleX = (int)(width * 0.4f);
|
||||
|
||||
serverList = new GUIListBox(new Rectangle(middleX,60,0,height-160), GUI.Style, menu);
|
||||
serverList = new GUIListBox(new Rectangle(middleX,60,0,height-160), "", menu);
|
||||
serverList.OnSelected = SelectServer;
|
||||
|
||||
float[] columnRelativeX = new float[] { 0.15f, 0.55f, 0.15f, 0.15f };
|
||||
@@ -62,19 +62,19 @@ namespace Barotrauma
|
||||
|
||||
ScalableFont font = GUI.SmallFont; // serverList.Rect.Width < 400 ? GUI.SmallFont : GUI.Font;
|
||||
|
||||
new GUITextBlock(new Rectangle(middleX, 30, 0, 30), "Password", GUI.Style, menu).Font = font;
|
||||
new GUITextBlock(new Rectangle(middleX, 30, 0, 30), "Password", "", menu).Font = font;
|
||||
|
||||
new GUITextBlock(new Rectangle(middleX + columnX[0], 30, 0, 30), "Name", GUI.Style, menu).Font = font;
|
||||
new GUITextBlock(new Rectangle(middleX + columnX[1], 30, 0, 30), "Players", GUI.Style, menu).Font = font;
|
||||
new GUITextBlock(new Rectangle(middleX + columnX[2], 30, 0, 30), "Round started", GUI.Style, menu).Font = font;
|
||||
new GUITextBlock(new Rectangle(middleX + columnX[0], 30, 0, 30), "Name", "", menu).Font = font;
|
||||
new GUITextBlock(new Rectangle(middleX + columnX[1], 30, 0, 30), "Players", "", menu).Font = font;
|
||||
new GUITextBlock(new Rectangle(middleX + columnX[2], 30, 0, 30), "Round started", "", menu).Font = font;
|
||||
|
||||
joinButton = new GUIButton(new Rectangle(-170, 0, 150, 30), "Refresh", Alignment.BottomRight, GUI.Style, menu);
|
||||
joinButton = new GUIButton(new Rectangle(-170, 0, 150, 30), "Refresh", Alignment.BottomRight, "", menu);
|
||||
joinButton.OnClicked = RefreshServers;
|
||||
|
||||
joinButton = new GUIButton(new Rectangle(0,0,150,30), "Join", Alignment.BottomRight, GUI.Style, menu);
|
||||
joinButton = new GUIButton(new Rectangle(0,0,150,30), "Join", Alignment.BottomRight, "", menu);
|
||||
joinButton.OnClicked = JoinServer;
|
||||
|
||||
GUIButton button = new GUIButton(new Rectangle(-20, -20, 100, 30), "Back", Alignment.TopLeft, GUI.Style, menu);
|
||||
GUIButton button = new GUIButton(new Rectangle(-20, -20, 100, 30), "Back", Alignment.TopLeft, "", menu);
|
||||
button.OnClicked = GameMain.MainMenuScreen.SelectTab;
|
||||
button.SelectedColor = button.Color;
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Barotrauma
|
||||
if (waitingForRefresh) return false;
|
||||
serverList.ClearChildren();
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 20), "Refreshing server list...", GUI.Style, serverList);
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 20), "Refreshing server list...", "", serverList);
|
||||
|
||||
CoroutineManager.StartCoroutine(WaitForRefresh());
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace Barotrauma
|
||||
|
||||
if (string.IsNullOrWhiteSpace(masterServerData))
|
||||
{
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 20), "Couldn't find any servers", GUI.Style, serverList);
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 20), "Couldn't find any servers", "", serverList);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -176,13 +176,13 @@ namespace Barotrauma
|
||||
passwordBox.Enabled = false;
|
||||
passwordBox.UserData = "password";
|
||||
|
||||
new GUITextBlock(new Rectangle(columnX[0], 0, 0, 0), serverName, GUI.Style, serverFrame);
|
||||
new GUITextBlock(new Rectangle(columnX[0], 0, 0, 0), serverName, "", serverFrame);
|
||||
|
||||
int playerCount = 0, maxPlayers = 1;
|
||||
int.TryParse(currPlayersStr, out playerCount);
|
||||
int.TryParse(maxPlayersStr, out maxPlayers);
|
||||
|
||||
new GUITextBlock(new Rectangle(columnX[1], 0, 0, 0), playerCount + "/" + maxPlayers, GUI.Style, serverFrame);
|
||||
new GUITextBlock(new Rectangle(columnX[1], 0, 0, 0), playerCount + "/" + maxPlayers, "", serverFrame);
|
||||
|
||||
var gameStartedBox = new GUITickBox(new Rectangle(columnX[2] + (columnX[3] - columnX[2])/ 2, 0, 20, 20), "", Alignment.TopLeft, serverFrame);
|
||||
gameStartedBox.Selected = gameStarted == "1";
|
||||
@@ -306,7 +306,7 @@ namespace Barotrauma
|
||||
if (hasPassword)
|
||||
{
|
||||
var msgBox = new GUIMessageBox(msg, "", new string[] { "OK", "Cancel" });
|
||||
var passwordBox = new GUITextBox(new Rectangle(0,40,150,25), Alignment.TopLeft, GUI.Style, msgBox.children[0]);
|
||||
var passwordBox = new GUITextBox(new Rectangle(0,40,150,25), Alignment.TopLeft, "", msgBox.children[0]);
|
||||
passwordBox.UserData = "password";
|
||||
|
||||
var okButton = msgBox.Buttons[0];
|
||||
|
||||
Reference in New Issue
Block a user