summaryrefslogtreecommitdiff
path: root/src/gui/statuswindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-24 01:30:46 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-24 01:32:02 +0300
commit3da7fa61442364be6713359690a35f89aa8e613a (patch)
tree48a941dbbb0234b897478aa50518112407d08e5b /src/gui/statuswindow.cpp
parent470aaad15a0f9a08dd12ab34c8602cd93fc57b76 (diff)
downloadplus-3da7fa61442364be6713359690a35f89aa8e613a.tar.gz
plus-3da7fa61442364be6713359690a35f89aa8e613a.tar.bz2
plus-3da7fa61442364be6713359690a35f89aa8e613a.tar.xz
plus-3da7fa61442364be6713359690a35f89aa8e613a.zip
Add support for show quest variables in skills window (evol only)
This allow use pseudo skills controlled by quest variables.
Diffstat (limited to 'src/gui/statuswindow.cpp')
-rw-r--r--src/gui/statuswindow.cpp38
1 files changed, 13 insertions, 25 deletions
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index 019d136d4..3e34b088d 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -373,12 +373,10 @@ void StatusWindow::processEvent(Channels channel A_UNUSED,
{
if (mJobLvlLabel)
{
- int lvl = PlayerInfo::getStatBase(
- static_cast<PlayerInfo::Attribute>(id));
-
+ int lvl = PlayerInfo::getStatBase(id);
const int oldExp = event.getInt("oldValue1");
- const std::pair<int, int> exp = PlayerInfo::getStatExperience(
- static_cast<PlayerInfo::Attribute>(id));
+ const std::pair<int, int> exp
+ = PlayerInfo::getStatExperience(id);
if (!lvl)
{
@@ -392,8 +390,7 @@ void StatusWindow::processEvent(Channels channel A_UNUSED,
{
lvl = (exp.second - 20000) / 150;
blocked = true;
- PlayerInfo::setStatBase(
- static_cast<PlayerInfo::Attribute>(id), lvl);
+ PlayerInfo::setStatBase(id, lvl);
blocked = false;
}
}
@@ -404,10 +401,8 @@ void StatusWindow::processEvent(Channels channel A_UNUSED,
lvl ++;
blocked = true;
PlayerInfo::setStatExperience(
- static_cast<PlayerInfo::Attribute>(id),
- exp.first, 20000 + lvl * 150);
- PlayerInfo::setStatBase(
- static_cast<PlayerInfo::Attribute>(id), lvl);
+ id, exp.first, 20000 + lvl * 150);
+ PlayerInfo::setStatBase(id, lvl);
blocked = false;
}
@@ -589,8 +584,7 @@ void StatusWindow::updateJobBar(ProgressBar *const bar, const bool percent)
void StatusWindow::updateProgressBar(ProgressBar *const bar, const int id,
const bool percent) const
{
- const std::pair<int, int> exp = PlayerInfo::getStatExperience(
- static_cast<PlayerInfo::Attribute>(id));
+ const std::pair<int, int> exp = PlayerInfo::getStatExperience(id);
updateProgressBar(bar, exp.first, exp.second, percent);
}
@@ -783,10 +777,8 @@ AttrDisplay::~AttrDisplay()
std::string AttrDisplay::update()
{
- const int base = PlayerInfo::getStatBase(
- static_cast<PlayerInfo::Attribute>(mId));
- const int bonus = PlayerInfo::getStatMod(
- static_cast<PlayerInfo::Attribute>(mId));
+ const int base = PlayerInfo::getStatBase(mId);
+ const int bonus = PlayerInfo::getStatMod(mId);
std::string value = toString(base + bonus);
if (bonus)
value += strprintf("=%d%+d", base, bonus);
@@ -872,10 +864,8 @@ void ChangeDisplay::action(const gcn::ActionEvent &event)
PlayerInfo::CHAR_POINTS) + 1;
PlayerInfo::setAttribute(PlayerInfo::CHAR_POINTS, newpoints);
- const int newbase = PlayerInfo::getStatBase(
- static_cast<PlayerInfo::Attribute>(mId)) - 1;
- PlayerInfo::setStatBase(static_cast<PlayerInfo::Attribute>(
- mId), newbase);
+ const int newbase = PlayerInfo::getStatBase(mId) - 1;
+ PlayerInfo::setStatBase(mId, newbase);
Net::getPlayerHandler()->decreaseAttribute(mId);
}
@@ -893,10 +883,8 @@ void ChangeDisplay::action(const gcn::ActionEvent &event)
PlayerInfo::CHAR_POINTS) - cnt;
PlayerInfo::setAttribute(PlayerInfo::CHAR_POINTS, newpoints);
- const int newbase = PlayerInfo::getStatBase(
- static_cast<PlayerInfo::Attribute>(mId)) + cnt;
- PlayerInfo::setStatBase(static_cast<PlayerInfo::Attribute>(
- mId), newbase);
+ const int newbase = PlayerInfo::getStatBase(mId) + cnt;
+ PlayerInfo::setStatBase(mId, newbase);
for (unsigned f = 0; f < mInc->getClickCount(); f ++)
{