Changeset 26 for trunk/Classes/mouse_handler_base.cpp
- Timestamp:
- 2010-05-28 07:39:52 (2 years ago)
- File:
-
- 1 edited
-
trunk/Classes/mouse_handler_base.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Classes/mouse_handler_base.cpp
r17 r26 19 19 #include "log.hpp" 20 20 #include "preferences.hpp" 21 22 extern bool gMegamap; 23 extern bool gRedraw; 24 extern bool gIsDragging; 21 25 22 26 … … 81 85 return true; 82 86 } 83 87 /* 84 88 if(minimap_scrolling_) { 85 89 //if the game is run in a window, we could miss a LMB/MMB up event … … 101 105 if(minimap_scrolling_) return true; 102 106 } 107 */ 103 108 104 109 // Fire the drag & drop only after minimal drag distance … … 132 137 dragged_y_ = dy; 133 138 didDrag_ = true; 139 gIsDragging = true; 134 140 // KP: fixes #5 135 141 unsigned long curTime = SDL_GetTicks(); … … 168 174 if (event.state == SDL_PRESSED) { 169 175 cancel_dragging(); 170 init_dragging(dragging_left_); 176 if (event.x < gui().map_area().w) 177 init_dragging(dragging_left_); 171 178 left_click(event.x, event.y, browse); 172 179 } else if (event.state == SDL_RELEASED) { … … 261 268 { 262 269 // clicked on a hex on the minimap? then initiate minimap scrolling 263 const map_location& loc = gui().minimap_location_on(x, y); 264 minimap_scrolling_ = false; 265 if(loc.valid()) { 266 minimap_scrolling_ = true; 267 last_hex_ = loc; 268 gui().scroll_to_tile(loc,display::WARP, false); 269 return true; 270 } 271 return false; 270 if (gMegamap == true) 271 { 272 const map_location& loc = gui().megamap_location_on(x, y); 273 if(loc.valid()) { 274 minimap_scrolling_ = true; 275 last_hex_ = loc; 276 gui().scroll_to_tile(loc, display::WARP, false); 277 gMegamap = false; 278 gRedraw = true; 279 cancel_dragging(); 280 dragged_x_ = 0; 281 dragged_y_ = 0; 282 didDrag_ = false; 283 gIsDragging = false; 284 drag_start_time_ = 0; 285 scroll_velocity_x_ = 0; 286 scroll_velocity_y_ = 0; 287 drag_last_xVelocity_ = 0; 288 drag_last_yVelocity_ = 0; 289 minimap_scrolling_ = false; 290 return true; 291 } 292 return false; 293 } 294 else 295 { 296 const map_location& loc = gui().minimap_location_on(x, y); 297 minimap_scrolling_ = false; 298 if(loc.valid()) { 299 #ifdef __IPAD__ 300 minimap_scrolling_ = true; 301 last_hex_ = loc; 302 gui().scroll_to_tile(loc,display::WARP, false); 303 #else 304 // KP: now, a click on the minimap causes the megamap to popup 305 gMegamap = true; 306 #endif 307 return true; 308 } 309 310 return false; 311 } 272 312 } 273 313
Note: See TracChangeset
for help on using the changeset viewer.