summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-27 01:40:41 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-27 01:40:41 +0300
commit56c7637441038c646084a7d0d07be8e93008d37a (patch)
tree0ddd0f72e19a3a4c6699e0b9300fa414bd923e9b /src/gui/widgets
parent5f5cba799299df65d74a99e7d37800b90c91b538 (diff)
downloadmv-56c7637441038c646084a7d0d07be8e93008d37a.tar.gz
mv-56c7637441038c646084a7d0d07be8e93008d37a.tar.bz2
mv-56c7637441038c646084a7d0d07be8e93008d37a.tar.xz
mv-56c7637441038c646084a7d0d07be8e93008d37a.zip
Add support for links to pets.
Format is: @@pID|@@ Example: [@@p1002|@@]
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/browserbox.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 098ee0d64..16484bf87 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -46,6 +46,7 @@
#include "resources/db/itemdb.h"
#include "resources/db/monsterdb.h"
+#include "resources/db/petdb.h"
#endif // DYECMD
#include "resources/imageset.h"
@@ -261,6 +262,14 @@ void BrowserBox::addRow(const std::string &row, const bool atTop)
if (info)
bLink.caption = info->getName();
}
+ else if (!link.empty() && link[0] == 'p')
+ { // pet link
+ const BeingTypeId id = static_cast<BeingTypeId>(
+ atoi(bLink.link.substr(1).c_str()));
+ BeingInfo *info = PETDB::get(id);
+ if (info)
+ bLink.caption = info->getName();
+ }
else
{ // item link
size_t idx = bLink.link.find(",");