mail[Wesnoth-commits] r44067 - in /trunk/src: mouse_events.cpp mouse_events.hpp play_controller.hpp


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

Header


Content

Posted by gabrielmorin on July 10, 2010 - 02:35:
Author: gabba
Date: Sat Jul 10 02:35:55 2010
New Revision: 44067

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44067&view=rev
Log:
For use by whiteboard: Made show_attack_dialog() and attack_enemy() public in 
mouse_handler. Made get_mouse_handler_base() public in play_controller.

Modified:
    trunk/src/mouse_events.cpp
    trunk/src/mouse_events.hpp
    trunk/src/play_controller.hpp

Modified: trunk/src/mouse_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/mouse_events.cpp?rev=44067&r1=44066&r2=44067&view=diff
==============================================================================
--- trunk/src/mouse_events.cpp (original)
+++ trunk/src/mouse_events.cpp Sat Jul 10 02:35:55 2010
@@ -702,7 +702,7 @@
        for (unsigned int i = 0; i < attacker->attacks().size(); i++) {
                // skip weapons with attack_weight=0
                if (attacker->attacks()[i].attack_weight() > 0) {
-                       battle_context bc(units_, attacker->get_location(), 
defender->get_location(), i);
+                       battle_context bc(*resources::units, 
attacker->get_location(), defender->get_location(), i);
                        bc_vector.push_back(bc);
                        if (bc.better_attack(bc_vector[best], 0.5)) {
                                // as some weapons can be hidden, i is not a 
valid index into the resulting vector
@@ -730,7 +730,7 @@
                                , weapons
                                , best_weapon);
 
-               dlg.show(gui_->video());
+               dlg.show(resources::screen->video());
 
                if(dlg.get_retval() == gui2::twindow::OK) {
                        return dlg.get_selected_weapon();

Modified: trunk/src/mouse_events.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/mouse_events.hpp?rev=44067&r1=44066&r2=44067&view=diff
==============================================================================
--- trunk/src/mouse_events.hpp (original)
+++ trunk/src/mouse_events.hpp Sat Jul 10 02:35:55 2010
@@ -63,6 +63,13 @@
        void add_waypoint(const map_location& loc);
 
        pathfind::marked_route get_route(unit_map::const_iterator un, 
map_location go_to, const std::vector<map_location>& waypoints, team &team);
+
+       // show the attack dialog and return the choice made
+       // which can be invalid if 'cancel' was used
+       int show_attack_dialog(const map_location& attacker_loc, const 
map_location& defender_loc);
+       // wrapper to catch bad_alloc so this should be called
+       void attack_enemy(const map_location& attacker_loc, const 
map_location& defender_loc, int choice);
+
 protected:
        /**
         * Due to the way this class is constructed we can assume that the
@@ -89,11 +96,6 @@
        // fill weapon choices into bc_vector
        // return the best weapon choice
        int fill_weapon_choices(std::vector<battle_context>& bc_vector, 
unit_map::iterator attacker, unit_map::iterator defender);
-       // show the attack dialog and return the choice made
-       // which can be invalid if 'cancel' was used
-       int show_attack_dialog(const map_location& attacker_loc, const 
map_location& defender_loc);
-       // wrapper to catch bad_alloc so this should be called
-       void attack_enemy(const map_location& attacker_loc, const 
map_location& defender_loc, int choice);
        // the real function but can throw bad_alloc
        // choice is the attack chosen in the attack dialog
        void attack_enemy_(const map_location attacker_loc, const 
map_location defender_loc, int choice);

Modified: trunk/src/play_controller.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/play_controller.hpp?rev=44067&r1=44066&r2=44067&view=diff
==============================================================================
--- trunk/src/play_controller.hpp (original)
+++ trunk/src/play_controller.hpp Sat Jul 10 02:35:55 2010
@@ -133,12 +133,14 @@
 
        config to_config() const;
 
-       bool is_skipping_replay() const { return skip_replay_;};
+       bool is_skipping_replay() const { return skip_replay_;}
+
+       events::mouse_handler& get_mouse_handler_base();
+
 protected:
        void slice_before_scroll();
        void slice_end();
 
-       events::mouse_handler& get_mouse_handler_base();
        game_display& get_display();
        bool have_keyboard_focus();
        void process_keydown_event(const SDL_Event& event);




Related Messages


Powered by MHonArc, Updated Sat Jul 10 02:40:11 2010