1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 16:45:20 +02:00

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.
This commit is contained in:
DTA7
2017-09-15 14:31:32 +02:00
committed by Loïc Blot
parent 04839f233f
commit 808ada11db
4 changed files with 13 additions and 12 deletions

View File

@@ -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,