summaryrefslogtreecommitdiff
path: root/src/resources/db/npcdialogdb.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/resources/db/npcdialogdb.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/resources/db/npcdialogdb.cpp')
-rw-r--r--src/resources/db/npcdialogdb.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/resources/db/npcdialogdb.cpp b/src/resources/db/npcdialogdb.cpp
index 628ee233e..cf334a601 100644
--- a/src/resources/db/npcdialogdb.cpp
+++ b/src/resources/db/npcdialogdb.cpp
@@ -56,9 +56,6 @@ static void loadNpcDialog(NpcDialogInfo *const dialog,
if (xmlNameEqual(childNode, "button"))
{
const std::string name = XML::getProperty(childNode, "name", "");
- if (name.empty())
- continue;
-
const std::string value = XML::getProperty(childNode, "value", "");
if (value.empty())
continue;
@@ -70,6 +67,17 @@ static void loadNpcDialog(NpcDialogInfo *const dialog,
childNode, "y", 0, 0, 10000);
button->name = name;
button->value = value;
+ button->image = XML::getProperty(childNode, "image", "");
+ if (button->name.empty() && button->image.empty())
+ {
+ logger->log("Error: npc button without name or image");
+ delete button;
+ continue;
+ }
+ button->imageWidth = XML::getIntProperty(
+ childNode, "imageWidth", 16, 1, 1000);
+ button->imageHeight = XML::getIntProperty(
+ childNode, "imageHeight", 16, 1, 1000);
dialog->buttons.push_back(button);
}
}