From 330a6f21f3fcd9c7c26b55ac3b86ec854b4d2261 Mon Sep 17 00:00:00 2001 From: Ricardo Cruz Date: Mon, 31 May 2004 23:47:05 +0000 Subject: [PATCH] confirm_dialog now accepts a background, instead of doing the screen capture hack. SVN-Revision: 1377 --- src/menu.cpp | 16 ++++++++-------- src/menu.h | 2 +- src/setup.cpp | 2 +- src/title.cpp | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/menu.cpp b/src/menu.cpp index e79cd2c37..b3ade4d0d 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -65,10 +65,8 @@ std::vector Menu::last_menus; Menu* Menu::current_ = 0; /* just displays a Yes/No text that can be used to confirm stuff */ -bool confirm_dialog(std::string text) +bool confirm_dialog(Surface *background, std::string text) { - // TODO -#if 0 //Surface* cap_screen = Surface::CaptureScreen(); Menu* dialog = new Menu; @@ -80,6 +78,8 @@ bool confirm_dialog(std::string text) Menu::set_current(dialog); + DrawingContext context; + while(true) { SDL_Event event; @@ -89,9 +89,9 @@ bool confirm_dialog(std::string text) dialog->event(event); } - //cap_screen->draw(0,0); + context.draw_surface(background, Vector(0,0), LAYER_BACKGROUND0); - dialog->draw(); + dialog->draw(context); dialog->action(); switch (dialog->check()) @@ -112,11 +112,11 @@ bool confirm_dialog(std::string text) break; } - mouse_cursor->draw(); - flipscreen(); + mouse_cursor->draw(context); + context.do_drawing(); SDL_Delay(25); } -#endif + return false; } diff --git a/src/menu.h b/src/menu.h index c77777fe6..5fe4e4ac5 100644 --- a/src/menu.h +++ b/src/menu.h @@ -93,7 +93,7 @@ enum LevelEditorSettingsMenuIDs { MNID_APPLY }; -bool confirm_dialog(std::string text); +bool confirm_dialog(Surface* background, std::string text); /* Kinds of menu items */ enum MenuItemKind { diff --git a/src/setup.cpp b/src/setup.cpp index 055356bb3..dbec4db96 100644 --- a/src/setup.cpp +++ b/src/setup.cpp @@ -508,7 +508,7 @@ bool process_load_game_menu() } // shrink_fade(Point((screen->w/2),(screen->h/2)), 1000); - fadeout(200); + fadeout(256); WorldMapNS::WorldMap worldmap; // Load the game or at least set the savegame_file variable diff --git a/src/title.cpp b/src/title.cpp index 21cd91890..f30f469b6 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -322,7 +322,7 @@ void title(void) char str[1024]; sprintf(str,"Are you sure you want to delete slot %d?", slot); - if(confirm_dialog(str)) + if(confirm_dialog(bkg_title, str)) { sprintf(str,"%s/slot%d.stsg", st_save_dir, slot); printf("Removing: %s\n",str); -- 2.11.0