X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fevents.c;h=b9b5b8621ffde3e25c1d15a06c9f6543a1782bb2;hb=d442dd6ca65b694c37fbd3c93505644fe8478263;hp=2dc5a01623be8323f34e618098d016283adf66d0;hpb=5c94351c5b8a12d8615b447b6275dd2f68615be4;p=rocksndiamonds.git diff --git a/src/events.c b/src/events.c index 2dc5a016..b9b5b862 100644 --- a/src/events.c +++ b/src/events.c @@ -223,6 +223,10 @@ void HandleOtherEvents(Event *event) case SDL_JOYBUTTONUP: HandleJoystickEvent(event); break; + + case SDL_SYSWMEVENT: + HandleWindowManagerEvent(event); + break; #endif default: @@ -413,6 +417,13 @@ void HandleClientMessageEvent(ClientMessageEvent *event) CloseAllAndExit(0); } +void HandleWindowManagerEvent(Event *event) +{ +#if defined(TARGET_SDL) + SDLHandleWindowManagerEvent(event); +#endif +} + void HandleButton(int mx, int my, int button, int button_nr) { static int old_mx = 0, old_my = 0; @@ -566,6 +577,11 @@ static void HandleKeysSpecial(Key key) { DumpTape(&tape); } + else if (is_string_suffix(cheat_input, ":save-native-level") || + is_string_suffix(cheat_input, ":snl")) + { + SaveNativeLevel(&level); + } } else if (game_status == GAME_MODE_PLAYING) { @@ -733,7 +749,7 @@ void HandleKey(Key key, int key_status) if (game_status == GAME_MODE_MAIN && (key == setup.shortcut.toggle_pause || key == KSYM_space)) { - StartGameActions(options.network, setup.autorecord, NEW_RANDOMIZE); + StartGameActions(options.network, setup.autorecord, level.random_seed); return; } @@ -746,6 +762,8 @@ void HandleKey(Key key, int key_status) TapeQuickLoad(); else if (key == setup.shortcut.toggle_pause) TapeTogglePause(TAPE_TOGGLE_MANUAL); + + HandleTapeButtonKeys(key); } if (game_status == GAME_MODE_PLAYING && !network_playing) @@ -811,7 +829,8 @@ void HandleKey(Key key, int key_status) break; case KSYM_Escape: - FadeSkipNextFadeIn(); + if (game_status != GAME_MODE_MAIN) + FadeSkipNextFadeIn(); if (game_status == GAME_MODE_TITLE) HandleTitleScreen(0, 0, 0, 0, MB_MENU_LEAVE);