diff --git a/src/engine/handinterface.h b/src/engine/handinterface.h index 0a1795ca..6504dcc2 100644 --- a/src/engine/handinterface.h +++ b/src/engine/handinterface.h @@ -71,6 +71,9 @@ public: virtual void setBettingRoundsPlayed(const int& theValue) =0; virtual int getBettingRoundsPlayed() const =0; + virtual void setLastPlayersTurn(const int& theValue) =0; + virtual int getLastPlayersTurn() const =0; + virtual void assignButtons() =0; virtual void highlightRoundLabel() =0; diff --git a/src/engine/local_engine/localflop.cpp b/src/engine/local_engine/localflop.cpp index ea45f6ff..1cfdbed3 100755 --- a/src/engine/local_engine/localflop.cpp +++ b/src/engine/local_engine/localflop.cpp @@ -76,8 +76,11 @@ void LocalFlop::flopRun() { myHand->getBoard()->collectSets(); myHand->getBoard()->collectPot(); myHand->getGuiInterface()->refreshPot(); - myHand->getGuiInterface()->refreshAll(); - + + myHand->getGuiInterface()->refreshSet(); + myHand->getGuiInterface()->refreshCash(); + myHand->getGuiInterface()->refreshAction(); + myHand->switchRounds(); } @@ -100,7 +103,7 @@ void LocalFlop::flopRun() { } while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6); myHand->getPlayerArray()[playersTurn]->setMyTurn(1); - myHand->getGuiInterface()->refreshGroupbox(); + myHand->getGuiInterface()->refreshGroupbox(playersTurn,2); // cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl; // cout << "playersTurn " << playersTurn << endl; diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index 57b86d4d..0dd8b002 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -25,6 +25,8 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe { int i, j, k; + lastPlayersTurn = 0; + CardsValue myCardsValue; myGui->setHand(this); @@ -47,7 +49,7 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe // Dealer, SB, BB bestimmen assignButtons(); - myGui->refreshAll(); +// myGui->refreshAll(); // Karten generieren und Board sowie Player zuweisen Tools myTool; @@ -237,8 +239,9 @@ void LocalHand::switchRounds() { actualRound++; } + //unhighlight actual players groupbox + myGui->refreshGroupbox(lastPlayersTurn,1); - myGui->refreshGroupbox(); highlightRoundLabel(); // /*/*/*/*cout <<*/*/*/*/ "NextPlayerSpeed1 stop" << endl; // diff --git a/src/engine/local_engine/localhand.h b/src/engine/local_engine/localhand.h index e5120f88..edc48f81 100755 --- a/src/engine/local_engine/localhand.h +++ b/src/engine/local_engine/localhand.h @@ -81,6 +81,10 @@ public: void setBettingRoundsPlayed(const int& theValue) { bettingRoundsPlayed = theValue; } int getBettingRoundsPlayed() const { return bettingRoundsPlayed; } + void setLastPlayersTurn(const int& theValue) { lastPlayersTurn = theValue; } + int getLastPlayersTurn() const { return lastPlayersTurn; } + + void assignButtons(); void highlightRoundLabel(); @@ -114,6 +118,8 @@ private: int startCash; int activePlayersCounter; + int lastPlayersTurn; + bool allInCondition; // hier steht bis zu welcher bettingRound der human player gespielt hat: 0 - nur Preflop, 1 - bis Flop, ... diff --git a/src/engine/local_engine/localplayer.cpp b/src/engine/local_engine/localplayer.cpp index 2f9b356e..3e55b73c 100755 --- a/src/engine/local_engine/localplayer.cpp +++ b/src/engine/local_engine/localplayer.cpp @@ -63,12 +63,15 @@ LocalPlayer::LocalPlayer(BoardInterface *b, int id, std::string name, std::strin } + LocalPlayer::~LocalPlayer() { } + void LocalPlayer::setHand(HandInterface* br) { actualHand = br; } + void LocalPlayer::action() { ConfigFile myConfig; @@ -116,6 +119,9 @@ void LocalPlayer::action() { myTurn = 0; // cout << "jetzt" << endl; + //set that i was the last active player. need this for unhighlighting groupbox + actualHand->setLastPlayersTurn(myID); + actualHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet); actualHand->getGuiInterface()->nextPlayerAnimation(); @@ -128,10 +134,11 @@ void LocalPlayer::preflopEngine() { int bet = 0; int raise = 0; - // übergang solange preflopValue und flopValue noch nicht bereinigt + // temporär solange preflopValue und flopValue noch nicht bereinigt für sechs und sieben spieler int players = actualHand->getActualQuantityPlayers(); if(players > 5) players = 5; - + + // myOdds auslesen readFile(); // Niveaus setzen + Dude + Anzahl Gegenspieler @@ -144,9 +151,7 @@ void LocalPlayer::preflopEngine() { int individualHighestSet = actualHand->getPreflop()->getHighestSet(); if(individualHighestSet > myCash) individualHighestSet = myCash; - // Verhaeltnis Set / Cash - - + // Verhaeltnis Set / Cash für call if(myCash/individualHighestSet >= 25) { myNiveau[0] += (25-myCash/individualHighestSet)/10; } else { @@ -158,9 +163,17 @@ void LocalPlayer::preflopEngine() { myNiveau[2] += (10-myCash/individualHighestSet)/2; } -// cout << myID << ": " << myHoleCardsValue << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << myCards[0] << " " << myCards[1] << endl; +// cout << myID << ": " << myHoleCardsValue << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << myCards[0] << " " << myCards[1] << endl; + + // Aggresivität des humanPlayers auslesen + int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*0.1)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*7.0); + +// if(aggValue > 0) { +// myNiveau[0] -= aggValue; +// myNiveau[2] -= aggValue; +// } + - // auf Aggresivität des humanPlayers eingehen // int aggValue = ( (50*(actualHand->getPlayerArray()[0]->getMyAverageSets()-6*actualHand->getSmallBlind())) / (actualHand->getStartQuantityPlayers()*actualHand->getStartCash() - 6*actualHand->getSmallBlind()) ); // if(aggValue > 0) { @@ -869,7 +882,6 @@ void LocalPlayer::riverEngine() { } - void LocalPlayer::evaluation(int bet, int raise) { int highestSet = 0; @@ -967,10 +979,6 @@ void LocalPlayer::evaluation(int bet, int raise) { } - - - - int LocalPlayer::preflopCardsValue(int* cards) { // Code der HoleCards ermitteln @@ -995,9 +1003,6 @@ int LocalPlayer::preflopCardsValue(int* cards) { } - - - int LocalPlayer::flopCardsValue(int* cards) { int array[5][3]; diff --git a/src/engine/local_engine/localpreflop.cpp b/src/engine/local_engine/localpreflop.cpp index bbfdbce9..00da1a35 100755 --- a/src/engine/local_engine/localpreflop.cpp +++ b/src/engine/local_engine/localpreflop.cpp @@ -83,8 +83,11 @@ void LocalPreflop::preflopRun() { myHand->getBoard()->collectSets(); myHand->getBoard()->collectPot(); myHand->getGuiInterface()->refreshPot(); - myHand->getGuiInterface()->refreshAll(); + myHand->getGuiInterface()->refreshSet(); + myHand->getGuiInterface()->refreshCash(); + myHand->getGuiInterface()->refreshAction(); + myHand->switchRounds(); } @@ -101,7 +104,7 @@ void LocalPreflop::preflopRun() { } while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || myHand->getPlayerArray()[playersTurn]->getMyAction() == 1 || myHand->getPlayerArray()[playersTurn]->getMyAction() == 6); myHand->getPlayerArray()[playersTurn]->setMyTurn(1); - myHand->getGuiInterface()->refreshGroupbox(); + myHand->getGuiInterface()->refreshGroupbox(playersTurn,2); if(playersTurn == 0) { // Wir sind dran diff --git a/src/engine/local_engine/localriver.cpp b/src/engine/local_engine/localriver.cpp index 0275d215..d1e2e8b7 100755 --- a/src/engine/local_engine/localriver.cpp +++ b/src/engine/local_engine/localriver.cpp @@ -77,7 +77,10 @@ void LocalRiver::riverRun() { myHand->getBoard()->collectSets(); myHand->getBoard()->collectPot(); myHand->getGuiInterface()->refreshPot(); - myHand->getGuiInterface()->refreshAll(); + + myHand->getGuiInterface()->refreshSet(); + myHand->getGuiInterface()->refreshCash(); + myHand->getGuiInterface()->refreshAction(); myHand->switchRounds(); @@ -100,7 +103,7 @@ void LocalRiver::riverRun() { } while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6); myHand->getPlayerArray()[playersTurn]->setMyTurn(1); - myHand->getGuiInterface()->refreshGroupbox(); + myHand->getGuiInterface()->refreshGroupbox(playersTurn,2); // cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl; // cout << "playersTurn " << playersTurn << endl; @@ -157,11 +160,9 @@ void LocalRiver::postRiverRun() { } } - // prüfen ob nur noch der human player an der verteilung teilnimmt + // prüfen ob nur noch der human player an der verteilung teilnimmt und myAggressive für human player setzen myHand->getPlayerArray()[0]->setMyAggressive(potPlayers == 1 && myHand->getPlayerArray()[0]->getMyActiveStatus() && myHand->getPlayerArray()[0]->getMyAction() != 1); - cout << "aggressive: " << myHand->getPlayerArray()[0]->getMyAggressive() << endl; - // Pot-Verteilung distributePot(); diff --git a/src/engine/local_engine/localturn.cpp b/src/engine/local_engine/localturn.cpp index 2177dd5d..938ff92f 100755 --- a/src/engine/local_engine/localturn.cpp +++ b/src/engine/local_engine/localturn.cpp @@ -78,7 +78,10 @@ void LocalTurn::turnRun() { myHand->getBoard()->collectSets(); myHand->getBoard()->collectPot(); myHand->getGuiInterface()->refreshPot(); - myHand->getGuiInterface()->refreshAll(); + + myHand->getGuiInterface()->refreshSet(); + myHand->getGuiInterface()->refreshCash(); + myHand->getGuiInterface()->refreshAction(); myHand->switchRounds(); @@ -101,7 +104,7 @@ void LocalTurn::turnRun() { } while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6); myHand->getPlayerArray()[playersTurn]->setMyTurn(1); - myHand->getGuiInterface()->refreshGroupbox(); + myHand->getGuiInterface()->refreshGroupbox(playersTurn,2); // cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl; // cout << "playersTurn " << playersTurn << endl; diff --git a/src/game.cpp b/src/game.cpp index 215335d8..1d303055 100755 --- a/src/game.cpp +++ b/src/game.cpp @@ -143,7 +143,7 @@ void Game::startHand() myGui->nextRoundCleanGui(); //Spielernamen schreiben - myGui->refreshPlayerName(); +// myGui->refreshPlayerName(); // Dealer-Button weiterschieben --> Achtung inactive do { diff --git a/src/gui/guiinterface.h b/src/gui/guiinterface.h index 15bfda9d..7d698b70 100644 --- a/src/gui/guiinterface.h +++ b/src/gui/guiinterface.h @@ -44,9 +44,11 @@ public: //refresh-Funktionen virtual void refreshSet() const=0; + virtual void refreshCash() const=0; + virtual void refreshAction(int =-1, int =-1) const=0; virtual void refreshChangePlayer() const=0; virtual void refreshPot() const=0; - virtual void refreshGroupbox() const=0; + virtual void refreshGroupbox(int =-1, int =-1) const=0; virtual void refreshAll() const=0; virtual void refreshPlayerName() const=0; diff --git a/src/gui/qt/guiwrapper.cpp b/src/gui/qt/guiwrapper.cpp index ffd0d343..889362a1 100644 --- a/src/gui/qt/guiwrapper.cpp +++ b/src/gui/qt/guiwrapper.cpp @@ -48,10 +48,12 @@ void GuiWrapper::setSession(Session *s) { myW->setSession(s); } int GuiWrapper::getMaxQuantityPlayers() const { return myW->getMaxQuantityPlayers(); } void GuiWrapper::refreshSet() const { myW->refreshSet(); } +void GuiWrapper::refreshCash() const { myW->refreshCash(); } +void GuiWrapper::refreshAction(int playerID, int playerAction) const { myW->refreshAction(playerID, playerAction); } void GuiWrapper::refreshChangePlayer() const { myW->refreshChangePlayer(); } void GuiWrapper::refreshAll() const { myW->refreshAll(); } void GuiWrapper::refreshPot() const { myW->refreshPot(); } -void GuiWrapper::refreshGroupbox() const { myW->refreshGroupbox(); } +void GuiWrapper::refreshGroupbox(int playerID, int status) const { myW->refreshGroupbox(playerID, status); } void GuiWrapper::refreshPlayerName() const { myW->refreshPlayerName(); } void GuiWrapper::dealHoleCards() const { myW->dealHoleCards(); } diff --git a/src/gui/qt/guiwrapper.h b/src/gui/qt/guiwrapper.h index 89db6da9..483f6d70 100644 --- a/src/gui/qt/guiwrapper.h +++ b/src/gui/qt/guiwrapper.h @@ -49,9 +49,11 @@ public: int getMaxQuantityPlayers() const; void refreshSet() const; + void refreshCash() const; + void refreshAction(int =-1, int =-1) const; void refreshChangePlayer() const; void refreshPot() const; - void refreshGroupbox() const; + void refreshGroupbox(int =-1, int =-1) const; void refreshAll() const; void refreshPlayerName() const; @@ -92,8 +94,8 @@ public: void SignalNetClientGameInfo(int actionID); void SignalNetClientError(int errorID, int osErrorID); - void SignalNetServerSuccess(int actionID); - void SignalNetServerError(int errorID, int osErrorID); + void SignalNetServerSuccess(int actionID); + void SignalNetServerError(int errorID, int osErrorID); private: diff --git a/src/gui/qt/mainwindow.ui b/src/gui/qt/mainwindow.ui index d746ab71..a4b9ece3 100644 --- a/src/gui/qt/mainwindow.ui +++ b/src/gui/qt/mainwindow.ui @@ -574,44 +574,34 @@ - + 197 - 0 + 172 197 - 16777215 + 172 - - 0 + + QGroupBox { background-image: url(:/graphics/resources/graphics/toolboxFrameBG.png) } - - - QWidget { background-image: url(:/graphics/resources/graphics/1px.png) } + + + + 10 + 20 + 181 + 133 + + + + :/graphics/resources/graphics/handRanking_release.png - - Hands - - - - 5 - - - 0 - - - - - :/graphics/resources/graphics/handRanking_release.png - - - - @@ -813,19 +803,6 @@ - - - - 25 - 120 - 50 - 50 - - - - - - @@ -900,6 +877,28 @@ Qt::AlignHCenter|Qt::AlignTop + + + + 232 + 44 + 55 + 21 + + + + + 40 + 0 + + + + Qt::NoFocus + + + 5 + + @@ -946,6 +945,9 @@ + + Qt::NoFocus + @@ -993,24 +995,8 @@ - - - - - 232 - 44 - 55 - 21 - - - - - 40 - 0 - - - - 5 + + Qt::NoFocus @@ -1059,6 +1045,25 @@ + + Qt::NoFocus + + + + + + 25 + 120 + 50 + 50 + + + + + + + true + @@ -1119,7 +1124,7 @@ - + 197 @@ -1132,44 +1137,115 @@ 172 + + QGroupBox { background-image: url(:/graphics/resources/graphics/toolboxFrameBG.png) } + - 0 + 9 5 - - - - 16777215 - 162 - + + + + + + + + 40 + 82 + 0 + + + + + + + 29 + 59 + 0 + + + + + + + 29 + 59 + 0 + + + + + + + + + 40 + 82 + 0 + + + + + + + 29 + 59 + 0 + + + + + + + 29 + 59 + 0 + + + + + + + + + 40 + 82 + 0 + + + + + + + 29 + 59 + 0 + + + + + + + 29 + 59 + 0 + + + + + - - 0 + + Qt::NoFocus + + + Qt::ScrollBarAlwaysOff - - - Log - - - - 4 - - - 0 - - - - - Qt::ScrollBarAlwaysOff - - - - - @@ -1249,6 +1325,9 @@ + + Qt::NoFocus + 1 @@ -1274,12 +1353,21 @@ + + + + 40 + 82 + 0 + + + - 0 - 0 - 0 + 240 + 240 + 240 @@ -1294,12 +1382,21 @@ + + + + 40 + 82 + 0 + + + - 0 - 0 - 0 + 240 + 240 + 240 @@ -1314,6 +1411,15 @@ + + + + 40 + 82 + 0 + + + @@ -1335,6 +1441,9 @@ + + Qt::NoFocus + Stop @@ -1594,19 +1703,6 @@ Qt::AlignBottom|Qt::AlignHCenter - - - - 17 - 17 - 50 - 50 - - - - - - @@ -1639,6 +1735,22 @@ + + + + 17 + 17 + 50 + 50 + + + + + + + true + + @@ -2681,19 +2793,6 @@ Qt::AlignBottom|Qt::AlignHCenter - - - - 17 - 17 - 50 - 50 - - - - - - @@ -2739,6 +2838,22 @@ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + 17 + 17 + 50 + 50 + + + + + + + true + + @@ -3023,6 +3138,9 @@ + + true + @@ -3255,19 +3373,6 @@ Qt::AlignBottom|Qt::AlignHCenter - - - - 17 - 17 - 50 - 50 - - - - - - @@ -3300,6 +3405,22 @@ + + + + 17 + 17 + 50 + 50 + + + + + + + true + + @@ -3575,6 +3696,9 @@ + + true + @@ -3794,19 +3918,6 @@ Qt::AlignBottom|Qt::AlignHCenter - - - - 17 - 17 - 50 - 50 - - - - - - @@ -3852,6 +3963,22 @@ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + 17 + 17 + 50 + 50 + + + + + + + true + + @@ -3944,10 +4071,6 @@ - pushButton_BetRaise - pushButton_CallCheckSet - pushButton_FoldAllin - tabWidget_LeftToolBox spinBox_set @@ -3961,12 +4084,12 @@ setNum(int) - 903 - 635 + 886 + 624 858 - 636 + 620 diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index c2ab192e..5d6f52bd 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -205,11 +205,11 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent) //Toolboxen verstecken? if (!myConfig->readConfigInt("ShowRightToolBox")) { - tabWidget_LeftToolBox->hide(); + groupBox_LeftToolBox->hide(); label_logoright->show(); } if (!myConfig->readConfigInt("ShowLeftToolBox")) { - tabWidget_LeftToolBox->hide(); + groupBox_LeftToolBox->hide(); label_logoleft->show(); } @@ -464,6 +464,9 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent) // QShortcut *startNewGameKeys = new QShortcut(QKeySequence(Qt::Key_Control + Qt::Key_N), this); // connect( startNewGameKeys, SIGNAL(activated() ), actionNewGame, SLOT( trigger() ) ); + //Clear Focus + groupBox_LeftToolBox->clearFocus(); + //Statusbar statusBar()->showMessage(tr("Ctrl+N to start a new Game")); @@ -574,8 +577,8 @@ void mainWindowImpl::startNewLocalGame(newGameDialogImpl *v) { // QPalette tempPalette = groupBox_board->palette(); // tempPalette.setColor(QPalette::Window, active); // groupBox_board->setPalette(tempPalette); - frame_RightToolBox->setDisabled(FALSE); - tabWidget_LeftToolBox->setDisabled(FALSE); + groupBox_RightToolBox->setDisabled(FALSE); + groupBox_LeftToolBox->setDisabled(FALSE); //show human player buttons for(i=0; i<3; i++) { @@ -677,11 +680,11 @@ void mainWindowImpl::callSettingsDialog() { if (v->getSettingsCorrect()) { //Toolbox verstecken? - if (myConfig->readConfigInt("ShowLeftToolBox")) { tabWidget_LeftToolBox->show(); } - else { tabWidget_LeftToolBox->hide(); } + if (myConfig->readConfigInt("ShowLeftToolBox")) { groupBox_LeftToolBox->show(); } + else { groupBox_LeftToolBox->hide(); } - if (myConfig->readConfigInt("ShowRightToolBox")) { frame_RightToolBox->show(); } - else { frame_RightToolBox->hide(); } + if (myConfig->readConfigInt("ShowRightToolBox")) { groupBox_RightToolBox->show(); } + else { groupBox_RightToolBox->hide(); } //Falls Spielernamen geändert wurden --> neu zeichnen --> erst beim nächsten Neustart neu ausgelesen if (v->getPlayerNickIsChanged() && actualGame) { @@ -697,7 +700,21 @@ void mainWindowImpl::callSettingsDialog() { refreshPlayerName(); } - + + if(actualGame) { + + actualHand->getPlayerArray()[0]->setMyAvatar(v->lineEdit_humanPlayerAvatar->text().toStdString()); + actualHand->getPlayerArray()[1]->setMyAvatar(v->lineEdit_Opponent1Avatar->text().toStdString()); + actualHand->getPlayerArray()[2]->setMyAvatar(v->lineEdit_Opponent2Avatar->text().toStdString()); + actualHand->getPlayerArray()[3]->setMyAvatar(v->lineEdit_Opponent3Avatar->text().toStdString()); + actualHand->getPlayerArray()[4]->setMyAvatar(v->lineEdit_Opponent4Avatar->text().toStdString()); + actualHand->getPlayerArray()[5]->setMyAvatar(v->lineEdit_Opponent5Avatar->text().toStdString()); + actualHand->getPlayerArray()[6]->setMyAvatar(v->lineEdit_Opponent6Avatar->text().toStdString()); + + //avatar refresh + refreshPlayerAvatar(); + } + //Flipside refresh if (myConfig->readConfigInt("FlipsideOwn") && myConfig->readConfigString("FlipsideOwnFile") != "") { @@ -716,8 +733,7 @@ void mainWindowImpl::callSettingsDialog() { } } - //avatar refresh - refreshPlayerAvatar(); + } } @@ -821,7 +837,7 @@ void mainWindowImpl::refreshPlayerAvatar() { } } -void mainWindowImpl::refreshAction() { +void mainWindowImpl::refreshAction(int playerID, int playerAction) { QPixmap onePix(":/graphics/resources/graphics/1px.png"); QPixmap action; @@ -829,25 +845,50 @@ void mainWindowImpl::refreshAction() { QStringList actionArray; actionArray << "" << "fold" << "check" << "call" << "bet" << "raise" << "allin"; - int i; - for (i=0; i clear Pixmap + if(actualHand->getPlayerArray()[i]->getMyAction() == 0) { + actionLabelArray[i]->setPixmap(onePix); + } + else { + if(i!=0 || ( i==0 && actualHand->getPlayerArray()[0]->getMyAction() != 1) ) { + //paint action pixmap + actionLabelArray[i]->setPixmap(QPixmap(":/actions/resources/graphics/actions/action_"+actionArray[actualHand->getPlayerArray()[i]->getMyAction()]+".png")); + } + // actionLabelArray[i]->setStyleSheet("QLabel { background-image: url(:/actions/resources/graphics/actions/action_"+actionArray[actualHand->getPlayerArray()[i]->getMyAction()]+".png"); + } + + if (actualHand->getPlayerArray()[i]->getMyAction()==1) { + // groupBoxArray[i]->setDisabled(TRUE); + + if(i != 0) { + holeCardsArray[i][0]->setPixmap(onePix, FALSE); + holeCardsArray[i][1]->setPixmap(onePix, FALSE); + } + } + } + } + else { //if no action --> clear Pixmap - if(actualHand->getPlayerArray()[i]->getMyAction() == 0) { - actionLabelArray[i]->setPixmap(onePix); + if(playerAction == 0) { + actionLabelArray[playerID]->setPixmap(onePix); } else { - //paint action pixmap and raise - actionLabelArray[i]->setPixmap(QPixmap(":/actions/resources/graphics/actions/action_"+actionArray[actualHand->getPlayerArray()[i]->getMyAction()]+".png")); + + // paint action pixmap and raise + actionLabelArray[playerID]->setPixmap(QPixmap(":/actions/resources/graphics/actions/action_"+actionArray[playerAction]+".png")); } + + if (playerAction == 1) { + // groupBoxArray[i]->setDisabled(TRUE); - if (actualHand->getPlayerArray()[i]->getMyAction()==1) { -// groupBoxArray[i]->setDisabled(TRUE); - - if(i != 0) { - holeCardsArray[i][0]->setPixmap(onePix, FALSE); - holeCardsArray[i][1]->setPixmap(onePix, FALSE); + if(playerID != 0) { + holeCardsArray[playerID][0]->setPixmap(onePix, FALSE); + holeCardsArray[playerID][1]->setPixmap(onePix, FALSE); } } } @@ -869,50 +910,88 @@ void mainWindowImpl::refreshCash() { } } -void mainWindowImpl::refreshGroupbox() { +void mainWindowImpl::refreshGroupbox(int playerID, int status) { - int i,j; - for (i=0; igetPlayerArray()[i]->getMyTurn()) { - //Groupbox glow wenn der Spiele dran ist. - if(i==0) { - groupBoxArray[0]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxActiveGlow.png) }"); - } - else { - groupBoxArray[i]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxActiveGlow.png) }"); - } - - } else { - //Groupbox auf Hintergrundfarbe setzen wenn der Spiele nicht dran aber aktiv ist. - if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) { + int i,j; + for (i=0; igetPlayerArray()[i]->getMyTurn()) { + //Groupbox glow wenn der Spiele dran ist. if(i==0) { - groupBoxArray[0]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxInactiveGlow.png) }"); - //show buttons - for(j=0; j<3; j++) { - userWidgetsArray[j]->show(); - } + groupBoxArray[0]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxActiveGlow.png) }"); } else { - groupBoxArray[i]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxInactiveGlow.png) }"); - } - } - //Groupbox verdunkeln wenn der Spiele inactive ist. - else { - if(i==0) { - groupBoxArray[0]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxInactiveGlow.png) }"); - //hide buttons - for(j=0; j<4; j++) { - userWidgetsArray[j]->hide(); - } + groupBoxArray[i]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxActiveGlow.png) }"); } + + } else { + //Groupbox auf Hintergrundfarbe setzen wenn der Spiele nicht dran aber aktiv ist. + if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) { + if(i==0) { + groupBoxArray[0]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxInactiveGlow.png) }"); + //show buttons + for(j=0; j<3; j++) { + userWidgetsArray[j]->show(); + } + } + else { + groupBoxArray[i]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxInactiveGlow.png) }"); + } + } + //Groupbox verdunkeln wenn der Spiele inactive ist. else { - groupBoxArray[i]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxInactiveGlow.png) }"); + if(i==0) { + groupBoxArray[0]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxInactiveGlow.png) }"); + //hide buttons + for(j=0; j<4; j++) { + userWidgetsArray[j]->hide(); + } + } + else { + groupBoxArray[i]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxInactiveGlow.png) }"); + } } } } } - + else { + switch(status) { + + //inactive + case 0: { + if (!playerID) { + groupBoxArray[playerID]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxInactiveGlow.png) }"); + } + else { + groupBoxArray[playerID]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxInactiveGlow.png) }"); + } + } + break; + //active but fold + case 1: { + if (!playerID) { + groupBoxArray[playerID]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxInactiveGlow.png) }"); + } + else { + groupBoxArray[playerID]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxInactiveGlow.png) }"); + } + } + break; + //active in action + case 2: { + if (!playerID) { + groupBoxArray[playerID]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxActiveGlow.png) }"); + } + else { + groupBoxArray[playerID]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxActiveGlow.png) }"); + } + } + break; + default: {} + } + } } void mainWindowImpl::highlightRoundLabel(string tempround) { @@ -945,11 +1024,9 @@ void mainWindowImpl::refreshAll() { void mainWindowImpl::refreshChangePlayer() { - refreshSet(); // alter - refreshButton(); // wech - refreshAction(); // alter - refreshCash(); // alter - //start(preDealCardsSpeed); } @@ -1230,24 +1307,24 @@ void mainWindowImpl::meInAction() { void mainWindowImpl::disableMyButtons() { //clear userWidgets + spinBox_set->setMinimum(0); + spinBox_set->setValue(0); + spinBox_set->hide(); pushButton_BetRaise->show(); pushButton_BetRaise->setText(""); pushButton_CallCheckSet->setText(""); pushButton_FoldAllin->setText(""); - spinBox_set->setMinimum(0); - spinBox_set->setValue(0); - spinBox_set->hide(); } void mainWindowImpl::myBetRaise() { if(pushButton_BetRaise->text() == "Raise") { myRaise(); } - else { myBet(); } + if(pushButton_BetRaise->text() == "Bet") { myBet(); } } void mainWindowImpl::myFoldAllin() { if(pushButton_FoldAllin->text() == "Fold") { myFold(); } - else { myAllIn(); } + if(pushButton_FoldAllin->text() == "All-In") { myAllIn(); } } void mainWindowImpl::myCallCheckSet() { @@ -1265,7 +1342,12 @@ void mainWindowImpl::myFold(){ //Action in LogWindow myLog->logPlayerActionMsg(actualHand->getPlayerArray()[0]->getMyName(), actualHand->getPlayerArray()[0]->getMyAction(), actualHand->getPlayerArray()[0]->getMySet()); + holeCardsArray[0][0]->startFadeOut(10); + holeCardsArray[0][1]->startFadeOut(10); disableMyButtons(); + + //set that i was the last active player. need this for unhighlighting groupbox + actualHand->setLastPlayersTurn(0); //Spiel läuft weiter nextPlayerAnimation(); @@ -1281,6 +1363,9 @@ void mainWindowImpl::myCheck() { disableMyButtons(); + //set that i was the last active player. need this for unhighlighting groupbox + actualHand->setLastPlayersTurn(0); + //Spiel läuft weiter nextPlayerAnimation(); } @@ -1321,6 +1406,9 @@ void mainWindowImpl::myCall(){ disableMyButtons(); + //set that i was the last active player. need this for unhighlighting groupbox + actualHand->setLastPlayersTurn(0); + //Spiel läuft weiter nextPlayerAnimation(); } @@ -1410,6 +1498,9 @@ void mainWindowImpl::mySet(){ disableMyButtons(); + //set that i was the last active player. need this for unhighlighting groupbox + actualHand->setLastPlayersTurn(0); + //Spiel läuft weiter nextPlayerAnimation(); } @@ -1443,13 +1534,21 @@ void mainWindowImpl::myAllIn(){ disableMyButtons(); + //set that i was the last active player. need this for unhighlighting groupbox + actualHand->setLastPlayersTurn(0); + //Spiel läuft weiter nextPlayerAnimation(); } void mainWindowImpl::nextPlayerAnimation() { - refreshChangePlayer(); + + //refresh Change Player + refreshSet(); + refreshAction(actualHand->getLastPlayersTurn(), actualHand->getPlayerArray()[actualHand->getLastPlayersTurn()]->getMyAction()); + refreshCash(); + nextPlayerAnimationTimer->start(nextPlayerSpeed1); } @@ -1857,8 +1956,10 @@ void mainWindowImpl::nextRoundCleanGui() { // labelPalette.setColor(QPalette::WindowText, c); // label_Pot->setPalette(labelPalette); - disableMyButtons(); - + // for startNewGame during human player is active + if(actualHand->getPlayerArray()[0]->getMyActiveStatus() == 1) { + disableMyButtons(); + } // QPalette tempPalette = frame_Pot->palette(); // tempPalette.setColor(QPalette::Window, active); // frame_Pot->setPalette(tempPalette); @@ -1925,7 +2026,7 @@ void mainWindowImpl::setSpeeds() { gameSpeed = (11-guiGameSpeed)*10; dealCardsSpeed = (gameSpeed/2)*10; //milliseconds preDealCardsSpeed = dealCardsSpeed*2; //Zeit for Karten aufdecken auf dem Board (Flop, Turn, River) - postDealCardsSpeed = dealCardsSpeed*2; //Zeit nach Karten aufdecken auf dem Board (Flop, Turn, River) + postDealCardsSpeed = dealCardsSpeed*3; //Zeit nach Karten aufdecken auf dem Board (Flop, Turn, River) AllInDealCardsSpeed = dealCardsSpeed*4; //Zeit nach Karten aufdecken auf dem Board (Flop, Turn, River) bei AllIn postRiverRunAnimationSpeed = gameSpeed*18; winnerBlinkSpeed = gameSpeed*3; //milliseconds @@ -2061,14 +2162,14 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) { void mainWindowImpl::switchLeftToolBox() { - if (tabWidget_LeftToolBox->isHidden()) { tabWidget_LeftToolBox->show(); } - else { tabWidget_LeftToolBox->hide(); } + if (groupBox_LeftToolBox->isHidden()) { groupBox_LeftToolBox->show(); } + else { groupBox_LeftToolBox->hide(); } } void mainWindowImpl::switchRightToolBox() { - if (frame_RightToolBox->isHidden()) { frame_RightToolBox->show(); } - else { frame_RightToolBox->hide(); } + if (groupBox_RightToolBox->isHidden()) { groupBox_RightToolBox->show(); } + else { groupBox_RightToolBox->hide(); } } void mainWindowImpl::switchFullscreen() { diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index d18103da..ae84ae9b 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -72,9 +72,9 @@ public: void refreshButton(); void refreshPlayerName(); void refreshPlayerAvatar(); - void refreshAction(); + void refreshAction(int =-1, int=-1); void refreshCash(); - void refreshGroupbox(); + void refreshGroupbox(int =-1, int =-1); void refreshAll(); void refreshChangePlayer(); void refreshPot(); diff --git a/src/gui/qt/mainwindow/mycardspixmaplabel.cpp b/src/gui/qt/mainwindow/mycardspixmaplabel.cpp index 5c4d188a..eece80db 100644 --- a/src/gui/qt/mainwindow/mycardspixmaplabel.cpp +++ b/src/gui/qt/mainwindow/mycardspixmaplabel.cpp @@ -60,7 +60,7 @@ void MyCardsPixmapLabel::startFadeOut(int speed) { void MyCardsPixmapLabel::nextFadeOutFrame() { - if (frameOpacity < 0.65) { + if (frameOpacity < 0.75) { frameOpacity += opacityRaiseIntervall; update(); } diff --git a/src/gui/qt/resources.qrc b/src/gui/qt/resources.qrc index 623a79b5..16f47779 100755 --- a/src/gui/qt/resources.qrc +++ b/src/gui/qt/resources.qrc @@ -77,6 +77,7 @@ resources/graphics/1px.png resources/graphics/fileopen16.png resources/graphics/handRanking_release.png + resources/graphics/toolboxFrameBG.png resources/graphics/logoChip3D.png diff --git a/src/gui/qt/resources/graphics/handRanking_release.png b/src/gui/qt/resources/graphics/handRanking_release.png index 8ff11161..43965881 100644 Binary files a/src/gui/qt/resources/graphics/handRanking_release.png and b/src/gui/qt/resources/graphics/handRanking_release.png differ diff --git a/src/gui/qt/resources/graphics/toolboxFrameBG.png b/src/gui/qt/resources/graphics/toolboxFrameBG.png new file mode 100644 index 00000000..9e3961f9 Binary files /dev/null and b/src/gui/qt/resources/graphics/toolboxFrameBG.png differ