diff --git a/.vs/Subsurface_Solution/v14/.suo b/.vs/Subsurface_Solution/v14/.suo index ef4d5c2a5..36e940095 100644 Binary files a/.vs/Subsurface_Solution/v14/.suo and b/.vs/Subsurface_Solution/v14/.suo differ diff --git a/Subsurface/Source/Characters/AI/CrewCommander.cs b/Subsurface/Source/Characters/AI/CrewCommander.cs index 7840b6b54..89b172e15 100644 --- a/Subsurface/Source/Characters/AI/CrewCommander.cs +++ b/Subsurface/Source/Characters/AI/CrewCommander.cs @@ -10,11 +10,13 @@ namespace Barotrauma { class CrewCommander { - CrewManager crewManager; + private CrewManager crewManager; - GUIFrame frame; + private GUIFrame frame; //GUIListBox characterList; + private bool infoTextShown; + private int characterFrameBottom; public GUIFrame Frame @@ -39,6 +41,12 @@ namespace Barotrauma if (IsOpen) { + if (!infoTextShown) + { + GUI.AddMessage("Press " + GameMain.Config.KeyBind(InputType.CrewOrders) + " to open/close the command menu", Color.Cyan, 5.0f); + infoTextShown = true; + } + if (frame == null) CreateGUIFrame(); UpdateCharacters(); } @@ -48,7 +56,14 @@ namespace Barotrauma { frame = new GUIFrame(Rectangle.Empty, Color.Black * 0.6f); frame.Padding = new Vector4(200.0f, 100.0f, 200.0f, 100.0f); - + + GUIButton closeButton = new GUIButton(new Rectangle(0, 50, 100, 20), "Close", GUI.Style, frame); + closeButton.OnClicked = (GUIButton button, object userData) => + { + ToggleGUIFrame(); + return false; + }; + //UpdateCharacters(); int buttonWidth = 130; @@ -62,7 +77,7 @@ namespace Barotrauma Order.PrefabList.FindAll(o => o.ItemComponentType == null) : Order.PrefabList.FindAll(o=> o.ItemComponentType != null); - int startX = (int)-(buttonWidth * orders.Count + spacing * (orders.Count - 1)) / 2; + int startX = -(buttonWidth * orders.Count + spacing * (orders.Count - 1)) / 2; int i=0; foreach (Order order in orders) diff --git a/Subsurface/Source/Items/Components/Door.cs b/Subsurface/Source/Items/Components/Door.cs index 76f148d05..7aaedf08b 100644 --- a/Subsurface/Source/Items/Components/Door.cs +++ b/Subsurface/Source/Items/Components/Door.cs @@ -7,7 +7,6 @@ using FarseerPhysics.Factories; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Barotrauma.Lights; -using System.Collections.Generic; namespace Barotrauma.Items.Components { @@ -250,6 +249,12 @@ namespace Barotrauma.Items.Components return true; } + public override bool Select(Character character) + { + //can only be selected if the item is broken + return item.Condition <= 0.0f; + } + public override void Update(float deltaTime, Camera cam) { if (!isStuck) diff --git a/Subsurface/Source/Items/ItemPrefab.cs b/Subsurface/Source/Items/ItemPrefab.cs index 6e1492955..35cb39684 100644 --- a/Subsurface/Source/Items/ItemPrefab.cs +++ b/Subsurface/Source/Items/ItemPrefab.cs @@ -130,7 +130,7 @@ namespace Barotrauma placePosition = Vector2.Zero; item.Submarine = Submarine.Loaded; - item.SetTransform(ConvertUnits.ToSimUnits(item.Position - Submarine.Loaded.Position), 0.0f); + item.SetTransform(ConvertUnits.ToSimUnits(Submarine.Loaded == null ? item.Position : item.Position - Submarine.Loaded.Position), 0.0f); item.FindHull(); //selected = null; diff --git a/Subsurface/Source/Map/WayPoint.cs b/Subsurface/Source/Map/WayPoint.cs index 0eedfcac7..58b28cadf 100644 --- a/Subsurface/Source/Map/WayPoint.cs +++ b/Subsurface/Source/Map/WayPoint.cs @@ -287,6 +287,12 @@ namespace Barotrauma public static void GenerateSubWaypoints() { + if (!Hull.hullList.Any()) + { + DebugConsole.ThrowError("Couldn't generate waypoints: no hulls found."); + return; + } + List existingWaypoints = WayPointList.FindAll(wp => wp.spawnType == SpawnType.Path); foreach (WayPoint wayPoint in existingWaypoints) { diff --git a/Subsurface/Source/Screens/EditMapScreen.cs b/Subsurface/Source/Screens/EditMapScreen.cs index f10f5b324..2eae21d93 100644 --- a/Subsurface/Source/Screens/EditMapScreen.cs +++ b/Subsurface/Source/Screens/EditMapScreen.cs @@ -467,8 +467,6 @@ namespace Barotrauma GUIpanel.Draw(spriteBatch); - if (selectedTab > -1) GUItabs[selectedTab].Draw(spriteBatch); - //EntityPrefab.DrawList(spriteBatch, new Vector2(20,50)); if (characterMode) @@ -497,12 +495,15 @@ namespace Barotrauma dummyCharacter.SelectedConstruction = null; } } - } + dummyCharacter.DrawHUD(spriteBatch, cam); + } else { + if (selectedTab > -1) GUItabs[selectedTab].Draw(spriteBatch); + MapEntity.Edit(spriteBatch, cam); }