diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-10-30 23:57:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-10-30 23:57:54 +0300 |
commit | 382d24526919eafc08df19169046fdae190e10da (patch) | |
tree | 5eee2825a6a0dd282990c1a6a2f4a8e924c8083d /src/gui/windows/npcdialog.cpp | |
parent | be1962973deaa161491b6592cbf21eb3e6700cc9 (diff) | |
download | manaverse-382d24526919eafc08df19169046fdae190e10da.tar.gz manaverse-382d24526919eafc08df19169046fdae190e10da.tar.bz2 manaverse-382d24526919eafc08df19169046fdae190e10da.tar.xz manaverse-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.cpp | 62 |
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) |