diff options
Diffstat (limited to 'src/gui/widgets/browserbox.cpp')
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index f21a4e16..64b494db 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -28,6 +28,8 @@ #include "gui/truetypefont.h" #include "gui/widgets/linkhandler.h" +#include "resources/itemdb.h" +#include "resources/iteminfo.h" #include "resources/theme.h" #include <guichan/graphics.hpp> @@ -96,6 +98,15 @@ void BrowserBox::addRow(const std::string &row) link.link = tmp.substr(idx1 + 2, idx2 - (idx1 + 2)); link.caption = tmp.substr(idx2 + 1, idx3 - (idx2 + 1)); + if (link.caption.empty()) + { + const int id = atoi(link.link.c_str()); + if (id) + link.caption = itemDb->get(id).getName(); + else + link.caption = link.link; + } + newRow.text += tmp.substr(0, idx1); newRow.text += "##<" + link.caption; |