rnd-19981214-2
[rocksndiamonds.git] / src / events.c
index 2d8eca3e861657b6442169036ac88d5395f08934..53b8171422ab97d250b7f66508d5944fff877726 100644 (file)
@@ -20,6 +20,7 @@
 #include "misc.h"
 #include "tape.h"
 #include "joystick.h"
+#include "buttons.h"
 #include "network.h"
 
 /* values for key_status */
@@ -279,6 +280,7 @@ void HandleButton(int mx, int my, int button)
     old_mx = mx;
     old_my = my;
 
+    HandleGadgets(mx,my, button);
     HandleVideoButtons(mx,my, button);
     HandleSoundButtons(mx,my, button);
     HandleGameButtons(mx,my, button);
@@ -427,7 +429,17 @@ void HandleKey(KeySym key, int key_status)
   /* allow quick escape to the main menu with the Escape key */
   if (key == XK_Escape && game_status != MAINMENU)
   {
-    CloseDoor(DOOR_CLOSE_1 | DOOR_NO_DELAY);
+    if (game_status == LEVELED)
+    {
+      /* draw smaller door */
+      XCopyArea(display, pix[PIX_DOOR], drawto, gc,
+               DOOR_GFX_PAGEX7, 64,
+               108, 64,
+               EX - 4, EY - 12);
+      redraw_mask |= REDRAW_ALL;
+    }
+
+    CloseDoor(DOOR_CLOSE_1 | DOOR_OPEN_2 | DOOR_NO_DELAY);
     game_status = MAINMENU;
     DrawMainMenu();
     return;