Show itemstring as tooltip if no item description
authorWuzzy <almikes@aol.com>
Fri, 24 Feb 2017 03:17:14 +0000 (04:17 +0100)
committerSmallJoker <mk939@ymail.com>
Sat, 18 Mar 2017 11:36:28 +0000 (12:36 +0100)
src/guiFormSpecMenu.cpp

index 19cac6241f3596e7b734ab9b91c921a66b253ebe..330124fe1aebf7441a9c6531fa7e2b6de27c1f9e 100644 (file)
@@ -2394,6 +2394,9 @@ 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 (tooltip_text != L"") {
                                std::vector<std::wstring> tt_rows = str_split(tooltip_text, L'\n');