From 5b47e947e687105a4c17eb685da6d204823b66c5 Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Mon, 25 Jan 2016 21:52:27 +0300
Subject: In char creation dialog show race fields only if more than 1 races in
 configuration.

---
 src/gui/windows/charcreatedialog.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'src')

diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index 5c81c51eb..cce6b3d2a 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -192,7 +192,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
 
     mNameField->setMaximum(24);
 
-    if (serverFeatures->haveRaceSelection())
+    if (serverFeatures->haveRaceSelection() && mMinRace < mMaxRace)
     {
         // TRANSLATORS: char create dialog button
         mNextRaceButton = new Button(this, _(">"), "nextrace", this);
@@ -315,7 +315,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
         if (mLookNameLabel)
             mLookNameLabel->setPosition(nameX, y);  // 93
     }
-    if (serverFeatures->haveRaceSelection())
+    if (serverFeatures->haveRaceSelection() && mMinRace < mMaxRace)
     {
         y += 24;
         if (mPrevRaceButton)
@@ -355,7 +355,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
         add(mLookNameLabel);
     }
 
-    if (serverFeatures->haveRaceSelection())
+    if (serverFeatures->haveRaceSelection() && mMinRace < mMaxRace)
     {
         add(mNextRaceButton);
         add(mPrevRaceButton);
@@ -372,7 +372,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
     mNameField->requestFocus();
 
     updateHair();
-    if (serverFeatures->haveRaceSelection())
+    if (serverFeatures->haveRaceSelection() && mMinRace < mMaxRace)
         updateRace();
     if (serverFeatures->haveLookSelection() && mMinLook < mMaxLook)
         updateLook();
@@ -601,7 +601,7 @@ void CharCreateDialog::setAttributes(const StringVect &labels,
     int y = 89;
     if (serverFeatures->haveLookSelection() && mMinLook < mMaxLook)
         y += 29;
-    if (serverFeatures->haveRaceSelection())
+    if (serverFeatures->haveRaceSelection() && mMinRace < mMaxRace)
         y += 29;
 
     for (unsigned i = 0, sz = static_cast<unsigned>(labels.size());
-- 
cgit v1.2.3-70-g09d2