X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fevents.c;h=b123c86d7f6667632eda8bfe7385da81ddbe2825;hb=564a563aee2c9fdb37116d41342b36eda63c1f6a;hp=366acd1a4fa83215d053491484e12c7006501020;hpb=9c285b0e8e4d81c5559815c5f7142685ce865206;p=rocksndiamonds.git diff --git a/src/events.c b/src/events.c index 366acd1a..b123c86d 100644 --- a/src/events.c +++ b/src/events.c @@ -85,7 +85,7 @@ void EventLoop(void) { Event event; - if (NextValidEvent(&event)) + while (NextValidEvent(&event)) { switch(event.type) { @@ -411,36 +411,8 @@ void HandleButton(int mx, int my, int button) case GAME_MODE_PLAYING: #ifdef DEBUG - if (button == MB_RELEASED) - { - if (IN_GFX_SCREEN(mx, my)) - { - int sx = (mx - SX) / TILEX; - int sy = (my - SY) / TILEY; - int x = LEVELX(sx); - int y = LEVELY(sy); - - printf("INFO: SCREEN(%d, %d), LEVEL(%d, %d)\n", sx, sy, x, y); - - if (!IN_LEV_FIELD(x, y)) - break; - - printf(" Feld[%d][%d] == %d ('%s')\n", x,y, Feld[x][y], - element_info[Feld[x][y]].token_name); - printf(" Back[%d][%d] == %d\n", x,y, Back[x][y]); - printf(" Store[%d][%d] == %d\n", x,y, Store[x][y]); - printf(" Store2[%d][%d] == %d\n", x,y, Store2[x][y]); - printf(" StorePlayer[%d][%d] == %d\n", x,y, StorePlayer[x][y]); - printf(" MovPos[%d][%d] == %d\n", x,y, MovPos[x][y]); - printf(" MovDir[%d][%d] == %d\n", x,y, MovDir[x][y]); - printf(" MovDelay[%d][%d] == %d\n", x,y, MovDelay[x][y]); - printf(" ChangeDelay[%d][%d] == %d\n", x,y, ChangeDelay[x][y]); - printf(" GfxElement[%d][%d] == %d\n", x,y, GfxElement[x][y]); - printf(" GfxAction[%d][%d] == %d\n", x,y, GfxAction[x][y]); - printf(" GfxFrame[%d][%d] == %d\n", x,y, GfxFrame[x][y]); - printf("\n"); - } - } + if (button == MB_PRESSED && !motion_status && IN_GFX_SCREEN(mx, my)) + DumpTile(LEVELX((mx - SX) / TILEX), LEVELY((my - SY) / TILEY)); #endif break; @@ -462,7 +434,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 +513,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 +668,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 */