added setup option to show/hide classic elements in the editor palette
[rocksndiamonds.git] / src / screens.c
index 641c5e0714b6648f646adabbe24a922466023369..c1f16489bb517140b3a8a9ea554370ef76d5ed9c 100644 (file)
@@ -2451,6 +2451,27 @@ void HandleMenuScreen(int mx, int my, int dx, int dy, int button,
 
        choice = choice_store[mode] = first_entry + y;
       }
+      else if (dx < 0)
+      {
+       PlaySound(SND_MENU_ITEM_SELECTING);
+
+       for (i = 0; menu_info[i].type != 0; i++)
+       {
+         if (menu_info[i].type & TYPE_LEAVE_MENU)
+         {
+           void (*menu_callback_function)(void) = menu_info[i].value;
+
+           FadeSetLeaveMenu();
+
+           menu_callback_function();
+
+           /* absolutely needed because function changes 'menu_info'! */
+           break;
+         }
+       }
+
+       return;
+      }
     }
     else if (!(menu_info[first_entry + y].type & TYPE_GHOSTED))
     {
@@ -3976,6 +3997,30 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button,
 
        ti->cl_cursor = y;
       }
+      else if (dx < 0)
+      {
+       if (game_status == GAME_MODE_SETUP)
+       {
+         if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED ||
+             setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY ||
+             setup_mode == SETUP_MODE_CHOOSE_SNAPSHOT_MODE)
+           execSetupGame();
+         else if (setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE ||
+                  setup_mode == SETUP_MODE_CHOOSE_SCALING_TYPE ||
+                  setup_mode == SETUP_MODE_CHOOSE_RENDERING)
+           execSetupGraphics();
+         else if (setup_mode == SETUP_MODE_CHOOSE_VOLUME_SIMPLE ||
+                  setup_mode == SETUP_MODE_CHOOSE_VOLUME_LOOPS ||
+                  setup_mode == SETUP_MODE_CHOOSE_VOLUME_MUSIC)
+           execSetupSound();
+         else if (setup_mode == SETUP_MODE_CHOOSE_TOUCH_CONTROL ||
+                  setup_mode == SETUP_MODE_CHOOSE_MOVE_DISTANCE ||
+                  setup_mode == SETUP_MODE_CHOOSE_DROP_DISTANCE)
+           execSetupTouch();
+         else
+           execSetupArtwork();
+       }
+      }
     }
     else
     {
@@ -4097,13 +4142,13 @@ void DrawChooseLevelNr()
 
     ti->node_top = &level_number;
     ti->sort_priority = 10000 + value;
-    ti->color = (level.no_valid_file ? FC_BLUE :
+    ti->color = (level.no_level_file ? FC_BLUE :
                 LevelStats_getSolved(i) ? FC_GREEN :
                 LevelStats_getPlayed(i) ? FC_YELLOW : FC_RED);
 
     sprintf(identifier, "%d", value);
     sprintf(name, "%03d: %s", value,
-           (level.no_valid_file ? "(no file)" : level.name));
+           (level.no_level_file ? "(no file)" : level.name));
 
     setString(&ti->identifier, identifier);
     setString(&ti->name, name);
@@ -5311,9 +5356,10 @@ static struct TokenInfo setup_info_editor[] =
   { TYPE_SWITCH,       &setup.editor.el_supaplex,      "Supaplex:"     },
   { TYPE_SWITCH,       &setup.editor.el_diamond_caves, "Diamond Caves II:" },
   { TYPE_SWITCH,       &setup.editor.el_dx_boulderdash,"DX-Boulderdash:" },
-#endif
   { TYPE_SWITCH,       &setup.editor.el_chars,         "Text Characters:" },
   { TYPE_SWITCH, &setup.editor.el_steel_chars, "Text Characters (Steel):" },
+#endif
+  { TYPE_SWITCH,       &setup.editor.el_classic,  "Classic Elements:" },
   { TYPE_SWITCH,       &setup.editor.el_custom,  "Custom & Group Elements:" },
 #if 0
   { TYPE_SWITCH,       &setup.editor.el_headlines,     "Headlines:"    },