diff --git a/Subsurface/Barotrauma.csproj b/Subsurface/Barotrauma.csproj index 8c149b2ae..7fde66839 100644 --- a/Subsurface/Barotrauma.csproj +++ b/Subsurface/Barotrauma.csproj @@ -734,12 +734,7 @@ PreserveNewest - - - PreserveNewest - - - PreserveNewest + Designer PreserveNewest @@ -771,9 +766,6 @@ PreserveNewest Designer - - PreserveNewest - PreserveNewest Designer @@ -803,12 +795,6 @@ PreserveNewest - - PreserveNewest - - - PreserveNewest - PreserveNewest @@ -816,9 +802,6 @@ PreserveNewest Designer - - PreserveNewest - PreserveNewest diff --git a/Subsurface/Content/Items/Diving/divinggear.xml b/Subsurface/Content/Items/Diving/divinggear.xml index 2b6146371..04bf10b3d 100644 --- a/Subsurface/Content/Items/Diving/divinggear.xml +++ b/Subsurface/Content/Items/Diving/divinggear.xml @@ -10,10 +10,10 @@ - - - + + + diff --git a/Subsurface/Content/Items/Diving/oxygentank.png b/Subsurface/Content/Items/Diving/oxygentank.png deleted file mode 100644 index 04cf31e58..000000000 Binary files a/Subsurface/Content/Items/Diving/oxygentank.png and /dev/null differ diff --git a/Subsurface/Content/Items/Tools/fueltank.png b/Subsurface/Content/Items/Tools/fueltank.png deleted file mode 100644 index f26b70ebe..000000000 Binary files a/Subsurface/Content/Items/Tools/fueltank.png and /dev/null differ diff --git a/Subsurface/Content/Items/Tools/plasmacutter.png b/Subsurface/Content/Items/Tools/plasmacutter.png deleted file mode 100644 index 25fdfaa60..000000000 Binary files a/Subsurface/Content/Items/Tools/plasmacutter.png and /dev/null differ diff --git a/Subsurface/Content/Items/Tools/screwdriver.png b/Subsurface/Content/Items/Tools/screwdriver.png deleted file mode 100644 index 488e8d131..000000000 Binary files a/Subsurface/Content/Items/Tools/screwdriver.png and /dev/null differ diff --git a/Subsurface/Content/Items/Tools/tools.png b/Subsurface/Content/Items/Tools/tools.png index 423e4025b..a1b58f649 100644 Binary files a/Subsurface/Content/Items/Tools/tools.png and b/Subsurface/Content/Items/Tools/tools.png differ diff --git a/Subsurface/Content/Items/Tools/tools.xml b/Subsurface/Content/Items/Tools/tools.xml index 48a75f29f..560e8c436 100644 --- a/Subsurface/Content/Items/Tools/tools.xml +++ b/Subsurface/Content/Items/Tools/tools.xml @@ -110,9 +110,9 @@ - + - + diff --git a/Subsurface/Content/Items/Tools/weldingtool.png b/Subsurface/Content/Items/Tools/weldingtool.png deleted file mode 100644 index 02101925a..000000000 Binary files a/Subsurface/Content/Items/Tools/weldingtool.png and /dev/null differ diff --git a/Subsurface/Content/Items/Tools/wrench.png b/Subsurface/Content/Items/Tools/wrench.png deleted file mode 100644 index 531b41d09..000000000 Binary files a/Subsurface/Content/Items/Tools/wrench.png and /dev/null differ diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs index 4ef576e61..ee77fdbff 100644 --- a/Subsurface/Source/Characters/Character.cs +++ b/Subsurface/Source/Characters/Character.cs @@ -377,6 +377,8 @@ namespace Barotrauma public static Character Create(string file, Vector2 position, CharacterInfo characterInfo = null, bool isNetworkPlayer = false, bool hasAi=true) { + if (!System.IO.File.Exists(file)) return null; + if (file != humanConfigFile) { var enemyCharacter = new AICharacter(file, position, characterInfo, isNetworkPlayer); diff --git a/Subsurface/Source/Characters/CharacterHUD.cs b/Subsurface/Source/Characters/CharacterHUD.cs index 3d192d008..72d9fbd10 100644 --- a/Subsurface/Source/Characters/CharacterHUD.cs +++ b/Subsurface/Source/Characters/CharacterHUD.cs @@ -9,7 +9,6 @@ namespace Barotrauma { class CharacterHUD { - private static Sprite statusIcons; private static Sprite noiseOverlay, damageOverlay; @@ -22,7 +21,7 @@ namespace Barotrauma { healthBar.Flash(); - damageOverlayTimer = MathHelper.Clamp(amount*0.1f, 0.2f, 5.0f); + damageOverlayTimer = MathHelper.Clamp(amount * 0.1f, 0.2f, 5.0f); } public static void Update(float deltaTime, Character character) @@ -39,17 +38,17 @@ namespace Barotrauma public static void Draw(SpriteBatch spriteBatch, Character character, Camera cam) { - if (statusIcons==null) + if (statusIcons == null) { statusIcons = new Sprite("Content/UI/statusIcons.png", Vector2.Zero); } - if (noiseOverlay==null) + if (noiseOverlay == null) { - noiseOverlay = new Sprite("Content/UI/noise.png", Vector2.Zero); + noiseOverlay = new Sprite("Content/UI/noise.png", Vector2.Zero); } - if (damageOverlay==null) + if (damageOverlay == null) { damageOverlay = new Sprite("Content/UI/damageOverlay.png", Vector2.Zero); } @@ -71,26 +70,26 @@ namespace Barotrauma Vector2 textPos = startPos; textPos -= new Vector2(GUI.Font.MeasureString(character.ClosestCharacter.Info.Name).X / 2, 20); - GUI.DrawString(spriteBatch, textPos, character.ClosestCharacter.Info.Name, Color.Orange, Color.Black, 2); + GUI.DrawString(spriteBatch, textPos, character.ClosestCharacter.Info.Name, Color.White, Color.Black, 2); } else if (character.SelectedCharacter == null && character.ClosestItem != null && character.SelectedConstruction == null) { + var hudTexts = character.ClosestItem.GetHUDTexts(character); - Vector2 startPos = character.DrawPosition + (character.ClosestItem.DrawPosition - character.DrawPosition) * 0.7f; - startPos = cam.WorldToScreen(startPos); + Vector2 startPos = new Vector2((int)(GameMain.GraphicsWidth / 2.0f), (int)(GameMain.GraphicsHeight)); + startPos.Y -= 50 + hudTexts.Count * 25; Vector2 textPos = startPos; - textPos -= new Vector2(GUI.Font.MeasureString(character.ClosestItem.Name).X / 2, 20); + textPos -= new Vector2((int)GUI.Font.MeasureString(character.ClosestItem.Name).X / 2, 20); - GUI.DrawString(spriteBatch, textPos, character.ClosestItem.Name, Color.Orange, Color.Black * 0.7f, 2); - - - textPos.Y += 50.0f; - foreach (ColoredText coloredText in character.ClosestItem.GetHUDTexts(character)) + GUI.DrawString(spriteBatch, textPos, character.ClosestItem.Name, Color.White, Color.Black * 0.7f, 2); + + textPos.Y += 30.0f; + foreach (ColoredText coloredText in hudTexts) { - textPos.X = startPos.X - GUI.Font.MeasureString(coloredText.Text).X / 2; + textPos.X = (int)(startPos.X - GUI.SmallFont.MeasureString(coloredText.Text).X / 2); - GUI.DrawString(spriteBatch, textPos, coloredText.Text, coloredText.Color, Color.Black*0.7f, 2); + GUI.DrawString(spriteBatch, textPos, coloredText.Text, coloredText.Color, Color.Black*0.7f, 2, GUI.SmallFont); textPos.Y += 25; } diff --git a/Subsurface/Source/DebugConsole.cs b/Subsurface/Source/DebugConsole.cs index 82db5a368..97242b3f2 100644 --- a/Subsurface/Source/DebugConsole.cs +++ b/Subsurface/Source/DebugConsole.cs @@ -219,10 +219,6 @@ namespace Barotrauma if (spawnedCharacter != null && GameMain.Server != null) GameMain.Server.SendCharacterSpawnMessage(spawnedCharacter); break; - //case "startserver": - // if (Game1.Server==null) - // Game1.NetworkMember = new GameServer(); - // break; case "kick": if (GameMain.Server == null) break; GameMain.Server.KickPlayer(commands[1]); diff --git a/Subsurface/Source/Items/Components/Signal/LightComponent.cs b/Subsurface/Source/Items/Components/Signal/LightComponent.cs index da087e47d..30a21a9d8 100644 --- a/Subsurface/Source/Items/Components/Signal/LightComponent.cs +++ b/Subsurface/Source/Items/Components/Signal/LightComponent.cs @@ -164,6 +164,9 @@ namespace Barotrauma.Items.Components case "set_state": IsActive = (signal != "0"); break; + case "set_color": + LightColor = signal; + break; } } } diff --git a/Subsurface/Source/Map/Levels/Level.cs b/Subsurface/Source/Map/Levels/Level.cs index a67d2bea2..69a73c480 100644 --- a/Subsurface/Source/Map/Levels/Level.cs +++ b/Subsurface/Source/Map/Levels/Level.cs @@ -162,7 +162,7 @@ namespace Barotrauma backgroundColor = new Color(backgroundColor, 1.0f); float minWidth = Submarine.Loaded == null ? 0.0f : Math.Max(Submarine.Borders.Width, Submarine.Borders.Height); - minWidth = Math.Max(minWidth, 3500.0f); + minWidth = Math.Max(minWidth, 6500.0f); startPosition = new Vector2((int)minWidth * 2, Rand.Range((int)minWidth * 2, borders.Height - (int)minWidth * 2, false)); endPosition = new Vector2(borders.Width - (int)minWidth * 2, Rand.Range((int)minWidth * 2, borders.Height - (int)minWidth * 2, false)); @@ -628,12 +628,11 @@ namespace Barotrauma if (tooClose && !tooCloseCells.Contains(cell)) tooCloseCells.Add(cell); } - for (int x = -1; x <= 1; x++) + for (float x = -minDistance; x <= minDistance; x+=siteInterval) { - for (int y = -1; y <= 1; y++) + for (float y = -minDistance; y <= minDistance; y += siteInterval) { - if (x == 0 && y == 0) continue; - Vector2 cornerPos = position + new Vector2(x * minDistance, y * minDistance); + Vector2 cornerPos = position + new Vector2(x,y); int cellIndex = FindCellIndex(cornerPos); if (cellIndex == -1) continue; diff --git a/Subsurface/Source/Screens/EditMapScreen.cs b/Subsurface/Source/Screens/EditMapScreen.cs index 96ede1c5f..abaff3ec6 100644 --- a/Subsurface/Source/Screens/EditMapScreen.cs +++ b/Subsurface/Source/Screens/EditMapScreen.cs @@ -516,8 +516,9 @@ namespace Barotrauma { if (dummyCharacter == null) return false; + //if the same type of wire has already been selected, deselect it and return Item existingWire = dummyCharacter.SelectedItems.FirstOrDefault(i => i != null && i.Prefab == userData as ItemPrefab); - if (existingWire!=null) + if (existingWire != null) { existingWire.Drop(); existingWire.Remove(); @@ -526,12 +527,14 @@ namespace Barotrauma var wire = new Item(userData as ItemPrefab, Vector2.Zero, null); - int slotIndex = dummyCharacter.Inventory.FindLimbSlot(LimbSlot.LeftHand); - if (dummyCharacter.Inventory.Items[slotIndex] != null && dummyCharacter.Inventory.Items[slotIndex].Prefab != userData as ItemPrefab) + + //if there's some other type of wire in the inventory, remove it + existingWire = dummyCharacter.Inventory.Items[slotIndex]; + if (existingWire != null && existingWire.Prefab != userData as ItemPrefab) { - dummyCharacter.Inventory.Items[slotIndex].Drop(); - dummyCharacter.Inventory.Items[slotIndex].Remove(); + existingWire.Drop(); + existingWire.Remove(); } dummyCharacter.Inventory.TryPutItem(wire, slotIndex, false, false); @@ -663,7 +666,7 @@ namespace Barotrauma if (wiringMode) { - if (!dummyCharacter.SelectedItems.Any(it => it.HasTag("Wire"))) + if (!dummyCharacter.SelectedItems.Any(it => it != null && it.HasTag("Wire"))) { wiringToolPanel.GetChild().Deselect(); }