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
Binary file not shown.

Before

Width:  |  Height:  |  Size: 400 KiB

After

Width:  |  Height:  |  Size: 449 KiB

+17 -6
View File
@@ -8,9 +8,20 @@
textcolor="0.0, 0.0, 0.0, 1.0">
<Sprite texture="Content/UI/UI_Atlas.png" size="0.0, 0.0" sourcerect ="32, 541, 420, 454" slice="87,576,430,960"/>
<Sprite texture="Content/UI/UI_Atlas.png" size="0.0, 0.0" sourcerect ="32, 541, 420, 220" slice="87,576,430,687"/>
</GUIFrame>
<GUIFrameHeader
padding="40.0, 40.0, 40.0, 40.0"
color="1.0,1.0,1.0,1.0"
hovercolor="1.0,1.0,1.0,1.0"
selectedcolor="1.0,1.0,1.0,1.0"
textcolor="0.0, 0.0, 0.0, 1.0">
<Sprite texture="Content/UI/UI_Atlas.png" size="0.0, 0.0" sourcerect ="32, 780, 420, 220" slice="87,853,430,929"/>
</GUIFrameHeader>
<GUIFrameTop
padding="40.0, 40.0, 40.0, 40.0"
color="1.0,1.0,1.0,1.0"
@@ -19,7 +30,7 @@
textcolor="0.0, 0.0, 0.0, 1.0">
<Sprite texture="Content/UI/UI_Atlas.png" size="0.0, 0.0" sourcerect ="32, 576, 420, 454" slice="87,578,430,960"/>
<Sprite texture="Content/UI/UI_Atlas.png" size="0.0, 0.0" sourcerect ="32, 705, 420, 55" slice="87,706,430,739"/>
</GUIFrameTop>
<GUIFrameLeft
@@ -30,7 +41,7 @@
textcolor="0.0, 0.0, 0.0, 1.0">
<Sprite texture="Content/UI/UI_Atlas.png" size="0.0, 0.0" sourcerect ="87, 541, 365, 454" slice="88,576,430,960"/>
<Sprite texture="Content/UI/UI_Atlas.png" size="0.0, 0.0" sourcerect ="87, 541, 365, 220" slice="88,576,430,687"/>
</GUIFrameLeft>
<GUIFrameRight
@@ -41,7 +52,7 @@
textcolor="0.0, 0.0, 0.0, 1.0">
<Sprite texture="Content/UI/UI_Atlas.png" size="0.0, 0.0" sourcerect ="32, 541, 395, 454" slice="87,576,430,960"/>
<Sprite texture="Content/UI/UI_Atlas.png" size="0.0, 0.0" sourcerect ="32, 541, 395, 220" slice="87,576,430,687"/>
</GUIFrameRight>
<InnerFrame
@@ -122,7 +133,7 @@
padding="5.0, 5.0, 5.0, 5.0">
<Sprite texture="Content/UI/UI_Atlas.png" state="Hover" sourcerect ="493, 544, 227, 52" slice="494, 552, 718, 584"/>
<Sprite texture="Content/UI/UI_Atlas.png" state="Selected" sourcerect ="493, 544, 227, 52" slice="494, 552, 718, 584"/>
<Sprite texture="Content/UI/UI_Atlas.png" state="Selected" sourcerect ="493, 490, 227, 52" slice="494, 497, 718, 529"/>
</ListBoxElement>
<GUIScrollBar>
@@ -160,7 +171,7 @@
textcolor="0.5, 0.55, 0.6, 1.0">
<Sprite texture="Content/UI/UI_Atlas.png" state="None" sourcerect ="470, 599, 274, 52" slice="480, 610, 731, 640"/>
<Sprite texture="Content/UI/UI_Atlas.png" state="Hover" sourcerect ="470, 544, 274, 52" slice="480, 552, 731, 584"/>
<Sprite texture="Content/UI/UI_Atlas.png" state="Selected" sourcerect ="470, 544, 274, 52" slice="480, 552, 731, 584"/>
<Sprite texture="Content/UI/UI_Atlas.png" state="Selected" sourcerect ="470, 490, 274, 52" slice="480, 497, 731, 529"/>
</GUITextBox>
<GUITickBox
@@ -260,9 +260,9 @@ namespace Barotrauma
GUITextBlock textBlock = new GUITextBlock(
new Rectangle(40, 0, 0, 25),
text,
Color.Transparent, Color.White,
null, null,
Alignment.Left, Alignment.Left,
null, frame, false);
"", frame, false);
textBlock.Font = GUI.SmallFont;
textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f);
+1 -1
View File
@@ -97,7 +97,7 @@ namespace Barotrauma
public void AddItem(string text, object userData = null)
{
GUITextBlock textBlock = new GUITextBlock(new Rectangle(0,0,0,20), text, "ListBoxElement", listBox);
GUITextBlock textBlock = new GUITextBlock(new Rectangle(0,0,0,20), text, "ListBoxElement", Alignment.TopLeft, Alignment.CenterLeft, listBox);
textBlock.UserData = userData;
}
+2 -1
View File
@@ -230,7 +230,6 @@ namespace Barotrauma
state = ComponentState.None;
}
textBlock.State = state;
if (CaretEnabled)
{
@@ -240,6 +239,7 @@ namespace Barotrauma
if (keyboardDispatcher.Subscriber == this)
{
state = ComponentState.Selected;
Character.DisableControls = true;
if (OnEnterPressed != null && PlayerInput.KeyHit(Keys.Enter))
{
@@ -256,6 +256,7 @@ namespace Barotrauma
}
textBlock.State = state;
textBlock.Update(deltaTime);
}
+2 -4
View File
@@ -221,15 +221,13 @@ namespace Barotrauma
frame.UserData = character;
frame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
frame.Color = (GameMain.NetworkMember != null && GameMain.NetworkMember.Character == character) ? Color.Gold * 0.2f : Color.Transparent;
frame.HoverColor = Color.LightGray * 0.5f;
frame.SelectedColor = Color.Gold * 0.5f;
GUITextBlock textBlock = new GUITextBlock(
new Rectangle(40, 0, 0, 25),
ToolBox.LimitString(character.Info.Name + " (" + character.Info.Job.Name + ")", GUI.Font, frame.Rect.Width-20),
Color.Transparent, Color.White,
null,null,
Alignment.Left, Alignment.Left,
null, frame);
"", frame);
textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f);
new GUIImage(new Rectangle(-10, 0, 0, 0), character.AnimController.Limbs[0].sprite, Alignment.Left, frame);
+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, "");