Added switch to turn off developer mode to the OptionMenu
authorIngo Ruhnke <grumbel@gmail.com>
Tue, 19 Aug 2014 00:35:12 +0000 (02:35 +0200)
committerIngo Ruhnke <grumbel@gmail.com>
Tue, 19 Aug 2014 00:40:10 +0000 (02:40 +0200)
src/supertux/menu/options_menu.cpp

index a3db0eb..1543687 100644 (file)
@@ -38,7 +38,8 @@ enum OptionsMenuIDs {
   MNID_MAGNIFICATION,
   MNID_ASPECTRATIO,
   MNID_SOUND,
-  MNID_MUSIC
+  MNID_MUSIC,
+  MNID_DEVELOPER_MODE
 };
 
 OptionsMenu::OptionsMenu(bool complete)
@@ -200,6 +201,12 @@ OptionsMenu::OptionsMenu(bool complete)
 
   add_submenu(_("Setup Joystick"), MenuStorage::JOYSTICK_MENU)
     ->set_help(_("Configure joystick control-action mappings"));
+
+  if (g_config->developer_mode)
+  {
+    add_toggle(MNID_DEVELOPER_MODE, _("Developer Mode"), g_config->developer_mode);
+  }
+
   add_hl();
   add_back(_("Back"));
 }
@@ -293,6 +300,11 @@ OptionsMenu::menu_action(MenuItem* item)
       }
       break;
 
+    case MNID_DEVELOPER_MODE:
+      g_config->developer_mode = is_toggled(MNID_DEVELOPER_MODE);
+      log_info << "developer mode: " << g_config->developer_mode << std::endl;
+      break;
+
     default:
       break;
   }