diff --git a/Subsurface/Source/GUI/GUITickBox.cs b/Subsurface/Source/GUI/GUITickBox.cs index f6097edfa..a4b0456b5 100644 --- a/Subsurface/Source/GUI/GUITickBox.cs +++ b/Subsurface/Source/GUI/GUITickBox.cs @@ -25,10 +25,19 @@ namespace Barotrauma } } + private bool enabled; + public bool Enabled { - get; - set; + get + { + return enabled; + } + set + { + enabled = value; + text.TextColor = enabled ? Color.White : Color.White * 0.5f; + } } public GUITickBox(Rectangle rect, string label, Alignment alignment, GUIComponent parent) @@ -86,12 +95,14 @@ namespace Barotrauma DrawChildren(spriteBatch); + float alpha = enabled ? 1.0f : 0.8f; + GUI.DrawRectangle(spriteBatch, new Rectangle(box.Rect.X + 1, box.Rect.Y + 1, box.Rect.Width - 2, box.Rect.Height - 2), - box.State == ComponentState.Hover ? new Color(50,50,50,255) : Color.Black, true); + (box.State == ComponentState.Hover ? new Color(50, 50, 50, 255) : Color.Black) * alpha, true); if (!selected) return; - GUI.DrawRectangle(spriteBatch, new Rectangle(box.Rect.X + 5, box.Rect.Y + 5, box.Rect.Width - 10, box.Rect.Height - 10), - Color.Green * 0.8f, true); + GUI.DrawRectangle(spriteBatch, new Rectangle(box.Rect.X + 5, box.Rect.Y + 5, box.Rect.Width - 10, box.Rect.Height - 10), + Color.Green * 0.8f * alpha, true); } } diff --git a/Subsurface/Source/Items/Components/Machines/Radar.cs b/Subsurface/Source/Items/Components/Machines/Radar.cs index dabfa610e..e730bdc80 100644 --- a/Subsurface/Source/Items/Components/Machines/Radar.cs +++ b/Subsurface/Source/Items/Components/Machines/Radar.cs @@ -20,6 +20,8 @@ namespace Barotrauma.Items.Components private Sprite pingCircle, screenOverlay; + private GUITickBox isActiveTickBox; + [HasDefaultValue(0.0f, false)] public float Range { @@ -45,8 +47,8 @@ namespace Barotrauma.Items.Components } } - var tickBox = new GUITickBox(new Rectangle(0,0,20,20), "Sonar", Alignment.TopLeft, GuiFrame); - tickBox.OnSelected = (GUITickBox box) => + isActiveTickBox = new GUITickBox(new Rectangle(0, 0, 20, 20), "Sonar", Alignment.TopLeft, GuiFrame); + isActiveTickBox.OnSelected = (GUITickBox box) => { IsActive = box.Selected; item.NewComponentEvent(this, true, false); @@ -330,6 +332,7 @@ namespace Barotrauma.Items.Components try { IsActive = message.ReadBoolean(); + isActiveTickBox.Selected = IsActive; } catch { diff --git a/Subsurface/Source/Items/Components/Machines/Steering.cs b/Subsurface/Source/Items/Components/Machines/Steering.cs index c9e4353e6..72c0ccb24 100644 --- a/Subsurface/Source/Items/Components/Machines/Steering.cs +++ b/Subsurface/Source/Items/Components/Machines/Steering.cs @@ -17,7 +17,7 @@ namespace Barotrauma.Items.Components private Vector2 currVelocity; private Vector2 targetVelocity; - private GUITickBox maintainPosTickBox; + private GUITickBox autopilotTickBox, maintainPosTickBox; private bool autoPilot; @@ -43,8 +43,9 @@ namespace Barotrauma.Items.Components autoPilot = value; - maintainPosTickBox.Enabled = autoPilot; + autopilotTickBox.Selected = value; + maintainPosTickBox.Enabled = autoPilot; if (autoPilot) { diff --git a/Subsurface/changelog.txt b/Subsurface/changelog.txt index 5e0f11bae..fed5f56a1 100644 --- a/Subsurface/changelog.txt +++ b/Subsurface/changelog.txt @@ -1,3 +1,18 @@ +--------------------------------------------------------------------------------------------------------- +v0.3.0.4 +--------------------------------------------------------------------------------------------------------- + +- submarine editor can be used without the console now +- autopilot can be set to maintain the current position of the sub +- monster syncing bugfixes +- ladder syncing bugfixes +- fixed server randomly stunning the players +- fixed "submarine not found" errors which occurred in multiplayer if the filename didn't match the +name of the submarine +- fixed new structures not lining up with existing ones if switching to editor while a round is running +- fixed a bug in shadow rendering which caused memory leaks +- molochs and endworms are immune to bleeding! + --------------------------------------------------------------------------------------------------------- v0.3.0.3 --------------------------------------------------------------------------------------------------------- diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index 64899467d..bb7149411 100644 Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ