Author: soliton
Date: Fri Oct 23 04:10:06 2009
New Revision: 39424

URL: http://svn.gna.org/viewcvs/wesnoth?rev=39424&view=rev
Log:
made tip buttons work right with the keyboard

Modified:
    trunk/src/titlescreen.cpp

Modified: trunk/src/titlescreen.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/titlescreen.cpp?rev=39424&r1=39423&r2=39424&view=diff
==============================================================================
--- trunk/src/titlescreen.cpp (original)
+++ trunk/src/titlescreen.cpp Fri Oct 23 04:10:06 2009
@@ -549,12 +549,12 @@
                        }
                }
 
-               if(previous_tip_button.pressed()) {
+               if(previous_tip_button.pressed() || (key[SDLK_RETURN] && 
keyboard_button == TIP_PREVIOUS - TUTORIAL)) {
                        next_tip_of_day(tips_of_day, true);
                        draw_tip_of_day(screen, tips_of_day, 
gui::dialog_frame::titlescreen_style,
                                                &previous_tip_button, 
&next_tip_button, &help_tip_button, &main_dialog_area, tip_of_day_restorer);
                }
-               if(next_tip_button.pressed()) {
+               if(next_tip_button.pressed() || (key[SDLK_RETURN] && 
keyboard_button == TIP_NEXT - TUTORIAL)) {
                        next_tip_of_day(tips_of_day, false);
                        draw_tip_of_day(screen, tips_of_day, 
gui::dialog_frame::titlescreen_style,
                                                &previous_tip_button, 
&next_tip_button, &help_tip_button, &main_dialog_area, tip_of_day_restorer);
@@ -602,7 +602,9 @@
                if (key[SDLK_F5])
                        return RELOAD_GAME_DATA;
 
-               if (key[SDLK_RETURN] && keyboard_button < nbuttons) {
+               if (key[SDLK_RETURN] && keyboard_button < nbuttons
+               && keyboard_button != TIP_PREVIOUS - TUTORIAL
+               && keyboard_button != TIP_NEXT - TUTORIAL) {
                        return static_cast<TITLE_RESULT>(keyboard_button + 
TUTORIAL);
                }
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to