summaryrefslogtreecommitdiff
path: root/src/gui/widgets/browserbox.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-27 02:05:28 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-27 02:05:28 +0300
commit6dd07b6697176da72ac8607897fca320d77142fd (patch)
treed9e1fea274e34f61568975a2026ad8cdc542d596 /src/gui/widgets/browserbox.cpp
parent0bf480113790977c33713b328b1754426af55fdc (diff)
downloadmv-6dd07b6697176da72ac8607897fca320d77142fd.tar.gz
mv-6dd07b6697176da72ac8607897fca320d77142fd.tar.bz2
mv-6dd07b6697176da72ac8607897fca320d77142fd.tar.xz
mv-6dd07b6697176da72ac8607897fca320d77142fd.zip
Add support for links to mercenaries.
Format is: @@MID|@@ Example: [@@M1191|@@]
Diffstat (limited to 'src/gui/widgets/browserbox.cpp')
-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 182f10507..94758e78f 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -46,6 +46,7 @@
#include "resources/db/homunculusdb.h"
#include "resources/db/itemdb.h"
+#include "resources/db/mercenarydb.h"
#include "resources/db/monsterdb.h"
#include "resources/db/petdb.h"
#endif // DYECMD
@@ -279,6 +280,14 @@ void BrowserBox::addRow(const std::string &row, const bool atTop)
if (info)
bLink.caption = info->getName();
}
+ else if (!link.empty() && link[0] == 'M')
+ { // homunculus link
+ const BeingTypeId id = static_cast<BeingTypeId>(
+ atoi(bLink.link.substr(1).c_str()));
+ BeingInfo *info = MercenaryDB::get(id);
+ if (info)
+ bLink.caption = info->getName();
+ }
else
{ // item link
size_t idx = bLink.link.find(",");