rnd-20040118-2-src
[rocksndiamonds.git] / src / events.c
index 366acd1a4fa83215d053491484e12c7006501020..e76026e17bfc68c3c468eedc59421fcdc08a1ff3 100644 (file)
@@ -462,7 +462,7 @@ static boolean is_string_suffix(char *string, char *suffix)
 
 #define MAX_CHEAT_INPUT_LEN    32
 
-static void HandleKeysCheating(Key key)
+static void HandleKeysSpecial(Key key)
 {
   static char cheat_input[2 * MAX_CHEAT_INPUT_LEN + 1] = "";
   char letter = getCharFromKey(key);
@@ -541,6 +541,14 @@ static void HandleKeysCheating(Key key)
            EL_DYNAMITE;
 #endif
   }
+  else if (game_status == GAME_MODE_EDITOR)
+  {
+    if (is_string_suffix(cheat_input, ":dump-brush") ||
+       is_string_suffix(cheat_input, ":DB"))
+    {
+      DumpBrush();
+    }
+  }
 }
 
 void HandleKey(Key key, int key_status)
@@ -688,10 +696,10 @@ void HandleKey(Key key, int key_status)
       TapeQuickLoad();
     else if (key == setup.shortcut.toggle_pause)
       TapeTogglePause(TAPE_TOGGLE_MANUAL);
-
-    HandleKeysCheating(key);
   }
 
+  HandleKeysSpecial(key);
+
   if (HandleGadgetsKeyInput(key))
   {
     if (key != KSYM_Escape)    /* always allow ESC key to be handled */