From c90c389a8a8d9d8661e9772ec4144c5cf2039f23 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- kfouleggs/field.cpp | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 kfouleggs/field.cpp (limited to 'kfouleggs/field.cpp') 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 + +#include +#include + +#include "common/commonprefs.h" +#include "board.h" + + +FEField::FEField(QWidget *parent) + : Field(parent) +{ + Board *b = static_cast(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(board); + KGameLCD *lcd = static_cast(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<(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(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(board)->nbChainedPuyos(i); + lcd->displayInt(nb); + lcd->show(); + } + } else + QWhatsThis::add(removedList, + i18n("Display the number of removed groups (\"puyos\").")); +} -- cgit v1.2.3