diff --git a/Subsurface/Properties/AssemblyInfo.cs b/Subsurface/Properties/AssemblyInfo.cs index 805f9dc02..c3d10bc58 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.3.0.2")] -[assembly: AssemblyFileVersion("0.3.0.2")] +[assembly: AssemblyVersion("0.3.0.3")] +[assembly: AssemblyFileVersion("0.3.0.3")] diff --git a/Subsurface/Source/GameMain.cs b/Subsurface/Source/GameMain.cs index aa071e44e..70bc95b17 100644 --- a/Subsurface/Source/GameMain.cs +++ b/Subsurface/Source/GameMain.cs @@ -22,6 +22,11 @@ namespace Barotrauma public static GameMain Instance; + public static bool WindowActive + { + get { return Instance == null ? true : GameMain.Instance.IsActive; } + } + public static bool DebugDraw; public static GraphicsDevice CurrGraphicsDevice; diff --git a/Subsurface/Source/PlayerInput.cs b/Subsurface/Source/PlayerInput.cs index a93f6e742..58069e2d2 100644 --- a/Subsurface/Source/PlayerInput.cs +++ b/Subsurface/Source/PlayerInput.cs @@ -232,7 +232,7 @@ namespace Barotrauma { get { - return GameMain.Instance.IsActive ? MousePosition - new Vector2(oldMouseState.X, oldMouseState.Y) : Vector2.Zero; + return GameMain.WindowActive ? MousePosition - new Vector2(oldMouseState.X, oldMouseState.Y) : Vector2.Zero; } } @@ -248,72 +248,72 @@ namespace Barotrauma public static int ScrollWheelSpeed { - get { return GameMain.Instance.IsActive ? mouseState.ScrollWheelValue - oldMouseState.ScrollWheelValue : 0; } + get { return GameMain.WindowActive ? mouseState.ScrollWheelValue - oldMouseState.ScrollWheelValue : 0; } } public static bool LeftButtonDown() { - return GameMain.Instance.IsActive && mouseState.LeftButton == ButtonState.Pressed; + return GameMain.WindowActive && mouseState.LeftButton == ButtonState.Pressed; } public static bool LeftButtonReleased() { - return GameMain.Instance.IsActive && mouseState.LeftButton == ButtonState.Released; + return GameMain.WindowActive && mouseState.LeftButton == ButtonState.Released; } public static bool LeftButtonClicked() { - return (GameMain.Instance.IsActive && + return (GameMain.WindowActive && oldMouseState.LeftButton == ButtonState.Pressed && mouseState.LeftButton == ButtonState.Released); } public static bool RightButtonDown() { - return GameMain.Instance.IsActive && mouseState.RightButton == ButtonState.Pressed; + return GameMain.WindowActive && mouseState.RightButton == ButtonState.Pressed; } public static bool RightButtonClicked() { - return (GameMain.Instance.IsActive && + return (GameMain.WindowActive && oldMouseState.RightButton == ButtonState.Pressed && mouseState.RightButton == ButtonState.Released); } public static bool DoubleClicked() { - return GameMain.Instance.IsActive && doubleClicked; + return GameMain.WindowActive && doubleClicked; } public static bool KeyHit(InputType inputType) { - return GameMain.Instance.IsActive && GameMain.Config.KeyBind(inputType).IsHit(); + return GameMain.WindowActive && GameMain.Config.KeyBind(inputType).IsHit(); } public static bool KeyDown(InputType inputType) { - return GameMain.Instance.IsActive && GameMain.Config.KeyBind(inputType).IsDown(); + return GameMain.WindowActive && GameMain.Config.KeyBind(inputType).IsDown(); } public static bool KeyUp(InputType inputType) { - return GameMain.Instance.IsActive && !GameMain.Config.KeyBind(inputType).IsDown(); + return GameMain.WindowActive && !GameMain.Config.KeyBind(inputType).IsDown(); } public static bool KeyHit(Keys button) { - return (GameMain.Instance.IsActive && oldKeyboardState.IsKeyDown(button) && keyboardState.IsKeyUp(button)); + return (GameMain.WindowActive && oldKeyboardState.IsKeyDown(button) && keyboardState.IsKeyUp(button)); } public static bool KeyDown(Keys button) { - return (GameMain.Instance.IsActive && keyboardState.IsKeyDown(button)); + return (GameMain.WindowActive && keyboardState.IsKeyDown(button)); } public static bool KeyUp(Keys button) { - return GameMain.Instance.IsActive && keyboardState.IsKeyUp(button); + return GameMain.WindowActive && keyboardState.IsKeyUp(button); } public static void Update(double deltaTime) diff --git a/Subsurface/changelog.txt b/Subsurface/changelog.txt index 0eb4df99c..5e0f11bae 100644 --- a/Subsurface/changelog.txt +++ b/Subsurface/changelog.txt @@ -1,3 +1,13 @@ +--------------------------------------------------------------------------------------------------------- +v0.3.0.3 +--------------------------------------------------------------------------------------------------------- + +- fixed selecting stairs and items outside the sub in editor +- fixed crashing when pressing the ''start'' button while no route is chosen in single player +- fixed fire syncing +- fixed another bug that crashed the game if in the lobby when a round ends +- camera keeps moving with the sub when typing into chatbox in spectator mode + --------------------------------------------------------------------------------------------------------- v0.3.0.2 --------------------------------------------------------------------------------------------------------- diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index 06bf73b6b..14d9dde82 100644 Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ