summaryrefslogtreecommitdiff
path: root/src/gui/windows/npcdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-28 18:18:13 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-28 18:18:13 +0300
commit8cd16a9a9ca605137276379361b0328af736c2cc (patch)
tree5a0c52367d604c42e0bcd7bdf26665900b179166 /src/gui/windows/npcdialog.cpp
parent0cdc936ea83fe265fb6bd1d128b10ff6b53e6254 (diff)
downloadplus-8cd16a9a9ca605137276379361b0328af736c2cc.tar.gz
plus-8cd16a9a9ca605137276379361b0328af736c2cc.tar.bz2
plus-8cd16a9a9ca605137276379361b0328af736c2cc.tar.xz
plus-8cd16a9a9ca605137276379361b0328af736c2cc.zip
Add support for add images into buttons in skinned npc dialogs.
Diffstat (limited to 'src/gui/windows/npcdialog.cpp')
-rw-r--r--src/gui/windows/npcdialog.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index 8e9ef526a..bb6a84eb7 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -1146,12 +1146,22 @@ void NpcDialog::createSkinControls()
FOR_EACH (std::vector<NpcButtonInfo*>::const_iterator, it, dialog->buttons)
{
const NpcButtonInfo *const info = *it;
- Button *const button = new Button(this,
- info->name,
- "skin_" + info->value,
- this);
-
+ Button *const button = new Button(this);
+ button->setCaption(info->name);
+ button->setActionEventId("skin_" + info->value);
+ button->addActionListener(this);
button->setPosition(info->x, info->y);
+ if (!info->image.empty())
+ {
+ button->setImageWidth(info->imageWidth);
+ button->setImageHeight(info->imageHeight);
+ button->loadImageSet(info->image);
+ }
mSkinContainer->add(button);
+ logger->log("test 1");
+ button->adjustSize();
+ logger->log("test 2");
+ button->setWidth(20);
+ button->setHeight(20);
}
}