diff --git a/Subsurface/Barotrauma.csproj b/Subsurface/Barotrauma.csproj
index 8658afc07..6b0ea2803 100644
--- a/Subsurface/Barotrauma.csproj
+++ b/Subsurface/Barotrauma.csproj
@@ -565,9 +565,15 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
@@ -586,6 +592,9 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
@@ -597,6 +606,7 @@
PreserveNewest
+ Designer
PreserveNewest
diff --git a/Subsurface/Content/Characters/Human/human.xml b/Subsurface/Content/Characters/Human/human.xml
index b9639f525..0f826b5ac 100644
--- a/Subsurface/Content/Characters/Human/human.xml
+++ b/Subsurface/Content/Characters/Human/human.xml
@@ -91,13 +91,13 @@
-
-
+
+
-
-
+
+
diff --git a/Subsurface/Content/Map/beaconbackground.jpg b/Subsurface/Content/Map/beaconbackground.jpg
new file mode 100644
index 000000000..179b69a7b
Binary files /dev/null and b/Subsurface/Content/Map/beaconbackground.jpg differ
diff --git a/Subsurface/Content/Map/citybackground.jpg b/Subsurface/Content/Map/citybackground.jpg
new file mode 100644
index 000000000..613f3e2dc
Binary files /dev/null and b/Subsurface/Content/Map/citybackground.jpg differ
diff --git a/Subsurface/Content/Map/locationTypes.xml b/Subsurface/Content/Map/locationTypes.xml
index 93450568d..d51b53400 100644
--- a/Subsurface/Content/Map/locationTypes.xml
+++ b/Subsurface/Content/Map/locationTypes.xml
@@ -1,7 +1,8 @@
+ symbol="Content/Map/beaconSymbol.png"
+ background="Content/Map/beaconbackground.jpg">
+ symbol="Content/Map/citySymbol.png"
+ background="Content/Map/citybackground.jpg">
+ symbol="Content/Map/militarySymbol.png"
+ background="Content/Map/militarybackground.jpg">
+ symbol="Content/Map/researchSymbol.png"
+ background="Content/Map/citybackground.jpg">
-
-
1.0f)
+ {
+ int limbsInWater = 0;
+ foreach (Limb limb in Limbs)
+ {
+ if (limb.inWater) limbsInWater++;
+ }
+
+ float slowdownFactor = (float)limbsInWater / (float)Limbs.Count();
+
+ float maxSpeed = Math.Max(TargetMovement.Length() - slowdownFactor, 1.0f);
+ if (character.SelectedCharacter!=null) maxSpeed = Math.Min(maxSpeed, 1.0f);
+
+ TargetMovement = Vector2.Normalize(TargetMovement) * maxSpeed;
+ }
+
float walkPosX = (float)Math.Cos(walkPos);
float walkPosY = (float)Math.Sin(walkPos);
float runningModifier = (float)Math.Max(Math.Min(Math.Abs(TargetMovement.X),3.0f) / 1.5f, 1.0);
@@ -224,31 +240,38 @@ namespace Barotrauma
float footMid = waist.SimPosition.X;// (leftFoot.SimPosition.X + rightFoot.SimPosition.X) / 2.0f;
- if (Math.Abs(TargetMovement.X)>1.0f)
- {
- int limbsInWater = 0;
- foreach (Limb limb in Limbs)
- {
- if (limb.inWater) limbsInWater++;
- }
-
- float slowdownFactor = (float)limbsInWater / (float)Limbs.Count();
-
- TargetMovement = Vector2.Normalize(TargetMovement) * Math.Max(TargetMovement.Length() - slowdownFactor, 1.0f);
- }
-
movement = MathUtils.SmoothStep(movement, TargetMovement, movementLerp);
movement.Y = 0.0f;
bool legsUp = false;
for (int i = 0; i < 2; i++)
{
- Limb leg = GetLimb((i == 0) ? LimbType.LeftThigh : LimbType.RightThigh);// : leftLeg;
+ Limb leg = GetLimb((i == 0) ? LimbType.LeftLeg : LimbType.RightLeg);// : leftLeg;
- if (leg.SimPosition.Y < torso.SimPosition.Y) continue;
+ float shortestAngle = leg.Rotation - torso.Rotation;
- leg.body.ApplyTorque(Dir * leg.Mass * 10.0f);
- legsUp = true;
+ if (Math.Abs(shortestAngle)<2.5f) continue;
+ //leg = GetLimb((i == 0) ? LimbType.LeftLeg : LimbType.RightLeg);
+ leg.body.ApplyTorque(-shortestAngle*10.0f);
+
+ // float torsoRot = MathHelper.WrapAngle(torso.Rotation);
+ // torsoRot = MathHelper.ToDegrees(torsoRot);
+
+ //float torque = Math.Sign(torso.SimPosition.X - leg.SimPosition.X) * leg.Mass * 10.0f;
+ //leg.body.ApplyTorque(torque);
+
+
+ //leg.body.ApplyTorque(torque);
+ // if (Math.Sign(Dir)==Math.Sign(torsoRot))
+ // {
+ //leg.body.ApplyTorque(-leg.Mass * 100.0f);
+ // }
+ // else
+ // {
+ // leg.body.ApplyTorque(leg.Mass * 100.0f);
+ // }
+
+ //legsUp = true;
}
if (legsUp || LowestLimb == null) return;
@@ -765,18 +788,26 @@ namespace Barotrauma
leftHand.Disabled = true;
rightHand.Disabled = true;
+
+ for (int i = 0; i < 2; i++ )
+ {
+ LimbType type = i == 0 ? LimbType.RightHand : LimbType.LeftHand;
+ Limb targetLimb = target.AnimController.GetLimb(type);
- Limb targetLimb = target.AnimController.GetLimb(LimbType.LeftHand);
+ Limb pullLimb = GetLimb(type);
- leftHand.pullJoint.Enabled = true;
- leftHand.pullJoint.WorldAnchorB = targetLimb.SimPosition;
- rightHand.pullJoint.Enabled = true;
- rightHand.pullJoint.WorldAnchorB = targetLimb.SimPosition;
+ pullLimb.pullJoint.Enabled = true;
+ pullLimb.pullJoint.WorldAnchorB = targetLimb.SimPosition;
+ pullLimb.pullJoint.MaxForce = 500.0f;
+
+ targetLimb.pullJoint.Enabled = true;
+ targetLimb.pullJoint.WorldAnchorB = pullLimb.SimPosition;
+
+ }
- targetLimb.pullJoint.Enabled = true;
- targetLimb.pullJoint.WorldAnchorB = leftHand.SimPosition;
target.AnimController.IgnorePlatforms = IgnorePlatforms;
+ target.AnimController.TargetMovement = TargetMovement;
}
public override void HoldItem(float deltaTime, Item item, Vector2[] handlePos, Vector2 holdPos, Vector2 aimPos, bool aim, float holdAngle)
diff --git a/Subsurface/Source/Characters/Animation/Ragdoll.cs b/Subsurface/Source/Characters/Animation/Ragdoll.cs
index 488694d18..8d3ab1458 100644
--- a/Subsurface/Source/Characters/Animation/Ragdoll.cs
+++ b/Subsurface/Source/Characters/Animation/Ragdoll.cs
@@ -306,8 +306,17 @@ namespace Barotrauma
float stairPosY = structure.StairDirection == Direction.Right ?
lowestLimb.Position.X - structure.Rect.X : structure.Rect.Width - (lowestLimb.Position.X - structure.Rect.X);
- if (lowestLimb.Position.Y < structure.Rect.Y - structure.Rect.Height + stairPosY) return false;
+
+ if (character.IsDead)
+ {
+ if (lowestLimb.Position.Y < structure.Rect.Y - structure.Rect.Height + stairPosY - 10.0f) return false;
+ }
+ else
+ {
+ if (lowestLimb.Position.Y < structure.Rect.Y - structure.Rect.Height + stairPosY) return false;
+ }
+
if (targetMovement.Y < 0.5f)
{
if (inWater || lowestLimb.Position.Y < structure.Rect.Y - structure.Rect.Height + 50.0f)
diff --git a/Subsurface/Source/Characters/Limb.cs b/Subsurface/Source/Characters/Limb.cs
index 9a8454f22..f3e20b861 100644
--- a/Subsurface/Source/Characters/Limb.cs
+++ b/Subsurface/Source/Characters/Limb.cs
@@ -230,7 +230,7 @@ namespace Barotrauma
pullJoint = new FixedMouseJoint(body.FarseerBody, jointPos);
pullJoint.Enabled = false;
- pullJoint.MaxForce = 150.0f * body.Mass;
+ pullJoint.MaxForce = ((type == LimbType.LeftHand || type == LimbType.RightHand) ? 400.0f : 150.0f) * body.Mass;
GameMain.World.AddJoint(pullJoint);
}
diff --git a/Subsurface/Source/GUI/GUIComponent.cs b/Subsurface/Source/GUI/GUIComponent.cs
index 5015214af..5a2ee4584 100644
--- a/Subsurface/Source/GUI/GUIComponent.cs
+++ b/Subsurface/Source/GUI/GUIComponent.cs
@@ -59,6 +59,8 @@ namespace Barotrauma
set;
}
+ public bool TileSprites;
+
private GUITextBlock toolTipBlock;
//protected float alpha;
@@ -96,7 +98,7 @@ namespace Barotrauma
}
}
- protected List sprites;
+ public List sprites;
//public Alignment SpriteAlignment { get; set; }
//public bool RepeatSpriteX, RepeatSpriteY;
@@ -152,6 +154,8 @@ namespace Barotrauma
{
Visible = true;
+ TileSprites = true;
+
OutlineColor = Color.Transparent;
Font = GUI.Font;
@@ -231,13 +235,24 @@ namespace Barotrauma
{
foreach (Sprite sprite in sprites)
{
- Vector2 startPos = new Vector2(rect.X, rect.Y);
- Vector2 size = new Vector2(Math.Min(sprite.SourceRect.Width,rect.Width), Math.Min(sprite.SourceRect.Height,rect.Height));
+ if (TileSprites)
+ {
+ Vector2 startPos = new Vector2(rect.X, rect.Y);
+ Vector2 size = new Vector2(Math.Min(sprite.SourceRect.Width,rect.Width), Math.Min(sprite.SourceRect.Height,rect.Height));
- if (sprite.size.X == 0.0f) size.X = rect.Width;
- if (sprite.size.Y == 0.0f) size.Y = rect.Height;
+ if (sprite.size.X == 0.0f) size.X = rect.Width;
+ if (sprite.size.Y == 0.0f) size.Y = rect.Height;
- sprite.DrawTiled(spriteBatch, startPos, size, currColor * (currColor.A / 255.0f));
+ sprite.DrawTiled(spriteBatch, startPos, size, currColor * (currColor.A / 255.0f));
+ }
+ else
+ {
+ float scale = (float)(rect.Width) / sprite.SourceRect.Width;
+
+ spriteBatch.Draw(sprite.Texture, rect,
+ new Rectangle(sprite.SourceRect.X, sprite.SourceRect.Y, (int)(sprite.SourceRect.Width), (int)(rect.Height / scale)),
+ currColor * (currColor.A / 255.0f), 0.0f, Vector2.Zero, SpriteEffects.None, 0.0f);
+ }
}
}
@@ -278,7 +293,6 @@ namespace Barotrauma
if (rect.Contains(PlayerInput.MousePosition))
{
MouseOn = this;
- //ToolTip = this.ToolTip;
}
else
{
@@ -339,7 +353,7 @@ namespace Barotrauma
selectedColor = style.SelectedColor;
padding = style.Padding;
- sprites = style.Sprites;
+ sprites = new List(style.Sprites);
OutlineColor = style.OutlineColor;
diff --git a/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs b/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs
index 5a6fe2582..4b4c71f24 100644
--- a/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs
+++ b/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs
@@ -141,6 +141,8 @@ namespace Barotrauma
CrewManager.Draw(spriteBatch);
+ if (Level.Loaded == null) return;
+
if (Level.Loaded.AtEndPosition)
{
endShiftButton.Text = "Enter " + Map.SelectedLocation.Name;
diff --git a/Subsurface/Source/Map/LocationType.cs b/Subsurface/Source/Map/LocationType.cs
index 6f4960dab..64f94b397 100644
--- a/Subsurface/Source/Map/LocationType.cs
+++ b/Subsurface/Source/Map/LocationType.cs
@@ -1,4 +1,5 @@
-using System;
+using Microsoft.Xna.Framework;
+using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
@@ -19,7 +20,9 @@ namespace Barotrauma
private List nameFormats;
- private Sprite sprite;
+ private Sprite symbolSprite;
+
+ private Sprite backGround;
public bool HasHireableCharacters
{
@@ -39,7 +42,12 @@ namespace Barotrauma
public Sprite Sprite
{
- get { return sprite; }
+ get { return symbolSprite; }
+ }
+
+ public Sprite Background
+ {
+ get { return backGround; }
}
private LocationType(XElement element)
@@ -58,7 +66,10 @@ namespace Barotrauma
}
string spritePath = ToolBox.GetAttributeString(element, "symbol", "Content/Map/beaconSymbol.png");
- sprite = new Sprite(spritePath, new Microsoft.Xna.Framework.Vector2(0.5f, 0.5f));
+ symbolSprite = new Sprite(spritePath, new Vector2(0.5f, 0.5f));
+
+ string backgroundPath = ToolBox.GetAttributeString(element, "background", "");
+ backGround = new Sprite(backgroundPath, Vector2.Zero);
//sprite.Origin = ;
}
diff --git a/Subsurface/Source/Map/Map.cs b/Subsurface/Source/Map/Map.cs
index 1a9c9a407..29848b186 100644
--- a/Subsurface/Source/Map/Map.cs
+++ b/Subsurface/Source/Map/Map.cs
@@ -257,7 +257,7 @@ namespace Barotrauma
Vector2 rectCenter = new Vector2(rect.Center.X, rect.Center.Y);
Vector2 offset = -currentLocation.MapPosition;
- iceTexture.DrawTiled(spriteBatch, new Vector2(rect.X, rect.Y), new Vector2(rect.Width, rect.Height), Vector2.Zero, Color.White);
+ iceTexture.DrawTiled(spriteBatch, new Vector2(rect.X, rect.Y), new Vector2(rect.Width, rect.Height), Vector2.Zero, Color.White*0.8f);
GUI.DrawRectangle(spriteBatch, rect, Color.White);
//spriteBatch.Draw(iceTexture, offset, rect, null, null, 0f, null, Color.White, SpriteEffects.None, 0.0f);
diff --git a/Subsurface/Source/Screens/LobbyScreen.cs b/Subsurface/Source/Screens/LobbyScreen.cs
index 4d8e8edf6..efe223844 100644
--- a/Subsurface/Source/Screens/LobbyScreen.cs
+++ b/Subsurface/Source/Screens/LobbyScreen.cs
@@ -12,8 +12,8 @@ namespace Barotrauma
{
enum PanelTab { Crew = 0, Map = 1, CurrentLocation = 2, Store = 3 }
- private GUIFrame leftPanel;
- private GUIFrame[] rightPanel;
+ private GUIFrame topPanel;
+ private GUIFrame[] bottomPanel;
private GUIButton startButton;
@@ -63,33 +63,30 @@ namespace Barotrauma
{
Rectangle panelRect = new Rectangle(
40, 40,
- GameMain.GraphicsWidth < 1000 ? 140 : 180,
- GameMain.GraphicsHeight - 80);
+ GameMain.GraphicsWidth - 80,
+ 100);
- leftPanel = new GUIFrame(panelRect, GUI.Style);
- leftPanel.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
-
- //new GUITextBlock(new Rectangle(0, 0, 200, 25),
- // save, Color.Transparent, Color.White, Alignment.Left, GUI.Style, leftPanel);
-
- GUITextBlock moneyText = new GUITextBlock(new Rectangle(0, 30, 0, 25), "", GUI.Style,
- Alignment.TopLeft, Alignment.TopLeft, leftPanel);
+ topPanel = new GUIFrame(panelRect, GUI.Style);
+ topPanel.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
+
+ GUITextBlock moneyText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "", GUI.Style,
+ Alignment.BottomLeft, Alignment.BottomLeft, topPanel);
moneyText.TextGetter = GetMoney;
- GUIButton button = new GUIButton(new Rectangle(0, 70, 100, 30), "Map", null, Alignment.TopCenter, GUI.Style, leftPanel);
+ GUIButton button = new GUIButton(new Rectangle(-360, 0, 100, 30), "Map", null, Alignment.BottomRight, GUI.Style, topPanel);
button.UserData = PanelTab.Map;
button.OnClicked = SelectRightPanel;
SelectRightPanel(button, button.UserData);
- button = new GUIButton(new Rectangle(0, 110, 100, 30), "Crew", null, Alignment.TopCenter, GUI.Style, leftPanel);
+ button = new GUIButton(new Rectangle(-240, 0, 100, 30), "Crew", null, Alignment.BottomRight, GUI.Style, topPanel);
button.UserData = PanelTab.Crew;
button.OnClicked = SelectRightPanel;
- button = new GUIButton(new Rectangle(0, 150, 100, 30), "Hire", null, Alignment.TopCenter, GUI.Style, leftPanel);
+ button = new GUIButton(new Rectangle(-120, 0, 100, 30), "Hire", null, Alignment.BottomRight, GUI.Style, topPanel);
button.UserData = PanelTab.CurrentLocation;
button.OnClicked = SelectRightPanel;
- button = new GUIButton(new Rectangle(0, 190, 100, 30), "Store", null, Alignment.TopCenter, GUI.Style, leftPanel);
+ button = new GUIButton(new Rectangle(0, 0, 100, 30), "Store", null, Alignment.BottomRight, GUI.Style, topPanel);
button.UserData = PanelTab.Store;
button.OnClicked = SelectRightPanel;
@@ -97,61 +94,62 @@ namespace Barotrauma
//---------------------------------------------------------------
panelRect = new Rectangle(
- panelRect.X + panelRect.Width + 40,
40,
- GameMain.GraphicsWidth - panelRect.Width - 120,
- GameMain.GraphicsHeight - 80);
+ panelRect.Bottom + 40,
+ panelRect.Width,
+ GameMain.GraphicsHeight - 120 - panelRect.Height);
- rightPanel = new GUIFrame[4];
+ bottomPanel = new GUIFrame[4];
- rightPanel[(int)PanelTab.Crew] = new GUIFrame(panelRect, GUI.Style);
- rightPanel[(int)PanelTab.Crew].Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
+ bottomPanel[(int)PanelTab.Crew] = new GUIFrame(panelRect, GUI.Style);
+ 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, rightPanel[(int)PanelTab.Crew]);
+ //new GUITextBlock(new Rectangle(0, 0, 200, 25), "Crew:", Color.Transparent, Color.White, Alignment.Left, GUI.Style, bottomPanel[(int)PanelTab.Crew]);
int crewColumnWidth = Math.Min(300, (panelRect.Width - 40) / 2);
- characterList = new GUIListBox(new Rectangle(0, 30, crewColumnWidth, 0), GUI.Style, rightPanel[(int)PanelTab.Crew]);
+ characterList = new GUIListBox(new Rectangle(0, 0, crewColumnWidth, 0), GUI.Style, bottomPanel[(int)PanelTab.Crew]);
characterList.OnSelected = SelectCharacter;
//---------------------------------------
- rightPanel[(int)PanelTab.Map] = new GUIFrame(panelRect, GUI.Style);
- rightPanel[(int)PanelTab.Map].Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
+ bottomPanel[(int)PanelTab.Map] = new GUIFrame(panelRect, GUI.Style);
+ 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, rightPanel[(int)PanelTab.Map]);
+ Alignment.BottomRight, GUI.Style, bottomPanel[(int)PanelTab.Map]);
startButton.OnClicked = StartShift;
startButton.Enabled = false;
//---------------------------------------
- rightPanel[(int)PanelTab.CurrentLocation] = new GUIFrame(panelRect, GUI.Style);
+ bottomPanel[(int)PanelTab.CurrentLocation] = new GUIFrame(panelRect, GUI.Style);
+ bottomPanel[(int)PanelTab.CurrentLocation].Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
//---------------------------------------
- rightPanel[(int)PanelTab.Store] = new GUIFrame(panelRect, GUI.Style);
- rightPanel[(int)PanelTab.Store].Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
+ bottomPanel[(int)PanelTab.Store] = new GUIFrame(panelRect, GUI.Style);
+ 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, 0, sellColumnWidth, 400), Color.White * 0.7f, GUI.Style, rightPanel[(int)PanelTab.Store]);
+ selectedItemList = new GUIListBox(new Rectangle(0, 0, sellColumnWidth, 400), Color.White * 0.7f, GUI.Style, bottomPanel[(int)PanelTab.Store]);
selectedItemList.OnSelected = DeselectItem;
- var costText = new GUITextBlock(new Rectangle(0, 0, 100, 25), "Cost: ", GUI.Style, Alignment.BottomLeft, Alignment.TopLeft, rightPanel[(int)PanelTab.Store]);
+ var costText = new GUITextBlock(new Rectangle(0, 0, 100, 25), "Cost: ", GUI.Style, Alignment.BottomLeft, Alignment.TopLeft, bottomPanel[(int)PanelTab.Store]);
costText.TextGetter = CostTextGetter;
- buyButton = new GUIButton(new Rectangle(sellColumnWidth+20, 0, 100, 25), "Buy", Alignment.Bottom, GUI.Style, rightPanel[(int)PanelTab.Store]);
+ buyButton = new GUIButton(new Rectangle(sellColumnWidth+20, 0, 100, 25), "Buy", Alignment.Bottom, GUI.Style, bottomPanel[(int)PanelTab.Store]);
buyButton.OnClicked = BuyItems;
- itemList = new GUIListBox(new Rectangle(0, 0, sellColumnWidth, 400), Color.White * 0.7f, Alignment.TopRight, GUI.Style, rightPanel[(int)PanelTab.Store]);
+ itemList = new GUIListBox(new Rectangle(0, 0, sellColumnWidth, 400), Color.White * 0.7f, Alignment.TopRight, GUI.Style, bottomPanel[(int)PanelTab.Store]);
itemList.OnSelected = SelectItem;
- foreach (MapEntityPrefab ep in MapEntityPrefab.list)
- {
- if (ep.Price == 0) continue;
+ foreach (MapEntityPrefab ep in MapEntityPrefab.list)
+ {
+ if (ep.Price == 0) continue;
- CreateItemFrame(ep, itemList);
- }
+ CreateItemFrame(ep, itemList);
+ }
}
public override void Select()
@@ -167,18 +165,44 @@ namespace Barotrauma
private void UpdateLocationTab(Location location)
{
- rightPanel[(int)PanelTab.CurrentLocation] = new GUIFrame(rightPanel[(int)PanelTab.CurrentLocation].Rect, GUI.Style);
- rightPanel[(int)PanelTab.CurrentLocation].UserData = location;
+ topPanel.RemoveChild(topPanel.FindChild("locationtitle"));
+
+ var locationTitle = new GUITextBlock(new Rectangle(0, 0, 200, 25),
+ "Location: "+location.Name, Color.Transparent, Color.White, Alignment.TopLeft, GUI.Style, topPanel);
+ locationTitle.UserData = "locationtitle";
+ locationTitle.Font = GUI.LargeFont;
+
+ bottomPanel[(int)PanelTab.CurrentLocation].ClearChildren();
//rightPanel[(int)PanelTab.Hire].Padding = GUI.style.smallPadding;
-
- new GUITextBlock(new Rectangle(0, 0, 200, 25),
- "Location: "+location.Name, GUI.Style, rightPanel[(int)PanelTab.CurrentLocation]);
- new GUITextBlock(new Rectangle(0, 20, 200, 25),
- "("+location.Type.Name+")", GUI.Style, rightPanel[(int)PanelTab.CurrentLocation]);
-
+
+ //for (int i = 0; i < Enum.GetNames(typeof(PanelTab)).Length; i++ )
+ //{
+
+ // float size = Math.Max(
+ // (float)GameMain.GraphicsWidth / (float)location.Type.Background.SourceRect.Width,
+ // (float)GameMain.GraphicsHeight / (float)location.Type.Background.SourceRect.Height);
+ // location.Type.Background.size = new Vector2(
+ // location.Type.Background.SourceRect.Width*size,
+ // location.Type.Background.SourceRect.Height*size);
+
+
+ // topPanel.sprites.Clear();
+ // topPanel.TileSprites = false;
+ // topPanel.sprites.Add(location.Type.Background);
+
+ // bottomPanel[i].sprites.Clear();
+ // bottomPanel[i].TileSprites = false;
+ // bottomPanel[i].sprites.Add(location.Type.Background);
+ //}
+
+ //new GUITextBlock(new Rectangle(0, 0, 200, 25),
+ // "Location: "+location.Name, GUI.Style, bottomPanel[(int)PanelTab.CurrentLocation]);
+ //new GUITextBlock(new Rectangle(0, 20, 200, 25),
+ // "("+location.Type.Name+")", GUI.Style, bottomPanel[(int)PanelTab.CurrentLocation]);
+
if (location.HireManager != null)
{
- hireList = new GUIListBox(new Rectangle(0, 60, 300, 0), GUI.Style, Alignment.Left, rightPanel[(int)PanelTab.CurrentLocation]);
+ hireList = new GUIListBox(new Rectangle(0, 0, 300, 0), GUI.Style, Alignment.Left, bottomPanel[(int)PanelTab.CurrentLocation]);
hireList.OnSelected = SelectCharacter;
hireList.ClearChildren();
@@ -196,6 +220,10 @@ namespace Barotrauma
Alignment.TopRight, GUI.Style, textBlock);
}
}
+ else
+ {
+ //(topPanel.FindChild(PanelTab.CurrentLocation) as GUIButton).Enabled = false;
+ }
}
@@ -208,11 +236,11 @@ namespace Barotrauma
public void SelectLocation(Location location, LocationConnection connection)
{
- GUIComponent locationPanel = rightPanel[(int)PanelTab.Map].GetChild("selectedlocation");
+ GUIComponent locationPanel = bottomPanel[(int)PanelTab.Map].GetChild("selectedlocation");
- if (locationPanel != null) rightPanel[(int)PanelTab.Map].RemoveChild(locationPanel);
+ if (locationPanel != null) bottomPanel[(int)PanelTab.Map].RemoveChild(locationPanel);
- locationPanel = new GUIFrame(new Rectangle(0, 0, 200, 190), Color.Transparent, Alignment.TopRight, null, rightPanel[(int)PanelTab.Map]);
+ locationPanel = new GUIFrame(new Rectangle(0, 0, 200, 190), Color.Transparent, Alignment.TopRight, null, bottomPanel[(int)PanelTab.Map]);
locationPanel.UserData = "selectedlocation";
if (location == null) return;
@@ -339,8 +367,8 @@ namespace Barotrauma
{
base.Update(deltaTime);
- leftPanel.Update((float)deltaTime);
- rightPanel[selectedRightPanel].Update((float)deltaTime);
+ topPanel.Update((float)deltaTime);
+ bottomPanel[selectedRightPanel].Update((float)deltaTime);
mapZoom += PlayerInput.ScrollWheelSpeed / 1000.0f;
mapZoom = MathHelper.Clamp(mapZoom, 1.0f, 4.0f);
@@ -357,24 +385,29 @@ namespace Barotrauma
graphics.Clear(Color.CornflowerBlue);
- GameMain.GameScreen.DrawMap(graphics, spriteBatch);
+ //GameMain.GameScreen.DrawMap(graphics, spriteBatch);
spriteBatch.Begin();
- leftPanel.Draw(spriteBatch);
+ Sprite backGround = GameMain.GameSession.Map.CurrentLocation.Type.Background;
+ spriteBatch.Draw(backGround.Texture, Vector2.Zero, null, Color.White, 0.0f, Vector2.Zero,
+ Math.Max((float)GameMain.GraphicsWidth / backGround.SourceRect.Width, (float)GameMain.GraphicsHeight / backGround.SourceRect.Width), SpriteEffects.None, 0.0f);
- rightPanel[selectedRightPanel].Draw(spriteBatch);
+
+ topPanel.Draw(spriteBatch);
+
+ bottomPanel[selectedRightPanel].Draw(spriteBatch);
if (selectedRightPanel == (int)PanelTab.Map)
{
GameMain.GameSession.Map.Draw(spriteBatch, new Rectangle(
- rightPanel[selectedRightPanel].Rect.X + 20,
- rightPanel[selectedRightPanel].Rect.Y + 20,
- rightPanel[selectedRightPanel].Rect.Width - 280,
- rightPanel[selectedRightPanel].Rect.Height - 40), mapZoom);
+ bottomPanel[selectedRightPanel].Rect.X + 20,
+ bottomPanel[selectedRightPanel].Rect.Y + 20,
+ bottomPanel[selectedRightPanel].Rect.Width - 280,
+ bottomPanel[selectedRightPanel].Rect.Height - 40), mapZoom);
}
- if (rightPanel[(int)selectedRightPanel].UserData as Location != GameMain.GameSession.Map.CurrentLocation)
+ if (bottomPanel[(int)selectedRightPanel].UserData as Location != GameMain.GameSession.Map.CurrentLocation)
{
UpdateLocationTab(GameMain.GameSession.Map.CurrentLocation);
}
@@ -397,7 +430,7 @@ namespace Barotrauma
if (button != null)
{
button.Selected = true;
- foreach (GUIComponent child in leftPanel.children)
+ foreach (GUIComponent child in topPanel.children)
{
GUIButton otherButton = child as GUIButton;
if (otherButton == null || otherButton == button) continue;
@@ -423,9 +456,9 @@ namespace Barotrauma
if (previewFrame == null || previewFrame.UserData != characterInfo)
{
- previewFrame = new GUIFrame(new Rectangle(rightPanel[(int)PanelTab.Crew].Rect.Width/2, 60, Math.Min(300,rightPanel[(int)PanelTab.Crew].Rect.Width/2 - 40), 300),
+ previewFrame = new GUIFrame(new Rectangle(bottomPanel[(int)PanelTab.Crew].Rect.Width/2, 60, Math.Min(300,bottomPanel[(int)PanelTab.Crew].Rect.Width/2 - 40), 300),
new Color(0.0f, 0.0f, 0.0f, 0.8f),
- Alignment.Top, GUI.Style, rightPanel[selectedRightPanel]);
+ Alignment.Top, GUI.Style, bottomPanel[selectedRightPanel]);
previewFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
previewFrame.UserData = characterInfo;
diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo
index 9226cf21d..30a66e032 100644
Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ