KeplerBR

[FreeRCT] Using the scroll bar to change the position of sho

Jul 19th, 2014
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.98 KB | None | 0 0
  1. Index: /home/r2d2/ApenasMeu/Dropbox/ProjectFreeRCT/src/ride_gui.cpp
  2. ===================================================================
  3. --- /home/r2d2/ApenasMeu/Dropbox/ProjectFreeRCT/src/ride_gui.cpp    (revisão 1237)
  4. +++ /home/r2d2/ApenasMeu/Dropbox/ProjectFreeRCT/src/ride_gui.cpp    (cópia de trabalho)
  5. @@ -275,13 +275,13 @@
  6.         }
  7.         case RSEL_ROT_POS:
  8.             _shop_placer.orientation = (TileEdge)((_shop_placer.orientation + 3) & 3);
  9. -           this->MarkWidgetDirty(RSEL_DISPLAY);
  10. +           //this->MarkWidgetDirty(RSEL_DISPLAY);
  11.             _shop_placer.Rotated();
  12.             break;
  13.  
  14.         case RSEL_ROT_NEG:
  15.             _shop_placer.orientation = (TileEdge)((_shop_placer.orientation + 1) & 3);
  16. -           this->MarkWidgetDirty(RSEL_DISPLAY);
  17. +           //this->MarkWidgetDirty(RSEL_DISPLAY);
  18.             _shop_placer.Rotated();
  19.             break;
  20.     }
  21. @@ -555,6 +555,22 @@
  22.     }
  23.  }
  24.  
  25. +void ShopPlacementManager::OnMouseWheelEvent(Viewport* vp, int direction) {
  26. +   #define WHEEL_DOWN -1
  27. +   #define WHEEL_UP 1
  28. +
  29. +   if (direction == WHEEL_DOWN) {
  30. +       this->orientation = (TileEdge)((_shop_placer.orientation + 1) & 3);
  31. +   } else if (direction == WHEEL_UP) {
  32. +       this->orientation = (TileEdge)((_shop_placer.orientation + 3) & 3);
  33. +   }
  34. +  
  35. +   #undef WHEEL_DOWN
  36. +   #undef WHEEL_UP
  37. +
  38. +   Rotated();
  39. +}
  40. +
  41.  void ShopPlacementManager::OnMouseMoveEvent(Viewport *vp, const Point16 &old_pos, const Point16 &pos)
  42.  {
  43.     this->mouse_pos = pos;
  44. Index: /home/r2d2/ApenasMeu/Dropbox/ProjectFreeRCT/src/shop_placement.h
  45. ===================================================================
  46. --- /home/r2d2/ApenasMeu/Dropbox/ProjectFreeRCT/src/shop_placement.h    (revisão 1237)
  47. +++ /home/r2d2/ApenasMeu/Dropbox/ProjectFreeRCT/src/shop_placement.h    (cópia de trabalho)
  48. @@ -44,6 +44,7 @@
  49.     void LeaveMode() override;
  50.     bool EnableCursors() override;
  51.  
  52. +   void OnMouseWheelEvent(Viewport* vp, int direction) override;
  53.     void OnMouseMoveEvent(Viewport *vp, const Point16 &old_pos, const Point16 &pos) override;
  54.     void OnMouseButtonEvent(Viewport *vp, uint8 state) override;
Add Comment
Please, Sign In to add comment