From 38d84edf098551793b78b845156e7de240d0d8b0 Mon Sep 17 00:00:00 2001 From: David Athay Date: Mon, 28 Apr 2008 17:30:00 +0000 Subject: Skills patch by roderic, mantis id=209 --- src/localplayer.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/localplayer.cpp') diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 1e61e59d..5bf6ec0e 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -421,24 +421,24 @@ void LocalPlayer::lowerAttribute(size_t attr) Net::GameServer::Player::lowerAttribute(attr + CHAR_ATTR_BEGIN); } -const std::string& LocalPlayer::getSkillName(int skill) +const struct LocalPlayer::skillInfo& LocalPlayer::getSkillInfo(int skill) { - static const std::string skills[CHAR_SKILL_NB + 1] = + static const skillInfo skills[CHAR_SKILL_NB + 1] = { - _("Unarmed"), // CHAR_SKILL_WEAPON_NONE - _("Knife"), // CHAR_SKILL_WEAPON_KNIFE - _("Sword"), // CHAR_SKILL_WEAPON_SWORD - _("Polearm"), // CHAR_SKILL_WEAPON_POLEARM - _("Staff"), // CHAR_SKILL_WEAPON_STAFF - _("Whip"), // CHAR_SKILL_WEAPON_WHIP - _("Bow"), // CHAR_SKILL_WEAPON_BOW - _("Shooting"), // CHAR_SKILL_WEAPON_SHOOTING - _("Mace"), // CHAR_SKILL_WEAPON_MACE - _("Axe"), // CHAR_SKILL_WEAPON_AXE - _("Thrown"), // CHAR_SKILL_WEAPON_THROWN - _("Magic"), // CHAR_SKILL_MAGIC_IAMJUSTAPLACEHOLDER - _("Craft"), // CHAR_SKILL_CRAFT_IAMJUSTAPLACEHOLDER - _("Unknown Skill") + { _("Unarmed"), "graphics/gui/unarmed.png" }, // CHAR_SKILL_WEAPON_NONE + { _("Knife"), "graphics/gui/knife.png" }, // CHAR_SKILL_WEAPON_KNIFE + { _("Sword"), "graphics/gui/sword.png" }, // CHAR_SKILL_WEAPON_SWORD + { _("Polearm"), "graphics/gui/polearm.png" }, // CHAR_SKILL_WEAPON_POLEARM + { _("Staff"), "graphics/gui/staff.png" }, // CHAR_SKILL_WEAPON_STAFF + { _("Whip"), "graphics/gui/whip.png" }, // CHAR_SKILL_WEAPON_WHIP + { _("Bow"), "graphics/gui/bow.png" }, // CHAR_SKILL_WEAPON_BOW + { _("Shooting"), "graphics/gui/shooting.png" }, // CHAR_SKILL_WEAPON_SHOOTING + { _("Mace"), "graphics/gui/mace.png" }, // CHAR_SKILL_WEAPON_MACE + { _("Axe"), "graphics/gui/axe.png" }, // CHAR_SKILL_WEAPON_AXE + { _("Thrown"), "graphics/gui/thrown.png" }, // CHAR_SKILL_WEAPON_THROWN + { _("Magic"), "graphics/gui/magic.png " }, // CHAR_SKILL_MAGIC_IAMJUSTAPLACEHOLDER + { _("Craft"), "graphics/gui/craft.png" }, // CHAR_SKILL_CRAFT_IAMJUSTAPLACEHOLDER + { _("Unknown Skill"), "graphics/gui/unknown-item.png" } }; if ((skill < 0) || (skill > CHAR_SKILL_NB)) @@ -457,7 +457,7 @@ void LocalPlayer::setExperience(int skill, int current, int next) int diff = current - mExpCurrent.at(skill); if (mMap && mExpCurrent.at(skill) != -1 && diff > 0) { - const std::string text = toString(diff) + " " + getSkillName(skill) + " xp"; + const std::string text = toString(diff) + " " + getSkillInfo(skill).name + " xp"; mExpMessages.push_back(text); } -- cgit v1.2.3-70-g09d2