summaryrefslogtreecommitdiff
path: root/src/gui/windows
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
parentbe1962973deaa161491b6592cbf21eb3e6700cc9 (diff)
downloadplus-382d24526919eafc08df19169046fdae190e10da.tar.gz
plus-382d24526919eafc08df19169046fdae190e10da.tar.bz2
plus-382d24526919eafc08df19169046fdae190e10da.tar.xz
plus-382d24526919eafc08df19169046fdae190e10da.zip
Add support for npc dialog inventory theming from npc skin.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/npcdialog.cpp62
-rw-r--r--src/gui/windows/npcdialog.h1
2 files changed, 46 insertions, 17 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)
diff --git a/src/gui/windows/npcdialog.h b/src/gui/windows/npcdialog.h
index 997f97e8a..ffe021bc6 100644
--- a/src/gui/windows/npcdialog.h
+++ b/src/gui/windows/npcdialog.h
@@ -318,7 +318,6 @@ class NpcDialog final : public Window,
int mCameraY;
bool mShowAvatar;
bool mLogInteraction;
- bool mHideText;
};
#endif // GUI_WINDOWS_NPCDIALOG_H