Author: shadowmaster
Date: Sun Apr  5 01:46:48 2009
New Revision: 34506

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34506&view=rev
Log:
Expose the [wml_message] code for usage elsewhere than EventWML.

Modified:
    trunk/src/game_events.cpp
    trunk/src/game_events.hpp

Modified: trunk/src/game_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=34506&r1=34505&r2=34506&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Sun Apr  5 01:46:48 2009
@@ -456,6 +456,14 @@
                        return false;
                }
                return matches;
+       }
+
+       void handle_wml_log_message(const config& cfg)
+       {
+               const std::string& logger = cfg["logger"];
+               const std::string& msg = cfg["message"];
+
+               put_wml_message(logger,msg);
        }
 
 } // end namespace game_events (1)
@@ -2079,10 +2087,7 @@
 
        WML_HANDLER_FUNCTION(wml_message,/*handler*/,/*event_info*/,cfg)
        {
-               const std::string& logger = cfg["logger"];
-               const std::string msg = cfg["message"];
-
-               put_wml_message(logger,msg);
+               game_events::handle_wml_log_message( cfg.get_parsed_config() );
        }
 
 

Modified: trunk/src/game_events.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.hpp?rev=34506&r1=34505&r2=34506&view=diff
==============================================================================
--- trunk/src/game_events.hpp (original)
+++ trunk/src/game_events.hpp Sun Apr  5 01:46:48 2009
@@ -283,6 +283,8 @@
 
        bool unit_matches_filter(unit_map::const_iterator itor, const vconfig 
filter);
 
+       void handle_wml_log_message(const config& cfg);
+
        /**
         * Function to fire an event.
         *


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

Reply via email to