]> git.lizzy.rs Git - minetest.git/blobdiff - src/touchscreengui.h
WoW-style Autorun
[minetest.git] / src / touchscreengui.h
index 8dc4820345660e16fd600dcc3dd4c79fedffc212..bb32317932acbd0c7efa3d0401f827f137b808e9 100644 (file)
@@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <map>
 
 #include "game.h"
-#include "tile.h"
+#include "client/tile.h"
 
 using namespace irr;
 using namespace irr::core;
@@ -38,15 +38,23 @@ typedef enum {
        backward_id,
        left_id,
        right_id,
+       inventory_id,
+       drop_id,
        jump_id,
        crunch_id,
-       inventory_id,
+       fly_id,
+       noclip_id,
+       fast_id,
+       debug_id,
        chat_id,
+       camera_id,
+       range_id,
        after_last_element_id
 } touch_gui_button_id;
 
 #define MIN_DIG_TIME_MS 500
 #define MAX_TOUCH_COUNT 64
+#define BUTTON_REPEAT_DELAY 0.2f
 
 extern const char** touchgui_button_imagenames;
 
@@ -98,6 +106,7 @@ class TouchScreenGUI
 
        struct button_info {
                float            repeatcounter;
+               float            repeatdelay;
                irr::EKEY_CODE   keycode;
                std::vector<int> ids;
                IGUIButton*      guibutton;
@@ -117,10 +126,11 @@ class TouchScreenGUI
 
        /* initialize a button */
        void initButton(touch_gui_button_id id, rect<s32> button_rect,
-                       std::wstring caption, bool immediate_release );
+                       std::wstring caption, bool immediate_release,
+                       float repeat_delay = BUTTON_REPEAT_DELAY);
 
        /* load texture */
-       void loadButtonTexture(button_info* btn, const char* path);
+       void loadButtonTexture(button_info* btn, const char* path, rect<s32> button_rect);
 
        struct id_status{
                int id;