diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | c90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch) | |
tree | 6d8391395bce9eaea4ad78958617edb20c6a7573 /kfouleggs/field.cpp | |
download | tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kfouleggs/field.cpp')
-rw-r--r-- | kfouleggs/field.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/kfouleggs/field.cpp b/kfouleggs/field.cpp new file mode 100644 index 00000000..9d7abe85 --- /dev/null +++ b/kfouleggs/field.cpp @@ -0,0 +1,61 @@ +#include "field.h" +#include "field.moc" + +#include <qwhatsthis.h> + +#include <klocale.h> +#include <kgamelcd.h> + +#include "common/commonprefs.h" +#include "board.h" + + +FEField::FEField(QWidget *parent) + : Field(parent) +{ + Board *b = static_cast<Board *>(board); + QWhatsThis::add(b->giftPool(), i18n("Display the amount of foul eggs sent by your opponent.")); +} + +void FEField::removedUpdated() +{ + Field::removedUpdated(); + const FEBoard *feb = static_cast<const FEBoard *>(board); + KGameLCD *lcd = static_cast<KGameLCD *>(removedList->lcd(0)); + lcd->displayInt(feb->nbPuyos()); + if ( feb->nbPuyos() ) lcd->highlight(); + if ( CommonPrefs::showDetailedRemoved() ) + for (uint i=0; i<4; i++) { + if ( !(feb->lastChained() & 2<<i) ) continue; + lcd = static_cast<KGameLCD *>(removedList->lcd(i+1)); + lcd->displayInt(feb->nbChainedPuyos(i)); + if ( feb->nbChainedPuyos(i) ) lcd->highlight(); + } +} + +void FEField::settingsChanged() +{ + Field::settingsChanged(); + + removedList->clear(); + KGameLCD *lcd = new KGameLCD(6, removedList); + removedList->append(i18n("Total:"), lcd); + uint nb = static_cast<const FEBoard *>(board)->nbPuyos(); + lcd->displayInt(nb); + lcd->show(); + + if ( CommonPrefs::showDetailedRemoved() ) { + QWhatsThis::add(removedList, + i18n("Display the number of removed groups (\"puyos\") classified by the number of chained removal.")); + for (uint i=0; i<4; i++) { + KGameLCD *lcd = new KGameLCD(6, removedList); + QString s = (i==3 ? ">3" : QString::number(i)); + removedList->append(s, lcd); + uint nb = static_cast<const FEBoard *>(board)->nbChainedPuyos(i); + lcd->displayInt(nb); + lcd->show(); + } + } else + QWhatsThis::add(removedList, + i18n("Display the number of removed groups (\"puyos\").")); +} |