diff options
author | RealBadAngel <maciej.kasatkin@o2.pl> | 2014-06-25 11:52:09 +0200 |
---|---|---|
committer | RealBadAngel <maciej.kasatkin@o2.pl> | 2014-06-25 16:23:05 +0200 |
commit | 09ba047c0175adfaca4a6bccc41c8a0570c295db (patch) | |
tree | b3bb762911ecc2fd6480d5f63b6cfcee0e419b79 | |
parent | 27538ecef51ebcc7622f13956d2f8e101d0f71a7 (diff) | |
download | minetest-09ba047c0175adfaca4a6bccc41c8a0570c295db.tar.gz minetest-09ba047c0175adfaca4a6bccc41c8a0570c295db.tar.bz2 minetest-09ba047c0175adfaca4a6bccc41c8a0570c295db.zip |
Add setting for tooltips show delay.
-rw-r--r-- | minetest.conf.example | 2 | ||||
-rw-r--r-- | src/defaultsettings.cpp | 1 | ||||
-rw-r--r-- | src/guiFormSpecMenu.cpp | 4 | ||||
-rw-r--r-- | src/guiFormSpecMenu.h | 1 |
4 files changed, 7 insertions, 1 deletions
diff --git a/minetest.conf.example b/minetest.conf.example index 6d4186f83..a8d573d82 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -200,6 +200,8 @@ #repeat_rightclick_time = 0.25 # Make fog and sky colors depend on daytime (dawn/sunset) and view direction #directional_colored_fog = true +#tooltip_show_delay = 400 +# Delay showing tooltips, in miliseconds # Default timeout for cURL, in milliseconds # Only has an effect if compiled with cURL diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index d0e562866..cc6a0dd69 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -64,6 +64,7 @@ void set_default_settings(Settings *settings) settings->setDefault("doubletap_jump", "false"); settings->setDefault("always_fly_fast", "true"); settings->setDefault("directional_colored_fog", "true"); + settings->setDefault("tooltip_show_delay", "400"); // Some (temporary) keys for debugging settings->setDefault("keymap_print_debug_stacks", "KEY_KEY_P"); diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index 3ff0274f8..2f4c2f5f3 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -99,6 +99,8 @@ GUIFormSpecMenu::GUIFormSpecMenu(irr::IrrlichtDevice* dev, m_doubleclickdetect[0].pos = v2s32(0, 0); m_doubleclickdetect[1].pos = v2s32(0, 0); + m_tooltip_show_delay = (u32)g_settings->getS32("tooltip_show_delay"); + m_btn_height = g_settings->getS32("font_size") +2; assert(m_btn_height > 0); } @@ -2136,7 +2138,7 @@ void GUIFormSpecMenu::drawMenu() m_old_tooltip_id = id; } else if (id == m_old_tooltip_id) { u32 delta = porting::getDeltaMs(m_hoovered_time, getTimeMs()); - if (delta <= 400) + if (delta <= m_tooltip_show_delay) goto skip_tooltip; for(std::vector<FieldSpec>::iterator iter = m_fields.begin(); iter != m_fields.end(); iter++) { diff --git a/src/guiFormSpecMenu.h b/src/guiFormSpecMenu.h index da0826681..3368bb82d 100644 --- a/src/guiFormSpecMenu.h +++ b/src/guiFormSpecMenu.h @@ -315,6 +315,7 @@ protected: v2s32 m_pointer; gui::IGUIStaticText *m_tooltip_element; + u32 m_tooltip_show_delay; s32 m_hoovered_time; s32 m_old_tooltip_id; std::string m_old_tooltip; |