summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-27 01:54:55 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-27 01:54:55 +0300
commit0bf480113790977c33713b328b1754426af55fdc (patch)
treeb2222965ef752a310045de3831b428b6f0ea74cf /src/gui
parent56c7637441038c646084a7d0d07be8e93008d37a (diff)
downloadplus-0bf480113790977c33713b328b1754426af55fdc.tar.gz
plus-0bf480113790977c33713b328b1754426af55fdc.tar.bz2
plus-0bf480113790977c33713b328b1754426af55fdc.tar.xz
plus-0bf480113790977c33713b328b1754426af55fdc.zip
Add support for links to homunculuses.
Format is: @@hID|@@ Example: [@@h6001|@@]
Diffstat (limited to 'src/gui')
-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 16484bf87..182f10507 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -44,6 +44,7 @@
#include "resources/beinginfo.h"
#include "resources/iteminfo.h"
+#include "resources/db/homunculusdb.h"
#include "resources/db/itemdb.h"
#include "resources/db/monsterdb.h"
#include "resources/db/petdb.h"
@@ -270,6 +271,14 @@ void BrowserBox::addRow(const std::string &row, const bool atTop)
if (info)
bLink.caption = info->getName();
}
+ else if (!link.empty() && link[0] == 'h')
+ { // homunculus link
+ const BeingTypeId id = static_cast<BeingTypeId>(
+ atoi(bLink.link.substr(1).c_str()));
+ BeingInfo *info = HomunculusDB::get(id);
+ if (info)
+ bLink.caption = info->getName();
+ }
else
{ // item link
size_t idx = bLink.link.find(",");