summaryrefslogtreecommitdiff
path: root/src/gui/windows/npcdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-30 23:57:54 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-30 23:57:54 +0300
commit382d24526919eafc08df19169046fdae190e10da (patch)
tree5eee2825a6a0dd282990c1a6a2f4a8e924c8083d /src/gui/windows/npcdialog.cpp
parentbe1962973deaa161491b6592cbf21eb3e6700cc9 (diff)
downloadmanaplus-382d24526919eafc08df19169046fdae190e10da.tar.gz
manaplus-382d24526919eafc08df19169046fdae190e10da.tar.bz2
manaplus-382d24526919eafc08df19169046fdae190e10da.tar.xz
manaplus-382d24526919eafc08df19169046fdae190e10da.zip
Add support for npc dialog inventory theming from npc skin.
Diffstat (limited to 'src/gui/windows/npcdialog.cpp')
-rw-r--r--src/gui/windows/npcdialog.cpp62
1 files changed, 46 insertions, 16 deletions
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index de74037f8..406e90c1a 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -139,8 +139,7 @@ NpcDialog::NpcDialog(const BeingId npcId) :
mCameraX(0),
mCameraY(0),
mShowAvatar(false),
- mLogInteraction(config.getBoolValue("logNpcInGui")),
- mHideText(false)
+ mLogInteraction(config.getBoolValue("logNpcInGui"))
{
// Basic Window Setup
setWindowName("NpcText");
@@ -816,7 +815,7 @@ void NpcDialog::placeMenuControls()
void NpcDialog::placeSkinControls()
{
createSkinControls();
- if (mHideText)
+ if (mDialogInfo && mDialogInfo->hideText)
{
if (mShowAvatar)
{
@@ -896,22 +895,54 @@ void NpcDialog::placeIntInputControls()
void NpcDialog::placeItemInputControls()
{
- if (mShowAvatar)
+ if (mDialogInfo)
{
- place(0, 0, mPlayerBox);
- place(1, 0, mScrollArea, 6, 3);
- place(0, 3, mItemScrollArea, 7, 3);
- place(1, 6, mButton3, 2);
- place(3, 6, mClearButton, 2);
- place(5, 6, mButton, 2);
+ mItemContainer->setCellBackgroundImage(mDialogInfo->inventory.cell);
+ mItemContainer->setMaxColumns(mDialogInfo->inventory.columns);
}
else
{
- place(0, 0, mScrollArea, 6, 3);
- place(0, 3, mItemScrollArea, 6, 3);
- place(0, 6, mButton3, 2);
- place(2, 6, mClearButton, 2);
- place(4, 6, mButton, 2);
+ mItemContainer->setCellBackgroundImage("inventory_cell.xml");
+ mItemContainer->setMaxColumns(10000);
+ }
+
+ if (mDialogInfo && mDialogInfo->hideText)
+ {
+ if (mShowAvatar)
+ {
+ place(0, 0, mPlayerBox);
+ place(1, 0, mItemScrollArea, 7, 3);
+ place(1, 3, mButton3, 2);
+ place(3, 3, mClearButton, 2);
+ place(5, 3, mButton, 2);
+ }
+ else
+ {
+ place(0, 0, mItemScrollArea, 6, 3);
+ place(0, 3, mButton3, 2);
+ place(2, 3, mClearButton, 2);
+ place(4, 3, mButton, 2);
+ }
+ }
+ else
+ {
+ if (mShowAvatar)
+ {
+ place(0, 0, mPlayerBox);
+ place(1, 0, mScrollArea, 6, 3);
+ place(0, 3, mItemScrollArea, 7, 3);
+ place(1, 6, mButton3, 2);
+ place(3, 6, mClearButton, 2);
+ place(5, 6, mButton, 2);
+ }
+ else
+ {
+ place(0, 0, mScrollArea, 6, 3);
+ place(0, 3, mItemScrollArea, 6, 3);
+ place(0, 6, mButton3, 2);
+ place(2, 6, mClearButton, 2);
+ place(4, 6, mButton, 2);
+ }
}
}
@@ -1153,7 +1184,6 @@ void NpcDialog::createSkinControls()
if (!mDialogInfo)
return;
- mHideText = mDialogInfo->hideText;
FOR_EACH (std::vector<NpcImageInfo*>::const_iterator,
it,
mDialogInfo->menu.images)