-renamed ViewPort to Camera
[supertux.git] / src / button.h
index e081966..950e898 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <vector>
 #include "texture.h"
+#include "drawable.h"
 
 enum ButtonState {
   BUTTON_NONE = -1,
@@ -30,7 +31,8 @@ enum ButtonState {
   BUTTON_PRESSED,
   BUTTON_HOVER,
   BUTTON_WHEELUP,
-  BUTTON_WHEELDOWN
+  BUTTON_WHEELDOWN,
+  BUTTON_DEACTIVE
 };
 
 class ButtonPanel;
@@ -45,15 +47,16 @@ public:
   void event(SDL_Event& event);
   void draw();
   int get_state();
+  void set_active(bool active) { active ? state = BUTTON_NONE : state = BUTTON_DEACTIVE; };
   void add_icon(std::string icon_file, int mw, int mh);
   SDL_Rect get_pos() { return rect; }
   int get_tag(){return tag; }
-  void set_game_object(GameObject* game_object_) { game_object = game_object_; }
-  GameObject* get_game_object() { return game_object; };
+  void set_drawable(Drawable* newdrawable)
+  { drawable = newdrawable; }
 
 private:
   static Timer popup_timer;
-  GameObject* game_object;
+  Drawable* drawable;
   std::vector<Surface*> icon;
   std::string info;
   SDLKey shortcut;