summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-25 18:38:52 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-25 18:38:52 +0300
commit3d447679df26179b7ffa781c34f5277e6a1aec29 (patch)
tree242365d32770a89448130684ad7ed2bf00c22561 /src/gui
parent8c8f9f6cf53a6d5b8d9d72f4860921b3325a7696 (diff)
downloadplus-3d447679df26179b7ffa781c34f5277e6a1aec29.tar.gz
plus-3d447679df26179b7ffa781c34f5277e6a1aec29.tar.bz2
plus-3d447679df26179b7ffa781c34f5277e6a1aec29.tar.xz
plus-3d447679df26179b7ffa781c34f5277e6a1aec29.zip
Dont compile manaserv related code if manaserv support disabled.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/charcreatedialog.cpp9
-rw-r--r--src/gui/charselectdialog.cpp2
-rw-r--r--src/gui/sell.cpp2
-rw-r--r--src/gui/serverdialog.cpp8
-rw-r--r--src/gui/viewport.cpp7
-rw-r--r--src/gui/windowmenu.cpp2
6 files changed, 27 insertions, 3 deletions
diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp
index 973273e95..914e29f3c 100644
--- a/src/gui/charcreatedialog.cpp
+++ b/src/gui/charcreatedialog.cpp
@@ -185,8 +185,11 @@ void CharCreateDialog::action(const gcn::ActionEvent &event)
{
if (event.getId() == "create")
{
- if (Net::getNetworkType() == ServerInfo::MANASERV
- || getName().length() >= 4)
+ if (
+#ifdef MANASERV_SUPPORT
+ Net::getNetworkType() == ServerInfo::MANASERV ||
+#endif
+ getName().length() >= 4)
{
// Attempt to create the character
mCreateButton->setEnabled(false);
@@ -199,9 +202,11 @@ void CharCreateDialog::action(const gcn::ActionEvent &event)
}
int characterSlot = mSlot;
+#ifdef MANASERV_SUPPORT
// On Manaserv, the slots start at 1, so we offset them.
if (Net::getNetworkType() == ServerInfo::MANASERV)
++characterSlot;
+#endif
Net::getCharHandler()->newCharacter(getName(), characterSlot,
mFemale->isSelected(), mHairStyle, mHairColor, mRace, atts);
diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp
index 54638f793..3179085cc 100644
--- a/src/gui/charselectdialog.cpp
+++ b/src/gui/charselectdialog.cpp
@@ -295,8 +295,10 @@ void CharSelectDialog::setCharacters(const Net::Characters &characters)
// Slots Number start at 1 for Manaserv, so we offset them by one.
int characterSlot = character->slot;
+#ifdef MANASERV_SUPPORT
if (Net::getNetworkType() == ServerInfo::MANASERV && characterSlot > 0)
--characterSlot;
+#endif
if (characterSlot >= static_cast<int>(mCharacterEntries.size()))
{
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp
index de1da395c..1a1fa60e0 100644
--- a/src/gui/sell.cpp
+++ b/src/gui/sell.cpp
@@ -222,9 +222,11 @@ void SellDialog::action(const gcn::ActionEvent &event)
itemIndex = item->getCurrentInvIndex();
sellCount = item->sellCurrentDuplicate(mAmountItems);
+#ifdef MANASERV_SUPPORT
// For Manaserv, the Item id is to be given as index.
if ((Net::getNetworkType() == ServerInfo::MANASERV))
itemIndex = item->getId();
+#endif
Net::getNpcHandler()->sellItem(mNpcId, itemIndex, sellCount);
mAmountItems -= sellCount;
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index 45ec907fb..e0d0a1e41 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -63,8 +63,10 @@ static std::string serverTypeToString(ServerInfo::Type type)
{
case ServerInfo::TMWATHENA:
return "TmwAthena";
+#ifdef MANASERV_SUPPORT
case ServerInfo::MANASERV:
return "ManaServ";
+#endif
default:
case ServerInfo::UNKNOWN:
return "";
@@ -79,8 +81,10 @@ static unsigned short defaultPortForServerType(ServerInfo::Type type)
case ServerInfo::UNKNOWN:
case ServerInfo::TMWATHENA:
return 6901;
+#ifdef MANASERV_SUPPORT
case ServerInfo::MANASERV:
return 9601;
+#endif
}
}
@@ -390,9 +394,11 @@ void ServerDialog::action(const gcn::ActionEvent &event)
case 0:
mServerInfo->type = ServerInfo::TMWATHENA;
break;
+#ifdef MANASERV_SUPPORT
case 1:
mServerInfo->type = ServerInfo::MANASERV;
break;
+#endif
default:
mServerInfo->type = ServerInfo::UNKNOWN;
}
@@ -478,9 +484,11 @@ void ServerDialog::valueChanged(const gcn::SelectionEvent &)
default:
mTypeField->setSelected(0);
break;
+#ifdef MANASERV_SUPPORT
case ServerInfo::MANASERV:
mTypeField->setSelected(1);
break;
+#endif
}
}
setFieldsReadOnly(true);
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index e34dd658a..9688c818a 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -304,6 +304,7 @@ void Viewport::_drawDebugPath(Graphics *graphics)
_drawPath(graphics, debugPath);
}
+#ifdef MANASERV_SUPPORT
else if (Net::getNetworkType() == ServerInfo::MANASERV)
{
const Vector &playerPos = player_node->getPosition();
@@ -330,6 +331,7 @@ void Viewport::_drawDebugPath(Graphics *graphics)
// But also the one currently walked on.
_drawPath(graphics, player_node->getPath(), gcn::Color(0, 0, 255));
}
+#endif
}
void Viewport::_drawPath(Graphics *graphics, const Path &path,
@@ -353,6 +355,7 @@ void Viewport::_drawPath(Graphics *graphics, const Path &path,
}
}
}
+#ifdef MANASERV_SUPPORT
else if (Net::getNetworkType() == ServerInfo::MANASERV)
{
for (Path::const_iterator i = path.begin(); i != path.end(); ++i)
@@ -369,8 +372,8 @@ void Viewport::_drawPath(Graphics *graphics, const Path &path,
squareX + 4, squareY + 12, gcn::Graphics::CENTER);
}
}
-
}
+#endif
}
void Viewport::mousePressed(gcn::MouseEvent &event)
@@ -505,6 +508,7 @@ void Viewport::mouseDragged(gcn::MouseEvent &event)
if (mPlayerFollowMouse && !event.isShiftPressed())
{
+#ifdef MANASERV_SUPPORT
if (Net::getNetworkType() == ServerInfo::MANASERV)
{
if (get_elapsed_time(mLocalWalkTime) >= walkingMouseDelay)
@@ -519,6 +523,7 @@ void Viewport::mouseDragged(gcn::MouseEvent &event)
}
}
else
+#endif
{
if (mLocalWalkTime != player_node->getActionTime())
{
diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp
index 2947779c7..5a7b700d7 100644
--- a/src/gui/windowmenu.cpp
+++ b/src/gui/windowmenu.cpp
@@ -79,11 +79,13 @@ WindowMenu::WindowMenu():
KeyboardConfig::KEY_WINDOW_SKILL);
}
+#ifdef MANASERV_SUPPORT
if (Net::getNetworkType() == ServerInfo::MANASERV)
{
addButton(N_("SPE"), _("Specials"), x, h,
KeyboardConfig::KEY_NO_VALUE);
}
+#endif
addButton(N_("SOC"), _("Social"), x, h, KeyboardConfig::KEY_WINDOW_SOCIAL);
addButton(N_("SH"), _("Shortcuts"), x, h,