From 887a4d50d0c966af5f19e5ed2fe8b5556a6f818d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 28 Oct 2015 18:36:52 +0300 Subject: In npc skinned dialogs add support for hide text part from npc window. --- src/gui/windows/npcdialog.cpp | 53 +++++++++++++++++++++++++++++-------------- src/gui/windows/npcdialog.h | 1 + 2 files changed, 37 insertions(+), 17 deletions(-) (limited to 'src/gui') diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index bb6a84eb7..53f64f41c 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -136,7 +136,8 @@ NpcDialog::NpcDialog(const BeingId npcId) : mCameraX(0), mCameraY(0), mShowAvatar(false), - mLogInteraction(config.getBoolValue("logNpcInGui")) + mLogInteraction(config.getBoolValue("logNpcInGui")), + mHideText(false) { // Basic Window Setup setWindowName("NpcText"); @@ -828,22 +829,43 @@ void NpcDialog::placeMenuControls() void NpcDialog::placeSkinControls() { createSkinControls(); - if (mShowAvatar) + if (mHideText) { - place(0, 0, mPlayerBox); - place(1, 0, mScrollArea, 6, 3); - place(0, 3, mSkinScrollArea, 7, 3); - place(1, 6, mButton2, 2); - place(3, 6, mClearButton, 2); - place(5, 6, mButton, 2); + if (mShowAvatar) + { + place(0, 0, mPlayerBox); + place(1, 0, mSkinScrollArea, 7, 3); + place(1, 3, mButton2, 2); + place(3, 3, mClearButton, 2); + place(5, 3, mButton, 2); + } + else + { + place(0, 0, mSkinScrollArea, 6, 3); + place(0, 3, mButton2, 2); + place(2, 3, mClearButton, 2); + place(4, 3, mButton, 2); + } } else { - place(0, 0, mScrollArea, 6, 3); - place(0, 3, mSkinScrollArea, 6, 3); - place(0, 6, mButton2, 2); - place(2, 6, mClearButton, 2); - place(4, 6, mButton, 2); + if (mShowAvatar) + { + place(0, 0, mPlayerBox); + place(1, 0, mScrollArea, 6, 3); + place(0, 3, mSkinScrollArea, 7, 3); + place(1, 6, mButton2, 2); + place(3, 6, mClearButton, 2); + place(5, 6, mButton, 2); + } + else + { + place(0, 0, mScrollArea, 6, 3); + place(0, 3, mSkinScrollArea, 6, 3); + place(0, 6, mButton2, 2); + place(2, 6, mClearButton, 2); + place(4, 6, mButton, 2); + } } } @@ -1143,6 +1165,7 @@ void NpcDialog::createSkinControls() return; } + mHideText = dialog->hideText; FOR_EACH (std::vector::const_iterator, it, dialog->buttons) { const NpcButtonInfo *const info = *it; @@ -1158,10 +1181,6 @@ void NpcDialog::createSkinControls() button->loadImageSet(info->image); } mSkinContainer->add(button); - logger->log("test 1"); button->adjustSize(); - logger->log("test 2"); - button->setWidth(20); - button->setHeight(20); } } diff --git a/src/gui/windows/npcdialog.h b/src/gui/windows/npcdialog.h index 6c6ea7fba..445cb03ba 100644 --- a/src/gui/windows/npcdialog.h +++ b/src/gui/windows/npcdialog.h @@ -315,6 +315,7 @@ class NpcDialog final : public Window, int mCameraY; bool mShowAvatar; bool mLogInteraction; + bool mHideText; }; #endif // GUI_WINDOWS_NPCDIALOG_H -- cgit v1.2.3-70-g09d2