diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-05-19 02:24:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-05-19 02:24:20 +0300 |
commit | 886522371299b45254b7dc72e6de3070703d7c10 (patch) | |
tree | 738745eab76eb5f55a9adc08bfac10077b07efac /src/gui | |
parent | 7cd309e7c9e0200cedb45edfeeba5a601d3fb446 (diff) | |
download | manaplus-886522371299b45254b7dc72e6de3070703d7c10.tar.gz manaplus-886522371299b45254b7dc72e6de3070703d7c10.tar.bz2 manaplus-886522371299b45254b7dc72e6de3070703d7c10.tar.xz manaplus-886522371299b45254b7dc72e6de3070703d7c10.zip |
Enable server type selection again. Add evol server type. Now working same as tmweathena.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/serverdialog.cpp | 43 | ||||
-rw-r--r-- | src/gui/skilldialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/viewport.cpp | 2 |
3 files changed, 32 insertions, 15 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index ca5711104..fca10c3c8 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -63,6 +63,8 @@ static std::string serverTypeToString(ServerInfo::Type type) { case ServerInfo::TMWATHENA: return "TmwAthena"; + case ServerInfo::EVOL: + return "Evol"; #ifdef MANASERV_SUPPORT case ServerInfo::MANASERV: return "ManaServ"; @@ -82,6 +84,7 @@ static unsigned short defaultPortForServerType(ServerInfo::Type type) default: case ServerInfo::UNKNOWN: case ServerInfo::TMWATHENA: + case ServerInfo::EVOL: #ifdef MANASERV_SUPPORT return 6901; case ServerInfo::MANASERV: @@ -134,8 +137,10 @@ std::string TypeListModel::getElementAt(int elementIndex) { if (elementIndex == 0) return "TmwAthena"; -#ifdef MANASERV_SUPPORT else if (elementIndex == 1) + return "Evol"; +#ifdef MANASERV_SUPPORT + else if (elementIndex == 2) return "ManaServ"; #endif else @@ -251,18 +256,26 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir): ScrollArea *usedScroll = new ScrollArea(mServersList); usedScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); -#ifdef MANASERV_SUPPORT Label *typeLabel = new Label(_("Server type:")); mTypeListModel = new TypeListModel(); mTypeField = new DropDown(mTypeListModel); - mTypeField->setSelected((serverInfo->type == ServerInfo::MANASERV) ? - 1 : 0); - int n = 1; -#else - mTypeListModel = 0; - mTypeField = 0; - int n = 0; + switch (serverInfo->type) + { + case ServerInfo::MANASERV: +#ifdef MANASERV_SUPPORT + mTypeField->setSelected(2); + break; #endif + default: + case ServerInfo::UNKNOWN: + case ServerInfo::TMWATHENA: + mTypeField->setSelected(0); + break; + case ServerInfo::EVOL: + mTypeField->setSelected(1); + break; + } + int n = 1; mDescription = new Label(std::string()); @@ -285,10 +298,8 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir): place(1, 0, mServerNameField, 5).setPadding(3); place(0, 1, portLabel); place(1, 1, mPortField, 5).setPadding(3); -#ifdef MANASERV_SUPPORT place(0, 2, typeLabel); place(1, 2, mTypeField, 5).setPadding(3); -#endif place(0, 2 + n, usedScroll, 6, 5).setPadding(3); place(0, 7 + n, mDescription, 6); place(0, 8 + n, mPersistentIPCheckBox, 6); @@ -399,8 +410,11 @@ void ServerDialog::action(const gcn::ActionEvent &event) case 0: mServerInfo->type = ServerInfo::TMWATHENA; break; -#ifdef MANASERV_SUPPORT case 1: + mServerInfo->type = ServerInfo::EVOL; + break; +#ifdef MANASERV_SUPPORT + case 2: mServerInfo->type = ServerInfo::MANASERV; break; #endif @@ -491,7 +505,7 @@ void ServerDialog::valueChanged(const gcn::SelectionEvent &) mTypeField->setSelected(0); break; case ServerInfo::MANASERV: - mTypeField->setSelected(1); + mTypeField->setSelected(2); break; #else case ServerInfo::MANASERV: @@ -499,6 +513,9 @@ void ServerDialog::valueChanged(const gcn::SelectionEvent &) mTypeField->setSelected(0); break; #endif + case ServerInfo::EVOL: + mTypeField->setSelected(1); + break; } } setFieldsReadOnly(true); diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index fe2325ab8..a58a3e169 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -335,7 +335,7 @@ void SkillDialog::loadSkills(const std::string &file) { logger->log("Error loading skills file: %s", file.c_str()); - if (Net::getNetworkType() == ServerInfo::TMWATHENA) + if (Net::getNetworkType() != ServerInfo::MANASERV) { SkillModel *model = new SkillModel(); if (!mDefaultModel) diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 1298a9744..e399d96ce 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -337,7 +337,7 @@ void Viewport::_drawPath(Graphics *graphics, const Path &path, graphics->setColor(color); #ifdef MANASERV_SUPPORT - if (Net::getNetworkType() == ServerInfo::TMWATHENA) + if (Net::getNetworkType() != ServerInfo::MANASERV) #endif { for (Path::const_iterator i = path.begin(); i != path.end(); ++i) |