Author: alink
Date: Tue Apr 21 01:24:49 2009
New Revision: 35092
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35092&view=rev
Log:
Add 2 new commands ':discover' and ':undiscover' which allow to fill or clear
the list of discovered units filtering what to show in help.
I think that ':discover' is a frequent user request and ':undiscover' will help
help to debug the currently not perfect update of discovered units.
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=35092&r1=35091&r2=35092&view=diff
==============================================================================
--- trunk/src/menu_events.cpp (original)
+++ trunk/src/menu_events.cpp Tue Apr 21 01:24:49 2009
@@ -2142,6 +2142,8 @@
void do_unit();
// void do_buff();
// void do_unbuff();
+ void do_discover();
+ void do_undiscover();
void do_create();
void do_fog();
void do_shroud();
@@ -2230,6 +2232,10 @@
_("Add a trait to a unit."), "", "D");
register_command("unbuff",
&console_handler::do_unbuff,
_("Remove a trait from a unit. (Does
not work yet.)"), "", "D");*/
+ register_command("discover",
&console_handler::do_discover,
+ _("Discover 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,
@@ -2890,6 +2896,15 @@
command_failed("No unit selected");
}
}*/
+ void console_handler::do_discover() {
+ unit_type_data::unit_type_map::const_iterator i =
unit_type_data::types().begin();
+ for(; i != unit_type_data::types().end(); ++i) {
+ preferences::encountered_units().insert(i->second.id());
+ }
+ }
+ void console_handler::do_undiscover() {
+ preferences::encountered_units().clear();
+ }
void console_handler::do_create() {
const map_location &loc = mouse_handler_.get_last_hex();
if (menu_handler_.map_.on_board(loc)) {
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits