From 9d4e69c7a98a634b94885d0ada939503f290ca4a Mon Sep 17 00:00:00 2001 From: kreatordxx <> Date: Thu, 28 Jan 2010 03:27:49 +0000 Subject: [PATCH] Make response to EVENT_WINDOW_CLOSE conform to 'handling' system - returning 1 means abort closing --- CHANGELOG.txt | 1 + arch/sdl/window.c | 4 ++-- main/automap.c | 1 + main/game.c | 1 + main/gamecntl.c | 1 + main/kconfig.c | 1 + main/menu.c | 1 + main/net_ipx.c | 1 + main/net_udp.c | 1 + main/newmenu.c | 2 ++ 10 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e27c31049..3013bd8da 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ D1X-Rebirth Changelog -------- main/playsave.c, main/playsave.h, main/object.c, main/render.c, main/hud.c, main/hostage.c, main/newdemo.c, main/gamerend.c, main/endlevel.c, main/game.c, main/gauges.c: Made PlayerCfg.CockpitMode an array to hold two values: 0 to store the actual "cockpit", 1 to also store Letterbox, Rear, etc. Greatly helps to switch and restore views - especially in Demo playback which now properly selects modes main/newdemo.c: Added a new code to properly re-record view/cockpit-events at beginning and end of Demo recording so views will be fine if switched before recording started; Also added lost sequence to record Rear-view reset between levels; Last but not least, record wall tmaps so opened/blasted doors will be shown correctly if opened/blasted before recording; Everything done without breaking the Demo format! +arch/sdl/window.c, main/automap.c, main/game.c, main/gamecntl.c, main/kconfig.c, main/menu.c, main/net_ipx.c, main/net_udp.c, main/newmenu.c: Make response to EVENT_WINDOW_CLOSE conform to 'handling' system - returning 1 means abort closing 20100127 -------- diff --git a/arch/sdl/window.c b/arch/sdl/window.c index 5f76aa0ec..03e145616 100644 --- a/arch/sdl/window.c +++ b/arch/sdl/window.c @@ -60,8 +60,8 @@ int window_close(window *wind) event.type = EVENT_WINDOW_CLOSE; - if (!window_send_event(wind, &event)) - return 0; // user cancelled close (e.g. clicked 'No' to abort box) + if (window_send_event(wind, &event)) + return 0; // user 'handled' the event, cancelling close if (wind == FrontWindow) { diff --git a/main/automap.c b/main/automap.c index 7cc3b7e0c..6b9594a67 100644 --- a/main/automap.c +++ b/main/automap.c @@ -543,6 +543,7 @@ int automap_handler(window *wind, d_event *event, automap *am) game_flush_inputs(); d_free(am); window_set_visible(Game_wind, 1); + return 0; // continue closing break; default: diff --git a/main/game.c b/main/game.c index d7bfa3c53..f2edb90e7 100644 --- a/main/game.c +++ b/main/game.c @@ -1058,6 +1058,7 @@ int game_handler(window *wind, d_event *event, void *data) clear_warn_func(game_show_warning); //don't use this func anymore game_disable_cheats(); Game_wind = NULL; + return 0; // continue closing break; default: diff --git a/main/gamecntl.c b/main/gamecntl.c index cabc2d006..76a52faf3 100644 --- a/main/gamecntl.c +++ b/main/gamecntl.c @@ -271,6 +271,7 @@ int pause_handler(window *wind, d_event *event, char *msg) ext_music_resume(); digi_resume_all(); d_free(msg); + return 0; // continue closing break; default: diff --git a/main/kconfig.c b/main/kconfig.c index 297deb041..af74b4b59 100644 --- a/main/kconfig.c +++ b/main/kconfig.c @@ -949,6 +949,7 @@ int kconfig_handler(window *wind, d_event *event, kc_menu *menu) for (i=0; ilistbox_callback)(lb, event, lb->userdata); newmenu_hide_cursor(); + return 0; // continue closing break; default: