From 6c68287a7a66ba6933bc4dbfe43f6c4761e683c1 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Wed, 8 Jul 2009 17:32:26 -0600 Subject: Have both builds use the same SkillDialog --- src/localplayer.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/localplayer.cpp') diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 1c7f7a5a..5fdd29cd 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -39,11 +39,8 @@ #include "gui/gui.h" #include "gui/ministatus.h" #include "gui/palette.h" -#ifdef EATHENA_SUPPORT -#include "gui/storagewindow.h" -#else #include "gui/skilldialog.h" -#endif +#include "gui/storagewindow.h" #include "net/inventoryhandler.h" #include "net/net.h" @@ -93,10 +90,10 @@ LocalPlayer::LocalPlayer(int id, int job, Map *map): mJobLevel(0), mXpForNextLevel(0), mJobXpForNextLevel(0), mMp(0), mMaxMp(0), + mSkillPoints(0), mAttackRange(0), ATK(0), MATK(0), DEF(0), MDEF(0), HIT(0), FLEE(0), ATK_BONUS(0), MATK_BONUS(0), DEF_BONUS(0), MDEF_BONUS(0), FLEE_BONUS(0), - mSkillPoint(0), mEquipment(new Equipment), #endif mInStorage(false), @@ -791,6 +788,8 @@ void LocalPlayer::lowerAttribute(size_t attr) Net::GameServer::Player::lowerAttribute(attr + CHAR_ATTR_BEGIN); } +#endif + void LocalPlayer::setAttributeBase(int num, int value) { int old = mAttributeBase[num]; @@ -813,6 +812,13 @@ void LocalPlayer::setAttributeEffective(int num, int value) skillDialog->update(num); } +void LocalPlayer::setSkillPoints(int points) +{ + mSkillPoints = points; + if (skillDialog) + skillDialog->update(); +} + void LocalPlayer::setExperience(int skill, int current, int next) { std::pair cur = getExperience(skill); @@ -825,11 +831,13 @@ void LocalPlayer::setExperience(int skill, int current, int next) if (skillDialog) name = skillDialog->update(skill); +#ifdef TMWSERV_SUPPORT if (mMap && cur.first != -1 && diff > 0 && !name.empty()) { const std::string text = strprintf("%d %s xp", diff, name.c_str()); mExpMessages.push_back(text); } +#endif } std::pair LocalPlayer::getExperience(int skill) @@ -837,8 +845,6 @@ std::pair LocalPlayer::getExperience(int skill) return mSkillExp[skill]; } -#endif - void LocalPlayer::setLevelProgress(int percent) { if (mMap && percent > percent) -- cgit v1.2.3-70-g09d2