UI layout tweaks

This commit is contained in:
Regalis
2017-04-20 17:39:32 +03:00
parent 9a5777183f
commit 499284dc91
9 changed files with 45 additions and 41 deletions
+13 -12
View File
@@ -126,7 +126,7 @@ namespace Barotrauma
selectedTab = -1;
topPanel = new GUIFrame(new Rectangle(0, 0, 0, 50), "GUIFrameTop");
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), "", topPanel);
@@ -150,7 +150,7 @@ namespace Barotrauma
return true;
};
var nameLabel = new GUITextBlock(new Rectangle(170, -4, 150, 20), "", "", 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", "", topPanel);
@@ -187,7 +187,7 @@ namespace Barotrauma
y+=25;
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);
GUItabs[i].Padding = new Vector4(10.0f, 30.0f, 10.0f, 10.0f);
new GUITextBlock(new Rectangle(-200, 0, 100, 15), "Filter", "", Alignment.TopRight, Alignment.CenterRight, GUItabs[i], false, GUI.SmallFont);
@@ -236,22 +236,22 @@ namespace Barotrauma
i++;
}
y += 50;
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;
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;
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;
y += 30;
new GUITextBlock(new Rectangle(0, y, 0, 20), "Show:", "", leftPanel);
@@ -277,7 +277,7 @@ namespace Barotrauma
{
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)), "", leftPanel);
previouslyUsedList = new GUIListBox(new Rectangle(0, y + 20, 0, Math.Min(GameMain.GraphicsHeight - y - 80, 150)), "", leftPanel);
previouslyUsedList.OnSelected = SelectPrefab;
}
@@ -732,7 +732,7 @@ namespace Barotrauma
private GUIFrame CreateWiringPanel()
{
GUIFrame frame = new GUIFrame(new Rectangle(0,0,65,300), null, Alignment.Right | Alignment.CenterY, "");
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, "", frame);
@@ -872,9 +872,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),
"", 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;
+7 -12
View File
@@ -232,11 +232,11 @@ namespace Barotrauma
{
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);
}
+1 -3
View File
@@ -130,9 +130,7 @@ namespace Barotrauma
return true;
};
// Submarine selectedSub = subList.SelectedData as Submarine;
//----------------------------------------------------------------------
menuTabs[(int)Tab.LoadGame] = new GUIFrame(panelRect, "");