diff --git a/src/gui/qt/log.cpp b/src/gui/qt/log.cpp index 70bafb95..fbd09cd0 100644 --- a/src/gui/qt/log.cpp +++ b/src/gui/qt/log.cpp @@ -224,19 +224,22 @@ void Log::logNewGameHandMsg(int gameID, int handID) { } -void Log::logPlayerWinsMsg(int playerID, int pot, int cardsValueInt) { +void Log::logPlayerWinsMsg(int playerID, int pot) { int i; - myW->textBrowser_Log->append(QString::fromStdString(myW->getActualHand()->getPlayerArray()[playerID]->getMyName())+" wins "+QString::number(pot,10)+"$ with "+translateCardsValueCode(cardsValueInt).at(0)+"!!! "); - myLogFile->open( QIODevice::ReadWrite ); QTextStream stream( myLogFile ); for(i=0; i<=linesInFile; i++) { stream.readLine(); } - - QString msg("
"+QString::fromStdString(myW->getActualHand()->getPlayerArray()[playerID]->getMyName())+" wins "+QString::number(pot,10)+"$!!!

\n"); - stream << msg; +// if (cardsValueInt != -1) { +// myW->textBrowser_Log->append(QString::fromStdString(myW->getActualHand()->getPlayerArray()[playerID]->getMyName())+" wins "+QString::number(pot,10)+"$ with "+translateCardsValueCode(cardsValueInt).at(0)+"!!! "); +// stream << "
"+QString::fromStdString(myW->getActualHand()->getPlayerArray()[playerID]->getMyName())+" wins "+QString::number(pot,10)+"$!!!

\n"; +// } +// else { + myW->textBrowser_Log->append(QString::fromStdString(myW->getActualHand()->getPlayerArray()[playerID]->getMyName())+" wins "+QString::number(pot,10)+"$!!! "); + stream << "
"+QString::fromStdString(myW->getActualHand()->getPlayerArray()[playerID]->getMyName())+" wins "+QString::number(pot,10)+"$!!!

\n"; +// } myLogFile->close(); linesInFile++; @@ -273,7 +276,7 @@ void Log::logDealBoardCardsMsg(int roundID, int card1, int card2, int card3, int } -void Log::logFlipHoleCardsMsg(std::string playerName, int card1, int card2) { +void Log::logFlipHoleCardsMsg(std::string playerName, int card1, int card2, int cardsValueInt) { int i; @@ -281,9 +284,15 @@ void Log::logFlipHoleCardsMsg(std::string playerName, int card1, int card2) { QTextStream stream( myLogFile ); for(i=0; i<=linesInFile; i++) { stream.readLine(); } - myW->textBrowser_Log->append(QString::fromStdString(playerName)+" shows "+"["+translateCardCode(card1).at(0)+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+translateCardCode(card2).at(1)+"]"); - stream << QString::fromStdString(playerName)+" shows [ "+translateCardCode(card1).at(0)+""+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+""+translateCardCode(card2).at(1)+"]"+"
\n"; + if (cardsValueInt != -1) { + myW->textBrowser_Log->append(QString::fromStdString(playerName)+" shows \""+translateCardsValueCode(cardsValueInt).at(0)+"\""); + stream << QString::fromStdString(playerName)+" shows [ "+translateCardCode(card1).at(0)+""+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+""+translateCardCode(card2).at(1)+"] - "+translateCardsValueCode(cardsValueInt).at(0)+"
\n"; + } + else { + myW->textBrowser_Log->append(QString::fromStdString(playerName)+" shows "+"["+translateCardCode(card1).at(0)+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+translateCardCode(card2).at(1)+"]"); + stream << QString::fromStdString(playerName)+" shows [ "+translateCardCode(card1).at(0)+""+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+""+translateCardCode(card2).at(1)+"]"+"
\n"; + } myLogFile->close(); linesInFile++; } diff --git a/src/gui/qt/log.h b/src/gui/qt/log.h index 6983a39d..5df6a222 100644 --- a/src/gui/qt/log.h +++ b/src/gui/qt/log.h @@ -40,9 +40,9 @@ public: void logPlayerActionMsg(std::string playerName, int action, int setValue); void logNewGameHandMsg(int gameID, int handID); - void logPlayerWinsMsg(int playerID, int pot, int cardsValueInt); + void logPlayerWinsMsg(int playerID, int pot); void logDealBoardCardsMsg(int roundID, int card1, int card2, int card3, int card4 = -1, int card5 = -1); - void logFlipHoleCardsMsg(std::string playerName, int card1, int card2); + void logFlipHoleCardsMsg(std::string playerName, int card1, int card2, int cardsValueInt = -1); QStringList translateCardsValueCode(int cardsValueCode); QStringList translateCardCode(int cardCode); diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 15459892..2769a01d 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -1387,13 +1387,13 @@ void mainWindowImpl::postRiverRunAnimation2() { } //Karten umdrehen Loggen - myLog->logFlipHoleCardsMsg(actualHand->getPlayerArray()[i]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1]); + myLog->logFlipHoleCardsMsg(actualHand->getPlayerArray()[i]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1], actualHand->getPlayerArray()[i]->getMyCardsValueInt()); } } //Karten umdrehen für Human PlayerLoggen actualHand->getPlayerArray()[0]->getMyCards(tempCardsIntArray); - myLog->logFlipHoleCardsMsg(actualHand->getPlayerArray()[0]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1]); + myLog->logFlipHoleCardsMsg(actualHand->getPlayerArray()[0]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1], actualHand->getPlayerArray()[0]->getMyCardsValueInt()); } else { //Ohne Eye-Candy @@ -1415,12 +1415,12 @@ void mainWindowImpl::postRiverRunAnimation2() { } //Karten umdrehen Loggen - myLog->logFlipHoleCardsMsg(actualHand->getPlayerArray()[i]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1] ); + myLog->logFlipHoleCardsMsg(actualHand->getPlayerArray()[i]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1], actualHand->getPlayerArray()[i]->getMyCardsValueInt() ); } } //Karten umdrehen für Human PlayerLoggen actualHand->getPlayerArray()[0]->getMyCards(tempCardsIntArray); - myLog->logFlipHoleCardsMsg(actualHand->getPlayerArray()[0]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1]); + myLog->logFlipHoleCardsMsg(actualHand->getPlayerArray()[0]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1], actualHand->getPlayerArray()[0]->getMyCardsValueInt()); } @@ -1503,7 +1503,14 @@ void mainWindowImpl::postRiverRunAnimation3() { //Pro Spieler den Cash aus dem Player und dem Label auslesen. Player_cash - Label_cash = Gewinnsumme bool toIntBool = TRUE; int pot = actualHand->getPlayerArray()[i]->getMyCash() - cashLabelArray[i]->text().remove(" $").toInt(&toIntBool,10) ; - myLog->logPlayerWinsMsg(i, pot, actualHand->getPlayerArray()[i]->getMyCardsValueInt()); + //Wenn River dann auch das Blatt loggen! +// if (textLabel_handLabel->text() == "River") { + myLog->logPlayerWinsMsg(i, pot); +// } +// else { +// myLog->logPlayerWinsMsg(i, pot); +// } +// } else {