Author: silene
Date: Sun May  3 17:32:42 2009
New Revision: 35435

URL: http://svn.gna.org/viewcvs/wesnoth?rev=35435&view=rev
Log:
Added a "lua" command.

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=35435&r1=35434&r2=35435&view=diff
==============================================================================
--- trunk/src/menu_events.cpp (original)
+++ trunk/src/menu_events.cpp Sun May  3 17:32:42 2009
@@ -45,6 +45,7 @@
 #include "unit_display.hpp"
 #include "wml_separators.hpp"
 #include "formula_string_utils.hpp"
+#include "scripting/lua.hpp"
 #include "widgets/combo.hpp"
 
 static lg::log_domain log_engine("engine");
@@ -2168,6 +2169,7 @@
                        void do_choose_level();
                        void do_debug();
                        void do_nodebug();
+                       void do_lua();
                        void do_custom();
                        void do_set_alias();
                        void do_set_var();
@@ -2251,6 +2253,8 @@
                                        _("Turn debug mode on."));
                                register_command("nodebug", 
&console_handler::do_nodebug,
                                        _("Turn debug mode off."), "", "D");
+                               register_command("lua", 
&console_handler::do_lua,
+                                       _("Execute a Lua statement."));
                                register_command("custom", 
&console_handler::do_custom,
                                        _("Set the command used by the custom 
command hotkey"), "<command>[;<command>...]");
                                register_command("alias", 
&console_handler::do_set_alias,
@@ -2823,6 +2827,9 @@
                        game_config::debug = false;
                }
        }
+       void console_handler::do_lua() {
+               game_events::resources->lua_kernel->run(get_data().c_str());
+       }
        void console_handler::do_custom() {
                preferences::set("custom_command", get_data());
        }


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

Reply via email to