DEADSOFTWARE

properly grey out the dmkeys menu option
[d2df-sdl.git] / src / game / g_menu.pas
index fe650785d11a8b34baa3b623089b0788e1b37349..62d9337a4f91dc9e3b60aecbbb36ceeacf46a3e1 100644 (file)
@@ -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;