#include "field.h" #include "field.moc" #include #include #include #include "board.h" #include "prefs.h" #include "piece.h" //----------------------------------------------------------------------------- KSField::KSField(TQWidget *parent) : Field(parent) { const Board *b = static_cast(board); TQWhatsThis::add(b->giftPool(), i18n("Indicate the number of garbage lines you received from your opponent.")); } void KSField::removedUpdated() { KGameLCD *lcd = static_cast(removedList->lcd(0)); lcd->displayInt(board->nbRemoved()); if ( board->nbRemoved() ) lcd->highlight(); if ( Prefs::showDetailedRemoved() ) { const KSBoard *ksb = static_cast(board); for (uint i=0; i<4; i++) { if ( !(ksb->lastRemoved() & (2<(removedList->lcd(i+1)); lcd->displayInt(ksb->nbRemovedLines(i)); if ( ksb->nbRemovedLines(i) ) lcd->highlight(); } } } void KSField::settingsChanged() { Field::settingsChanged(); bool b = Prefs::oldRotationStyle(); static_cast(Piece::info()).setOldRotationStyle(b); removedList->clear(); TQWhatsThis::remove(removedList); KGameLCD *lcd = new KGameLCD(5, removedList); TQString s = (Prefs::showDetailedRemoved() ? i18n("Total:") : TQString()); removedList->append(s, lcd); lcd->displayInt( board->nbRemoved() ); lcd->show(); if ( Prefs::showDetailedRemoved() ) { for (uint i=0; i<4; i++) { KGameLCD *lcd = new KGameLCD(5, removedList); TQString s = i18n("1 Line:", "%n Lines:", i+1); removedList->append(s, lcd); uint nb = static_cast(board)->nbRemovedLines(i); lcd->displayInt(nb); lcd->show(); } } }