diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-16 20:45:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-16 20:45:24 +0300 |
commit | e873e33f470ef65375a64652bc4d4dbbb0297172 (patch) | |
tree | 8dbf9dbb52ceebf3739c08516e8a0789f909c6a4 | |
parent | 2ff3df08fa993d1bf1f00f47f7cbad7b60ce3ce3 (diff) | |
download | mv-e873e33f470ef65375a64652bc4d4dbbb0297172.tar.gz mv-e873e33f470ef65375a64652bc4d4dbbb0297172.tar.bz2 mv-e873e33f470ef65375a64652bc4d4dbbb0297172.tar.xz mv-e873e33f470ef65375a64652bc4d4dbbb0297172.zip |
Add server feature haveOtherGender.
-rw-r--r-- | src/gui/windows/registerdialog.cpp | 3 | ||||
-rw-r--r-- | src/net/eathena/serverfeatures.cpp | 5 | ||||
-rw-r--r-- | src/net/eathena/serverfeatures.h | 2 | ||||
-rw-r--r-- | src/net/serverfeatures.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/serverfeatures.cpp | 5 | ||||
-rw-r--r-- | src/net/tmwa/serverfeatures.h | 2 |
6 files changed, 18 insertions, 1 deletions
diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp index 6ac30634b..7253c3630 100644 --- a/src/gui/windows/registerdialog.cpp +++ b/src/gui/windows/registerdialog.cpp @@ -45,6 +45,7 @@ #include "net/loginhandler.h" #include "net/net.h" #include "net/registrationoptions.h" +#include "net/serverfeatures.h" #include "utils/delete2.h" #include "utils/gettext.h" @@ -100,7 +101,7 @@ RegisterDialog::RegisterDialog(LoginData *const data) : mMaleButton = new RadioButton(this, _("Male"), "sex", true); // TRANSLATORS: register dialog. button. mFemaleButton = new RadioButton(this, _("Female"), "sex", false); - if (serverVersion >= 5) + if (Net::getServerFeatures()->haveOtherGender()) { // TRANSLATORS: register dialog. button. mOtherButton = new RadioButton(this, _("Other"), "sex", false); diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp index 807c2292b..9d6824ba2 100644 --- a/src/net/eathena/serverfeatures.cpp +++ b/src/net/eathena/serverfeatures.cpp @@ -107,4 +107,9 @@ bool ServerFeatures::haveItemColors() const return false; } +bool ServerFeatures::haveOtherGender() const +{ + return false; +} + } // namespace EAthena diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h index 36bd1bc4b..036d3be4b 100644 --- a/src/net/eathena/serverfeatures.h +++ b/src/net/eathena/serverfeatures.h @@ -63,6 +63,8 @@ class ServerFeatures final : public Net::ServerFeatures bool haveMove3() const override final; bool haveItemColors() const override final; + + bool haveOtherGender() const override final; }; } // namespace EAthena diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h index b25c98573..dcd777a03 100644 --- a/src/net/serverfeatures.h +++ b/src/net/serverfeatures.h @@ -60,6 +60,8 @@ class ServerFeatures notfinal virtual bool haveMove3() const = 0; virtual bool haveItemColors() const = 0; + + virtual bool haveOtherGender() const = 0; }; } // namespace Net diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp index 07b567b72..e7d35b666 100644 --- a/src/net/tmwa/serverfeatures.cpp +++ b/src/net/tmwa/serverfeatures.cpp @@ -109,4 +109,9 @@ bool ServerFeatures::haveItemColors() const return serverVersion >= 1; } +bool ServerFeatures::haveOtherGender() const +{ + return serverVersion >= 5; +} + } // namespace TmwAthena diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h index 4307dc002..2af67f255 100644 --- a/src/net/tmwa/serverfeatures.h +++ b/src/net/tmwa/serverfeatures.h @@ -63,6 +63,8 @@ class ServerFeatures final : public Net::ServerFeatures bool haveMove3() const override final; bool haveItemColors() const override final; + + bool haveOtherGender() const override final; }; } // namespace TmwAthena |