diff --git a/Subsurface/Barotrauma.csproj b/Subsurface/Barotrauma.csproj index c9d2e5a0b..64f70eddc 100644 --- a/Subsurface/Barotrauma.csproj +++ b/Subsurface/Barotrauma.csproj @@ -273,6 +273,13 @@ PreserveNewest + + PreserveNewest + + + Designer + PreserveNewest + PreserveNewest diff --git a/Subsurface/Barotrauma.csproj.user b/Subsurface/Barotrauma.csproj.user index df35fcf91..1782abafa 100644 --- a/Subsurface/Barotrauma.csproj.user +++ b/Subsurface/Barotrauma.csproj.user @@ -9,7 +9,7 @@ en-US false - ProjectFiles + ShowAllFiles diff --git a/Subsurface/Content/Characters/Coelanth/Coelanth.png b/Subsurface/Content/Characters/Coelanth/Coelanth.png new file mode 100644 index 000000000..0c9b63349 Binary files /dev/null and b/Subsurface/Content/Characters/Coelanth/Coelanth.png differ diff --git a/Subsurface/Content/Characters/Coelanth/coelanth.xml b/Subsurface/Content/Characters/Coelanth/coelanth.xml new file mode 100644 index 000000000..0de557050 --- /dev/null +++ b/Subsurface/Content/Characters/Coelanth/coelanth.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Subsurface/Content/Map/StructurePrefabs.xml b/Subsurface/Content/Map/StructurePrefabs.xml index 29096ffc1..3e7b7f062 100644 --- a/Subsurface/Content/Map/StructurePrefabs.xml +++ b/Subsurface/Content/Map/StructurePrefabs.xml @@ -1,9 +1,9 @@ + width = "128" height ="64" resizehorizontal="true"/> + width = "128" height ="32" resizehorizontal="true"/> @@ -34,19 +34,19 @@ width = "16" height ="16"/> + width = "16" height ="16"/> + width = "32" height ="64" resizevertical="true" fliphorizontal="true" body="true" health="500"/> + width = "32" height ="64" resizevertical="true" body="true" health="500"/> + width = "64" height ="32" resizehorizontal="true" body="true" health="500"/> @@ -54,29 +54,35 @@ + + + + + width = "128" height ="32" resizehorizontal="true"/> + width = "64" height ="64" resizehorizontal="true" body="true" platform="true"/> + width = "64" height ="32" resizehorizontal="true" body="true" platform="true"/> + width="64" height="64" resizehorizontal="true" resizevertical="true"/> + width="64" height="64" resizehorizontal="true" resizevertical="true"/> + width="64" height="64" resizehorizontal="true" resizevertical="true"/> + width="256" height="320" depth = "0.1" stairdirection="Right"/> + width="256" height="320" depth = "0.1" stairdirection="Left"/> diff --git a/Subsurface/Content/Map/testroom.png b/Subsurface/Content/Map/testroom.png index 75870c026..01924bcc7 100644 Binary files a/Subsurface/Content/Map/testroom.png and b/Subsurface/Content/Map/testroom.png differ diff --git a/Subsurface/Content/randomevents.xml b/Subsurface/Content/randomevents.xml index ff6ea15a4..653076aa8 100644 --- a/Subsurface/Content/randomevents.xml +++ b/Subsurface/Content/randomevents.xml @@ -25,4 +25,13 @@ difficulty="25" minamount="1" maxamount="2" musictype="monster"/> + + + \ No newline at end of file diff --git a/Subsurface/Properties/AssemblyInfo.cs b/Subsurface/Properties/AssemblyInfo.cs index 91f993b8a..09223bc74 100644 --- a/Subsurface/Properties/AssemblyInfo.cs +++ b/Subsurface/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.2.4.1")] -[assembly: AssemblyFileVersion("0.2.4.1")] +[assembly: AssemblyVersion("0.2.5.0")] +[assembly: AssemblyFileVersion("0.2.5.0")] diff --git a/Subsurface/Source/Characters/AICharacter.cs b/Subsurface/Source/Characters/AICharacter.cs index 2f265fe20..c56f4814e 100644 --- a/Subsurface/Source/Characters/AICharacter.cs +++ b/Subsurface/Source/Characters/AICharacter.cs @@ -13,7 +13,7 @@ namespace Barotrauma const float AttackBackPriority = 1.0f; private AIController aiController; - + public override AIController AIController { get { return aiController; } diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs index fe7777f30..00183e073 100644 --- a/Subsurface/Source/Characters/Character.cs +++ b/Subsurface/Source/Characters/Character.cs @@ -825,15 +825,26 @@ namespace Barotrauma { if (!Enabled) return; - AnimController.SimplePhysicsEnabled = (Character.controlled!=this && Vector2.Distance(cam.WorldViewCenter, Position)>5000.0f); + AnimController.SimplePhysicsEnabled = (Character.controlled != this && Vector2.Distance(cam.WorldViewCenter, Position) > 5000.0f); if (isDead) return; - - if (PressureProtection==0.0f && - (AnimController.CurrentHull == null || AnimController.CurrentHull.LethalPressure >= 100.0f)) + + if (!(this is AICharacter)) { - Implode(); - return; + bool protectedFromPressure = PressureProtection > 0.0f; + + if (Submarine.Loaded!=null && Level.Loaded !=null) + { + protectedFromPressure = protectedFromPressure && (Position-Level.Loaded.Position).Y > SubmarineBody.DamageDepth; + } + + + if (!protectedFromPressure && + (AnimController.CurrentHull == null || AnimController.CurrentHull.LethalPressure >= 100.0f)) + { + Implode(); + return; + } } if (controlled == this) diff --git a/Subsurface/Source/EventInput/EventInput.cs b/Subsurface/Source/EventInput/EventInput.cs index d166c78c9..d6818366e 100644 --- a/Subsurface/Source/EventInput/EventInput.cs +++ b/Subsurface/Source/EventInput/EventInput.cs @@ -154,7 +154,10 @@ namespace EventInput public static void Initialize(GameWindow window) { if (initialized) - throw new InvalidOperationException("TextInput.Initialize can only be called once!"); + { + return; + } + //throw new InvalidOperationException("TextInput.Initialize can only be called once!"); hookProcDelegate = HookProc; #if WINDOWS diff --git a/Subsurface/Source/Events/MonsterEvent.cs b/Subsurface/Source/Events/MonsterEvent.cs index 609bdc736..7bd7bdc44 100644 --- a/Subsurface/Source/Events/MonsterEvent.cs +++ b/Subsurface/Source/Events/MonsterEvent.cs @@ -12,6 +12,8 @@ namespace Barotrauma private Character[] monsters; + private bool spawnDeep; + public MonsterEvent(XElement element) : base (element) { @@ -19,6 +21,8 @@ namespace Barotrauma minAmount = ToolBox.GetAttributeInt(element, "minamount", 1); maxAmount = Math.Max(ToolBox.GetAttributeInt(element, "maxamount", 1), minAmount); + + spawnDeep = ToolBox.GetAttributeBool(element, "spawndeep", false); } private void SpawnMonsters() @@ -32,6 +36,13 @@ namespace Barotrauma for (int i = 0; i < amount; i++) { Vector2 position = (randomWayPoint == null) ? Vector2.Zero : FarseerPhysics.ConvertUnits.ToSimUnits(randomWayPoint.Position + Level.Loaded.Position); + + + if (spawnDeep) + { + position.Y = FarseerPhysics.ConvertUnits.ToSimUnits(Level.Loaded.Position.Y); + } + position.X += Rand.Range(-0.5f, 0.5f); position.Y += Rand.Range(-0.5f, 0.5f); monsters[i] = new AICharacter(characterFile, position); diff --git a/Subsurface/Source/GUI/GUIMessageBox.cs b/Subsurface/Source/GUI/GUIMessageBox.cs index 6768ca6be..a47b7fa4b 100644 --- a/Subsurface/Source/GUI/GUIMessageBox.cs +++ b/Subsurface/Source/GUI/GUIMessageBox.cs @@ -64,5 +64,10 @@ namespace Barotrauma return true; } + + public static void CloseAll() + { + MessageBoxes.Clear(); + } } } diff --git a/Subsurface/Source/GameMain.cs b/Subsurface/Source/GameMain.cs index 165acfe56..40aa5f961 100644 --- a/Subsurface/Source/GameMain.cs +++ b/Subsurface/Source/GameMain.cs @@ -20,6 +20,8 @@ namespace Barotrauma static int graphicsWidth, graphicsHeight; static SpriteBatch spriteBatch; + public static GameMain Instance; + public static bool DebugDraw; public static GraphicsDevice CurrGraphicsDevice; @@ -99,6 +101,8 @@ namespace Barotrauma { Graphics = new GraphicsDeviceManager(this); + Instance = this; + Config = new GameSettings("config.xml"); if (Config.WasGameUpdated) { @@ -169,7 +173,7 @@ namespace Barotrauma CoroutineManager.StartCoroutine(Load()); } - private IEnumerable Load() + public IEnumerable Load() { GUI.Init(Content); diff --git a/Subsurface/Source/GameSettings.cs b/Subsurface/Source/GameSettings.cs index d24c8a73d..7f35ed79e 100644 --- a/Subsurface/Source/GameSettings.cs +++ b/Subsurface/Source/GameSettings.cs @@ -36,8 +36,8 @@ namespace Barotrauma return keyMapping[(int)inputType]; } - public int GraphicsWidth { get; set; } - public int GraphicsHeight { get; set; } + public int GraphicsWidth { get; set; } + public int GraphicsHeight { get; set; } public bool FullScreenEnabled { get; set; } @@ -155,15 +155,14 @@ namespace Barotrauma int mouseButton; if (Enum.TryParse(attribute.Name.ToString(), true, out inputType)) { - if (Enum.TryParse(attribute.Value.ToString(), true, out key)) - { - keyMapping[(int)inputType] = new KeyOrMouse(key); - } - else if (int.TryParse(attribute.Value.ToString(), out mouseButton)) + if (int.TryParse(attribute.Value.ToString(), out mouseButton)) { keyMapping[(int)inputType] = new KeyOrMouse(mouseButton); } - + else if (Enum.TryParse(attribute.Value.ToString(), true, out key)) + { + keyMapping[(int)inputType] = new KeyOrMouse(key); + } } } break; @@ -213,6 +212,22 @@ namespace Barotrauma new XAttribute("path", SelectedContentPackage.Path))); } + var keyMappingElement = new XElement("keymapping"); + doc.Root.Add(keyMappingElement); + for (int i = 0; i(); foreach (DisplayMode mode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes) @@ -340,9 +360,18 @@ namespace Barotrauma DisplayMode mode = selected.UserData as DisplayMode; if (mode == null) return false; + if (GraphicsWidth == mode.Width && GraphicsHeight == mode.Height) return false; + GraphicsWidth = mode.Width; GraphicsHeight = mode.Height; + + //GameMain.Graphics.PreferredBackBufferWidth = GraphicsWidth; + //GameMain.Graphics.PreferredBackBufferHeight = GraphicsHeight; + //GameMain.Graphics.ApplyChanges(); + + //CoroutineManager.StartCoroutine(GameMain.Instance.Load()); + UnsavedSettings = true; return true; @@ -352,7 +381,10 @@ namespace Barotrauma private IEnumerable WaitForKeyPress(GUITextBox keyBox) { - while (keyBox.Selected && PlayerInput.GetKeyboardState.GetPressedKeys().Length==0) + yield return CoroutineStatus.Running; + + while (keyBox.Selected && PlayerInput.GetKeyboardState.GetPressedKeys().Length==0 + && !PlayerInput.LeftButtonClicked() && !PlayerInput.RightButtonClicked()) { if (Screen.Selected != GameMain.MainMenuScreen) yield return CoroutineStatus.Success; @@ -361,12 +393,29 @@ namespace Barotrauma UnsavedSettings = true; - Keys key = PlayerInput.GetKeyboardState.GetPressedKeys()[0]; - int keyIndex = (int)keyBox.UserData; - keyMapping[keyIndex] = new KeyOrMouse(key); - keyBox.Text = key.ToString("G"); + if (PlayerInput.LeftButtonClicked()) + { + keyMapping[keyIndex] = new KeyOrMouse(0); + keyBox.Text = "Mouse1"; + } + else if (PlayerInput.LeftButtonClicked()) + { + keyMapping[keyIndex] = new KeyOrMouse(1); + keyBox.Text = "Mouse2"; + } + else if (PlayerInput.GetKeyboardState.GetPressedKeys().Length > 0) + { + Keys key = PlayerInput.GetKeyboardState.GetPressedKeys()[0]; + keyMapping[keyIndex] = new KeyOrMouse(key); + keyBox.Text = key.ToString("G"); + } + else + { + yield return CoroutineStatus.Success; + } + keyBox.Deselect(); yield return CoroutineStatus.Success; @@ -375,6 +424,12 @@ namespace Barotrauma private bool ApplyClicked(GUIButton button, object userData) { Save("config.xml"); + + if (GameMain.GraphicsWidth != GameMain.Config.GraphicsWidth || GameMain.GraphicsHeight != GameMain.Config.GraphicsHeight) + { + new GUIMessageBox("Restart required", "You need to restart the game for the resolution changes to take effect."); + } + return true; } } diff --git a/Subsurface/Source/Items/ItemPrefab.cs b/Subsurface/Source/Items/ItemPrefab.cs index f7f3f4b66..c83ded41c 100644 --- a/Subsurface/Source/Items/ItemPrefab.cs +++ b/Subsurface/Source/Items/ItemPrefab.cs @@ -70,6 +70,12 @@ namespace Barotrauma public override void UpdatePlacing(SpriteBatch spriteBatch, Camera cam) { Vector2 position = Submarine.MouseToWorldGrid(cam); + + if (PlayerInput.RightButtonClicked()) + { + selected = null; + return; + } if (!resizeHorizontal && !resizeVertical) { @@ -80,7 +86,7 @@ namespace Barotrauma placePosition = Vector2.Zero; - selected = null; + // selected = null; return; } @@ -106,7 +112,7 @@ namespace Barotrauma { new Item(new Rectangle((int)placePosition.X, (int)placePosition.Y, (int)placeSize.X, (int)placeSize.Y), this); - selected = null; + //selected = null; return; } @@ -116,7 +122,7 @@ namespace Barotrauma if (sprite != null) sprite.DrawTiled(spriteBatch, new Vector2(position.X, -position.Y), placeSize, Color.White); } - if (PlayerInput.GetMouseState.RightButton == ButtonState.Pressed) selected = null; + //if (PlayerInput.GetMouseState.RightButton == ButtonState.Pressed) selected = null; } diff --git a/Subsurface/Source/Map/Levels/Level.cs b/Subsurface/Source/Map/Levels/Level.cs index 92ca9cdc4..95703046f 100644 --- a/Subsurface/Source/Map/Levels/Level.cs +++ b/Subsurface/Source/Map/Levels/Level.cs @@ -305,9 +305,9 @@ namespace Barotrauma cells = CleanCells(pathCells); - pathCells.AddRange(CreateBottomHoles(1.0f, new Rectangle( + pathCells.AddRange(CreateBottomHoles(0.8f, new Rectangle( (int)(borders.Width * 0.2f), 0, - (int)(borders.Width * 0.6f), (int)(borders.Height * 0.3f)))); + (int)(borders.Width * 0.6f), (int)(borders.Height * 0.5f)))); foreach (VoronoiCell cell in pathCells) { @@ -338,7 +338,7 @@ namespace Barotrauma { for (int i = 0; i < 2; i++) { - wrappingWalls[side, i] = new WrappingWall(pathCells, cells, borders.Height * 0.7f, + wrappingWalls[side, i] = new WrappingWall(pathCells, cells, borders.Height * 0.5f, (side == 0 ? -1 : 1) * (i == 0 ? 1 : 2)); wrappingWalls[side, i].Vertices = GeneratePolygons(wrappingWalls[side, i].Cells, new List()); @@ -651,7 +651,7 @@ namespace Barotrauma if (!tempVertices.Contains(ge.point2)) tempVertices.Add(ge.point2); VoronoiCell adjacentCell = ge.AdjacentCell(cell); - if (adjacentCell!=null && !emptyCells.Contains(adjacentCell)) continue; + if (adjacentCell!=null && cells.Contains(adjacentCell)) continue; ge.isSolid = true; @@ -929,7 +929,30 @@ namespace Barotrauma } } - return edges; + for (int side = 0; side < 2; side++ ) + { + for (int n = 0 ; n<2; n++) + { + if (Vector2.Distance(wrappingWalls[side, n].MidPos, refPos) > WrappingWall.WallWidth) continue; + + foreach (VoronoiCell cell in wrappingWalls[side, n].Cells) + { + for (int i = 0; i < cell.edges.Count; i++) + { + if (onlySolid && !cell.edges[i].isSolid) continue; + Vector2 start = cell.edges[i].point1 + Position; + start.Y = -start.Y; + + Vector2 end = cell.edges[i].point2 + Position; + end.Y = -end.Y; + + edges.Add(new Vector2[] { start, end }); + } + } + } + } + + return edges; } public void Render(GraphicsDevice graphicsDevice, Camera cam) diff --git a/Subsurface/Source/Map/Levels/VoronoiElements.cs b/Subsurface/Source/Map/Levels/VoronoiElements.cs index af7980910..ec22a8f5c 100644 --- a/Subsurface/Source/Map/Levels/VoronoiElements.cs +++ b/Subsurface/Source/Map/Levels/VoronoiElements.cs @@ -157,6 +157,12 @@ namespace Voronoi2 edges.Add(ge); } + GraphEdge lastEdge = new GraphEdge(); + lastEdge.point1 = vertices[0]; + lastEdge.point2 = vertices[vertices.Length-1]; + + edges.Add(lastEdge); + site = new Site(); site.SetPoint(midPoint); } diff --git a/Subsurface/Source/Map/Levels/WrappingWall.cs b/Subsurface/Source/Map/Levels/WrappingWall.cs index d58fb1af8..80f0fef83 100644 --- a/Subsurface/Source/Map/Levels/WrappingWall.cs +++ b/Subsurface/Source/Map/Levels/WrappingWall.cs @@ -13,7 +13,7 @@ namespace Barotrauma class WrappingWall { - const float wallWidth = 20000.0f; + public const float WallWidth = 20000.0f; public VertexPositionTexture[] Vertices; @@ -34,6 +34,11 @@ namespace Barotrauma get { return cells; } } + public Vector2 MidPos + { + get { return midPos; } + } + public WrappingWall(List pathCells, List mapCells, float maxY, int dir = -1) { cells = new List(); @@ -61,21 +66,21 @@ namespace Barotrauma } } - Vector2 wallSectionSize = new Vector2(2300.0f, 2300.0f); + Vector2 wallSectionSize = new Vector2(2000.0f, 2000.0f); Vector2 startPos = (dir < 0) ? - edgeCell.Center + Vector2.UnitX * wallWidth * dir : - edgeCell.Center + wallWidth * Vector2.UnitX * (dir - 1); + edgeCell.Center + Vector2.UnitX * WallWidth * dir : + edgeCell.Center + WallWidth * Vector2.UnitX * (dir - 1); - midPos = startPos + Vector2.UnitX * wallWidth/2; + midPos = startPos + Vector2.UnitX * WallWidth/2; List bottomVertices = new List(); - for (float x = 0; x <= wallWidth; x += wallSectionSize.X) + for (float x = 0; x <= WallWidth; x += wallSectionSize.X) { Vector2 center = new Vector2(startPos.X + x, edgeCell.Center.Y); - float distFromCenter = Math.Abs(x - wallWidth / 2); - float distFromEdge = wallWidth / 2 - distFromCenter; - float normalizedDist = distFromEdge / (wallWidth / 2); + float distFromCenter = Math.Abs(x - WallWidth / 2); + float distFromEdge = WallWidth / 2 - distFromCenter; + float normalizedDist = distFromEdge / (WallWidth / 2); float variance = 1000.0f * normalizedDist; bottomVertices.Add(center + new Vector2(Rand.Range(-variance, variance, false), Rand.Range(-variance, variance, false)*2.0f)); @@ -90,23 +95,16 @@ namespace Barotrauma vertices[3] = vertices[0] + Vector2.UnitY * wallSectionSize.Y; VoronoiCell wallCell = new VoronoiCell(vertices); + wallCell.edges[1].cell1 = wallCell; + wallCell.edges[3].cell1 = wallCell; + if (i > 1) + { + wallCell.edges[1].cell2 = cells[i - 2]; + cells[i - 2].edges[3].cell2 = wallCell; + } + cells.Add(wallCell); } - - //for (float x = 0; x<=wallWidth; x+=wallSectionSize.X) - //{ - // Vector2 center = new Vector2(startPos.X+x, edgeCell.Center.Y); - - // Vector2[] vertices = new Vector2[4]; - // vertices[0] = center - wallSectionSize / 2; - // vertices[2] = center + wallSectionSize / 2; - // vertices[1] = new Vector2(vertices[2].X, vertices[0].Y); - // vertices[3] = new Vector2(vertices[0].X, vertices[2].Y); - - // VoronoiCell wallCell = new VoronoiCell(vertices); - // wallCells.Add(wallCell); - //} - } @@ -150,7 +148,7 @@ namespace Barotrauma { slot += amount; - Vector2 moveAmount = Vector2.UnitX * wallWidth * amount; + Vector2 moveAmount = Vector2.UnitX * WallWidth * amount; Vector2 simMoveAmount = ConvertUnits.ToSimUnits(moveAmount); foreach (VoronoiCell cell in cells) diff --git a/Subsurface/Source/Map/Submarine.cs b/Subsurface/Source/Map/Submarine.cs index 8f3bf5d46..3cb4469f8 100644 --- a/Subsurface/Source/Map/Submarine.cs +++ b/Subsurface/Source/Map/Submarine.cs @@ -117,6 +117,11 @@ namespace Barotrauma get { return filePath; } } + public bool AtDamageDepth + { + get { return subBody == null ? false : subBody.AtDamageDepth; } + } + //constructors & generation ---------------------------------------------------- public Submarine(string filePath, string hash = "") diff --git a/Subsurface/Source/Map/SubmarineHull.cs b/Subsurface/Source/Map/SubmarineHull.cs index 55d59e0c8..6083c4a49 100644 --- a/Subsurface/Source/Map/SubmarineHull.cs +++ b/Subsurface/Source/Map/SubmarineHull.cs @@ -16,7 +16,7 @@ namespace Barotrauma { class SubmarineBody { - const float DamageDepth = 0.0f; + public const float DamageDepth = -10000.0f; const float PressureDamageMultiplier = 0.001f; //structure damage = impact * damageMultiplier @@ -77,6 +77,11 @@ namespace Barotrauma get { return new Vector2(Borders.X + Borders.Width / 2, Borders.Y - Borders.Height / 2); } } + public bool AtDamageDepth + { + get { return sub.Position.Y < DamageDepth; } + } + public SubmarineBody(Submarine sub) { this.sub = sub; diff --git a/Subsurface/Source/Networking/GameServer.cs b/Subsurface/Source/Networking/GameServer.cs index 8fb56e9c9..b3dba2eb7 100644 --- a/Subsurface/Source/Networking/GameServer.cs +++ b/Subsurface/Source/Networking/GameServer.cs @@ -635,9 +635,7 @@ namespace Barotrauma.Networking } if (recipients.Count == 0) return; - - - + foreach (NetworkEvent networkEvent in NetworkEvent.events) { NetOutgoingMessage message = server.CreateMessage(); @@ -676,8 +674,17 @@ namespace Barotrauma.Networking public bool StartGameClicked(GUIButton button, object obj) { - Submarine selectedSub = Voting.AllowSubVoting ? - Voting.HighestVoted(VoteType.Sub, connectedClients) : GameMain.NetLobbyScreen.SelectedSub; + Submarine selectedSub = null; + + if (Voting.AllowSubVoting) + { + Voting.HighestVoted(VoteType.Sub, connectedClients); + if (selectedSub == null) selectedSub = GameMain.NetLobbyScreen.SelectedSub; + } + else + { + selectedSub = GameMain.NetLobbyScreen.SelectedSub; + } if (selectedSub == null) { @@ -692,6 +699,8 @@ namespace Barotrauma.Networking private IEnumerable StartGame(Submarine selectedSub) { + GUIMessageBox.CloseAll(); + AssignJobs(); //selectedMap.Load(); diff --git a/Subsurface/Source/Networking/GameServerSettings.cs b/Subsurface/Source/Networking/GameServerSettings.cs index bfc0e1f44..4081baf14 100644 --- a/Subsurface/Source/Networking/GameServerSettings.cs +++ b/Subsurface/Source/Networking/GameServerSettings.cs @@ -155,7 +155,7 @@ namespace Barotrauma.Networking settingsFrame = null; } - return true; + return false; } } } diff --git a/Subsurface/Source/Networking/NetworkMember.cs b/Subsurface/Source/Networking/NetworkMember.cs index 830c289f0..ec97c99f8 100644 --- a/Subsurface/Source/Networking/NetworkMember.cs +++ b/Subsurface/Source/Networking/NetworkMember.cs @@ -246,7 +246,7 @@ namespace Barotrauma.Networking } } - if (PlayerInput.KeyHit(Keys.Tab)) + if (PlayerInput.KeyHit(InputType.Chat)) { if (chatMsgBox.Selected) { diff --git a/Subsurface/Source/PlayerInput.cs b/Subsurface/Source/PlayerInput.cs index 836c3b5c3..a5d33222c 100644 --- a/Subsurface/Source/PlayerInput.cs +++ b/Subsurface/Source/PlayerInput.cs @@ -18,6 +18,15 @@ namespace Barotrauma Keys keyBinding; int? mouseButton; + public Keys Key + { + get { return keyBinding; } + } + public int? MouseButton + { + get { return mouseButton; } + } + public KeyOrMouse(Keys keyBinding) { this.keyBinding = keyBinding; @@ -258,6 +267,16 @@ namespace Barotrauma return doubleClicked; } + public static bool KeyHit(InputType inputType) + { + return GameMain.Config.KeyBind(inputType).IsHit(); + } + + public static bool KeyDOwn(InputType inputType) + { + return GameMain.Config.KeyBind(inputType).IsDown(); + } + public static bool KeyHit(Keys button) { return (oldKeyboardState.IsKeyDown(button) && keyboardState.IsKeyUp(button)); diff --git a/Subsurface/Source/Screens/MainMenuScreen.cs b/Subsurface/Source/Screens/MainMenuScreen.cs index aa2af5025..45109e74a 100644 --- a/Subsurface/Source/Screens/MainMenuScreen.cs +++ b/Subsurface/Source/Screens/MainMenuScreen.cs @@ -235,6 +235,11 @@ namespace Barotrauma GameMain.Config.Save("config.xml"); selectedTab = (int)obj; + if (GameMain.GraphicsWidth != GameMain.Config.GraphicsWidth || GameMain.GraphicsHeight != GameMain.Config.GraphicsHeight) + { + new GUIMessageBox("Restart required", "You need to restart the game for the resolution changes to take effect."); + } + return true; } diff --git a/Subsurface/Source/Screens/NetLobbyScreen.cs b/Subsurface/Source/Screens/NetLobbyScreen.cs index 471b5bdfc..172e4d3fb 100644 --- a/Subsurface/Source/Screens/NetLobbyScreen.cs +++ b/Subsurface/Source/Screens/NetLobbyScreen.cs @@ -305,7 +305,7 @@ namespace Barotrauma modeList.OnSelected = VotableClicked; modeList.OnSelected += SelectMode; subList.OnSelected = VotableClicked; - subList.OnSelected += SelectMode; + subList.OnSelected += SelectMap; GUIButton startButton = new GUIButton(new Rectangle(0, 0, 80, 30), "Start", Alignment.BottomRight, GUI.Style, infoFrame); startButton.OnClicked = GameMain.Server.StartGameClicked; diff --git a/Subsurface/changelog.txt b/Subsurface/changelog.txt index 4781bed25..15646efaa 100644 --- a/Subsurface/changelog.txt +++ b/Subsurface/changelog.txt @@ -1,4 +1,26 @@ +--------------------------------------------------------------------------------------------------------- +v0.2.5 +--------------------------------------------------------------------------------------------------------- + +Multiplayer: + - option to randomly select level seed, submarine and/or game mode + - players can be allowed to vote for the next sub and game mode + - option to choose character's head + +Submarine: + - pressure damage if the submarine dives too deep + - added the missing mechanic spawnpoint missing to Aegir + +Creatures: + - a new enemy that only spawns deep below the level + +Misc: + - the levels aren't just enclosed tunnels anymore and it's possible to dive much deeper + - settings menu + - better UI scaling on small resolutions + - fixed items occasionally disappearing from inventory after loading in single player + --------------------------------------------------------------------------------------------------------- v0.2.4.1 --------------------------------------------------------------------------------------------------------- diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index 6a685082e..23df6311a 100644 Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ