mail[Wesnoth-commits] r40152 - /branches/fendrin_gui_stuff/src/playsingle_controller.cpp


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

Header


Content

Posted by fabianmueller5 on December 06, 2009 - 19:40:
Author: fendrin
Date: Sun Dec  6 19:40:13 2009
New Revision: 40152

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40152&view=rev
Log:
Added handlers for cursor related key events. 

Modified:
    branches/fendrin_gui_stuff/src/playsingle_controller.cpp

Modified: branches/fendrin_gui_stuff/src/playsingle_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/fendrin_gui_stuff/src/playsingle_controller.cpp?rev=40152&r1=40151&r2=40152&view=diff
==============================================================================
--- branches/fendrin_gui_stuff/src/playsingle_controller.cpp (original)
+++ branches/fendrin_gui_stuff/src/playsingle_controller.cpp Sun Dec  6 
19:40:13 2009
@@ -93,6 +93,64 @@
        for(std::vector<team>::iterator t = teams_.begin(); t != 
teams_.end(); ++t) {
                ::clear_shroud(t - teams_.begin() + 1);
        }
+}
+
+void playsingle_controller::move_cursor_select(){
+       mouse_handler_.left_click(0,0,false);
+}
+
+void playsingle_controller::move_cursor(int x_offset, int y_offset){
+       display& display = get_display();
+       map_location loc = display.mouseover_hex();
+       loc.x += x_offset;
+       loc.y += y_offset;
+
+       if(resources::game_map->on_board(loc)) {
+               mouse_handler_.mouse_motion(loc,false,false);
+               display.scroll_to_tile(loc,display::ONSCREENWARP,true,true);
+       }
+}
+
+void playsingle_controller::move_cursor(map_location::DIRECTION direction) {
+       display& display = get_display();
+       map_location loc = display.mouseover_hex().get_direction(direction);
+
+       if(resources::game_map->on_board(loc)) {
+               mouse_handler_.mouse_motion(loc,false,false);
+               display.scroll_to_tile(loc,display::ONSCREENWARP,true,true);
+       }
+}
+
+void playsingle_controller::move_cursor_east() {
+       move_cursor(1,0);
+}
+
+void playsingle_controller::move_cursor_west() {
+       move_cursor(-1,0);
+}
+
+void playsingle_controller::move_cursor_north() {
+       move_cursor(map_location::NORTH);
+}
+
+void playsingle_controller::move_cursor_south() {
+       move_cursor(map_location::SOUTH);
+}
+
+void playsingle_controller::move_cursor_southeast() {
+       move_cursor(map_location::SOUTH_EAST);
+}
+
+void playsingle_controller::move_cursor_southwest() {
+       move_cursor(map_location::SOUTH_WEST);
+}
+
+void playsingle_controller::move_cursor_northeast() {
+       move_cursor(map_location::NORTH_EAST);
+}
+
+void playsingle_controller::move_cursor_northwest() {
+       move_cursor(map_location::NORTH_WEST);
 }
 
 void playsingle_controller::recruit(){




Related Messages


Powered by MHonArc, Updated Sun Dec 06 20:00:15 2009