From 540ddb5411378d5e60c942cda230ddf186bdfbc6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 Nov 2015 19:36:56 +0300 Subject: Fix attibutes left label in char create dialog. --- src/gui/windows/charcreatedialog.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/gui/windows/charcreatedialog.cpp') diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index d51c8158e..bb55e06ce 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -559,7 +559,12 @@ void CharCreateDialog::setAttributes(const StringVect &labels, const int w = 480; int h = 350; - int y = 118 + 29; + int y = 89; + if (serverFeatures->haveLookSelection() && mMinLook < mMaxLook) + y += 29; + if (serverFeatures->haveRaceSelection()) + y += 29; + for (unsigned i = 0, sz = static_cast(labels.size()); i < sz; i++) { @@ -589,7 +594,8 @@ void CharCreateDialog::setAttributes(const StringVect &labels, } else { - h = 290 + mAttributesLeft->getHeight() + getPadding(); + h = y + labels.size() * 24 + + mAttributesLeft->getHeight() + getPadding(); } if (serverFeatures->haveCreateCharGender() && y < 160) { @@ -598,7 +604,6 @@ void CharCreateDialog::setAttributes(const StringVect &labels, } if (h < mMaxY) h = mMaxY; - h += mCreateButton->getHeight(); setContentSize(w, h); @@ -723,6 +728,7 @@ void CharCreateDialog::keyPressed(KeyEvent &event) void CharCreateDialog::setButtonsPosition(const int w, const int h) { + const int h2 = h - 5 - mCancelButton->getHeight(); if (mainGraphics->getHeight() < 480) { if (mMaxPoints) @@ -744,10 +750,10 @@ void CharCreateDialog::setButtonsPosition(const int w, const int h) { mCancelButton->setPosition( w / 2, - h - 5 - mCancelButton->getHeight()); + h2); mCreateButton->setPosition( mCancelButton->getX() - 5 - mCreateButton->getWidth(), - h - 5 - mCancelButton->getHeight()); + h2); } - mAttributesLeft->setPosition(15, 260 + 29); + mAttributesLeft->setPosition(15, h2 - mAttributesLeft->getHeight()); } -- cgit v1.2.3-60-g2f50