From 97216f3f770df77bf2c49883f127ed1a91619444 Mon Sep 17 00:00:00 2001 From: doitux Date: Tue, 23 Jan 2007 19:20:18 +0000 Subject: [PATCH] --- src/config/configfile.cpp | 5 +- src/game.cpp | 5 +- src/gui/qt/mainwindowimpl.cpp | 291 ++++++++++-- src/gui/qt/mainwindowimpl.h | 40 +- src/gui/qt/newgamedialog.ui | 73 +-- src/gui/qt/newgamedialogimpl.cpp | 2 +- src/gui/qt/settingsdialog.ui | 741 ++++++++++++++++-------------- src/gui/qt/settingsdialogimpl.cpp | 2 + 8 files changed, 726 insertions(+), 433 deletions(-) diff --git a/src/config/configfile.cpp b/src/config/configfile.cpp index c20edcd2..d28acefb 100644 --- a/src/config/configfile.cpp +++ b/src/config/configfile.cpp @@ -82,9 +82,12 @@ void ConfigFile::createDefaultConfig() { TiXmlElement * confElement3 = new TiXmlElement( "SmallBlind" ); config->LinkEndChild( confElement3 ); confElement3->SetAttribute("value", 10); + TiXmlElement * confElement12 = new TiXmlElement( "HandsBeforeRaiseSmallBlind" ); + config->LinkEndChild( confElement12 ); + confElement12->SetAttribute("value", 9); TiXmlElement * confElement4 = new TiXmlElement( "GameSpeed" ); config->LinkEndChild( confElement4 ); - confElement4->SetAttribute("value", 4); + confElement4->SetAttribute("value", 4); TiXmlElement * confElement5 = new TiXmlElement( "ShowGameSettingsDialogOnNewGame" ); config->LinkEndChild( confElement5 ); confElement5->SetAttribute("value", 1); diff --git a/src/game.cpp b/src/game.cpp index ec309733..9fff54c1 100755 --- a/src/game.cpp +++ b/src/game.cpp @@ -117,8 +117,9 @@ void Game::startHand() actualHandID++; - // smallBlind alle 9 Runden erh�en - if(actualHandID%9 == 0) actualSmallBlind *= 2; + // smallBlind alle x Runden erhöhen + int handsBeforeRaiseSmallBLind = myConfig->readConfigInt("HandsBeforeRaiseSmallBlind", 9); + if(actualHandID%handsBeforeRaiseSmallBLind == 0) actualSmallBlind *= 2; //Spieler Action auf 0 setzen for(i=0; igetMaxQuantityPlayers(); i++) { diff --git a/src/gui/qt/mainwindowimpl.cpp b/src/gui/qt/mainwindowimpl.cpp index 6baf3822..78cc9a34 100755 --- a/src/gui/qt/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindowimpl.cpp @@ -98,7 +98,103 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name) } //Timer Objekt erstellen + + + dealFlopCards0Timer = new QTimer(this); + dealFlopCards1Timer = new QTimer(this); + dealFlopCards2Timer = new QTimer(this); + dealFlopCards3Timer = new QTimer(this); + dealFlopCards4Timer = new QTimer(this); + dealFlopCards5Timer = new QTimer(this); + dealFlopCards6Timer = new QTimer(this); + dealTurnCards0Timer = new QTimer(this); + dealTurnCards1Timer = new QTimer(this); + dealTurnCards2Timer = new QTimer(this); + dealRiverCards0Timer = new QTimer(this); + dealRiverCards1Timer = new QTimer(this); + dealRiverCards2Timer = new QTimer(this); + + nextPlayerAnimationTimer = new QTimer(this); + preflopAnimation1Timer = new QTimer(this); + preflopAnimation2Timer = new QTimer(this); + flopAnimation1Timer = new QTimer(this); + flopAnimation2Timer = new QTimer(this); + turnAnimation1Timer = new QTimer(this); + turnAnimation2Timer = new QTimer(this); + riverAnimation1Timer = new QTimer(this); + riverAnimation2Timer = new QTimer(this); + + postRiverAnimation1Timer = new QTimer(this); + postRiverRunAnimation1Timer = new QTimer(this); + postRiverRunAnimation2Timer = new QTimer(this); + postRiverRunAnimation3Timer = new QTimer(this); + postRiverRunAnimation5Timer = new QTimer(this); potDistributeTimer = new QTimer(this); + postRiverRunAnimation6Timer = new QTimer(this); + + dealFlopCards0Timer->setSingleShot(TRUE); + dealFlopCards1Timer->setSingleShot(TRUE); + dealFlopCards2Timer->setSingleShot(TRUE); + dealFlopCards3Timer->setSingleShot(TRUE); + dealFlopCards4Timer->setSingleShot(TRUE); + dealFlopCards5Timer->setSingleShot(TRUE); + dealFlopCards6Timer->setSingleShot(TRUE); + dealTurnCards0Timer->setSingleShot(TRUE); + dealTurnCards1Timer->setSingleShot(TRUE); + dealTurnCards2Timer->setSingleShot(TRUE); + dealRiverCards0Timer->setSingleShot(TRUE); + dealRiverCards1Timer->setSingleShot(TRUE); + dealRiverCards2Timer->setSingleShot(TRUE); + + nextPlayerAnimationTimer->setSingleShot(TRUE); + preflopAnimation1Timer->setSingleShot(TRUE); + preflopAnimation2Timer->setSingleShot(TRUE); + flopAnimation1Timer->setSingleShot(TRUE); + flopAnimation2Timer->setSingleShot(TRUE); + turnAnimation1Timer->setSingleShot(TRUE); + turnAnimation2Timer->setSingleShot(TRUE); + riverAnimation1Timer->setSingleShot(TRUE); + riverAnimation2Timer->setSingleShot(TRUE); + + postRiverAnimation1Timer->setSingleShot(TRUE); + postRiverRunAnimation1Timer->setSingleShot(TRUE); + postRiverRunAnimation2Timer->setSingleShot(TRUE); + postRiverRunAnimation3Timer->setSingleShot(TRUE); + postRiverRunAnimation5Timer->setSingleShot(TRUE); + postRiverRunAnimation6Timer->setSingleShot(TRUE); + + connect(dealFlopCards0Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards1() )); + connect(dealFlopCards1Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards2() )); + connect(dealFlopCards2Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards3() )); + connect(dealFlopCards3Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards4() )); + connect(dealFlopCards4Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards5() )); + connect(dealFlopCards5Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards6() )); + connect(dealFlopCards6Timer, SIGNAL(timeout()), this, SLOT( handSwitchRounds() )); + connect(dealTurnCards0Timer, SIGNAL(timeout()), this, SLOT( dealTurnCards1() )); + connect(dealTurnCards1Timer, SIGNAL(timeout()), this, SLOT( dealTurnCards2() )); + connect(dealTurnCards2Timer, SIGNAL(timeout()), this, SLOT( handSwitchRounds() )); + connect(dealRiverCards0Timer, SIGNAL(timeout()), this, SLOT( dealRiverCards1() )); + connect(dealRiverCards1Timer, SIGNAL(timeout()), this, SLOT( dealRiverCards2() )); + connect(dealRiverCards2Timer, SIGNAL(timeout()), this, SLOT( handSwitchRounds() )); + + connect(nextPlayerAnimationTimer, SIGNAL(timeout()), this, SLOT( handSwitchRounds() )); + connect(preflopAnimation1Timer, SIGNAL(timeout()), this, SLOT( preflopAnimation1Action() )); + connect(preflopAnimation2Timer, SIGNAL(timeout()), this, SLOT( preflopAnimation2Action() )); + connect(flopAnimation1Timer, SIGNAL(timeout()), this, SLOT( flopAnimation1Action() )); + connect(flopAnimation2Timer, SIGNAL(timeout()), this, SLOT( flopAnimation2Action() )); + connect(turnAnimation1Timer, SIGNAL(timeout()), this, SLOT( turnAnimation1Action() )); + connect(turnAnimation2Timer, SIGNAL(timeout()), this, SLOT( turnAnimation2Action() )); + connect(riverAnimation1Timer, SIGNAL(timeout()), this, SLOT( riverAnimation1Action() )); + connect(riverAnimation2Timer, SIGNAL(timeout()), this, SLOT( riverAnimation2Action() )); + + connect(postRiverAnimation1Timer, SIGNAL(timeout()), this, SLOT( postRiverAnimation1Action() )); + connect(postRiverRunAnimation1Timer, SIGNAL(timeout()), this, SLOT( postRiverRunAnimation2() )); + connect(postRiverRunAnimation2Timer, SIGNAL(timeout()), this, SLOT( postRiverRunAnimation3() )); + connect(postRiverRunAnimation3Timer, SIGNAL(timeout()), this, SLOT( postRiverRunAnimation4() )); + connect(potDistributeTimer, SIGNAL(timeout()), this, SLOT(postRiverRunAnimation5())); + connect(postRiverRunAnimation5Timer, SIGNAL(timeout()), this, SLOT( postRiverRunAnimation6() )); + connect(postRiverRunAnimation6Timer, SIGNAL(timeout()), this, SLOT( startNewHand() )); + // buttonLabelArray init buttonLabelArray[0] = textLabel_Button0; @@ -170,7 +266,7 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name) firstCallNewGame = TRUE; - connect(potDistributeTimer, SIGNAL(timeout()), this, SLOT(postRiverRunAnimation5())); + connect( actionNewGame, SIGNAL( activated() ), this, SLOT( callNewGameDialog() ) ); connect( actionAboutPokerth, SIGNAL( activated() ), this, SLOT( callAboutPokerthDialog() ) ); @@ -214,11 +310,10 @@ void mainWindowImpl::callNewGameDialog() { //Speeds setSpeeds(); - //restliche Singleshots abfangen!!! -// if (firstCallNewGame) { firstCallNewGame = FALSE; } -// else { newRoundTimerBlock = TRUE; } -// QTimer::singleShot(400*gameSpeed, this, SLOT( timerBlockerFalse() )); - + //restliche Singleshots killen!!! + lockTimer(); +// unlockTimer(); + label_Pot->setText("

Pot Total

"); label_Sets->setText("

Sets:

"); @@ -232,6 +327,8 @@ void mainWindowImpl::callNewGameDialog() { //positioning Slider horizontalSlider_speed->setValue(guiGameSpeed); + unlockTimer(); + //Start Game!!! mySession->startGame(v->spinBox_quantityPlayers->value(), v->spinBox_startCash->value(), v->spinBox_smallBlind->value()); @@ -249,10 +346,10 @@ void mainWindowImpl::callNewGameDialog() { //Speeds setSpeeds(); - //restliche Singleshots abfangen!!! -// if (firstCallNewGame) { firstCallNewGame = FALSE; } -// else { newRoundTimerBlock = TRUE; } -// QTimer::singleShot(40*gameSpeed, this, SLOT( timerBlockerFalse() )); + //restliche Singleshots killen!!! + lockTimer(); +// unlockTimer(); + label_Pot->setText("

Pot Total

"); @@ -271,6 +368,7 @@ void mainWindowImpl::callNewGameDialog() { //positioning Slider horizontalSlider_speed->setValue(guiGameSpeed); + unlockTimer(); //Start Game!!! mySession->startGame(myConfig->readConfigInt("NumberOfPlayers",5), myConfig->readConfigInt("StartCash",2000), myConfig->readConfigInt("SmallBlind",10)); @@ -278,7 +376,7 @@ void mainWindowImpl::callNewGameDialog() { } - actionNewGame->setDisabled(TRUE); +// actionNewGame->setDisabled(TRUE); } @@ -542,7 +640,7 @@ void mainWindowImpl::dealFlopCards0() { if( !newRoundTimerBlock ){ - QTimer::singleShot(dealCardsSpeed*2, this, SLOT( dealFlopCards1() )); + dealFlopCards0Timer->start(dealCardsSpeed*2); } else { newRoundTimerBlock=FALSE; } } @@ -553,7 +651,8 @@ if( !newRoundTimerBlock ){ QPixmap flipside(":/othercards/cards/othercards/flipside.png"); boardCardsArray[0]->setPixmap(flipside); - QTimer::singleShot(dealCardsSpeed, this, SLOT( dealFlopCards2() )); +// QTimer::singleShot(dealCardsSpeed, this, SLOT( dealFlopCards2() )); + dealFlopCards1Timer->start(dealCardsSpeed); } else { newRoundTimerBlock=FALSE; } @@ -565,7 +664,8 @@ if( !newRoundTimerBlock ){ QPixmap flipside(":/othercards/cards/othercards/flipside.png"); boardCardsArray[1]->setPixmap(flipside); - QTimer::singleShot(dealCardsSpeed, this, SLOT( dealFlopCards3() )); +// QTimer::singleShot(dealCardsSpeed, this, SLOT( dealFlopCards3() )); + dealFlopCards2Timer->start(dealCardsSpeed); } else { newRoundTimerBlock=FALSE; } @@ -577,8 +677,8 @@ if( !newRoundTimerBlock ){ QPixmap flipside(":/othercards/cards/othercards/flipside.png"); boardCardsArray[2]->setPixmap(flipside); - QTimer::singleShot(dealCardsSpeed, this, SLOT( dealFlopCards4() )); - +// QTimer::singleShot(dealCardsSpeed, this, SLOT( dealFlopCards4() )); + dealFlopCards3Timer->start(dealCardsSpeed); } else { newRoundTimerBlock=FALSE; } @@ -594,7 +694,8 @@ if( !newRoundTimerBlock ){ tempCardsPixmap.load(":/othercards/cards/othercards/"+QString::number(tempBoardCardsArray[0], 10)+".png"); QPixmap card(tempCardsPixmap); boardCardsArray[0]->setPixmap(card); - QTimer::singleShot(dealCardsSpeed, this, SLOT( dealFlopCards5() )); +// QTimer::singleShot(dealCardsSpeed, this, SLOT( dealFlopCards5() )); + dealFlopCards4Timer->start(dealCardsSpeed); } else { newRoundTimerBlock=FALSE; } @@ -610,7 +711,8 @@ if( !newRoundTimerBlock ){ tempCardsPixmap.load(":/othercards/cards/othercards/"+QString::number(tempBoardCardsArray[1], 10)+".png"); QPixmap card(tempCardsPixmap); boardCardsArray[1]->setPixmap(card); - QTimer::singleShot(dealCardsSpeed, this, SLOT( dealFlopCards6() )); +// QTimer::singleShot(dealCardsSpeed, this, SLOT( dealFlopCards6() )); + dealFlopCards5Timer->start(dealCardsSpeed); } else { newRoundTimerBlock=FALSE; } @@ -631,11 +733,13 @@ if( !newRoundTimerBlock ){ // stable // wenn alle All In if(actualHand->getAllInCondition()) { - QTimer::singleShot(dealCardsSpeed*4, this, SLOT( handSwitchRounds() )); +// QTimer::singleShot(dealCardsSpeed*4, this, SLOT( handSwitchRounds() )); + dealFlopCards6Timer->start(dealCardsSpeed*4); } // sonst normale Variante else { - QTimer::singleShot(dealCardsSpeed, this, SLOT( handSwitchRounds() )); +// QTimer::singleShot(dealCardsSpeed, this, SLOT( handSwitchRounds() )); + dealFlopCards6Timer->start(dealCardsSpeed); } } @@ -648,7 +752,8 @@ void mainWindowImpl::dealTurnCards0() { if( !newRoundTimerBlock ){ - QTimer::singleShot(dealCardsSpeed*2, this, SLOT( dealTurnCards1() )); +// QTimer::singleShot(dealCardsSpeed*2, this, SLOT( dealTurnCards1() )); + dealTurnCards0Timer->start(dealCardsSpeed*2); } else { newRoundTimerBlock=FALSE; } } @@ -660,7 +765,8 @@ if( !newRoundTimerBlock ){ QPixmap flipside(":/othercards/cards/othercards/flipside.png"); boardCardsArray[3]->setPixmap(flipside); - QTimer::singleShot(dealCardsSpeed, this, SLOT( dealTurnCards2() )); +// QTimer::singleShot(dealCardsSpeed, this, SLOT( dealTurnCards2() )); + dealTurnCards1Timer->start(dealCardsSpeed); } else { newRoundTimerBlock=FALSE; } @@ -680,11 +786,13 @@ if( !newRoundTimerBlock ){ // stable // wenn alle All In if(actualHand->getAllInCondition()) { - QTimer::singleShot(dealCardsSpeed*4, this, SLOT( handSwitchRounds() )); +// QTimer::singleShot(dealCardsSpeed*4, this, SLOT( handSwitchRounds() )); + dealTurnCards2Timer->start(dealCardsSpeed*4); } // sonst normale Variante else { - QTimer::singleShot(dealCardsSpeed, this, SLOT( handSwitchRounds() )); +// QTimer::singleShot(dealCardsSpeed, this, SLOT( handSwitchRounds() )); + dealTurnCards2Timer->start(dealCardsSpeed); } } else { newRoundTimerBlock=FALSE; } @@ -696,7 +804,8 @@ void mainWindowImpl::dealRiverCards0() { if( !newRoundTimerBlock ){ - QTimer::singleShot(dealCardsSpeed*2, this, SLOT( dealRiverCards1() )); +// QTimer::singleShot(dealCardsSpeed*2, this, SLOT( dealRiverCards1() )); + dealRiverCards0Timer->start(dealCardsSpeed*2); } else { newRoundTimerBlock=FALSE; } } @@ -707,8 +816,8 @@ if( !newRoundTimerBlock ){ QPixmap flipside(":/othercards/cards/othercards/flipside.png"); boardCardsArray[4]->setPixmap(flipside); - QTimer::singleShot(dealCardsSpeed, this, SLOT( dealRiverCards2() )); - +// QTimer::singleShot(dealCardsSpeed, this, SLOT( dealRiverCards2() )); + dealRiverCards1Timer->start(dealCardsSpeed); } else { newRoundTimerBlock=FALSE; } @@ -729,11 +838,13 @@ if( !newRoundTimerBlock ){ // stable // wenn alle All In if(actualHand->getAllInCondition()) { - QTimer::singleShot(dealCardsSpeed*4, this, SLOT( handSwitchRounds() )); +// QTimer::singleShot(dealCardsSpeed*4, this, SLOT( handSwitchRounds() )); + dealRiverCards2Timer->start(dealCardsSpeed*4); } // sonst normale Variante else { - QTimer::singleShot(dealCardsSpeed, this, SLOT( handSwitchRounds() )); +// QTimer::singleShot(dealCardsSpeed, this, SLOT( handSwitchRounds() )); + dealRiverCards2Timer->start(dealCardsSpeed); } } @@ -744,7 +855,7 @@ else { newRoundTimerBlock=FALSE; } void mainWindowImpl::meInAction() { - actionNewGame->setDisabled(FALSE); +// actionNewGame->setDisabled(FALSE); switch (actualHand->getActualRound()) { @@ -1041,43 +1152,44 @@ void mainWindowImpl::myAllIn(){ void mainWindowImpl::nextPlayerAnimation() { - actionNewGame->setDisabled(TRUE); +// actionNewGame->setDisabled(TRUE); refreshChangePlayer(); //weiter mit switchrounds in Hand - QTimer::singleShot(nextPlayerSpeed1, this, SLOT( handSwitchRounds() )); +// // QTimer::singleShot(nextPlayerSpeed1, this, SLOT( handSwitchRounds() )); + nextPlayerAnimationTimer->start(nextPlayerSpeed1); } -void mainWindowImpl::preflopAnimation1() { QTimer::singleShot(nextPlayerSpeed2, this, SLOT(preflopAnimation1Action())); } +void mainWindowImpl::preflopAnimation1() { preflopAnimation1Timer->start(nextPlayerSpeed2); } void mainWindowImpl::preflopAnimation1Action() { actualHand->getPreflop()->preflopRun(); } -void mainWindowImpl::preflopAnimation2() { QTimer::singleShot(preflopNextPlayerSpeed, this, SLOT(preflopAnimation2Action())); } +void mainWindowImpl::preflopAnimation2() { preflopAnimation2Timer->start(preflopNextPlayerSpeed); } void mainWindowImpl::preflopAnimation2Action() { actualHand->getPreflop()->nextPlayer2(); } -void mainWindowImpl::flopAnimation1() { QTimer::singleShot(nextPlayerSpeed2, this, SLOT(flopAnimation1Action())); } +void mainWindowImpl::flopAnimation1() { flopAnimation1Timer->start(nextPlayerSpeed2); } void mainWindowImpl::flopAnimation1Action() { actualHand->getFlop()->flopRun(); } -void mainWindowImpl::flopAnimation2() { QTimer::singleShot(nextPlayerSpeed3, this, SLOT(flopAnimation2Action())); } +void mainWindowImpl::flopAnimation2() { flopAnimation2Timer->start(nextPlayerSpeed3); } void mainWindowImpl::flopAnimation2Action() { actualHand->getFlop()->nextPlayer2(); } -void mainWindowImpl::turnAnimation1() { QTimer::singleShot(nextPlayerSpeed2, this, SLOT(turnAnimation1Action())); } +void mainWindowImpl::turnAnimation1() { turnAnimation1Timer->start(nextPlayerSpeed2); } void mainWindowImpl::turnAnimation1Action() { actualHand->getTurn()->turnRun(); } -void mainWindowImpl::turnAnimation2() { QTimer::singleShot(nextPlayerSpeed3, this, SLOT(turnAnimation2Action())); } +void mainWindowImpl::turnAnimation2() { turnAnimation2Timer->start(nextPlayerSpeed3); } void mainWindowImpl::turnAnimation2Action() { actualHand->getTurn()->nextPlayer2(); } -void mainWindowImpl::riverAnimation1() { QTimer::singleShot(nextPlayerSpeed2, this, SLOT(riverAnimation1Action())); } +void mainWindowImpl::riverAnimation1() { riverAnimation1Timer->start(nextPlayerSpeed2); } void mainWindowImpl::riverAnimation1Action() { actualHand->getRiver()->riverRun(); } -void mainWindowImpl::riverAnimation2() { QTimer::singleShot(nextPlayerSpeed3, this, SLOT(riverAnimation2Action())); } +void mainWindowImpl::riverAnimation2() { riverAnimation2Timer->start(nextPlayerSpeed3); } void mainWindowImpl::riverAnimation2Action() { actualHand->getRiver()->nextPlayer2(); } -void mainWindowImpl::postRiverAnimation1() { QTimer::singleShot(nextPlayerSpeed2, this, SLOT(postRiverAnimation1Action())); } +void mainWindowImpl::postRiverAnimation1() { postRiverAnimation1Timer->start(nextPlayerSpeed2); } void mainWindowImpl::postRiverAnimation1Action() { actualHand->getRiver()->postRiverRun(); } @@ -1095,7 +1207,7 @@ void mainWindowImpl::postRiverRunAnimation1() { - QTimer::singleShot(postRiverRunAnimationSpeed, this, SLOT( postRiverRunAnimation2() )); + postRiverRunAnimation1Timer->start(postRiverRunAnimationSpeed); } @@ -1132,7 +1244,7 @@ if( !newRoundTimerBlock ){ } } } - QTimer::singleShot(postRiverRunAnimationSpeed, this, SLOT( postRiverRunAnimation3() )); + postRiverRunAnimation2Timer->start(postRiverRunAnimationSpeed); } else { postRiverRunAnimation3(); } } @@ -1159,7 +1271,7 @@ if( !newRoundTimerBlock ){ //Hintergrundfarbe der userWidgets anpassen; userWidgetsBackgroudColor(); - QTimer::singleShot(postRiverRunAnimationSpeed/2, this, SLOT( postRiverRunAnimation4() )); + postRiverRunAnimation3Timer->start(postRiverRunAnimationSpeed/2); } else { newRoundTimerBlock=FALSE; } @@ -1225,7 +1337,7 @@ if( !newRoundTimerBlock ){ } else { potDistributeTimer->stop(); - QTimer::singleShot(gameSpeed, this, SLOT( postRiverRunAnimation6() )); + postRiverRunAnimation5Timer->start(gameSpeed); } } @@ -1259,7 +1371,7 @@ if( !newRoundTimerBlock ){ else { } - QTimer::singleShot(newRoundSpeed, this, SLOT( startNewHand() )); + postRiverRunAnimation6Timer->start(newRoundSpeed); } else { newRoundTimerBlock=FALSE; } @@ -1323,6 +1435,78 @@ void mainWindowImpl::nextRoundCleanGui() { } +void mainWindowImpl::lockTimer() { + + dealFlopCards0Timer->blockSignals(TRUE); + dealFlopCards1Timer->blockSignals(TRUE); + dealFlopCards2Timer->blockSignals(TRUE); + dealFlopCards3Timer->blockSignals(TRUE); + dealFlopCards4Timer->blockSignals(TRUE); + dealFlopCards5Timer->blockSignals(TRUE); + dealFlopCards6Timer->blockSignals(TRUE); + dealTurnCards0Timer->blockSignals(TRUE); + dealTurnCards1Timer->blockSignals(TRUE); + dealTurnCards2Timer->blockSignals(TRUE); + dealRiverCards0Timer->blockSignals(TRUE); + dealRiverCards1Timer->blockSignals(TRUE); + dealRiverCards2Timer->blockSignals(TRUE); + + nextPlayerAnimationTimer->blockSignals(TRUE); + preflopAnimation1Timer->blockSignals(TRUE); + preflopAnimation2Timer->blockSignals(TRUE); + flopAnimation1Timer->blockSignals(TRUE); + flopAnimation2Timer->blockSignals(TRUE); + turnAnimation1Timer->blockSignals(TRUE); + turnAnimation2Timer->blockSignals(TRUE); + riverAnimation1Timer->blockSignals(TRUE); + riverAnimation2Timer->blockSignals(TRUE); + + postRiverAnimation1Timer->blockSignals(TRUE); + postRiverRunAnimation1Timer->blockSignals(TRUE); + postRiverRunAnimation2Timer->blockSignals(TRUE); + postRiverRunAnimation3Timer->blockSignals(TRUE); + postRiverRunAnimation5Timer->blockSignals(TRUE); + postRiverRunAnimation6Timer->blockSignals(TRUE); + potDistributeTimer->blockSignals(TRUE); + +} + +void mainWindowImpl::unlockTimer() { + + dealFlopCards0Timer->blockSignals(FALSE); + dealFlopCards1Timer->blockSignals(FALSE); + dealFlopCards2Timer->blockSignals(FALSE); + dealFlopCards3Timer->blockSignals(FALSE); + dealFlopCards4Timer->blockSignals(FALSE); + dealFlopCards5Timer->blockSignals(FALSE); + dealFlopCards6Timer->blockSignals(FALSE); + dealTurnCards0Timer->blockSignals(FALSE); + dealTurnCards1Timer->blockSignals(FALSE); + dealTurnCards2Timer->blockSignals(FALSE); + dealRiverCards0Timer->blockSignals(FALSE); + dealRiverCards1Timer->blockSignals(FALSE); + dealRiverCards2Timer->blockSignals(FALSE); + + nextPlayerAnimationTimer->blockSignals(FALSE); + preflopAnimation1Timer->blockSignals(FALSE); + preflopAnimation2Timer->blockSignals(FALSE); + flopAnimation1Timer->blockSignals(FALSE); + flopAnimation2Timer->blockSignals(FALSE); + turnAnimation1Timer->blockSignals(FALSE); + turnAnimation2Timer->blockSignals(FALSE); + riverAnimation1Timer->blockSignals(FALSE); + riverAnimation2Timer->blockSignals(FALSE); + + postRiverAnimation1Timer->blockSignals(FALSE); + postRiverRunAnimation1Timer->blockSignals(FALSE); + postRiverRunAnimation2Timer->blockSignals(FALSE); + postRiverRunAnimation3Timer->blockSignals(FALSE); + postRiverRunAnimation5Timer->blockSignals(FALSE); + postRiverRunAnimation6Timer->blockSignals(FALSE); + potDistributeTimer->blockSignals(FALSE); +} + + void mainWindowImpl::userWidgetsBackgroudColor() { @@ -1377,6 +1561,16 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) { // cout << event->key() << endl; if (event->key() == 16777265) { switchToolBox(); } +// if (event->key() == 65) { +// dealFlopCards0Timer->blockSignals(TRUE); +// dealFlopCards1Timer->blockSignals(TRUE); +// dealFlopCards2Timer->blockSignals(TRUE); +// dealFlopCards3Timer->blockSignals(TRUE); +// dealFlopCards4Timer->blockSignals(TRUE); +// dealFlopCards5Timer->blockSignals(TRUE); +// dealFlopCards6Timer->blockSignals(TRUE); +// } + } @@ -1387,3 +1581,8 @@ void mainWindowImpl::switchToolBox() { } +// void mainWindowImpl::processOneThing() { +// +// cout << "wurst" << endl; +// timer->start(300); +// } diff --git a/src/gui/qt/mainwindowimpl.h b/src/gui/qt/mainwindowimpl.h index 154130d7..0115d97d 100755 --- a/src/gui/qt/mainwindowimpl.h +++ b/src/gui/qt/mainwindowimpl.h @@ -150,6 +150,10 @@ public slots: void handSwitchRounds(); void startNewHand(); + + void lockTimer(); + void unlockTimer(); + void nextRoundCleanGui(); void userWidgetsBackgroudColor(); @@ -159,6 +163,9 @@ public slots: void keyPressEvent ( QKeyEvent * event ); void switchToolBox(); +// void processOneThing(); + + private: Game *actualGame; @@ -167,9 +174,40 @@ private: Log *myLog; ConfigFile *myConfig; - + //Timer QTimer *potDistributeTimer; + QTimer *timer; + QTimer *dealFlopCards0Timer; + QTimer *dealFlopCards1Timer; + QTimer *dealFlopCards2Timer; + QTimer *dealFlopCards3Timer; + QTimer *dealFlopCards4Timer; + QTimer *dealFlopCards5Timer; + QTimer *dealFlopCards6Timer; + QTimer *dealTurnCards0Timer; + QTimer *dealTurnCards1Timer; + QTimer *dealTurnCards2Timer; + QTimer *dealRiverCards0Timer; + QTimer *dealRiverCards1Timer; + QTimer *dealRiverCards2Timer; + QTimer *nextPlayerAnimationTimer; + QTimer *preflopAnimation1Timer; + QTimer *preflopAnimation2Timer; + QTimer *flopAnimation1Timer; + QTimer *flopAnimation2Timer; + QTimer *turnAnimation1Timer; + QTimer *turnAnimation2Timer; + QTimer *riverAnimation1Timer; + QTimer *riverAnimation2Timer; + + QTimer *postRiverAnimation1Timer; + QTimer *postRiverRunAnimation1Timer; + QTimer *postRiverRunAnimation2Timer; + QTimer *postRiverRunAnimation3Timer; + QTimer *postRiverRunAnimation5Timer; + QTimer *postRiverRunAnimation6Timer; + QWidget *userWidgetsArray[8]; QLabel *buttonLabelArray[5]; QLabel *cashLabelArray[5]; diff --git a/src/gui/qt/newgamedialog.ui b/src/gui/qt/newgamedialog.ui index d562cf2a..adef66db 100755 --- a/src/gui/qt/newgamedialog.ui +++ b/src/gui/qt/newgamedialog.ui @@ -5,8 +5,8 @@ 0 0 - 212 - 212 + 277 + 243 @@ -31,7 +31,47 @@ 6 - + + + + 11 + + + 1 + + + 1 + + + 4 + + + + + + + Hands before raise Small Blind + + + + + + + 1 + + + 9 + + + + + + + Game-Speed + + + + 5 @@ -44,7 +84,7 @@ - + 500 @@ -57,7 +97,7 @@ - + 5000 @@ -77,13 +117,6 @@ - - - - Game-Speed - - - @@ -98,22 +131,6 @@ - - - - 11 - - - 1 - - - 1 - - - 4 - - - diff --git a/src/gui/qt/newgamedialogimpl.cpp b/src/gui/qt/newgamedialogimpl.cpp index 2688dcf4..43132510 100755 --- a/src/gui/qt/newgamedialogimpl.cpp +++ b/src/gui/qt/newgamedialogimpl.cpp @@ -35,7 +35,7 @@ newGameDialogImpl::newGameDialogImpl(QWidget *parent, const char *name) spinBox_startCash->setValue(myConfig.readConfigInt("StartCash", 2000)); spinBox_smallBlind->setValue(myConfig.readConfigInt("SmallBlind", 10)); spinBox_gameSpeed->setValue(myConfig.readConfigInt("GameSpeed", 4)); - + spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig.readConfigInt("HandsBeforeRaiseSmallBlind", 9)); } diff --git a/src/gui/qt/settingsdialog.ui b/src/gui/qt/settingsdialog.ui index 8be5f2c7..792deb40 100644 --- a/src/gui/qt/settingsdialog.ui +++ b/src/gui/qt/settingsdialog.ui @@ -12,375 +12,408 @@ PokerTH - Settings - - - 9 + + + + 9 + 302 + 469 + 28 + - - 6 + + Qt::Horizontal - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok - - + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + 9 + 9 + 150 + 278 + + + + + 150 + 16777215 + + + + + Game Settings + - - - - - 150 - 16777215 - - - - - Game Settings - - - - - Interface - - - - - Player Nicks - - - - - Log Messages - - - + + + Interface + - - - - 0 + + + Player Nicks + + + + + Log Messages + + + + + + + 9 + 293 + 469 + 16 + + + + Qt::Horizontal + + + + + + 170 + 20 + 313 + 275 + + + + 0 + + + + + 9 - - - + + 6 + + + + + 1 + + 9 - - 6 + + + + + + Game-Speed - - - - Qt::Horizontal - - - - - - - Show game settings dialog on every new game - - - - - - - Game-Speed - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - 500 - - - 5 - - - - - - - Start Cash - - - - - - - Small Blind - - - - - - - Number of Players - - - - - - - - 75 - true - - - - Game Settings - - - - - - - 5000 - - - 1000 - - - - - - - 11 - - - 1 - - - 1 - - - - - - - 5 - - - 2 - - - - - - - - - 9 + + + + + + 11 - - 6 + + 1 - - - - - 75 - true - - - - Interface - - - - - - - Qt::Horizontal - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Show Toolbox (F2 to switch on/off) - - - - - - - - - 9 + + 1 - - 6 + + + + + + Hands before raise Small Blind - - - - - 75 - true - - - - Player Nicks - - - - - - - Qt::Vertical - - - - 295 - 51 - - - - - - - - Human Player: - - - - - - - Opponent 2: - - - - - - - Opponent 4: - - - - - - - Opponent 3: - - - - - - - Opponent 1: - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - - - - - - 9 + + + + + + 5 - - 6 + + 2 - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Horizontal - - - - - - - - 75 - true - - - - Log Messages - - - - - - - - - - - Qt::Horizontal + + + + + + 5000 + + + 1000 + + + + + + + + 75 + true + + + + Game Settings + + + + + + + Number of Players + + + + + + + Small Blind + + + + + + + Start Cash + + + + + + + 500 + + + 5 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Show Game Settings Dialog on every new Game + + + + + + + Qt::Horizontal + + + + + + + + + 9 - - - + + 6 + + + + + + 75 + true + + + + Interface + + + + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Show Toolbox (F2 to switch on/off) + + + + + + + + + 9 + + + 6 + + + + + + 75 + true + + + + Player Nicks + + + + + + + Qt::Vertical + + + + 295 + 51 + + + + + + + + Human Player: + + + + + + + Opponent 2: + + + + + + + Opponent 4: + + + + + + + Opponent 3: + + + + + + + Opponent 1: + + + + + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + + + + + + 9 + + + 6 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + + + + + + 75 + true + + + + Log Messages + + + + + + listWidget diff --git a/src/gui/qt/settingsdialogimpl.cpp b/src/gui/qt/settingsdialogimpl.cpp index b8165b4d..f5fa9f0f 100644 --- a/src/gui/qt/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialogimpl.cpp @@ -42,6 +42,7 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, const char *name) spinBox_quantityPlayers->setValue(myConfig.readConfigInt("NumberOfPlayers", 5)); spinBox_startCash->setValue(myConfig.readConfigInt("StartCash", 2000)); spinBox_smallBlind->setValue(myConfig.readConfigInt("SmallBlind", 10)); + spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig.readConfigInt("HandsBeforeRaiseSmallBlind", 9)); spinBox_gameSpeed->setValue(myConfig.readConfigInt("GameSpeed", 4)); checkBox_showGameSettingsDialogOnNewGame->setChecked(myConfig.readConfigInt("ShowGameSettingsDialogOnNewGame", 1)); @@ -69,6 +70,7 @@ void settingsDialogImpl::isAccepted() { myConfig.writeConfigInt("NumberOfPlayers", spinBox_quantityPlayers->value()); myConfig.writeConfigInt("StartCash", spinBox_startCash->value()); myConfig.writeConfigInt("SmallBlind", spinBox_smallBlind->value()); + myConfig.writeConfigInt("HandsBeforeRaiseSmallBlind", spinBox_handsBeforeRaiseSmallBlind->value()); myConfig.writeConfigInt("GameSpeed", spinBox_gameSpeed->value()); myConfig.writeConfigInt("ShowGameSettingsDialogOnNewGame", checkBox_showGameSettingsDialogOnNewGame->isChecked());