aboutsummaryrefslogtreecommitdiff
path: root/src/guiFormSpecMenu.cpp
diff options
context:
space:
mode:
authorDTA7 <dta7e@t-online.de>2017-09-15 14:31:32 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-09-15 14:31:32 +0200
commit808ada11db2877576641380b9406756e347ce7f1 (patch)
tree5c3bc8463e5c169ce36f577e7effcdebd9c0dfca /src/guiFormSpecMenu.cpp
parent04839f233f37faa9af406ea66fc6c199127781eb (diff)
downloadminetest-808ada11db2877576641380b9406756e347ce7f1.tar.xz
Add setting to display the itemstring after the tooltip in the inventory. (#6413)
* Add setting to display the itemstring after the tooltip in the inventory.
Diffstat (limited to 'src/guiFormSpecMenu.cpp')
-rw-r--r--src/guiFormSpecMenu.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp
index 7b7bd7c29..ef2637400 100644
--- a/src/guiFormSpecMenu.cpp
+++ b/src/guiFormSpecMenu.cpp
@@ -112,6 +112,7 @@ GUIFormSpecMenu::GUIFormSpecMenu(JoystickController *joystick,
m_doubleclickdetect[1].pos = v2s32(0, 0);
m_tooltip_show_delay = (u32)g_settings->getS32("tooltip_show_delay");
+ m_tooltip_append_itemstring = g_settings->getBool("tooltip_append_itemstring");
}
GUIFormSpecMenu::~GUIFormSpecMenu()
@@ -2388,9 +2389,13 @@ void GUIFormSpecMenu::drawList(const ListDrawSpec &s, int phase,
utf8_to_wide(item.getDefinition(m_client->idef()).description);
else
tooltip_text = utf8_to_wide(desc);
- // Show itemstring as fallback for easier debugging
- if (!item.name.empty() && tooltip_text.empty())
- tooltip_text = utf8_to_wide(item.name);
+
+ if (!item.name.empty()) {
+ if (tooltip_text.empty())
+ tooltip_text = utf8_to_wide(item.name);
+ if (m_tooltip_append_itemstring)
+ tooltip_text += utf8_to_wide(" [" + item.name + "]");
+ }
}
if (!tooltip_text.empty()) {
showTooltip(tooltip_text, m_default_tooltip_color,