Merge branch 'master' into new-netcode
Conflicts: Subsurface/Source/GUI/GUIButton.cs Subsurface/Source/GameSession/CrewManager.cs Subsurface/Source/GameSession/GameSession.cs Subsurface/Source/Items/Item.cs Subsurface/Source/Networking/GameServer.cs Subsurface/Source/Screens/MainMenuScreen.cs Subsurface/Source/Screens/ServerListScreen.cs
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Barotrauma
|
||||
const int PreviouslyUsedCount = 10;
|
||||
private GUIListBox previouslyUsedList;
|
||||
|
||||
GUIDropDown linkedSubBox;
|
||||
private GUIDropDown linkedSubBox;
|
||||
|
||||
//a Character used for picking up and manipulating items
|
||||
private Character dummyCharacter;
|
||||
@@ -126,37 +126,46 @@ namespace Barotrauma
|
||||
|
||||
selectedTab = -1;
|
||||
|
||||
topPanel = new GUIFrame(new Rectangle(0, 0, 0, 31), GUI.Style);
|
||||
topPanel = new GUIFrame(new Rectangle(0, 0, 0, 35), "GUIFrameTop");
|
||||
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);
|
||||
button.OnClicked = CreateLoadScreen;
|
||||
|
||||
button = new GUIButton(new Rectangle(80,0,70,20), "Save", GUI.Style, topPanel);
|
||||
|
||||
var button = new GUIButton(new Rectangle(0, 0, 70, 20), "Open...", "", topPanel);
|
||||
button.OnClicked = (GUIButton btn, object data) =>
|
||||
{
|
||||
saveFrame = null;
|
||||
selectedTab = -1;
|
||||
CreateLoadScreen();
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(80,0,70,20), "Save", "", topPanel);
|
||||
button.OnClicked = (GUIButton btn, object data) =>
|
||||
{
|
||||
loadFrame = null;
|
||||
selectedTab = -1;
|
||||
CreateSaveScreen();
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
var nameLabel = new GUITextBlock(new Rectangle(170, -4, 150, 20), "", GUI.Style, topPanel, GUI.LargeFont);
|
||||
var nameLabel = new GUITextBlock(new Rectangle(170, 0, 150, 20), "", "", Alignment.TopLeft, Alignment.CenterLeft, topPanel, false, GUI.LargeFont);
|
||||
nameLabel.TextGetter = GetSubName;
|
||||
|
||||
linkedSubBox = new GUIDropDown(new Rectangle(750,0,200,20), "Add submarine", GUI.Style, topPanel);
|
||||
linkedSubBox.ToolTip =
|
||||
"Places another submarine into the current submarine file. "+
|
||||
"Can be used for adding things such as smaller vessels, "+
|
||||
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, " +
|
||||
"escape pods or detachable sections into the main submarine.";
|
||||
|
||||
foreach (Submarine sub in Submarine.SavedSubmarines)
|
||||
@@ -164,64 +173,58 @@ namespace Barotrauma
|
||||
linkedSubBox.AddItem(sub.Name, sub);
|
||||
}
|
||||
linkedSubBox.OnSelected += SelectLinkedSub;
|
||||
|
||||
leftPanel = new GUIFrame(new Rectangle(0, 30, 150, GameMain.GraphicsHeight-30), GUI.Style);
|
||||
|
||||
leftPanel = new GUIFrame(new Rectangle(0, 0, 150, GameMain.GraphicsHeight), "GUIFrameLeft");
|
||||
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];
|
||||
GUItabs = new GUIComponent[Enum.GetValues(typeof(MapEntityCategory)).Length];
|
||||
|
||||
int width = 400, height = 400;
|
||||
int y = 90;
|
||||
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].Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
|
||||
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, 30.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.CenterRight, 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), null,null, Alignment.TopRight, Alignment.CenterLeft, "", 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;
|
||||
|
||||
foreach (MapEntityPrefab ep in MapEntityPrefab.list)
|
||||
{
|
||||
if (!ep.Category.HasFlag(category)) continue;
|
||||
|
||||
Color color = ((itemList.CountChildren % 2) == 0) ? Color.Transparent : Color.White * 0.1f;
|
||||
|
||||
GUIFrame frame = new GUIFrame(new Rectangle(0, 0, 0, 50), Color.Transparent, null, itemList);
|
||||
|
||||
GUIFrame frame = new GUIFrame(new Rectangle(0, 0, 0, 50), Color.Transparent, "ListBoxElement", itemList);
|
||||
frame.UserData = ep;
|
||||
frame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||
frame.Color = color;
|
||||
frame.HoverColor = Color.Gold * 0.2f;
|
||||
frame.SelectedColor = Color.Gold * 0.5f;
|
||||
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(40, 0, 0, 25),
|
||||
ep.Name,
|
||||
Color.Transparent, Color.White,
|
||||
Alignment.Left, Alignment.Left,
|
||||
null, frame);
|
||||
ep.Name, "",
|
||||
Alignment.Top, Alignment.CenterLeft,
|
||||
frame);
|
||||
textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(ep.Description))
|
||||
@@ -231,7 +234,7 @@ namespace Barotrauma
|
||||
|
||||
if (ep.sprite != null)
|
||||
{
|
||||
GUIImage img = new GUIImage(new Rectangle(0, 0, 40, 40), ep.sprite, Alignment.Left, frame);
|
||||
GUIImage img = new GUIImage(new Rectangle(0, 0, 40, 40), ep.sprite, Alignment.CenterLeft, frame);
|
||||
img.Scale = Math.Min(Math.Min(40.0f / img.SourceRect.Width, 40.0f / img.SourceRect.Height), 1.0f);
|
||||
img.Color = ep.SpriteColor;
|
||||
}
|
||||
@@ -242,24 +245,24 @@ namespace Barotrauma
|
||||
i++;
|
||||
}
|
||||
|
||||
y+=50;
|
||||
button = new GUIButton(new Rectangle(0, y, 0, 20), "Character mode", Alignment.Left, GUI.Style, leftPanel);
|
||||
y += 10;
|
||||
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);
|
||||
y += 25;
|
||||
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);
|
||||
|
||||
y += 35;
|
||||
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);
|
||||
y += 30;
|
||||
|
||||
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 +284,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 + 20, 0, Math.Min(GameMain.GraphicsHeight - y - 80, 150)), "", leftPanel);
|
||||
previouslyUsedList.OnSelected = SelectPrefab;
|
||||
}
|
||||
|
||||
@@ -425,33 +428,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 +494,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;
|
||||
@@ -503,7 +506,7 @@ namespace Barotrauma
|
||||
|
||||
}
|
||||
|
||||
private bool CreateLoadScreen(GUIButton button, object obj)
|
||||
private bool CreateLoadScreen()
|
||||
{
|
||||
if (characterMode) ToggleCharacterMode();
|
||||
if (wiringMode) ToggleWiringMode();
|
||||
@@ -511,10 +514,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 +531,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 +539,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) =>
|
||||
@@ -562,15 +565,15 @@ namespace Barotrauma
|
||||
|
||||
deleteButton.Enabled = false;
|
||||
|
||||
CreateLoadScreen(null, null);
|
||||
CreateLoadScreen();
|
||||
|
||||
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;
|
||||
@@ -605,6 +608,9 @@ namespace Barotrauma
|
||||
if (characterMode) ToggleCharacterMode();
|
||||
if (wiringMode) ToggleWiringMode();
|
||||
|
||||
saveFrame = null;
|
||||
loadFrame = null;
|
||||
|
||||
selectedTab = (int)obj;
|
||||
|
||||
var searchBox = GUItabs[selectedTab].GetChild<GUITextBox>();
|
||||
@@ -738,10 +744,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, "GUIFrameRight");
|
||||
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)
|
||||
@@ -878,9 +884,10 @@ namespace Barotrauma
|
||||
string name = ToolBox.LimitString(mapEntityPrefab.Name,15);
|
||||
|
||||
var textBlock = new GUITextBlock(
|
||||
new Rectangle(0,0,0,10),
|
||||
ToolBox.LimitString(name, GUI.SmallFont, previouslyUsedList.Rect.Width),
|
||||
GUI.Style, previouslyUsedList, GUI.SmallFont);
|
||||
new Rectangle(0,0,0,15),
|
||||
ToolBox.LimitString(name, GUI.SmallFont, previouslyUsedList.Rect.Width),
|
||||
"", Alignment.TopLeft, Alignment.CenterLeft,
|
||||
previouslyUsedList, false, 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,17 +226,17 @@ 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)
|
||||
{
|
||||
var mission = GameMain.GameSession.Map.SelectedConnection.Mission;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 80, 0, 20), "Mission: "+mission.Name, Color.Black*0.8f, Color.White, Alignment.TopLeft, null, locationPanel);
|
||||
new GUITextBlock(new Rectangle(0, 80, 0, 20), "Mission: "+mission.Name, "", locationPanel);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 100, 0, 20), "Reward: " + mission.Reward+" credits", Color.Black * 0.8f, Color.White, Alignment.TopLeft, null, locationPanel);
|
||||
new GUITextBlock(new Rectangle(0, 100, 0, 20), "Reward: " + mission.Reward+" credits", "", locationPanel);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 120, 0, 0), mission.Description, Color.Black * 0.8f, Color.White, Alignment.TopLeft, null, locationPanel, true);
|
||||
new GUITextBlock(new Rectangle(0, 130, 0, 0), mission.Description, "", locationPanel, true);
|
||||
|
||||
}
|
||||
|
||||
@@ -256,14 +256,9 @@ namespace Barotrauma
|
||||
|
||||
private void CreateItemFrame(MapEntityPrefab ep, GUIListBox listBox, int width)
|
||||
{
|
||||
Color color = ((listBox.CountChildren % 2) == 0) ? Color.Transparent : Color.White * 0.1f;
|
||||
|
||||
GUIFrame frame = new GUIFrame(new Rectangle(0, 0, 0, 50), Color.Transparent, null, listBox);
|
||||
GUIFrame frame = new GUIFrame(new Rectangle(0, 0, 0, 50), "ListBoxElement", listBox);
|
||||
frame.UserData = ep;
|
||||
frame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||
frame.Color = color;
|
||||
frame.HoverColor = Color.Gold * 0.2f;
|
||||
frame.SelectedColor = Color.Gold * 0.5f;
|
||||
|
||||
frame.ToolTip = ep.Description;
|
||||
|
||||
@@ -272,16 +267,16 @@ namespace Barotrauma
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(50, 0, 0, 25),
|
||||
ep.Name,
|
||||
Color.Transparent, Color.White,
|
||||
null,null,
|
||||
Alignment.Left, Alignment.CenterX | Alignment.Left,
|
||||
null, frame);
|
||||
"", frame);
|
||||
textBlock.Font = font;
|
||||
textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f);
|
||||
textBlock.ToolTip = ep.Description;
|
||||
|
||||
if (ep.sprite != null)
|
||||
{
|
||||
GUIImage img = new GUIImage(new Rectangle(0, 0, 40, 40), ep.sprite, Alignment.Left, frame);
|
||||
GUIImage img = new GUIImage(new Rectangle(0, 0, 40, 40), ep.sprite, Alignment.CenterLeft, frame);
|
||||
img.Color = ep.SpriteColor;
|
||||
img.Scale = Math.Min(Math.Min(40.0f / img.SourceRect.Width, 40.0f / img.SourceRect.Height), 1.0f);
|
||||
}
|
||||
@@ -290,7 +285,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 +488,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 +497,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;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Barotrauma
|
||||
|
||||
private GameMain game;
|
||||
|
||||
int selectedTab;
|
||||
private Tab selectedTab;
|
||||
|
||||
public MainMenuScreen(GameMain game)
|
||||
{
|
||||
@@ -42,41 +42,42 @@ namespace Barotrauma
|
||||
Rectangle panelRect = new Rectangle(
|
||||
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 +85,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;
|
||||
@@ -130,43 +131,41 @@ namespace Barotrauma
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
// Submarine selectedSub = subList.SelectedData as Submarine;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
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 +176,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;
|
||||
@@ -198,7 +197,6 @@ namespace Barotrauma
|
||||
UpdateSubList();
|
||||
|
||||
SelectTab(null, 0);
|
||||
//selectedTab = 0;
|
||||
}
|
||||
|
||||
private void UpdateSubList()
|
||||
@@ -211,7 +209,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), "ListBoxElement",
|
||||
Alignment.Left, Alignment.Left, subList)
|
||||
{
|
||||
Padding = new Vector4(10.0f, 0.0f, 0.0f, 0.0f),
|
||||
@@ -223,7 +221,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;
|
||||
}
|
||||
@@ -273,42 +271,41 @@ namespace Barotrauma
|
||||
return;
|
||||
}
|
||||
|
||||
selectedTab = (int)tab;
|
||||
selectedTab = tab;
|
||||
|
||||
switch (selectedTab)
|
||||
{
|
||||
case (int)Tab.NewGame:
|
||||
case Tab.NewGame:
|
||||
saveNameBox.Text = SaveUtil.CreateSavePath();
|
||||
break;
|
||||
case (int)Tab.LoadGame:
|
||||
case Tab.LoadGame:
|
||||
UpdateLoadScreen();
|
||||
break;
|
||||
case (int)Tab.Settings:
|
||||
case Tab.Settings:
|
||||
GameMain.Config.ResetSettingsFrame();
|
||||
menuTabs[(int)Tab.Settings] = GameMain.Config.SettingsFrame;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private bool ApplySettings(GUIButton button, object obj)
|
||||
private bool ApplySettings(GUIButton button, object userData)
|
||||
{
|
||||
GameMain.Config.Save("config.xml");
|
||||
selectedTab = 0;
|
||||
|
||||
if (userData is Tab) SelectTab((Tab)userData);
|
||||
|
||||
if (GameMain.GraphicsWidth != GameMain.Config.GraphicsWidth || GameMain.GraphicsHeight != GameMain.Config.GraphicsHeight)
|
||||
{
|
||||
new GUIMessageBox("Restart required", "You need to restart the game for the resolution changes to take effect.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool DiscardSettings(GUIButton button, object obj)
|
||||
private bool DiscardSettings(GUIButton button, object userData)
|
||||
{
|
||||
GameMain.Config.Load("config.xml");
|
||||
selectedTab = (int)obj;
|
||||
if (userData is Tab) SelectTab((Tab)userData);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -388,7 +385,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 +393,7 @@ namespace Barotrauma
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, 0, 25),
|
||||
saveFile,
|
||||
GUI.Style,
|
||||
"ListBoxElement",
|
||||
Alignment.Left,
|
||||
Alignment.Left,
|
||||
saveList);
|
||||
@@ -404,7 +401,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 +425,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;
|
||||
|
||||
@@ -479,24 +476,20 @@ namespace Barotrauma
|
||||
public override void AddToGUIUpdateList()
|
||||
{
|
||||
buttonsTab.AddToGUIUpdateList();
|
||||
if (selectedTab > 0) menuTabs[selectedTab].AddToGUIUpdateList();
|
||||
if (selectedTab > 0) menuTabs[(int)selectedTab].AddToGUIUpdateList();
|
||||
}
|
||||
|
||||
public override void Update(double deltaTime)
|
||||
{
|
||||
//GameMain.TitleScreen.Update();
|
||||
buttonsTab.Update((float)deltaTime);
|
||||
if (selectedTab > 0)
|
||||
{
|
||||
menuTabs[selectedTab].Update((float)deltaTime);
|
||||
}
|
||||
|
||||
if (selectedTab>0) menuTabs[(int)selectedTab].Update((float)deltaTime);
|
||||
|
||||
GameMain.TitleScreen.TitlePosition =
|
||||
Vector2.Lerp(GameMain.TitleScreen.TitlePosition, new Vector2(
|
||||
GameMain.TitleScreen.TitleSize.X / 2.0f * GameMain.TitleScreen.Scale + 30.0f,
|
||||
GameMain.TitleScreen.TitleSize.Y / 2.0f * GameMain.TitleScreen.Scale + 30.0f),
|
||||
0.1f);
|
||||
|
||||
0.1f);
|
||||
}
|
||||
|
||||
public override void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch)
|
||||
@@ -511,7 +504,7 @@ namespace Barotrauma
|
||||
spriteBatch.Begin(0, BlendState.AlphaBlend);
|
||||
|
||||
buttonsTab.Draw(spriteBatch);
|
||||
if (selectedTab>0) menuTabs[selectedTab].Draw(spriteBatch);
|
||||
if (selectedTab>0) menuTabs[(int)selectedTab].Draw(spriteBatch);
|
||||
|
||||
GUI.Draw((float)deltaTime, spriteBatch, null);
|
||||
|
||||
|
||||
@@ -180,12 +180,12 @@ namespace Barotrauma
|
||||
|
||||
Rectangle panelRect = new Rectangle(0,0,width,height);
|
||||
|
||||
menu = new GUIFrame(panelRect, Color.Transparent, Alignment.Center);
|
||||
menu = new GUIFrame(panelRect, Color.Transparent, Alignment.Center, null);
|
||||
//menu.Padding = GUI.style.smallPadding;
|
||||
|
||||
//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 ----------------------------------------------------------------------
|
||||
@@ -193,11 +193,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 ------------------------------------------------------------
|
||||
@@ -205,7 +205,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 ------------------------------------------------------------------
|
||||
@@ -213,11 +213,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 ------------------------------------------------------------------
|
||||
@@ -225,11 +225,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;
|
||||
|
||||
@@ -240,17 +240,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;
|
||||
|
||||
@@ -260,8 +260,8 @@ namespace Barotrauma
|
||||
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, 0, 25),
|
||||
mode.Name, GUI.Style,
|
||||
Alignment.Left, Alignment.Left,
|
||||
mode.Name, "ListBoxElement",
|
||||
Alignment.TopLeft, Alignment.CenterLeft,
|
||||
modeList);
|
||||
textBlock.ToolTip = mode.Description;
|
||||
textBlock.Padding = new Vector4(10.0f, 0.0f, 0.0f, 0.0f);
|
||||
@@ -270,17 +270,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;
|
||||
@@ -291,7 +291,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;
|
||||
@@ -301,25 +301,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.Center, "", 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;
|
||||
|
||||
|
||||
@@ -328,18 +328,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;
|
||||
|
||||
@@ -407,10 +407,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";
|
||||
|
||||
@@ -432,7 +432,7 @@ namespace Barotrauma
|
||||
|
||||
if (myPlayerFrame.children.Find(c => c.UserData as string == "playyourself") == null)
|
||||
{
|
||||
var playYourself = new GUITickBox(new Rectangle(0, -10, 20, 20), "Play yourself", Alignment.TopLeft, myPlayerFrame);
|
||||
var playYourself = new GUITickBox(new Rectangle(0, 0, 20, 20), "Play yourself", Alignment.TopLeft, myPlayerFrame);
|
||||
playYourself.Selected = GameMain.Server.CharacterInfo != null;
|
||||
playYourself.OnSelected = TogglePlayYourself;
|
||||
playYourself.UserData = "playyourself";
|
||||
@@ -452,7 +452,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";
|
||||
}
|
||||
@@ -473,7 +473,7 @@ namespace Barotrauma
|
||||
if (GameMain.Client == null) return;
|
||||
|
||||
infoFrame.RemoveChild(infoFrame.children.Find(c => c.UserData as string == "spectateButton"));
|
||||
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";
|
||||
}
|
||||
@@ -486,40 +486,40 @@ namespace Barotrauma
|
||||
|
||||
if (IsServer && GameMain.Server != null)
|
||||
{
|
||||
var playYourself = new GUITickBox(new Rectangle(0, -10, 20, 20), "Play yourself", Alignment.TopLeft, myPlayerFrame);
|
||||
var playYourself = new GUITickBox(new Rectangle(0, 0, 20, 20), "Play yourself", Alignment.TopLeft, myPlayerFrame);
|
||||
playYourself.Selected = GameMain.Server.CharacterInfo != null;
|
||||
playYourself.OnSelected = TogglePlayYourself;
|
||||
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;
|
||||
|
||||
|
||||
@@ -527,22 +527,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;
|
||||
@@ -702,8 +702,8 @@ 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,
|
||||
Alignment.Left, Alignment.CenterY | Alignment.Left, subList)
|
||||
new Rectangle(0, 0, 0, 25), ToolBox.LimitString(sub.Name, GUI.Font, subList.Rect.Width - 65), "ListBoxElement",
|
||||
Alignment.TopLeft, Alignment.CenterLeft, subList)
|
||||
{
|
||||
Padding = new Vector4(10.0f, 0.0f, 0.0f, 0.0f),
|
||||
ToolTip = sub.Description,
|
||||
@@ -734,7 +734,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;
|
||||
}
|
||||
@@ -788,7 +788,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);
|
||||
@@ -819,24 +819,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)))
|
||||
{
|
||||
@@ -880,7 +880,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;
|
||||
@@ -888,18 +888,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;
|
||||
@@ -1046,7 +1046,7 @@ namespace Barotrauma
|
||||
GUITextBlock msg = new GUITextBlock(new Rectangle(0, 0, chatBox.Rect.Width, 0),
|
||||
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;
|
||||
msg.CanBeFocused = false;
|
||||
@@ -1153,7 +1153,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;
|
||||
}
|
||||
|
||||
@@ -37,23 +37,23 @@ 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 };
|
||||
float[] columnRelativeX = new float[] { 0.15f, 0.5f, 0.15f, 0.2f };
|
||||
columnX = new int[columnRelativeX.Length];
|
||||
for (int n = 0; n < columnX.Length; n++)
|
||||
{
|
||||
@@ -63,19 +63,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;
|
||||
|
||||
@@ -105,7 +105,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());
|
||||
|
||||
@@ -138,7 +138,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;
|
||||
}
|
||||
@@ -167,25 +167,23 @@ namespace Barotrauma
|
||||
|
||||
string hasPassWordStr = (arguments.Length > 6) ? arguments[6] : "";
|
||||
|
||||
var serverFrame = new GUIFrame(new Rectangle(0, 0, 0, 20), (i % 2 == 0) ? Color.Transparent : Color.White * 0.2f, null, serverList);
|
||||
var serverFrame = new GUIFrame(new Rectangle(0, 0, 0, 30), (i % 2 == 0) ? Color.Transparent : Color.White * 0.2f, "ListBoxElement", serverList);
|
||||
serverFrame.UserData = IP + ":" + port;
|
||||
serverFrame.HoverColor = Color.Gold * 0.2f;
|
||||
serverFrame.SelectedColor = Color.Gold * 0.5f;
|
||||
|
||||
var passwordBox = new GUITickBox(new Rectangle(columnX[0] / 2, 0, 20, 20), "", Alignment.TopLeft, serverFrame);
|
||||
var passwordBox = new GUITickBox(new Rectangle(columnX[0] / 2, 0, 20, 20), "", Alignment.CenterLeft, serverFrame);
|
||||
passwordBox.Selected = hasPassWordStr == "1";
|
||||
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, "", Alignment.TopLeft, Alignment.CenterLeft, 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, "", Alignment.TopLeft, Alignment.CenterLeft, serverFrame);
|
||||
|
||||
var gameStartedBox = new GUITickBox(new Rectangle(columnX[2] + (columnX[3] - columnX[2])/ 2, 0, 20, 20), "", Alignment.TopLeft, serverFrame);
|
||||
var gameStartedBox = new GUITickBox(new Rectangle(columnX[2] + (columnX[3] - columnX[2])/ 2, 0, 20, 20), "", Alignment.CenterRight, serverFrame);
|
||||
gameStartedBox.Selected = gameStarted == "1";
|
||||
gameStartedBox.Enabled = false;
|
||||
|
||||
@@ -327,9 +325,7 @@ namespace Barotrauma
|
||||
spriteBatch.Begin();
|
||||
|
||||
menu.Draw(spriteBatch);
|
||||
|
||||
//if (previewPlayer!=null) previewPlayer.Draw(spriteBatch);
|
||||
|
||||
|
||||
GUI.Draw((float)deltaTime, spriteBatch, null);
|
||||
|
||||
spriteBatch.End();
|
||||
|
||||
Reference in New Issue
Block a user