From 64c142345bb444d1b689a86a89af4f847b2c3eaa Mon Sep 17 00:00:00 2001 From: Flamefire Date: Sun, 7 Sep 2014 19:31:57 +0200 Subject: [PATCH] Disable Buttons also deselects it --- VocaluxeLib/Menu/CButton.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/VocaluxeLib/Menu/CButton.cs b/VocaluxeLib/Menu/CButton.cs index 1a9a8a49..09ebdf86 100644 --- a/VocaluxeLib/Menu/CButton.cs +++ b/VocaluxeLib/Menu/CButton.cs @@ -79,7 +79,18 @@ namespace VocaluxeLib.Menu } } public bool Visible = true; - public bool Enabled = true; + private bool _Enabled = true; + + public bool Enabled + { + get { return _Enabled; } + set + { + _Enabled = value; + if (!_Enabled) + _Selected = false; + } + } public string GetThemeName() { @@ -116,7 +127,7 @@ namespace VocaluxeLib.Menu _SelText = new CText(button._SelText); Selected = false; EditMode = false; - Enabled = button.Enabled; + _Enabled = button._Enabled; _Reflection = button._Reflection; _ReflectionHeight = button._ReflectionHeight; @@ -281,7 +292,7 @@ namespace VocaluxeLib.Menu CTexture texture; - if (!Selected && !Pressed || !Enabled) + if (!Selected && !Pressed || !_Enabled) { texture = Texture ?? CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);