diff options
author | Kess Vargavind <vargavind@gmail.com> | 2009-09-01 08:42:00 +0200 |
---|---|---|
committer | Kess Vargavind <vargavind@gmail.com> | 2009-09-01 09:10:34 +0200 |
commit | 1bd64c1bd6e1647ac767f6da52f9cbe267c195f5 (patch) | |
tree | 0c9c6c2ab733d9ae55e1bef4df7482fb6013d82d /src/gui/statuswindow.cpp | |
parent | f7d11d6734940c509bcc676e464b939edc7f84a6 (diff) | |
download | mana-1bd64c1bd6e1647ac767f6da52f9cbe267c195f5.tar.gz mana-1bd64c1bd6e1647ac767f6da52f9cbe267c195f5.tar.bz2 mana-1bd64c1bd6e1647ac767f6da52f9cbe267c195f5.tar.xz mana-1bd64c1bd6e1647ac767f6da52f9cbe267c195f5.zip |
Disable correction points in eA client
For now, until correction points are supported in eA.
By the way, I notice mDec et cetera aren't private members. Not
sure what you are up to.
Diffstat (limited to 'src/gui/statuswindow.cpp')
-rw-r--r-- | src/gui/statuswindow.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index 6f5f72fa..8151bd92 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -81,7 +81,9 @@ class ChangeDisplay : public AttrDisplay, gcn::ActionListener int mNeeded; Label *mPoints; +#ifdef TMWSERV_SUPPORT Button *mDec; +#endif Button *mInc; }; @@ -160,9 +162,11 @@ StatusWindow::StatusWindow(): getLayout().setRowHeight(3, Layout::AUTO_SET); mCharacterPointsLabel = new Label("C"); - mCorrectionPointsLabel = new Label("C"); place(0, 6, mCharacterPointsLabel, 5); +#ifdef TMWSERV_SUPPORT + mCorrectionPointsLabel = new Label("C"); place(0, 7, mCorrectionPointsLabel, 5); +#endif loadWindowState(); @@ -227,9 +231,11 @@ std::string StatusWindow::update(int id) player_node->getCharacterPoints())); mCharacterPointsLabel->adjustSize(); +#ifdef TMWSERV_SUPPORT mCorrectionPointsLabel->setCaption(strprintf(_("Correction points: %d"), player_node->getCorrectionPoints())); mCorrectionPointsLabel->adjustSize(); +#endif for (Attrs::iterator it = mAttrs.begin(); it != mAttrs.end(); it++) { @@ -470,19 +476,23 @@ ChangeDisplay::ChangeDisplay(int id, const std::string &name): AttrDisplay(id, name), mNeeded(1) { mPoints = new Label("1"); - mDec = new Button(_("-"), "dec", this); mInc = new Button(_("+"), "inc", this); - mDec->setWidth(mInc->getWidth()); // Do the layout ContainerPlacer place = mLayout->getPlacer(0, 0); place(0, 0, mLabel, 3); - place(3, 0, mDec); place(4, 0, mValue, 2); place(6, 0, mInc); place(7, 0, mPoints); +#ifdef TMWSERV_SUPPORT + mDec = new Button(_("-"), "dec", this); + mDec->setWidth(mInc->getWidth()); + + place(3, 0, mDec); +#endif + update(); } @@ -490,7 +500,9 @@ std::string ChangeDisplay::update() { mPoints->setCaption(toString(mNeeded)); +#ifdef TMWSERV_SUPPORT mDec->setEnabled(player_node->getCorrectionPoints()); +#endif mInc->setEnabled(player_node->getCharacterPoints() >= mNeeded); return AttrDisplay::update(); @@ -505,11 +517,13 @@ void ChangeDisplay::setPointsNeeded(int needed) void ChangeDisplay::action(const gcn::ActionEvent &event) { +#ifdef TMWSERV_SUPPORT if (event.getSource() == mDec) { Net::getPlayerHandler()->decreaseAttribute(mId); - } - else if (event.getSource() == mInc) + } else +#endif + if (event.getSource() == mInc) { Net::getPlayerHandler()->increaseAttribute(mId); } |