From fcc940800c047322aea40da5a24d9d5c0fbd051e Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Tue, 24 Nov 2009 14:41:09 -0700 Subject: Fix increasing attributes that are at max --- src/gui/statuswindow.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/gui/statuswindow.cpp') 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(); } -- cgit v1.2.3-60-g2f50