Separate sprites for horizontal and vertical scrollbars, style tweaking

This commit is contained in:
Regalis
2017-04-18 19:24:13 +03:00
parent dc6ed7daf1
commit 9a5777183f
11 changed files with 88 additions and 86 deletions
+12 -18
View File
@@ -189,7 +189,7 @@ namespace Barotrauma
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", "", 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, "", GUItabs[i]);
searchBox.Font = GUI.SmallFont;
@@ -206,22 +206,16 @@ namespace Barotrauma
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 +225,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,7 +236,7 @@ namespace Barotrauma
i++;
}
y+=50;
y += 50;
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;
@@ -251,13 +245,13 @@ namespace Barotrauma
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;
y += 50;
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;
y += 50;
new GUITextBlock(new Rectangle(0, y, 0, 20), "Show:", "", leftPanel);
+2 -2
View File
@@ -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), "",
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),
@@ -396,7 +396,7 @@ namespace Barotrauma
GUITextBlock textBlock = new GUITextBlock(
new Rectangle(0, 0, 0, 25),
saveFile,
"",
"ListBoxElement",
Alignment.Left,
Alignment.Left,
saveList);
+2 -2
View File
@@ -250,7 +250,7 @@ namespace Barotrauma
GUITextBlock textBlock = new GUITextBlock(
new Rectangle(0, 0, 0, 25),
mode.Name, "",
mode.Name, "ListBoxElement",
Alignment.TopLeft, Alignment.CenterLeft,
modeList);
textBlock.ToolTip = mode.Description;
@@ -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), "",
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),
@@ -52,7 +52,7 @@ namespace Barotrauma
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++)
{
@@ -166,12 +166,10 @@ 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";
@@ -184,7 +182,7 @@ namespace Barotrauma
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;