mail[Wesnoth-commits] r52829 - in /trunk: changelog src/savegame.cpp


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

Header


Content

Posted by shadowm2006 on January 31, 2012 - 00:42:
Author: shadowmaster
Date: Tue Jan 31 00:42:20 2012
New Revision: 52829

URL: http://svn.gna.org/viewcvs/wesnoth?rev=52829&view=rev
Log:
Display the savegame version when warning the user about unsupported or 
mismatched versions (bug #7243)

Along the way, made the unsupported case use the GUI2 error message
dialog instead of the generic message dialog, and gave the mismatched
version case prompt a title label.

Modified:
    trunk/changelog
    trunk/src/savegame.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=52829&r1=52828&r2=52829&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Tue Jan 31 00:42:20 2012
@@ -27,6 +27,8 @@
      {SOUND:POISON} macros, and several macros from animation-utils2.cfg are 
used
      (see bug #19274)
    * Restart is no longer required to toggle desktop notifications
+   * Display the savegame version when warning the user about unsupported or
+     mismatched versions (bug #7243)
 
 Version 1.10.0:
  * Campaigns:

Modified: trunk/src/savegame.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/savegame.cpp?rev=52829&r1=52828&r2=52829&view=diff
==============================================================================
--- trunk/src/savegame.cpp (original)
+++ trunk/src/savegame.cpp Tue Jan 31 00:42:20 2012
@@ -18,6 +18,7 @@
 
 #include "dialogs.hpp" //FIXME: get rid of this as soon as the two remaining 
dialogs are moved to gui2
 #include "foreach.hpp"
+#include "formula_string_utils.hpp"
 #include "game_display.hpp"
 #include "game_end_exceptions.hpp"
 #include "game_preferences.hpp"
@@ -514,13 +515,19 @@
            save_version != game_config::test_version &&
            wesnoth_version != game_config::test_version)
        {
-               gui2::show_message(gui_.video(), "", _("This save is from a 
version too old to be loaded."));
+               const std::string message = _("This save is from an old, 
unsupported version ($version_number|) and cannot be loaded.");
+               utils::string_map symbols;
+               symbols["version_number"] = save_version.str();
+               gui2::show_error_message(gui_.video(), 
utils::interpolate_variables_into_string(message, &symbols));
                throw load_game_cancelled_exception();
        }
 
        int res = gui2::twindow::OK;
        if(preferences::confirm_load_save_from_different_version()) {
-               res = gui2::show_message(gui_.video(), "", _("This save is 
from a different version of the game. Do you want to try to load it?"),
+               const std::string message = _("This save is from a different 
version of the game ($version_number|). Do you wish to try to load it?");
+               utils::string_map symbols;
+               symbols["version_number"] = save_version.str();
+               res = gui2::show_message(gui_.video(), _("Load Game"), 
utils::interpolate_variables_into_string(message, &symbols),
                        gui2::tmessage::yes_no_buttons);
        }
 




Related Messages


Powered by MHonArc, Updated Tue Jan 31 01:40:06 2012