From ce69e155fd2ba56c04fbae4671e4b7464a1c5b94 Mon Sep 17 00:00:00 2001 From: Regalis Date: Sun, 4 Jun 2017 16:02:48 +0300 Subject: [PATCH] Fixed GUITickBoxes appearing unchecked if they're set to the checked state when interaction with the box has been disabled (or vice versa) --- Barotrauma/Source/GUI/GUITickBox.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Barotrauma/Source/GUI/GUITickBox.cs b/Barotrauma/Source/GUI/GUITickBox.cs index 1f895dfd3..7e24f58ef 100644 --- a/Barotrauma/Source/GUI/GUITickBox.cs +++ b/Barotrauma/Source/GUI/GUITickBox.cs @@ -1,13 +1,12 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Microsoft.Xna.Framework.Input; namespace Barotrauma { public class GUITickBox : GUIComponent { - GUIFrame box; - GUITextBlock text; + private GUIFrame box; + private GUITextBlock text; public delegate bool OnSelectedHandler(GUITickBox obj); public OnSelectedHandler OnSelected; @@ -22,6 +21,8 @@ namespace Barotrauma if (value == selected) return; selected = value; state = (selected) ? ComponentState.Selected : ComponentState.None; + + box.State = state; } } @@ -107,9 +108,9 @@ namespace Barotrauma public override void Update(float deltaTime) { - if (!Visible || !Enabled) return; + if (!Visible) return; - if (MouseOn == this) + if (MouseOn == this && Enabled) { box.State = ComponentState.Hover;