diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-11-13 23:36:31 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-11-14 00:34:05 +0300 |
commit | 35b27514c8eede4daa8f07f7b44d9579c78d18cf (patch) | |
tree | 6202acddb70586efd064c51c9f98e9f3530c5e8b | |
parent | cd7e273322d9648be6c005fd2930a6037149a357 (diff) | |
download | plus-35b27514c8eede4daa8f07f7b44d9579c78d18cf.tar.gz plus-35b27514c8eede4daa8f07f7b44d9579c78d18cf.tar.bz2 plus-35b27514c8eede4daa8f07f7b44d9579c78d18cf.tar.xz plus-35b27514c8eede4daa8f07f7b44d9579c78d18cf.zip |
Add features.xml attribute for force account gender for new chars.
New attribute: forceAccountGender
Default value: -1 (mean not forcing)
-rw-r--r-- | src/defaults.cpp | 1 | ||||
-rw-r--r-- | src/gui/windows/charcreatedialog.cpp | 7 | ||||
-rw-r--r-- | src/gui/windows/registerdialog.cpp | 24 |
3 files changed, 23 insertions, 9 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp index 0c11be8ac..a424137c0 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -632,6 +632,7 @@ DefaultsData* getFeaturesDefaults() AddDEF("languageTab", false); AddDEF("allowFollow", true); AddDEF("fixDeadAnimation", true); + AddDEF("forceAccountGender", -1); return configData; } diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index bb55e06ce..39618917e 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -226,8 +226,11 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, mGenderStrip->addButton(_("F"), "f", false); // TRANSLATORS: one char size male character gender mGenderStrip->addButton(_("M"), "m", false); - // TRANSLATORS: one char size unknown character gender - mGenderStrip->addButton(_("U"), "u", true); + if (features.getIntValue("forceAccountGender") == -1) + { + // TRANSLATORS: one char size unknown character gender + mGenderStrip->addButton(_("U"), "u", true); + } mGenderStrip->setVisible(Visible_true); add(mGenderStrip); diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp index d3deaeb5e..b4f9d8868 100644 --- a/src/gui/windows/registerdialog.cpp +++ b/src/gui/windows/registerdialog.cpp @@ -23,6 +23,9 @@ #include "gui/windows/registerdialog.h" #include "client.h" +#include "configuration.h" + +#include "being/being.h" #include "gui/windows/okdialog.h" @@ -85,8 +88,7 @@ RegisterDialog::RegisterDialog(LoginData &data) : int row = 3; - // for future usage flag - if (true) + if (features.getIntValue("forceAccountGender") == -1) { // TRANSLATORS: register dialog. button. mMaleButton = new RadioButton(this, _("Male"), "sex", true); @@ -265,12 +267,20 @@ void RegisterDialog::action(const ActionEvent &event) mRegisterButton->setEnabled(false); mLoginData->username = mUserField->getText(); mLoginData->password = mPasswordField->getText(); - if (mFemaleButton && mFemaleButton->isSelected()) - mLoginData->gender = Gender::FEMALE; - else if (mOtherButton && mOtherButton->isSelected()) - mLoginData->gender = Gender::OTHER; + if (features.getIntValue("forceAccountGender") == -1) + { + if (mFemaleButton && mFemaleButton->isSelected()) + mLoginData->gender = Gender::FEMALE; + else if (mOtherButton && mOtherButton->isSelected()) + mLoginData->gender = Gender::OTHER; + else + mLoginData->gender = Gender::MALE; + } else - mLoginData->gender = Gender::MALE; + { + mLoginData->gender = Being::intToGender( + features.getIntValue("forceAccountGender")); + } if (mEmailField) mLoginData->email = mEmailField->getText(); |