mail[Wesnoth-commits] r43412 - /trunk/src/menu_events.cpp


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

Header


Content

Posted by alinktomine on June 13, 2010 - 19:16:
Author: alink
Date: Sun Jun 13 19:16:24 2010
New Revision: 43412

URL: http://svn.gna.org/viewcvs/wesnoth?rev=43412&view=rev
Log:
Reactivate :undiscover but with a confirmation dialog to prevent 'accident'

Modified:
    trunk/src/menu_events.cpp

Modified: trunk/src/menu_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/menu_events.cpp?rev=43412&r1=43411&r2=43412&view=diff
==============================================================================
--- trunk/src/menu_events.cpp (original)
+++ trunk/src/menu_events.cpp Sun Jun 13 19:16:24 2010
@@ -2486,9 +2486,8 @@
                        //    _("Remove a trait from a unit. (Does not work 
yet.)"), "", "D");
                        register_command("discover", 
&console_handler::do_discover,
                                _("Discover all units in help."), "");
-                       // Hide to prevent unwanted clearing of user's 
progress
-                       // register_command("undiscover", 
&console_handler::do_undiscover,
-                       //        _("'Undiscover' all units in help."), "");*/
+                       register_command("undiscover", 
&console_handler::do_undiscover,
+                                 _("'Undiscover' all units in help."), "");
                        register_command("create", 
&console_handler::do_create,
                                _("Create a unit."), "", "D");
                        register_command("fog", &console_handler::do_fog,
@@ -3330,7 +3329,10 @@
        }
 }
 void console_handler::do_undiscover() {
-       preferences::encountered_units().clear();
+       const int res = gui::dialog(*menu_handler_.gui_, "Undiscover", 
_("Clear all your discovered units from help?"),gui::YES_NO).show();
+       if(res == 0) {
+               preferences::encountered_units().clear();
+       }
 }
 void console_handler::do_create() {
        const map_location &loc = mouse_handler_.get_last_hex();




Related Messages


Powered by MHonArc, Updated Sun Jun 13 19:20:14 2010