diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-16 17:55:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-16 17:55:30 +0300 |
commit | 7931a86899d1c4e93fcde4ed753f8a62f52575fe (patch) | |
tree | 0a81126d55b792a2eab83fd8d15077f6882991cf | |
parent | c79a9b4ffa2762be199b85a78cd798d4bccc9b1b (diff) | |
download | manaverse-7931a86899d1c4e93fcde4ed753f8a62f52575fe.tar.gz manaverse-7931a86899d1c4e93fcde4ed753f8a62f52575fe.tar.bz2 manaverse-7931a86899d1c4e93fcde4ed753f8a62f52575fe.tar.xz manaverse-7931a86899d1c4e93fcde4ed753f8a62f52575fe.zip |
Add server feature haveRaceSelection.
-rw-r--r-- | src/gui/windows/charcreatedialog.cpp | 9 | ||||
-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, 21 insertions, 4 deletions
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index 49eacd93e..650f58459 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -41,6 +41,7 @@ #include "gui/widgets/textfield.h" #include "net/net.h" +#include "net/serverfeatures.h" #include "resources/iteminfo.h" @@ -188,7 +189,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, mNameField->setMaximum(24); - if (serverVersion >= 2) + if (Net::getServerFeatures()->haveRaceSelection()) { // TRANSLATORS: char create dialog button mNextRaceButton = new Button(this, _(">"), "nextrace", this); @@ -263,7 +264,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, mLookLabel->setPosition(labelX, y); mLookNameLabel->setPosition(nameX, y); // 93 } - if (serverVersion >= 2) + if (Net::getServerFeatures()->haveRaceSelection()) { y += 24; mPrevRaceButton->setPosition(leftX, y); @@ -302,7 +303,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, add(mLookNameLabel); } - if (serverVersion >= 2) + if (Net::getServerFeatures()->haveRaceSelection()) { add(mNextRaceButton); add(mPrevRaceButton); @@ -323,7 +324,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, mNameField->requestFocus(); updateHair(); - if (serverVersion >= 2) + if (Net::getServerFeatures()->haveRaceSelection()) updateRace(); if (serverVersion >= 9 && mMinLook < mMaxLook) updateLook(); diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp index 2ee68f405..da2e9c945 100644 --- a/src/net/eathena/serverfeatures.cpp +++ b/src/net/eathena/serverfeatures.cpp @@ -77,4 +77,9 @@ bool ServerFeatures::haveIncompleteChatMessages() const return false; } +bool ServerFeatures::haveRaceSelection() const +{ + return false; +} + } // namespace EAthena diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h index 3aa99e40d..625655b3c 100644 --- a/src/net/eathena/serverfeatures.h +++ b/src/net/eathena/serverfeatures.h @@ -51,6 +51,8 @@ class ServerFeatures final : public Net::ServerFeatures bool haveNativeGuilds() const override final; bool haveIncompleteChatMessages() const override final; + + bool haveRaceSelection() const override final; }; } // namespace EAthena diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h index 8f5acb0c2..3f623f1c9 100644 --- a/src/net/serverfeatures.h +++ b/src/net/serverfeatures.h @@ -48,6 +48,8 @@ class ServerFeatures notfinal virtual bool haveNativeGuilds() const = 0; virtual bool haveIncompleteChatMessages() const = 0; + + virtual bool haveRaceSelection() const = 0; }; } // namespace Net diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp index 31b7a16ed..330dff083 100644 --- a/src/net/tmwa/serverfeatures.cpp +++ b/src/net/tmwa/serverfeatures.cpp @@ -79,4 +79,9 @@ bool ServerFeatures::haveIncompleteChatMessages() const return tmwServerVersion > 0; } +bool ServerFeatures::haveRaceSelection() const +{ + return serverVersion >= 2; +} + } // namespace TmwAthena diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h index 916fbf3db..740d73e5b 100644 --- a/src/net/tmwa/serverfeatures.h +++ b/src/net/tmwa/serverfeatures.h @@ -51,6 +51,8 @@ class ServerFeatures final : public Net::ServerFeatures bool haveNativeGuilds() const override final; bool haveIncompleteChatMessages() const override final; + + bool haveRaceSelection() const override final; }; } // namespace TmwAthena |