diff --git a/src/config/configfile.cpp b/src/config/configfile.cpp index 8a3b736f..eb61617a 100644 --- a/src/config/configfile.cpp +++ b/src/config/configfile.cpp @@ -51,7 +51,7 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0) if(strcmp(argv[i], "--nowriteaccess") == 0) { noWriteAccess = 1; } } // !!!! Revisionsnummer der Configdefaults !!!!! - configRev = 26; + configRev = 27; //standard defaults logOnOffDefault = "1"; @@ -145,7 +145,7 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0) configList.push_back(ConfigInfo("ShowFadeOutCardsAnimation", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("ShowFlipCardsAnimation", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("ShowBlindButtons", CONFIG_TYPE_INT, "1")); - configList.push_back(ConfigInfo("PlaySoundEffects", CONFIG_TYPE_INT, "1")); + configList.push_back(ConfigInfo("AntiPeekMode", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("PlaySoundEffects", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("SoundVolume", CONFIG_TYPE_INT, "8")); configList.push_back(ConfigInfo("FlipsideTux", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("FlipsideOwn", CONFIG_TYPE_INT, "0")); diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index aa2cd5b9..ee9f177f 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -1093,7 +1093,7 @@ void mainWindowImpl::refreshAction(int playerID, int playerAction) { if (playerAction == 1) { // FOLD - if (playerID == 0) { + if (playerID == 0 && !myConfig->readConfigInt("AntiPeekMode")) { holeCardsArray[0][0]->startFadeOut(10); holeCardsArray[0][1]->startFadeOut(10); } @@ -1311,9 +1311,15 @@ void mainWindowImpl::dealHoleCards() { for(j=0; j<2; j++) { if(currentGame->getPlayerArray()[i]->getMyActiveStatus()) { if ((i == 0) || DEBUG_MODE) { - tempCardsPixmapArray[j].load(":/cards/resources/graphics/cards/"+QString::number(tempCardsIntArray[j], 10)+".png"); - holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j],FALSE); - + if(myConfig->readConfigInt("AntiPeekMode")) { + holeCardsArray[i][j]->setPixmap(*flipside, TRUE); + tempCardsPixmapArray[j].load(":/cards/resources/graphics/cards/"+QString::number(tempCardsIntArray[j], 10)+".png"); + holeCardsArray[i][j]->setFrontPixmap(tempCardsPixmapArray[j]); + } + else { + tempCardsPixmapArray[j].load(":/cards/resources/graphics/cards/"+QString::number(tempCardsIntArray[j], 10)+".png"); + holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j],FALSE); + } } else { holeCardsArray[i][j]->setPixmap(*flipside, TRUE); @@ -1327,6 +1333,8 @@ void mainWindowImpl::dealHoleCards() { } } } + //fix press mouse button during bankrupt with anti-peek-mode + this->mouseOverFlipCards(FALSE); } void mainWindowImpl::dealBeRoCards(int myBeRoID) { @@ -1885,7 +1893,7 @@ void mainWindowImpl::postRiverRunAnimation2() { for(i=0; igetPlayerArray()[i]->getMyCards(tempCardsIntArray); if(currentHand->getPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != 1) { - if(i) { + if(i || (i==0 && myConfig->readConfigInt("AntiPeekMode")) ) { for(j=0; j<2; j++) { holeCardsArray[i][j]->startFlipCards(guiGameSpeed, QPixmap(":/cards/resources/graphics/cards/"+QString::number(tempCardsIntArray[j], 10)+".png"), flipside); @@ -1910,7 +1918,7 @@ void mainWindowImpl::postRiverRunAnimation2() { for(i=0; igetPlayerArray()[i]->getMyCards(tempCardsIntArray); if(currentHand->getPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != 1) { - if(i) { + if(i || (i==0 && myConfig->readConfigInt("AntiPeekMode")) ) { for(j=0; j<2; j++) { tempCardsPixmapArray[j].load(":/cards/resources/graphics/cards/"+QString::number(tempCardsIntArray[j], 10)+".png"); holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j], FALSE); @@ -2171,7 +2179,7 @@ void mainWindowImpl::flipHolecardsAllIn() { for(i=0; igetPlayerArray()[i]->getMyCards(tempCardsIntArray); if(currentHand->getPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != 1) { - if(i) { + if(i || (i==0 && myConfig->readConfigInt("AntiPeekMode")) ) { for(j=0; j<2; j++) { holeCardsArray[i][j]->startFlipCards(guiGameSpeed, QPixmap(":/cards/resources/graphics/cards/"+QString::number(tempCardsIntArray[j], 10)+".png"), flipside); } @@ -2196,7 +2204,7 @@ void mainWindowImpl::flipHolecardsAllIn() { for(i=0; igetPlayerArray()[i]->getMyCards(temp2CardsIntArray); if(currentHand->getPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != 1) { - if(i) { + if(i || (i==0 && myConfig->readConfigInt("AntiPeekMode")) ) { for(j=0; j<2; j++) { tempCardsPixmapArray[j].load(":/cards/resources/graphics/cards/"+QString::number(temp2CardsIntArray[j], 10)+".png"); @@ -2314,6 +2322,9 @@ void mainWindowImpl::nextRoundCleanGui() { //Clear Statusbarmessage statusBar()->clearMessage(); + + //fix press mouse button during bankrupt with anti-peek-mode + this->mouseOverFlipCards(FALSE); } void mainWindowImpl::stopTimer() { @@ -2685,8 +2696,12 @@ void mainWindowImpl::networkGameModification() { void mainWindowImpl::mouseOverFlipCards(bool front) { - holeCardsArray[0][0]->signalFastFlipCards(front); - holeCardsArray[0][1]->signalFastFlipCards(front); + if(mySession->getCurrentGameID()) { + if(myConfig->readConfigInt("AntiPeekMode") && mySession->getCurrentGame()->getCurrentHand()->getPlayerArray()[0]->getMyActiveStatus() && mySession->getCurrentGame()->getPlayerArray()[0]->getMyAction() != PLAYER_ACTION_FOLD) { + holeCardsArray[0][0]->signalFastFlipCards(front); + holeCardsArray[0][1]->signalFastFlipCards(front); + } + } } void mainWindowImpl::closeEvent(QCloseEvent *event) { quitPokerTH(); } diff --git a/src/gui/qt/mainwindow/mycardspixmaplabel.cpp b/src/gui/qt/mainwindow/mycardspixmaplabel.cpp index 891a40cf..7ec79e7d 100644 --- a/src/gui/qt/mainwindow/mycardspixmaplabel.cpp +++ b/src/gui/qt/mainwindow/mycardspixmaplabel.cpp @@ -147,6 +147,11 @@ void MyCardsPixmapLabel::setPixmap(const QPixmap &pic, const bool flipsideIs) { } +void MyCardsPixmapLabel::setFrontPixmap ( const QPixmap &pic ) { + + myHiddenFront = pic; +} + void MyCardsPixmapLabel::paintEvent(QPaintEvent * event) { if (!(flipCardsAction1 || flipCardsAction2)) { @@ -193,13 +198,12 @@ void MyCardsPixmapLabel::paintEvent(QPaintEvent * event) { painter3.drawPixmap(0,0, tmpFront); } - if (fastFlipCardsFront) { QPainter painter(this); - painter.setBrush(QColor(0,0,0)); - if(objectName().contains("pixmapLabel_card0")) { - painter.drawRect(10,10,20,20); - } + if (fastFlipCardsFront && !fadeOutAction && !flipCardsAction1 && !flipCardsAction2) { + if(objectName().contains("pixmapLabel_card0")) { + QPainter painter4(this); + painter4.drawPixmap(0,0, myHiddenFront.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + } } - } void MyCardsPixmapLabel::fastFlipCards(bool front){ diff --git a/src/gui/qt/mainwindow/mycardspixmaplabel.h b/src/gui/qt/mainwindow/mycardspixmaplabel.h index 115c1bfc..1be94458 100644 --- a/src/gui/qt/mainwindow/mycardspixmaplabel.h +++ b/src/gui/qt/mainwindow/mycardspixmaplabel.h @@ -51,7 +51,7 @@ signals: public slots: void setPixmap ( const QPixmap &, const bool ); -// void setFrontPixmap ( const QPixmap & ); + void setFrontPixmap ( const QPixmap & ); void nextFadeOutFrame(); void nextFlipCardsFrame(); @@ -86,6 +86,8 @@ private: bool mousePress; bool fastFlipCardsFront; + QPixmap myHiddenFront; + friend class mainWindowImpl; }; diff --git a/src/gui/qt/settingsdialog.ui b/src/gui/qt/settingsdialog.ui index 88f70848..4bed0ecf 100644 --- a/src/gui/qt/settingsdialog.ui +++ b/src/gui/qt/settingsdialog.ui @@ -38,93 +38,18 @@ 6 - - - - + + + + Qt::Vertical - - - 9 - - - 6 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Play sound effects - - - - - - - 0 - - - 6 - - - - - Sound Volume: - - - - - - - - 20 - 0 - - - - 10 - - - - - - - 1 - - - 10 - - - 8 - - - Qt::Horizontal - - - - - - - - - - - - Show flip-card animation + + + 20 + 40 + - + @@ -220,51 +145,24 @@ p, li { white-space: pre-wrap; } - - - - Qt::Vertical - - - - 20 - 40 - - - - - - + + - Show buttons for small blind and big blind + Show own cards only on mouse click - - + + - Show fade-out animation for non-winning cards + Show right toolbox (F11 to switch on/off) - - + + - Show statusbar messages - - - - - - - Show left toolbox (F10 to switch on/off) - - - - - - - Qt::Horizontal + Show intro on startup @@ -281,17 +179,141 @@ p, li { white-space: pre-wrap; } - - - - Show intro on startup + + + + Qt::Horizontal - - + + - Show right toolbox (F11 to switch on/off) + Show left toolbox (F10 to switch on/off) + + + + + + + Show statusbar messages + + + + + + + Show fade-out animation for non-winning cards + + + + + + + Show buttons for small blind and big blind + + + + + + + Show flip-card animation + + + + + + + + + 9 + + + 6 + + + + + Play sound effects + + + + + + + 0 + + + 6 + + + + + Sound Volume: + + + + + + + + 20 + 0 + + + + 10 + + + + + + + 1 + + + 10 + + + 8 + + + Qt::Horizontal + + + + + + + + + Qt::Vertical + + + + 20 + 281 + + + + + + + + + 75 + true + + + + Sound + + + + + + + Qt::Horizontal @@ -2091,6 +2113,23 @@ p, li { white-space: pre-wrap; } + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + @@ -2110,6 +2149,11 @@ p, li { white-space: pre-wrap; } Interface + + + Sound + + Local Game Settings @@ -2132,23 +2176,6 @@ p, li { white-space: pre-wrap; } - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok - - - - - - - Qt::Horizontal - - - @@ -2283,21 +2310,5 @@ p, li { white-space: pre-wrap; } - - horizontalSlider_soundVolume - valueChanged(int) - label_soundVolume - setNum(int) - - - 546 - 264 - - - 501 - 260 - - - diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index 7a37f808..33eafea2 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -129,6 +129,7 @@ void settingsDialogImpl::exec() { checkBox_showFadeOutCardsAnimation->setChecked(myConfig->readConfigInt("ShowFadeOutCardsAnimation")); checkBox_showFlipCardsAnimation->setChecked(myConfig->readConfigInt("ShowFlipCardsAnimation")); checkBox_showBlindButtons->setChecked(myConfig->readConfigInt("ShowBlindButtons")); + checkBox_antiPeekMode->setChecked(myConfig->readConfigInt("AntiPeekMode")); checkBox_playSoundEffects->setChecked(myConfig->readConfigInt("PlaySoundEffects")); horizontalSlider_soundVolume->setValue(myConfig->readConfigInt("SoundVolume")); radioButton_flipsideTux->setChecked(myConfig->readConfigInt("FlipsideTux")); @@ -210,6 +211,7 @@ void settingsDialogImpl::isAccepted() { myConfig->writeConfigInt("ShowFadeOutCardsAnimation", checkBox_showFadeOutCardsAnimation->isChecked()); myConfig->writeConfigInt("ShowFlipCardsAnimation", checkBox_showFlipCardsAnimation->isChecked()); myConfig->writeConfigInt("ShowBlindButtons", checkBox_showBlindButtons->isChecked()); + myConfig->writeConfigInt("AntiPeekMode", checkBox_antiPeekMode->isChecked()); myConfig->writeConfigInt("PlaySoundEffects", checkBox_playSoundEffects->isChecked()); myConfig->writeConfigInt("SoundVolume", horizontalSlider_soundVolume->value()); myConfig->writeConfigInt("FlipsideTux", radioButton_flipsideTux->isChecked());