From eae5f68f8968f24a80cab1f58e2ef3660e5c445b Mon Sep 17 00:00:00 2001 From: doitux Date: Wed, 28 Feb 2007 20:51:43 +0000 Subject: [PATCH] --- pokerth.pro | 4 +-- src/{config => core}/tinyxml/readme.txt | 0 src/{config => core}/tinyxml/tinystr.cpp | 0 src/{config => core}/tinyxml/tinystr.h | 0 src/{config => core}/tinyxml/tinyxml.cpp | 0 src/{config => core}/tinyxml/tinyxml.h | 0 src/{config => core}/tinyxml/tinyxmlerror.cpp | 0 .../tinyxml/tinyxmlparser.cpp | 0 src/engine/local_engine/localhand.cpp | 5 +++- src/engine/local_engine/localplayer.h | 8 +++--- src/engine/playerinterface.h | 3 +++ .../joinnetworkgamedialogimpl.cpp | 21 +++++++++------- src/gui/qt/mainwindow/mainwindowimpl.cpp | 25 ++++++++++++++++++- src/gui/qt/mainwindow/mainwindowimpl.h | 1 + 14 files changed, 50 insertions(+), 17 deletions(-) rename src/{config => core}/tinyxml/readme.txt (100%) rename src/{config => core}/tinyxml/tinystr.cpp (100%) rename src/{config => core}/tinyxml/tinystr.h (100%) rename src/{config => core}/tinyxml/tinyxml.cpp (100%) rename src/{config => core}/tinyxml/tinyxml.h (100%) rename src/{config => core}/tinyxml/tinyxmlerror.cpp (100%) rename src/{config => core}/tinyxml/tinyxmlparser.cpp (100%) diff --git a/pokerth.pro b/pokerth.pro index 4e18abb5..e3c7acba 100755 --- a/pokerth.pro +++ b/pokerth.pro @@ -115,8 +115,8 @@ SOURCES += pokerth.cpp \ TEMPLATE = vcapp RESOURCES = src/gui/qt/deck.qrc TEMPLATE = app -DEPENDPATH += . src uics src/config src/config/tinyxml src/gui src/gui/qt src/gui/qt/mainwindow/startsplash src/gui/qt/mainwindow src/gui/qt/aboutpokerth src/gui/qt/joinnetworkgamedialog src/gui/qt/connecttoserverdialog src/gui/qt/newlocalgamedialog src/gui/qt/settingsdialog src/gui/qt/waitforservertostartgamedialog src/gui/qt/startnetworkgamedialog src/gui/qt/createnetworkgamedialog src/gui/qt/log src/engine src/engine/local_engine src/net src/net/common src/core/ -INCLUDEPATH += . src uics src/config src/config/tinyxml src/gui src/gui/qt src/gui/qt/mainwindow/startsplash src/gui/qt/mainwindow src/gui/qt/aboutpokerth src/gui/qt/joinnetworkgamedialog src/gui/qt/connecttoserverdialog src/gui/qt/newlocalgamedialog src/gui/qt/settingsdialog src/gui/qt/waitforservertostartgamedialog src/gui/qt/startnetworkgamedialog src/gui/qt/createnetworkgamedialog src/gui/qt/log src/engine src/engine/local_engine src/net src/net/common src/core/ +DEPENDPATH += . src uics src/config src/core/tinyxml src/gui src/gui/qt src/gui/qt/mainwindow/startsplash src/gui/qt/mainwindow src/gui/qt/aboutpokerth src/gui/qt/joinnetworkgamedialog src/gui/qt/connecttoserverdialog src/gui/qt/newlocalgamedialog src/gui/qt/settingsdialog src/gui/qt/waitforservertostartgamedialog src/gui/qt/startnetworkgamedialog src/gui/qt/createnetworkgamedialog src/gui/qt/log src/engine src/engine/local_engine src/net src/net/common src/core/ +INCLUDEPATH += . src uics src/config src/core/tinyxml src/gui src/gui/qt src/gui/qt/mainwindow/startsplash src/gui/qt/mainwindow src/gui/qt/aboutpokerth src/gui/qt/joinnetworkgamedialog src/gui/qt/connecttoserverdialog src/gui/qt/newlocalgamedialog src/gui/qt/settingsdialog src/gui/qt/waitforservertostartgamedialog src/gui/qt/startnetworkgamedialog src/gui/qt/createnetworkgamedialog src/gui/qt/log src/engine src/engine/local_engine src/net src/net/common src/core/ win32 { DEPENDPATH += src/net/win32/ INCLUDEPATH += ../boost/ diff --git a/src/config/tinyxml/readme.txt b/src/core/tinyxml/readme.txt similarity index 100% rename from src/config/tinyxml/readme.txt rename to src/core/tinyxml/readme.txt diff --git a/src/config/tinyxml/tinystr.cpp b/src/core/tinyxml/tinystr.cpp similarity index 100% rename from src/config/tinyxml/tinystr.cpp rename to src/core/tinyxml/tinystr.cpp diff --git a/src/config/tinyxml/tinystr.h b/src/core/tinyxml/tinystr.h similarity index 100% rename from src/config/tinyxml/tinystr.h rename to src/core/tinyxml/tinystr.h diff --git a/src/config/tinyxml/tinyxml.cpp b/src/core/tinyxml/tinyxml.cpp similarity index 100% rename from src/config/tinyxml/tinyxml.cpp rename to src/core/tinyxml/tinyxml.cpp diff --git a/src/config/tinyxml/tinyxml.h b/src/core/tinyxml/tinyxml.h similarity index 100% rename from src/config/tinyxml/tinyxml.h rename to src/core/tinyxml/tinyxml.h diff --git a/src/config/tinyxml/tinyxmlerror.cpp b/src/core/tinyxml/tinyxmlerror.cpp similarity index 100% rename from src/config/tinyxml/tinyxmlerror.cpp rename to src/core/tinyxml/tinyxmlerror.cpp diff --git a/src/config/tinyxml/tinyxmlparser.cpp b/src/core/tinyxml/tinyxmlparser.cpp similarity index 100% rename from src/config/tinyxml/tinyxmlparser.cpp rename to src/core/tinyxml/tinyxmlparser.cpp diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index b5fae451..25e28765 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -74,8 +74,11 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe // Karten austeilen myGui->dealHoleCards(); - + // myFlipCards auf 0 setzen + for(i=0; isetMyCardsFlip(0); + } // Preflop, Flop, Turn und River erstellen myPreflop = myFactory->createPreflop(this, myID, actualQuantityPlayers, dealerPosition, smallBlind); diff --git a/src/engine/local_engine/localplayer.h b/src/engine/local_engine/localplayer.h index faa49ffb..7ab20c7c 100755 --- a/src/engine/local_engine/localplayer.h +++ b/src/engine/local_engine/localplayer.h @@ -71,6 +71,9 @@ public: void setMyTurn(bool theValue){ myTurn = theValue;} bool getMyTurn() const{ return myTurn;} + void setMyCardsFlip(bool theValue){ myCardsFlip = theValue;} + bool getMyCardsFlip() const{ return myCardsFlip;} + void setMyCardsValueInt(const int& theValue) { myCardsValueInt = theValue;} int getMyCardsValueInt() const { return myCardsValueInt; } @@ -88,10 +91,6 @@ public: void flopEngine(); void turnEngine(); void riverEngine(); - - - - private: @@ -116,6 +115,7 @@ private: int myButton; // 0 = none, 1 = dealer, 2 =small, 3 = big bool myActiveStatus; // 0 = inactive, 1 = active bool myTurn; // 0 = no, 1 = yes + bool myCardsFlip; // 0 = cards are not fliped, 1 = cards are already flipped, int myRoundStartCash; int myAverageSets; diff --git a/src/engine/playerinterface.h b/src/engine/playerinterface.h index 25ddaaa6..df250e0f 100644 --- a/src/engine/playerinterface.h +++ b/src/engine/playerinterface.h @@ -60,6 +60,9 @@ public: virtual void setMyTurn(bool theValue) =0; virtual bool getMyTurn() const =0; + virtual void setMyCardsFlip(bool theValue) =0; + virtual bool getMyCardsFlip() const =0; + virtual void setMyCardsValueInt(const int& theValue) =0; virtual int getMyCardsValueInt() const =0; diff --git a/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp b/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp index 2d88709e..c0602fef 100644 --- a/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp +++ b/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp @@ -35,6 +35,8 @@ joinNetworkGameDialogImpl::joinNetworkGameDialogImpl(QWidget *parent) QValidator *validator = new QRegExpValidator(rx, this); lineEdit_profileName->setValidator(validator); + pushButton_delete->setDisabled(TRUE); + lineEdit_ipAddress->setFocus(); myServerProfilesFile = myConfig.readConfigString("DataDir")+"serverprofiles.xml"; @@ -141,6 +143,8 @@ void joinNetworkGameDialogImpl::itemFillForm (QTreeWidgetItem* item, int column) checkBox_ipv6->setChecked(QString::fromStdString(profile->Attribute("IsIpv6")).toInt(&toIntTrue, 10)); } + + pushButton_delete->setEnabled(TRUE); } void joinNetworkGameDialogImpl::saveServerProfile() { @@ -202,22 +206,21 @@ void joinNetworkGameDialogImpl::deleteServerProfile() { TiXmlElement* profile = docHandle.FirstChild( "PokerTH" ).FirstChild( "ServerProfiles" ).FirstChild( treeWidget->currentItem()->data(0,0).toString().toStdString() ).ToElement(); - if ( profile ) { - cout << profile->Attribute("Name") << "\n"; - profile->Parent()->RemoveChild(profile); - } - else { cout << "nööö" << "\n"; } - + if ( profile ) { profile->Parent()->RemoveChild(profile); } + + if(!doc.SaveFile()) { QMessageBox::warning(this, tr("Save Server-Profile-File Error"), + tr("Could not save Server-Profiles-File:\n"+QString::fromStdString(myServerProfilesFile).toAscii()), + QMessageBox::Close); } + //Liste Füllen fillServerProfileList(); } - + + pushButton_delete->setDisabled(TRUE); } void joinNetworkGameDialogImpl::keyPressEvent ( QKeyEvent * event ) { // std::cout << "key" << event->key(); - if (event->key() == 16777220) { pushButton_connect->click(); } //ENTER - } diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 6822978e..944c6ace 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -1499,11 +1499,12 @@ void mainWindowImpl::postRiverRunAnimation2() { for(j=0; j<2; j++) { holeCardsArray[i][j]->startFlipCards(guiGameSpeed, QPixmap(":/cards/graphics/cards/"+QString::number(tempCardsIntArray[j], 10)+".png"), flipside); - } } //Karten umdrehen Loggen myLog->logFlipHoleCardsMsg(actualHand->getPlayerArray()[i]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1], actualHand->getPlayerArray()[i]->getMyCardsValueInt()); + + actualHand->getPlayerArray()[i]->setMyCardsFlip(1); } } } @@ -1530,6 +1531,8 @@ void mainWindowImpl::postRiverRunAnimation2() { } //Karten umdrehen Loggen myLog->logFlipHoleCardsMsg(actualHand->getPlayerArray()[i]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1], actualHand->getPlayerArray()[i]->getMyCardsValueInt() ); + + actualHand->getPlayerArray()[i]->setMyCardsFlip(1); } } } @@ -1757,6 +1760,8 @@ void mainWindowImpl::flipHolecardsAllIn() { } //Karten umdrehen Loggen myLog->logFlipHoleCardsMsg(actualHand->getPlayerArray()[i]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1]); + + actualHand->getPlayerArray()[i]->setMyCardsFlip(1); } } @@ -1784,6 +1789,8 @@ void mainWindowImpl::flipHolecardsAllIn() { } //Karten umdrehen Loggen myLog->logFlipHoleCardsMsg(actualHand->getPlayerArray()[i]->getMyName(), temp2CardsIntArray[0], temp2CardsIntArray[1] ); + + actualHand->getPlayerArray()[i]->setMyCardsFlip(1); } } } @@ -1794,6 +1801,21 @@ void mainWindowImpl::flipHolecardsAllIn() { flipHolecardsAllInAlreadyDone = TRUE; } +void mainWindowImpl::showMyCards() { + + //TempArrays + int tempCardsIntArray[2]; + + actualHand->getPlayerArray()[0]->getMyCards(tempCardsIntArray); + if( actualHand->getPlayerArray()[0]->getMyCardsFlip() == 0 && actualHand->getActualRound() == 4 && actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) { + //Karten umdrehen Loggen + myLog->logFlipHoleCardsMsg(actualHand->getPlayerArray()[0]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1], actualHand->getPlayerArray()[0]->getMyCardsValueInt() ); + + actualHand->getPlayerArray()[0]->setMyCardsFlip(1); + } +} + + void mainWindowImpl::startNewHand() { if( !breakAfterActualHand){ actualGame->startHand(); @@ -1971,6 +1993,7 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) { if (event->key() == 16777265) { switchLeftToolBox(); } //F2 if (event->key() == 16777266) { switchRightToolBox(); } //F3 if (event->key() == Qt::Key_F) { switchFullscreen(); } //f + if (event->key() == Qt::Key_S) { showMyCards(); } //f if (event->key() == 16777249) { pushButton_break->click(); ctrlPressed = TRUE; diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index f984868e..b43a7e65 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -158,6 +158,7 @@ public slots: void postRiverRunAnimation6(); void flipHolecardsAllIn(); + void showMyCards(); void handSwitchRounds();