mail[Wesnoth-commits] r27571 - in /trunk/src: game.cpp titlescreen.cpp titlescreen.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by paniemin on June 28, 2008 - 23:20:
Author: suokko
Date: Sat Jun 28 23:20:40 2008
New Revision: 27571

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27571&view=rev
Log:
Made titlescreen reload game configs when F5 is pressed
Fixed titlescreen loop tohave event::pump() at top

Modified:
    trunk/src/game.cpp
    trunk/src/titlescreen.cpp
    trunk/src/titlescreen.hpp

Modified: trunk/src/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game.cpp?rev=27571&r1=27570&r2=27571&view=diff
==============================================================================
--- trunk/src/game.cpp (original)
+++ trunk/src/game.cpp Sat Jun 28 23:20:40 2008
@@ -2754,6 +2754,10 @@
                } else if(res == gui::BEG_FOR_UPLOAD) {
                        game.show_upload_begging();
                        continue;
+               } else if(res == gui::RELOAD_GAME_DATA) {
+                       loadscreen::global_loadscreen_manager 
loadscreen(game.disp().video());
+                       game.reload_changed_game_config();
+                       continue;
 #ifdef USE_EDITOR2
                } else if(res == gui::START_MAP_EDITOR) {
                        //@todo editor can ask the game to quit completely

Modified: trunk/src/titlescreen.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/titlescreen.cpp?rev=27571&r1=27570&r2=27571&view=diff
==============================================================================
--- trunk/src/titlescreen.cpp (original)
+++ trunk/src/titlescreen.cpp Sat Jun 28 23:20:40 2008
@@ -458,8 +458,7 @@
        gui::button 
help_tip_button(screen.video(),sgettext(button_labels[b]),button::TYPE_PRESS,"lite_small");
        help_tip_button.set_help_string( sgettext(button_labels[b] ));
 
-       /** @todo FIXME: Translatable string is here because we WILL put text 
in before 1.2! */
-       gui::button beg_button(screen.video(),("Help 
Wesnoth"),button::TYPE_IMAGE,"menu-button",button::MINIMUM_SPACE);
+       gui::button beg_button(screen.video(),_("Help 
Wesnoth"),button::TYPE_IMAGE,"menu-button",button::MINIMUM_SPACE);
        beg_button.set_help_string(_("Help Wesnoth by sending us 
information"));
 
        next_tip_of_day(tips_of_day);
@@ -478,7 +477,6 @@
 
        CKey key;
 
-       bool last_escape = key[SDLK_ESCAPE] != 0;
 
        update_whole_screen();
        background_is_dirty_ = false;
@@ -486,6 +484,7 @@
        LOG_DP << "entering interactive loop...\n";
 
        for(;;) {
+               events::pump();
                for(size_t b = 0; b != buttons.size(); ++b) {
                        if(buttons[b].pressed()) {
                                return TITLE_RESULT(b);
@@ -515,12 +514,13 @@
 
                screen.flip();
 
-               if(!last_escape && key[SDLK_ESCAPE])
+               if(key[SDLK_ESCAPE])
                        return QUIT_GAME;
-
-               last_escape = key[SDLK_ESCAPE] != 0;
-
-               events::pump();
+               if(key[SDLK_F5])
+                       return RELOAD_GAME_DATA;
+
+
+
 
                // If the resolution has changed due to the user resizing the 
screen,
                // or from changing between windowed and fullscreen:

Modified: trunk/src/titlescreen.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/titlescreen.hpp?rev=27571&r1=27570&r2=27571&view=diff
==============================================================================
--- trunk/src/titlescreen.hpp (original)
+++ trunk/src/titlescreen.hpp Sat Jun 28 23:20:40 2008
@@ -36,6 +36,7 @@
                                        SHOW_HELP,
                                        BEG_FOR_UPLOAD,         /**< Ask user 
for permission to upload game-stats as feedback */
                                        REDRAW_BACKGROUND,      /**< Used 
after an action needing a redraw (ex: fullscreen) */
+                                       RELOAD_GAME_DATA,       /**< Used to 
reload all game data */
                                        NOTHING                         /**< 
Default, nothing done, no redraw needed */
                                  };
 




Related Messages


Powered by MHonArc, Updated Sun Jun 29 00:23:03 2008