diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-11-24 14:41:09 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-11-24 14:41:09 -0700 |
commit | fcc940800c047322aea40da5a24d9d5c0fbd051e (patch) | |
tree | 8249555c102bf51af4f4996a9af4f22bbd65838a /src/gui/statuswindow.cpp | |
parent | 1d5a5c6d4d1125a57c60058cf9c1e49633236f32 (diff) | |
download | mana-fcc940800c047322aea40da5a24d9d5c0fbd051e.tar.gz mana-fcc940800c047322aea40da5a24d9d5c0fbd051e.tar.bz2 mana-fcc940800c047322aea40da5a24d9d5c0fbd051e.tar.xz mana-fcc940800c047322aea40da5a24d9d5c0fbd051e.zip |
Fix increasing attributes that are at max
Diffstat (limited to 'src/gui/statuswindow.cpp')
-rw-r--r-- | src/gui/statuswindow.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index 7d4a612d..c479fed7 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -473,7 +473,7 @@ DerDisplay::DerDisplay(int id, const std::string &name): ChangeDisplay::ChangeDisplay(int id, const std::string &name): AttrDisplay(id, name), mNeeded(1) { - mPoints = new Label("1 "); + mPoints = new Label(_("Max")); mInc = new Button(_("+"), "inc", this); // Do the layout @@ -501,11 +501,21 @@ ChangeDisplay::ChangeDisplay(int id, const std::string &name): std::string ChangeDisplay::update() { - mPoints->setCaption(toString(mNeeded)); + if (mNeeded > 0) + { + mPoints->setCaption(toString(mNeeded)); + } + else + { + mPoints->setCaption(_("Max")); + } if (mDec) + { mDec->setEnabled(player_node->getCorrectionPoints()); - mInc->setEnabled(player_node->getCharacterPoints() >= mNeeded); + } + mInc->setEnabled(player_node->getCharacterPoints() >= mNeeded && + mNeeded > 0); return AttrDisplay::update(); } |