bubba2251 / freerct

Automatically exported from code.google.com/p/freerct
0 stars 0 forks source link

Use scrollwheel change shop rotation #53

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Code:
Index: /home/r2d2/ApenasMeu/Dropbox/ProjectFreeRCT/src/ride_gui.cpp
===================================================================
--- /home/r2d2/ApenasMeu/Dropbox/ProjectFreeRCT/src/ride_gui.cpp    (revisão 1237)
+++ /home/r2d2/ApenasMeu/Dropbox/ProjectFreeRCT/src/ride_gui.cpp    (cópia de 
trabalho)
@@ -555,6 +555,16 @@
    }
 }

+void ShopPlacementManager::OnMouseWheelEvent(Viewport* vp, int direction) {
+   if (direction == -1) { // Scrollbar mouse moved downwards
+       this->orientation = (TileEdge)((_shop_placer.orientation + 1) & 3);
+   } else if (direction == 1) { // Scrollbar mouse moved upwards
+       this->orientation = (TileEdge)((_shop_placer.orientation + 3) & 3);
+   }
+
+   Rotated();
+}
+
 void ShopPlacementManager::OnMouseMoveEvent(Viewport *vp, const Point16 &old_pos, const Point16 &pos)
 {
    this->mouse_pos = pos;
Index: /home/r2d2/ApenasMeu/Dropbox/ProjectFreeRCT/src/shop_placement.h
===================================================================
--- /home/r2d2/ApenasMeu/Dropbox/ProjectFreeRCT/src/shop_placement.h    (revisão 
1237)
+++ /home/r2d2/ApenasMeu/Dropbox/ProjectFreeRCT/src/shop_placement.h    (cópia de 
trabalho)
@@ -44,6 +44,7 @@
    void LeaveMode() override;
    bool EnableCursors() override;

+   void OnMouseWheelEvent(Viewport* vp, int direction) override;
    void OnMouseMoveEvent(Viewport *vp, const Point16 &old_pos, const Point16 &pos) override;
    void OnMouseButtonEvent(Viewport *vp, uint8 state) override;

Code in Pastebin: http://pastebin.com/rZTyDtuN
Topic: 
https://groups.google.com/forum/?fromgroups#!topic/freerctgame/YJkLBolVQvs

Original issue reported on code.google.com by keple...@gmail.com on 22 Jul 2014 at 2:58

GoogleCodeExporter commented 9 years ago
Better, although an attachment is more normal :)

Also, i was thinking that you should just "move" the constant names to comments 
- a sentence isn't necessary. (Oh, and it's scrollwheel, rather than scrollbar)

Thanks :)

Original comment by CharlesP...@googlemail.com on 23 Jul 2014 at 4:04