diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-14 16:51:36 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-14 16:51:36 +0300 |
commit | da98d12637db106b87341560cc72ca6207b2d12f (patch) | |
tree | c79f1c3389f38ec878fc2dfc4729839242e2e81c /src/gui | |
parent | 8a616021cbefff5f62b0ca55cf535130c8c1b5f0 (diff) | |
download | manaplus-da98d12637db106b87341560cc72ca6207b2d12f.tar.gz manaplus-da98d12637db106b87341560cc72ca6207b2d12f.tar.bz2 manaplus-da98d12637db106b87341560cc72ca6207b2d12f.tar.xz manaplus-da98d12637db106b87341560cc72ca6207b2d12f.zip |
Add configure and cmake option to enable/disable compilation for tmwa/evol.
Tmwa/evol by default enabled.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/models/typelistmodel.h | 13 | ||||
-rw-r--r-- | src/gui/windows/editserverdialog.cpp | 25 | ||||
-rw-r--r-- | src/gui/windows/serverdialog.cpp | 8 |
3 files changed, 39 insertions, 7 deletions
diff --git a/src/gui/models/typelistmodel.h b/src/gui/models/typelistmodel.h index 2db290e70..bd27fce39 100644 --- a/src/gui/models/typelistmodel.h +++ b/src/gui/models/typelistmodel.h @@ -37,8 +37,10 @@ class TypeListModel final : public ListModel * Used to get number of line in the list */ int getNumberOfElements() override final A_WARN_UNUSED -#ifdef EATHENA_SUPPORT +#if defined(EATHENA_SUPPORT) && defined(TMWA_SUPPORT) { return 3; } +#elif defined(EATHENA_SUPPORT) + { return 1; } #else { return 2; } #endif @@ -49,6 +51,7 @@ class TypeListModel final : public ListModel std::string getElementAt(int elementIndex) override final A_WARN_UNUSED { +#ifdef TMWA_SUPPORT if (elementIndex == 0) return "TmwAthena"; else if (elementIndex == 1) @@ -56,7 +59,13 @@ class TypeListModel final : public ListModel #ifdef EATHENA_SUPPORT else if (elementIndex == 2) return "eAthena"; -#endif +#endif // EATHENA_SUPPORT +#else // TMWA_SUPPORT +#ifdef EATHENA_SUPPORT + if (elementIndex == 0) + return "eAthena"; +#endif // EATHENA_SUPPORT +#endif // TMWA_SUPPORT else return "Unknown"; } diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp index 11f22fafe..3dd7dd72b 100644 --- a/src/gui/windows/editserverdialog.cpp +++ b/src/gui/windows/editserverdialog.cpp @@ -145,21 +145,28 @@ EditServerDialog::EditServerDialog(ServerDialog *const parent, switch (mServer.type) { -#ifdef EATHENA_SUPPORT case ServerInfo::EATHENA: +#ifdef EATHENA_SUPPORT +#ifdef TMWA_SUPPORT mTypeField->setSelected(2); +#else // TMWA_SUPPORT + mTypeField->setSelected(0); +#endif // TMWA_SUPPORT +#else // EATHENA_SUPPORT + mTypeField->setSelected(0); +#endif // EATHENA_SUPPORT break; -#endif default: case ServerInfo::UNKNOWN: case ServerInfo::TMWATHENA: -#ifndef EATHENA_SUPPORT - case ServerInfo::EATHENA: -#endif mTypeField->setSelected(0); break; case ServerInfo::EVOL: +#ifdef TMWA_SUPPORT mTypeField->setSelected(1); +#else // TMWA_SUPPORT + mTypeField->setSelected(0); +#endif // TMWA_SUPPORT break; } @@ -220,6 +227,7 @@ void EditServerDialog::action(const ActionEvent &event) { switch (mTypeField->getSelected()) { +#ifdef TMWA_SUPPORT case 0: mServer.type = ServerInfo::TMWATHENA; break; @@ -231,6 +239,13 @@ void EditServerDialog::action(const ActionEvent &event) mServer.type = ServerInfo::EATHENA; break; #endif +#else +#ifdef EATHENA_SUPPORT + case 0: + mServer.type = ServerInfo::EATHENA; + break; +#endif +#endif default: mServer.type = ServerInfo::UNKNOWN; break; diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index 2b1996bdb..23a066ade 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -66,10 +66,16 @@ static std::string serverTypeToString(const ServerInfo::Type type) { switch (type) { +#ifdef TMWA_SUPPORT case ServerInfo::TMWATHENA: return "TmwAthena"; case ServerInfo::EVOL: return "Evol"; +#else + case ServerInfo::TMWATHENA: + case ServerInfo::EVOL: + return ""; +#endif case ServerInfo::EATHENA: #ifdef EATHENA_SUPPORT return "eAthena"; @@ -90,8 +96,10 @@ static uint16_t defaultPortForServerType(const ServerInfo::Type type) return 6900; #endif case ServerInfo::UNKNOWN: +#ifdef TMWA_SUPPORT case ServerInfo::TMWATHENA: case ServerInfo::EVOL: +#endif return 6901; } } |