From ed17aa400a745a81940020e024a3944671a47281 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 28 Oct 2015 21:02:57 +0300 Subject: Add text object to skined npc menus. --- src/gui/windows/npcdialog.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/gui/windows/npcdialog.cpp') diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index 9d96336b1..f5639acd8 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -1173,7 +1173,31 @@ void NpcDialog::createSkinControls() mSkinContainer->add(icon); } } - + FOR_EACH (std::vector::const_iterator, it, dialog->texts) + { + const NpcTextInfo *const info = *it; + BrowserBox *box = new BrowserBox(this, + BrowserBox::AUTO_WRAP, + true, + "browserbox.xml"); + box->setOpaque(false); + box->setMaxRow(config.getIntValue("ChatLogLength")); + box->setLinkHandler(mItemLinkHandler); + box->setProcessVars(true); + box->setFont(gui->getNpcFont()); + box->setEnableKeys(true); + box->setEnableTabs(true); + box->setPosition(info->x, info->y); + mSkinContainer->add(box); + box->setWidth(info->width); + box->setHeight(info->height); + StringVect parts; + splitToStringVector(parts, info->text, '\n'); + FOR_EACH (StringVectCIter, it2, parts) + { + box->addRow(*it2); + } + } FOR_EACH (std::vector::const_iterator, it, dialog->buttons) { const NpcButtonInfo *const info = *it; -- cgit v1.2.3-60-g2f50