mail[Wesnoth-commits] r44074 - in /trunk/src: ./ whiteboard/


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

Header


Content

Posted by gabrielmorin on July 10, 2010 - 08:07:
Author: gabba
Date: Sat Jul 10 08:07:10 2010
New Revision: 44074

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44074&view=rev
Log:
Whiteboard: stopped selecting enemy units, and did a few other tweaks.

Modified:
    trunk/src/mouse_events.cpp
    trunk/src/whiteboard/attack.cpp
    trunk/src/whiteboard/highlight_visitor.cpp
    trunk/src/whiteboard/highlight_visitor.hpp
    trunk/src/whiteboard/manager.cpp
    trunk/src/whiteboard/move.cpp
    trunk/src/whiteboard/validate_visitor.cpp

Modified: trunk/src/mouse_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/mouse_events.cpp?rev=44074&r1=44073&r2=44074&view=diff
==============================================================================
--- trunk/src/mouse_events.cpp (original)
+++ trunk/src/mouse_events.cpp Sat Jul 10 08:07:10 2010
@@ -466,6 +466,7 @@
                if (resources::whiteboard->is_active()) {
 
                        
resources::whiteboard->save_temp_attack(clicked_u->get_location());
+                       return false;
 
                } else {
                        if (attack_from == selected_hex_) { //no move needed

Modified: trunk/src/whiteboard/attack.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/attack.cpp?rev=44074&r1=44073&r2=44074&view=diff
==============================================================================
--- trunk/src/whiteboard/attack.cpp (original)
+++ trunk/src/whiteboard/attack.cpp Sat Jul 10 08:07:10 2010
@@ -40,7 +40,8 @@
 {
        if(resources::screen)
        {
-               //invalidate target hex so attack indicator is properly 
cleared
+               //invalidate dest and target hex so attack indicator is 
properly cleared
+               resources::screen->invalidate(dest_hex_);
                resources::screen->invalidate(target_hex_);
        }
 }

Modified: trunk/src/whiteboard/highlight_visitor.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/highlight_visitor.cpp?rev=44074&r1=44073&r2=44074&view=diff
==============================================================================
--- trunk/src/whiteboard/highlight_visitor.cpp (original)
+++ trunk/src/whiteboard/highlight_visitor.cpp Sat Jul 10 08:07:10 2010
@@ -25,6 +25,7 @@
 
 #include "arrow.hpp"
 #include "foreach.hpp"
+#include "play_controller.hpp"
 #include "unit_map.hpp"
 #include "resources.hpp"
 
@@ -59,7 +60,8 @@
        mouseover_hex_ = hex;
        //if we're right over a unit, just highlight all of this unit's 
actions
        unit_map::const_iterator it = unit_map_.find(hex);
-       if (it != unit_map_.end())
+       if (it != unit_map_.end()
+                       && (it->side() == 
resources::controller->current_side()))
        {
                owner_unit_ = &(*it);
 

Modified: trunk/src/whiteboard/highlight_visitor.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/highlight_visitor.hpp?rev=44074&r1=44073&r2=44074&view=diff
==============================================================================
--- trunk/src/whiteboard/highlight_visitor.hpp (original)
+++ trunk/src/whiteboard/highlight_visitor.hpp Sat Jul 10 08:07:10 2010
@@ -39,7 +39,6 @@
        highlight_visitor(const unit_map& unit_map, side_actions_ptr 
side_actions);
        virtual ~highlight_visitor();
 
-       void set_selected_unit(unit& unit);
        void set_mouseover_hex(const map_location& hex);
        const map_location& get_mouseover_hex() const {return mouseover_hex_; 
}
 
@@ -75,7 +74,6 @@
        const unit_map& unit_map_;
        side_actions_ptr side_actions_;
 
-       unit* selected_unit_;
        map_location mouseover_hex_;
        unit* owner_unit_;
 

Modified: trunk/src/whiteboard/manager.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/manager.cpp?rev=44074&r1=44073&r2=44074&view=diff
==============================================================================
--- trunk/src/whiteboard/manager.cpp (original)
+++ trunk/src/whiteboard/manager.cpp Sat Jul 10 08:07:10 2010
@@ -165,6 +165,7 @@
                return;
        }
 
+       assert(selected_unit_->side() == 
resources::controller->current_side());
 
        //Temporary: Don't draw move arrow if move goes beyond range.
        bool cancel = false;

Modified: trunk/src/whiteboard/move.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/move.cpp?rev=44074&r1=44073&r2=44074&view=diff
==============================================================================
--- trunk/src/whiteboard/move.cpp (original)
+++ trunk/src/whiteboard/move.cpp Sat Jul 10 08:07:10 2010
@@ -76,6 +76,8 @@
 
 move::~move()
 {
+       //reminder: here we rely on the ~arrow destructor to invalidate
+       //its whole path.
 }
 
 void move::accept(visitor& v)

Modified: trunk/src/whiteboard/validate_visitor.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/validate_visitor.cpp?rev=44074&r1=44073&r2=44074&view=diff
==============================================================================
--- trunk/src/whiteboard/validate_visitor.cpp (original)
+++ trunk/src/whiteboard/validate_visitor.cpp Sat Jul 10 08:07:10 2010
@@ -121,6 +121,7 @@
 void validate_visitor::visit_attack(attack_ptr attack)
 {
        //invalidate target hex to make sure attack indicators are updated
+       resources::screen->invalidate(attack->dest_hex_);
        resources::screen->invalidate(attack->target_hex_);
 
        visit_move(boost::static_pointer_cast<move>(attack));




Related Messages


Powered by MHonArc, Updated Sat Jul 10 08:20:08 2010