From cb6fd27320d3e0abe87ee52a8239d16a2e79c6a9 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Mon, 10 Feb 2020 20:19:09 +0300 Subject: [PATCH] properly grey out the dmkeys menu option --- src/game/g_menu.pas | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas index fe65078..62d9337 100644 --- a/src/game/g_menu.pas +++ b/src/game/g_menu.pas @@ -1727,7 +1727,16 @@ begin if GameType in [GT_CUSTOM, GT_SERVER] then begin TGUISwitch(menu.GetControl('swTeamDamage')).Enabled := True; - TGUISwitch(menu.GetControl('swDeathmatchKeys')).Enabled := (GameMode in [GM_DM, GM_TDM, GM_CTF]); + if (GameMode in [GM_DM, GM_TDM, GM_CTF]) then + begin + TGUISwitch(menu.GetControl('swDeathmatchKeys')).Enabled := True; + TGUILabel(menu.GetControlsText('swDeathmatchKeys')).Color := MENU_ITEMSTEXT_COLOR; + end + else + begin + TGUISwitch(menu.GetControl('swDeathmatchKeys')).Enabled := False; + TGUILabel(menu.GetControlsText('swDeathmatchKeys')).Color := MENU_UNACTIVEITEMS_COLOR; + end; TGUIEdit(menu.GetControl('edTimeLimit')).Enabled := True; TGUILabel(menu.GetControlsText('edTimeLimit')).Color := MENU_ITEMSTEXT_COLOR; TGUIEdit(menu.GetControl('edGoalLimit')).Enabled := True; @@ -1740,6 +1749,7 @@ begin begin TGUISwitch(menu.GetControl('swTeamDamage')).Enabled := True; TGUISwitch(menu.GetControl('swDeathmatchKeys')).Enabled := False; + TGUILabel(menu.GetControlsText('swDeathmatchKeys')).Color := MENU_UNACTIVEITEMS_COLOR; with TGUIEdit(menu.GetControl('edTimeLimit')) do begin Enabled := False; -- 2.29.2