From 9ed2963cd91d1f7f9d9f0765cc25ea241298cfe1 Mon Sep 17 00:00:00 2001 From: Regalis Date: Mon, 26 Oct 2015 19:35:57 +0200 Subject: [PATCH] Settings menu with sound and music volume sliders, re-enabled deselecting connectionpanels with E in editmapscreen --- Subsurface/Properties/AssemblyInfo.cs | 4 +- Subsurface/Source/Characters/Character.cs | 2 +- Subsurface/Source/Characters/Limb.cs | 2 +- Subsurface/Source/Characters/Ragdoll.cs | 2 +- Subsurface/Source/GUI/GUIScrollBar.cs | 6 +- Subsurface/Source/GameMain.cs | 4 +- Subsurface/Source/GameSettings.cs | 164 ++++++++++++++---- .../Source/Items/Components/Projectile.cs | 12 +- .../Components/Signal/ConnectionPanel.cs | 3 +- Subsurface/Source/Map/Gap.cs | 2 +- Subsurface/Source/Map/Structure.cs | 4 +- Subsurface/Source/Map/Submarine.cs | 2 +- Subsurface/Source/Map/SubmarineHull.cs | 2 +- Subsurface/Source/PlayerInput.cs | 2 +- Subsurface/Source/Screens/MainMenuScreen.cs | 26 ++- .../Source/Sounds/AmbientSoundManager.cs | 18 +- Subsurface/Source/Sounds/SoundManager.cs | 8 +- Subsurface/changelog.txt | 32 ++++ Subsurface_Solution.v12.suo | Bin 811008 -> 811008 bytes 19 files changed, 223 insertions(+), 72 deletions(-) diff --git a/Subsurface/Properties/AssemblyInfo.cs b/Subsurface/Properties/AssemblyInfo.cs index ea1db45ce..91f993b8a 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.3.2")] -[assembly: AssemblyFileVersion("0.2.3.2")] +[assembly: AssemblyVersion("0.2.4.1")] +[assembly: AssemblyFileVersion("0.2.4.1")] diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs index 43d157e00..23968f6ad 100644 --- a/Subsurface/Source/Characters/Character.cs +++ b/Subsurface/Source/Characters/Character.cs @@ -998,7 +998,7 @@ namespace Barotrauma // limb.Damage = 100.0f; } - AmbientSoundManager.PlayDamageSound(DamageSoundType.Implode, 50.0f, AnimController.RefLimb.body.FarseerBody); + SoundPlayer.PlayDamageSound(DamageSoundType.Implode, 50.0f, AnimController.RefLimb.body.FarseerBody); for (int i = 0; i < 10; i++) { diff --git a/Subsurface/Source/Characters/Limb.cs b/Subsurface/Source/Characters/Limb.cs index 4ba5871d4..5c0abc64a 100644 --- a/Subsurface/Source/Characters/Limb.cs +++ b/Subsurface/Source/Characters/Limb.cs @@ -319,7 +319,7 @@ namespace Barotrauma if (playSound) { - AmbientSoundManager.PlayDamageSound(damageSoundType, amount, ConvertUnits.ToDisplayUnits(simPosition)); + SoundPlayer.PlayDamageSound(damageSoundType, amount, ConvertUnits.ToDisplayUnits(simPosition)); } //Bleeding += bleedingAmount; diff --git a/Subsurface/Source/Characters/Ragdoll.cs b/Subsurface/Source/Characters/Ragdoll.cs index 9f8835052..97287c92b 100644 --- a/Subsurface/Source/Characters/Ragdoll.cs +++ b/Subsurface/Source/Characters/Ragdoll.cs @@ -368,7 +368,7 @@ namespace Barotrauma character.Health -= (impact - l.impactTolerance * 0.1f); strongestImpact = Math.Max(strongestImpact, impact - l.impactTolerance); - AmbientSoundManager.PlayDamageSound(DamageSoundType.LimbBlunt, strongestImpact, l.body.FarseerBody); + SoundPlayer.PlayDamageSound(DamageSoundType.LimbBlunt, strongestImpact, l.body.FarseerBody); if (Character.Controlled == character) GameMain.GameScreen.Cam.Shake = strongestImpact; } diff --git a/Subsurface/Source/GUI/GUIScrollBar.cs b/Subsurface/Source/GUI/GUIScrollBar.cs index ec750e54c..74d086110 100644 --- a/Subsurface/Source/GUI/GUIScrollBar.cs +++ b/Subsurface/Source/GUI/GUIScrollBar.cs @@ -17,7 +17,7 @@ namespace Barotrauma private bool enabled; - public delegate bool OnMovedHandler(object obj); + public delegate bool OnMovedHandler(float barScroll); public OnMovedHandler OnMoved; public bool IsHorizontal @@ -95,6 +95,8 @@ namespace Barotrauma //System.Diagnostics.Debug.WriteLine(frame.rect); + this.barSize = barSize; + bar = new GUIButton(new Rectangle(0, 0, 0, 0), "", color, style, this); bar.OnPressed = SelectBar; @@ -172,7 +174,7 @@ namespace Barotrauma barScroll = (float)newY / ((float)frame.Rect.Height - (float)bar.Rect.Height); } - if (moveAmount != 0 && OnMoved != null) OnMoved(moveAmount); + if (moveAmount != 0 && OnMoved != null) OnMoved(barScroll); bar.Rect = new Rectangle(newX + frame.Rect.X, newY + frame.Rect.Y, bar.Rect.Width, bar.Rect.Height); diff --git a/Subsurface/Source/GameMain.cs b/Subsurface/Source/GameMain.cs index 77faa8aa2..119f8c918 100644 --- a/Subsurface/Source/GameMain.cs +++ b/Subsurface/Source/GameMain.cs @@ -202,7 +202,7 @@ namespace Barotrauma yield return CoroutineStatus.Running; Debug.WriteLine("sounds"); - CoroutineManager.StartCoroutine(AmbientSoundManager.Init()); + CoroutineManager.StartCoroutine(SoundPlayer.Init()); TitleScreen.LoadState = 70.0f; yield return CoroutineStatus.Running; @@ -267,7 +267,7 @@ namespace Barotrauma if (hasLoaded && !titleScreenOpen) { - AmbientSoundManager.Update(); + SoundPlayer.Update(); if (PlayerInput.KeyHit(Keys.Escape)) GUI.TogglePauseMenu(); diff --git a/Subsurface/Source/GameSettings.cs b/Subsurface/Source/GameSettings.cs index bf3e37f4c..c6f728918 100644 --- a/Subsurface/Source/GameSettings.cs +++ b/Subsurface/Source/GameSettings.cs @@ -1,4 +1,6 @@ -using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; using System; using System.Collections.Generic; using System.Linq; @@ -9,45 +11,50 @@ namespace Barotrauma { public class GameSettings { - public int GraphicsWidth + private GUIFrame settingsFrame; + + private float soundVolume, musicVolume; + + private Keys[] keyMapping; + + public GUIFrame SettingsFrame { - get; - set; - } - public int GraphicsHeight - { - get; - set; + get + { + if (settingsFrame == null) CreateSettingsFrame(); + return settingsFrame; + } } - public bool FullScreenEnabled + public int GraphicsWidth { get; set; } + public int GraphicsHeight { get; set; } + + public bool FullScreenEnabled { get; set; } + + public ContentPackage SelectedContentPackage { get; set; } + + public string MasterServerUrl { get; set; } + public bool AutoCheckUpdates { get; set; } + public bool WasGameUpdated { get; set; } + + public float SoundVolume { - get; - set; + get { return soundVolume; } + set + { + soundVolume = MathHelper.Clamp(value, 0.0f, 1.0f); + Sounds.SoundManager.MasterVolume = soundVolume; + } } - public ContentPackage SelectedContentPackage + public float MusicVolume { - get; - set; - } - - public string MasterServerUrl - { - get; - private set; - } - - public bool AutoCheckUpdates - { - get; - set; - } - - public bool WasGameUpdated - { - get; - set; + get { return musicVolume; } + set + { + musicVolume = MathHelper.Clamp(value, 0.0f, 1.0f); + SoundPlayer.MusicVolume = musicVolume; + } } public GameSettings(string filePath) @@ -90,6 +97,18 @@ namespace Barotrauma AutoCheckUpdates = ToolBox.GetAttributeBool(doc.Root, "autocheckupdates", true); WasGameUpdated = ToolBox.GetAttributeBool(doc.Root, "wasgameupdated", false); + SoundVolume = ToolBox.GetAttributeFloat(doc.Root, "soundvolume", 1.0f); + MusicVolume = ToolBox.GetAttributeFloat(doc.Root, "musicvolume", 0.3f); + + keyMapping = new Keys[Enum.GetNames(typeof(InputType)).Length]; + keyMapping[(int)InputType.Up] = Keys.W; + keyMapping[(int)InputType.Down] = Keys.S; + keyMapping[(int)InputType.Left] = Keys.A; + keyMapping[(int)InputType.Right] = Keys.D; + keyMapping[(int)InputType.Run] = Keys.LeftShift; + keyMapping[(int)InputType.Chat] = Keys.Tab; + keyMapping[(int)InputType.Select] = Keys.E; + foreach (XElement subElement in doc.Root.Elements()) { switch (subElement.Name.ToString().ToLower()) @@ -100,6 +119,18 @@ namespace Barotrauma if (SelectedContentPackage == null) SelectedContentPackage = new ContentPackage(path); break; + case "keymapping": + foreach (XAttribute attribute in subElement.Attributes()) + { + InputType inputType; + Keys key; + if (Enum.TryParse(attribute.Name.ToString(), true, out inputType) && + Enum.TryParse(attribute.Value.ToString(), true, out key)) + { + keyMapping[(int)inputType] = key; + } + } + break; } } } @@ -115,13 +146,14 @@ namespace Barotrauma doc.Root.Add( new XAttribute("masterserverurl", MasterServerUrl), - new XAttribute("autocheckupdates", AutoCheckUpdates)); + new XAttribute("autocheckupdates", AutoCheckUpdates), + new XAttribute("musicvolume", musicVolume), + new XAttribute("soundvolume", soundVolume)); if (WasGameUpdated) { - doc.Root.Add(new XAttribute("gamupdated", true)); - } - + doc.Root.Add(new XAttribute("wasgameupdated", true)); + } XElement gMode = doc.Root.Element("graphicsmode"); if (gMode == null) @@ -144,5 +176,63 @@ namespace Barotrauma doc.Save(filePath); } + + private bool ChangeSoundVolume(float barScroll) + { + SoundVolume = MathHelper.Clamp(barScroll, 0.0f, 1.0f); + + return true; + } + + private bool ChangeMusicVolume(float barScroll) + { + MusicVolume = MathHelper.Clamp(barScroll, 0.0f, 1.0f); + + return true; + } + + private void CreateSettingsFrame() + { + settingsFrame = new GUIFrame(new Rectangle(0, 0, 500, 500), null, Alignment.Center, GUI.Style); + + new GUITextBlock(new Rectangle(0, 0, 100, 20), "Sound volume:", GUI.Style, settingsFrame); + GUIScrollBar soundScrollBar = new GUIScrollBar(new Rectangle(0, 20, 150, 20), GUI.Style,0.1f, settingsFrame); + soundScrollBar.BarScroll = SoundVolume; + soundScrollBar.OnMoved = ChangeSoundVolume; + + new GUITextBlock(new Rectangle(0, 40, 100, 20), "Music volume:", GUI.Style, settingsFrame); + GUIScrollBar musicScrollBar = new GUIScrollBar(new Rectangle(0, 60, 150, 20), GUI.Style, 0.1f, settingsFrame); + musicScrollBar.BarScroll = MusicVolume; + musicScrollBar.OnMoved = ChangeMusicVolume; + + int x = 250; + int y = 60; + + new GUITextBlock(new Rectangle(x, 40, 100, 20), "Controls:", GUI.Style, settingsFrame); + var inputNames = Enum.GetNames(typeof(InputType)); + for (int i = 0; i< inputNames.Length; i++) + { + new GUITextBlock(new Rectangle(x, y, 100, 20), inputNames[i]+": ", GUI.Style, settingsFrame); + var keyBox = new GUITextBox(new Rectangle(x + 100, y, 70, 15), GUI.Style, settingsFrame); + keyBox.Text = keyMapping[i].ToString(); + keyBox.OnTextChanged = MapKey; + + y += 20; + } + + var applyButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Apply", GUI.Style, settingsFrame); + applyButton.OnClicked = ApplyClicked; + } + + private bool MapKey(GUITextBox textBox, string text) + { + return true; + } + + private bool ApplyClicked(GUIButton button, object userData) + { + Save("config.xml"); + return true; + } } } diff --git a/Subsurface/Source/Items/Components/Projectile.cs b/Subsurface/Source/Items/Components/Projectile.cs index d9fadefd2..aeb462c97 100644 --- a/Subsurface/Source/Items/Components/Projectile.cs +++ b/Subsurface/Source/Items/Components/Projectile.cs @@ -105,7 +105,17 @@ namespace Barotrauma.Items.Components { if (stickTarget != null) { - item.body.FarseerBody.RestoreCollisionWith(stickTarget); + try + { + item.body.FarseerBody.RestoreCollisionWith(stickTarget); + } + catch + { +#if DEBUG + DebugConsole.ThrowError("Failed to restore collision with stickTarget", e); +#endif + } + stickTarget = null; } GameMain.World.RemoveJoint(stickJoint); diff --git a/Subsurface/Source/Items/Components/Signal/ConnectionPanel.cs b/Subsurface/Source/Items/Components/Signal/ConnectionPanel.cs index 838eb95e3..31470ffe3 100644 --- a/Subsurface/Source/Items/Components/Signal/ConnectionPanel.cs +++ b/Subsurface/Source/Items/Components/Signal/ConnectionPanel.cs @@ -37,7 +37,8 @@ namespace Barotrauma.Items.Components { if (character != Character.Controlled || character != user) return; - if (character.GetInputState(InputType.Select) && + if (Screen.Selected != GameMain.EditMapScreen && + character.GetInputState(InputType.Select) && character.SelectedConstruction==this.item) character.SelectedConstruction = null; Connection.DrawConnections(spriteBatch, this, character); diff --git a/Subsurface/Source/Map/Gap.cs b/Subsurface/Source/Map/Gap.cs index 24408afe3..5f45e58d1 100644 --- a/Subsurface/Source/Map/Gap.cs +++ b/Subsurface/Source/Map/Gap.cs @@ -234,7 +234,7 @@ namespace Barotrauma int index = (int)Math.Floor(flowForce.Length() / 100.0f); index = Math.Min(index,2); - soundIndex = AmbientSoundManager.flowSounds[index].Loop(soundIndex, soundVolume, Position, 2000.0f); + soundIndex = SoundPlayer.flowSounds[index].Loop(soundIndex, soundVolume, Position, 2000.0f); flowForce = Vector2.Zero; lerpedFlowForce = Vector2.Lerp(lerpedFlowForce, flowForce, 0.05f); diff --git a/Subsurface/Source/Map/Structure.cs b/Subsurface/Source/Map/Structure.cs index 3e73a182f..ed2477da5 100644 --- a/Subsurface/Source/Map/Structure.cs +++ b/Subsurface/Source/Map/Structure.cs @@ -345,7 +345,7 @@ namespace Barotrauma if (impact < 10.0f) return true; - AmbientSoundManager.PlayDamageSound(DamageSoundType.StructureBlunt, impact, + SoundPlayer.PlayDamageSound(DamageSoundType.StructureBlunt, impact, new Vector2( sections[section].rect.X + sections[section].rect.Width / 2, sections[section].rect.Y - sections[section].rect.Height / 2)); @@ -436,7 +436,7 @@ namespace Barotrauma if (playSound && !SectionHasHole(i)) { DamageSoundType damageSoundType = (attack.DamageType == DamageType.Blunt) ? DamageSoundType.StructureBlunt : DamageSoundType.StructureSlash; - AmbientSoundManager.PlayDamageSound(damageSoundType, damageAmount, position); + SoundPlayer.PlayDamageSound(damageSoundType, damageAmount, position); } AddDamage(i, damageAmount); diff --git a/Subsurface/Source/Map/Submarine.cs b/Subsurface/Source/Map/Submarine.cs index 3018e175c..8f3bf5d46 100644 --- a/Subsurface/Source/Map/Submarine.cs +++ b/Subsurface/Source/Map/Submarine.cs @@ -361,7 +361,7 @@ namespace Barotrauma public void ApplyForce(Vector2 force) { - subBody.ApplyForce(force); + if (subBody != null) subBody.ApplyForce(force); } public void SetPosition(Vector2 position) diff --git a/Subsurface/Source/Map/SubmarineHull.cs b/Subsurface/Source/Map/SubmarineHull.cs index 9beddb331..5518b77ce 100644 --- a/Subsurface/Source/Map/SubmarineHull.cs +++ b/Subsurface/Source/Map/SubmarineHull.cs @@ -258,7 +258,7 @@ namespace Barotrauma if (lastContactPoint == null || lastContactCell==null || impact < 3.0f) return; - AmbientSoundManager.PlayDamageSound(DamageSoundType.StructureBlunt, impact * 10.0f, ConvertUnits.ToDisplayUnits((Vector2)lastContactPoint)); + SoundPlayer.PlayDamageSound(DamageSoundType.StructureBlunt, impact * 10.0f, ConvertUnits.ToDisplayUnits((Vector2)lastContactPoint)); GameMain.GameScreen.Cam.Shake = impact * 2.0f; Vector2 limbForce = -normal * impact*0.5f; diff --git a/Subsurface/Source/PlayerInput.cs b/Subsurface/Source/PlayerInput.cs index abd1fcdf1..48cf8a746 100644 --- a/Subsurface/Source/PlayerInput.cs +++ b/Subsurface/Source/PlayerInput.cs @@ -10,7 +10,7 @@ namespace Barotrauma ActionHit, ActionHeld, SecondaryHit, SecondaryHeld, Left, Right, Up, Down, - Run + Run, Chat } class Key diff --git a/Subsurface/Source/Screens/MainMenuScreen.cs b/Subsurface/Source/Screens/MainMenuScreen.cs index 0716c35b4..e57183348 100644 --- a/Subsurface/Source/Screens/MainMenuScreen.cs +++ b/Subsurface/Source/Screens/MainMenuScreen.cs @@ -8,7 +8,7 @@ namespace Barotrauma { class MainMenuScreen : Screen { - public enum Tab { NewGame = 1, LoadGame = 2, HostServer = 3 } + public enum Tab { NewGame = 1, LoadGame = 2, HostServer = 3, Settings = 4 } GUIFrame buttonsTab; @@ -42,23 +42,27 @@ namespace Barotrauma GUIButton button = new GUIButton(new Rectangle(0, 0, 0, 30), "Tutorial", Alignment.CenterX, GUI.Style, buttonsTab); button.OnClicked = TutorialButtonClicked; - button = new GUIButton(new Rectangle(0, 70, 0, 30), "New Game", Alignment.CenterX, GUI.Style, buttonsTab); + button = new GUIButton(new Rectangle(0, 60, 0, 30), "New Game", Alignment.CenterX, GUI.Style, buttonsTab); button.UserData = Tab.NewGame; button.OnClicked = SelectTab; - button = new GUIButton(new Rectangle(0, 130, 0, 30), "Load Game", Alignment.CenterX, GUI.Style, buttonsTab); + button = new GUIButton(new Rectangle(0, 100, 0, 30), "Load Game", Alignment.CenterX, GUI.Style, buttonsTab); button.UserData = Tab.LoadGame; button.OnClicked = SelectTab; - button = new GUIButton(new Rectangle(0, 200, 0, 30), "Join Server", Alignment.CenterX, GUI.Style, buttonsTab); + button = new GUIButton(new Rectangle(0, 160, 0, 30), "Join Server", Alignment.CenterX, GUI.Style, buttonsTab); //button.UserData = (int)Tabs.JoinServer; button.OnClicked = JoinServerClicked; - button = new GUIButton(new Rectangle(0, 260, 0, 30), "Host Server", Alignment.CenterX, GUI.Style, buttonsTab); + button = new GUIButton(new Rectangle(0, 200, 0, 30), "Host Server", Alignment.CenterX, GUI.Style, buttonsTab); button.UserData = Tab.HostServer; button.OnClicked = SelectTab; - button = new GUIButton(new Rectangle(0, 330, 0, 30), "Quit", Alignment.CenterX, GUI.Style, buttonsTab); + button = new GUIButton(new Rectangle(0, 260, 0, 30), "Settings", Alignment.CenterX, GUI.Style, buttonsTab); + button.UserData = Tab.Settings; + button.OnClicked = SelectTab; + + button = new GUIButton(new Rectangle(0, 320, 0, 30), "Quit", Alignment.CenterX, GUI.Style, buttonsTab); button.OnClicked = QuitClicked; //---------------------------------------------------------------------- @@ -197,7 +201,15 @@ namespace Barotrauma { selectedTab = (int)tab; - if (selectedTab == (int)Tab.LoadGame) UpdateLoadScreen(); + switch (selectedTab) + { + case (int)Tab.LoadGame: + UpdateLoadScreen(); + break; + case (int)Tab.Settings: + menuTabs[(int)Tab.Settings] = GameMain.Config.SettingsFrame; + break; + } } private bool TutorialButtonClicked(GUIButton button, object obj) diff --git a/Subsurface/Source/Sounds/AmbientSoundManager.cs b/Subsurface/Source/Sounds/AmbientSoundManager.cs index c78161f04..bd538bd69 100644 --- a/Subsurface/Source/Sounds/AmbientSoundManager.cs +++ b/Subsurface/Source/Sounds/AmbientSoundManager.cs @@ -49,10 +49,12 @@ namespace Barotrauma } } - static class AmbientSoundManager + static class SoundPlayer { public static Sound[] flowSounds = new Sound[3]; + public static float MusicVolume = 1.0f; + private const float MusicLerpSpeed = 0.01f; private static Sound[] waterAmbiences = new Sound[2]; @@ -63,7 +65,7 @@ namespace Barotrauma private static BackgroundMusic currentMusic; private static BackgroundMusic targetMusic; private static BackgroundMusic[] musicClips; - private static float musicVolume; + private static float currMusicVolume; private static Sound startDrone; @@ -251,20 +253,20 @@ namespace Barotrauma if (targetMusic == null || currentMusic == null || targetMusic.file != currentMusic.file) { - musicVolume = MathHelper.Lerp(musicVolume, 0.0f, MusicLerpSpeed); - if (currentMusic != null) Sound.StreamVolume(musicVolume); + currMusicVolume = MathHelper.Lerp(currMusicVolume, 0.0f, MusicLerpSpeed); + if (currentMusic != null) Sound.StreamVolume(currMusicVolume); - if (musicVolume < 0.01f) + if (currMusicVolume < 0.01f) { Sound.StopStream(); - if (targetMusic != null) Sound.StartStream(targetMusic.file, musicVolume); + if (targetMusic != null) Sound.StartStream(targetMusic.file, currMusicVolume); currentMusic = targetMusic; } } else { - musicVolume = MathHelper.Lerp(musicVolume, 0.3f, MusicLerpSpeed); - Sound.StreamVolume(musicVolume); + currMusicVolume = MathHelper.Lerp(currMusicVolume, MusicVolume, MusicLerpSpeed); + Sound.StreamVolume(currMusicVolume); } } diff --git a/Subsurface/Source/Sounds/SoundManager.cs b/Subsurface/Source/Sounds/SoundManager.cs index 7943c820a..93416efd6 100644 --- a/Subsurface/Source/Sounds/SoundManager.cs +++ b/Subsurface/Source/Sounds/SoundManager.cs @@ -29,6 +29,8 @@ namespace Barotrauma.Sounds public static OggStreamer oggStreamer; public static OggStream oggStream; + public static float MasterVolume = 1.0f; + public static void Init() { AC = new AudioContext(); @@ -250,7 +252,7 @@ namespace Barotrauma.Sounds public static void Volume(int sourceIndex, float volume) { - AL.Source(alSources[sourceIndex], ALSourcef.Gain, volume); + AL.Source(alSources[sourceIndex], ALSourcef.Gain, volume * MasterVolume); ALHelper.Check(); } @@ -303,8 +305,8 @@ namespace Barotrauma.Sounds //Resume(sourceIndex); position/= 1000.0f; - - OpenTK.Audio.OpenAL.AL.Source(alSources[sourceIndex], OpenTK.Audio.OpenAL.ALSourcef.Gain, baseVolume); + + OpenTK.Audio.OpenAL.AL.Source(alSources[sourceIndex], OpenTK.Audio.OpenAL.ALSourcef.Gain, baseVolume * MasterVolume); OpenTK.Audio.OpenAL.AL.Source(alSources[sourceIndex], OpenTK.Audio.OpenAL.ALSource3f.Position, position.X, position.Y, 0.0f); float lowPassGain = lowPassHfGain / Math.Max(position.Length() * 5.0f, 1.0f); diff --git a/Subsurface/changelog.txt b/Subsurface/changelog.txt index 191407d1e..4781bed25 100644 --- a/Subsurface/changelog.txt +++ b/Subsurface/changelog.txt @@ -1,3 +1,35 @@ + +--------------------------------------------------------------------------------------------------------- +v0.2.4.1 +--------------------------------------------------------------------------------------------------------- + +- fixed rewiring not working in the editor +- fixed a game-crashing projectile bug + +--------------------------------------------------------------------------------------------------------- +v0.2.4 +--------------------------------------------------------------------------------------------------------- + +Multiplayer: + - fixed invincible NPCs + - the target in traitor mode is properly randomized and the host can be selected as a traitor/target + - the "fix list" when repairing items is synced between clients, so the reactor can actually be fixed now + - more networking optimization + - bans can be removed by using a button under the player list, not just by editing the bannedplayers.xml file + +Items: + - wires are removed from connection panels when they're deleted in the editor + - doors can be rewired from either side + - the rewire screen can be deselect by pressing E + - sonar won't work anymore if the power wire is removed + - stun batons can't be double wielded or used for fast underwater movement + +Misc: + - some particles floating in the water, which make it easier to see if the sub is moving just by + looking out of a window + - fixed a bug which may have crashed the game if a character spawned on a platform or stairs + + --------------------------------------------------------------------------------------------------------- v0.2.3.2 --------------------------------------------------------------------------------------------------------- diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index 37dfb929e65e716ddc62f627cbbe901a05ea7101..7b9744537cafc79660cfb5df8e3ab0d1a14c2a3e 100644 GIT binary patch delta 3474 zcmd6o3s6+o8OQHA=PvABc9#|9A+ET>f>n$Hu1b913e*xD6)o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