From 771513ebe5bdfbf5a91012d6b3a3245cac28eccb Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 29 Dec 2021 13:17:21 +0100 Subject: [PATCH] Update raygui.h --- src/raygui.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/raygui.h b/src/raygui.h index e63ba49..474af18 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -1252,10 +1252,12 @@ static Vector3 ConvertRGBtoHSV(Vector3 rgb); // Convert color // Gui Setup Functions Definition //---------------------------------------------------------------------------------- // Enable gui global state -void GuiEnable(void) { guiState = GUI_STATE_NORMAL; } +// NOTE: We check for GUI_STATE_DISABLED to avoid messing custom global state setups +void GuiEnable(void) { if (guiState == GUI_STATE_DISABLED) guiState = GUI_STATE_NORMAL; } // Disable gui global state -void GuiDisable(void) { guiState = GUI_STATE_DISABLED; } +// NOTE: We check for GUI_STATE_NORMAL to avoid messing custom global state setups +void GuiDisable(void) { if (guiState == GUI_STATE_NORMAL) guiState = GUI_STATE_DISABLED; } // Lock gui global state void GuiLock(void) { guiLocked = true; }