diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-11-14 00:23:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-11-14 00:34:05 +0300 |
commit | d6c647ca7f46a517b200f2901eba319e7e4223e8 (patch) | |
tree | 1cf66e73804e65753bd66ea49f6eaab114414a04 /src/gui/windows/charcreatedialog.cpp | |
parent | 35b27514c8eede4daa8f07f7b44d9579c78d18cf (diff) | |
download | mv-d6c647ca7f46a517b200f2901eba319e7e4223e8.tar.gz mv-d6c647ca7f46a517b200f2901eba319e7e4223e8.tar.bz2 mv-d6c647ca7f46a517b200f2901eba319e7e4223e8.tar.xz mv-d6c647ca7f46a517b200f2901eba319e7e4223e8.zip |
Add features.xml attribute for force char gender for new chars.
New attribute: forceCharGender
Default value: -1 (mean not forcing)
Diffstat (limited to 'src/gui/windows/charcreatedialog.cpp')
-rw-r--r-- | src/gui/windows/charcreatedialog.cpp | 56 |
1 files changed, 35 insertions, 21 deletions
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index 39618917e..58363cb76 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -215,28 +215,37 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, if (serverFeatures->haveCreateCharGender()) { - const int size = config.getIntValue("fontSize"); - mGenderStrip = new TabStrip(this, - "gender_" + getWindowName(), - size + 16); - mGenderStrip->setPressFirst(false); - mGenderStrip->addActionListener(this); - mGenderStrip->setActionEventId("gender_"); - // TRANSLATORS: one char size female character gender - mGenderStrip->addButton(_("F"), "f", false); - // TRANSLATORS: one char size male character gender - mGenderStrip->addButton(_("M"), "m", false); - if (features.getIntValue("forceAccountGender") == -1) + const int forceGender = features.getIntValue("forceCharGender"); + if (forceGender == -1) { - // TRANSLATORS: one char size unknown character gender - mGenderStrip->addButton(_("U"), "u", true); - } - mGenderStrip->setVisible(Visible_true); - add(mGenderStrip); + const int size = config.getIntValue("fontSize"); + mGenderStrip = new TabStrip(this, + "gender_" + getWindowName(), + size + 16); + mGenderStrip->setPressFirst(false); + mGenderStrip->addActionListener(this); + mGenderStrip->setActionEventId("gender_"); + // TRANSLATORS: one char size female character gender + mGenderStrip->addButton(_("F"), "f", false); + // TRANSLATORS: one char size male character gender + mGenderStrip->addButton(_("M"), "m", false); + if (features.getIntValue("forceAccountGender") == -1) + { + // TRANSLATORS: one char size unknown character gender + mGenderStrip->addButton(_("U"), "u", true); + } + mGenderStrip->setVisible(Visible_true); + add(mGenderStrip); - mGenderStrip->setPosition(385, 130); - mGenderStrip->setWidth(500); - mGenderStrip->setHeight(50); + mGenderStrip->setPosition(385, 130); + mGenderStrip->setWidth(500); + mGenderStrip->setHeight(50); + } + else + { + mGender = Being::intToGender(forceGender); + mPlayer->setGender(mGender); + } } mPlayerBox->setWidth(74); @@ -600,7 +609,9 @@ void CharCreateDialog::setAttributes(const StringVect &labels, h = y + labels.size() * 24 + mAttributesLeft->getHeight() + getPadding(); } - if (serverFeatures->haveCreateCharGender() && y < 160) + if (serverFeatures->haveCreateCharGender() && + features.getIntValue("forceCharGender") == -1 && + y < 160) { if (h < 160) h = 160; @@ -615,6 +626,9 @@ void CharCreateDialog::setAttributes(const StringVect &labels, void CharCreateDialog::setDefaultGender(const GenderT gender) { + if (features.getIntValue("forceCharGender") != -1) + return; + mDefaultGender = gender; mPlayer->setGender(gender); } |