summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-16 18:05:48 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-16 18:05:48 +0300
commit415d696feaa2981d555d1912f201b548c1f0ffad (patch)
tree7898a5db9f3872d9f8466df509cb6582dff621a5 /src
parent7931a86899d1c4e93fcde4ed753f8a62f52575fe (diff)
downloadManaVerse-415d696feaa2981d555d1912f201b548c1f0ffad.tar.gz
ManaVerse-415d696feaa2981d555d1912f201b548c1f0ffad.tar.bz2
ManaVerse-415d696feaa2981d555d1912f201b548c1f0ffad.tar.xz
ManaVerse-415d696feaa2981d555d1912f201b548c1f0ffad.zip
Add server feature haveLookSelection.
Diffstat (limited to 'src')
-rw-r--r--src/gui/windows/charcreatedialog.cpp10
-rw-r--r--src/net/eathena/serverfeatures.cpp5
-rw-r--r--src/net/eathena/serverfeatures.h2
-rw-r--r--src/net/serverfeatures.h2
-rw-r--r--src/net/tmwa/serverfeatures.cpp5
-rw-r--r--src/net/tmwa/serverfeatures.h2
6 files changed, 21 insertions, 5 deletions
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index 650f58459..2d1161d1d 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -199,7 +199,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
mRaceLabel = new Label(this, _("Race:"));
mRaceNameLabel = new Label(this, "");
}
- if (serverVersion >= 9 && mMinLook < mMaxLook)
+ if (Net::getServerFeatures()->haveLookSelection() && mMinLook < mMaxLook)
{
// TRANSLATORS: char create dialog button
mNextLookButton = new Button(this, _(">"), "nextlook", this);
@@ -255,7 +255,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
mHairStyleLabel->setPosition(labelX, y);
mHairStyleNameLabel->setPosition(nameX, y);
- if (serverVersion >= 9 && mMinLook < mMaxLook)
+ if (Net::getServerFeatures()->haveLookSelection() && mMinLook < mMaxLook)
{
y += 24;
mPrevLookButton->setPosition(leftX, y);
@@ -295,7 +295,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
add(mActionButton);
add(mRotateButton);
- if (serverVersion >= 9 && mMinLook < mMaxLook)
+ if (Net::getServerFeatures()->haveLookSelection() && mMinLook < mMaxLook)
{
add(mNextLookButton);
add(mPrevLookButton);
@@ -326,7 +326,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
updateHair();
if (Net::getServerFeatures()->haveRaceSelection())
updateRace();
- if (serverVersion >= 9 && mMinLook < mMaxLook)
+ if (Net::getServerFeatures()->haveLookSelection() && mMinLook < mMaxLook)
updateLook();
updatePlayer();
@@ -640,7 +640,7 @@ void CharCreateDialog::updateLook()
{
const ItemInfo &item = ItemDB::get(-100 - mRace);
const int sz = item.getColorsSize();
- if (sz > 0 && serverVersion >= 9)
+ if (sz > 0 && Net::getServerFeatures()->haveLookSelection())
{
if (mLook < 0)
mLook = sz - 1;
diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp
index da2e9c945..9cd8a5f22 100644
--- a/src/net/eathena/serverfeatures.cpp
+++ b/src/net/eathena/serverfeatures.cpp
@@ -82,4 +82,9 @@ bool ServerFeatures::haveRaceSelection() const
return false;
}
+bool ServerFeatures::haveLookSelection() const
+{
+ return false;
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h
index 625655b3c..8ead8eff1 100644
--- a/src/net/eathena/serverfeatures.h
+++ b/src/net/eathena/serverfeatures.h
@@ -53,6 +53,8 @@ class ServerFeatures final : public Net::ServerFeatures
bool haveIncompleteChatMessages() const override final;
bool haveRaceSelection() const override final;
+
+ bool haveLookSelection() const override final;
};
} // namespace EAthena
diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h
index 3f623f1c9..553217185 100644
--- a/src/net/serverfeatures.h
+++ b/src/net/serverfeatures.h
@@ -50,6 +50,8 @@ class ServerFeatures notfinal
virtual bool haveIncompleteChatMessages() const = 0;
virtual bool haveRaceSelection() const = 0;
+
+ virtual bool haveLookSelection() const = 0;
};
} // namespace Net
diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp
index 330dff083..23330a02a 100644
--- a/src/net/tmwa/serverfeatures.cpp
+++ b/src/net/tmwa/serverfeatures.cpp
@@ -84,4 +84,9 @@ bool ServerFeatures::haveRaceSelection() const
return serverVersion >= 2;
}
+bool ServerFeatures::haveLookSelection() const
+{
+ return serverVersion >= 9;
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h
index 740d73e5b..01db18cc5 100644
--- a/src/net/tmwa/serverfeatures.h
+++ b/src/net/tmwa/serverfeatures.h
@@ -53,6 +53,8 @@ class ServerFeatures final : public Net::ServerFeatures
bool haveIncompleteChatMessages() const override final;
bool haveRaceSelection() const override final;
+
+ bool haveLookSelection() const override final;
};
} // namespace TmwAthena