show cards button gui action hopefully implemented ;-)

This commit is contained in:
doitux
2010-07-16 09:13:43 +00:00
parent 756e92aeab
commit 96fa7c642c
6 changed files with 4534 additions and 4514 deletions
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -179,7 +179,7 @@ public:
void setNetSessionData(boost::shared_ptr<SessionData> session); void setNetSessionData(boost::shared_ptr<SessionData> session);
boost::shared_ptr<SessionData> getNetSessionData(); boost::shared_ptr<SessionData> getNetSessionData();
bool checkIfINeedToShowCards();
private: private:
@@ -515,3 +515,13 @@ boost::shared_ptr<SessionData> ClientPlayer::getNetSessionData()
return myNetSessionData; return myNetSessionData;
} }
bool ClientPlayer::checkIfINeedToShowCards()
{
std::list<unsigned> playerNeedToShowCardsList = currentBoard->getPlayerNeedToShowCards();
for(std::list<unsigned>::iterator it = playerNeedToShowCardsList.begin(); it != playerNeedToShowCardsList.end(); it++)
{
if(*it == myUniqueID) return true;
}
return false;
}
+2
View File
@@ -181,6 +181,8 @@ private:
bool myWinnerState; bool myWinnerState;
boost::shared_ptr<SessionData> myNetSessionData; boost::shared_ptr<SessionData> myNetSessionData;
bool checkIfINeedToShowCards();
}; };
#endif #endif
+2
View File
@@ -115,6 +115,8 @@ public:
virtual void setNetSessionData(boost::shared_ptr<SessionData> session) =0; virtual void setNetSessionData(boost::shared_ptr<SessionData> session) =0;
virtual boost::shared_ptr<SessionData> getNetSessionData() =0; virtual boost::shared_ptr<SessionData> getNetSessionData() =0;
virtual bool checkIfINeedToShowCards() =0;
}; };
#endif #endif
+17 -21
View File
@@ -2024,23 +2024,16 @@ void gameTableImpl::postRiverRunAnimation2() {
//TempArrays //TempArrays
QPixmap tempCardsPixmapArray[2]; QPixmap tempCardsPixmapArray[2];
int tempCardsIntArray[2]; int tempCardsIntArray[2];
int antiPeekMode = myConfig->readConfigInt("AntiPeekMode");
int showFlipcardAnimation = myConfig->readConfigInt("ShowFlipCardsAnimation"); int showFlipcardAnimation = myConfig->readConfigInt("ShowFlipCardsAnimation");
int antiPeekMode = myConfig->readConfigInt("AntiPeekMode");
int j; int j;
for (it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) { for (it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
(*it_c)->getMyCards(tempCardsIntArray); (*it_c)->getMyCards(tempCardsIntArray);
if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) { if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD && (*it_c)->checkIfINeedToShowCards()) {
// TODO
//only some players need to show cards directly. if i dont kneed the show i get the button
if((*it_c)->getMyID() || ((*it_c)->getMyID()==0 && antiPeekMode) ) { if((*it_c)->getMyID() || ((*it_c)->getMyID()==0 && antiPeekMode) ) {
for(j=0; j<2; j++) { for(j=0; j<2; j++) {
if(showFlipcardAnimation) { // with Eye-Candy if(showFlipcardAnimation) { // with Eye-Candy
holeCardsArray[(*it_c)->getMyID()][j]->startFlipCards(guiGameSpeed, QPixmap::fromImage(QImage(myCardDeckStyle->getCurrentDir()+QString::number(tempCardsIntArray[j], 10)+".png")), *flipside); holeCardsArray[(*it_c)->getMyID()][j]->startFlipCards(guiGameSpeed, QPixmap::fromImage(QImage(myCardDeckStyle->getCurrentDir()+QString::number(tempCardsIntArray[j], 10)+".png")), *flipside);
} }
@@ -2049,28 +2042,23 @@ void gameTableImpl::postRiverRunAnimation2() {
holeCardsArray[(*it_c)->getMyID()][j]->setPixmap(tempCardsPixmapArray[j], FALSE); holeCardsArray[(*it_c)->getMyID()][j]->setPixmap(tempCardsPixmapArray[j], FALSE);
} }
} }
} }
//set Player value (logging) //set Player value (logging)
(*it_c)->setMyCardsFlip(1,1); (*it_c)->setMyCardsFlip(1,1);
// TODO
// showShowMyCardsButton();
}
} }
//if human player dont need to show cards he gets the button "show cards" in internet or network game
if( (myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK) && (*it_c)->getMyID() == 0 && (*it_c)->getMyAction() != PLAYER_ACTION_FOLD && !(*it_c)->checkIfINeedToShowCards()) {
showShowMyCardsButton();
}
//Wenn einmal umgedreht dann fertig!! //Wenn einmal umgedreht dann fertig!!
flipHolecardsAllInAlreadyDone = TRUE; flipHolecardsAllInAlreadyDone = TRUE;
} }
}
else { else {
int tempCardsIntArray[2]; int tempCardsIntArray[2];
// int i;
for (it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) { for (it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
(*it_c)->getMyCards(tempCardsIntArray); (*it_c)->getMyCards(tempCardsIntArray);
if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) { if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
@@ -2419,10 +2407,16 @@ void gameTableImpl::showMyCards() {
//TempArrays //TempArrays
int tempCardsIntArray[2]; int tempCardsIntArray[2];
HandInterface *currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); HandInterface *currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand();
currentHand->getSeatsList()->front()->getMyCards(tempCardsIntArray); currentHand->getSeatsList()->front()->getMyCards(tempCardsIntArray);
if( currentHand->getSeatsList()->front()->getMyCardsFlip() == 0 && currentHand->getCurrentRound() == 4 && currentHand->getSeatsList()->front()->getMyActiveStatus() && currentHand->getSeatsList()->front()->getMyAction() != PLAYER_ACTION_FOLD) { if( currentHand->getSeatsList()->front()->getMyCardsFlip() == 0 && currentHand->getCurrentRound() == 4 && currentHand->getSeatsList()->front()->getMyActiveStatus() && currentHand->getSeatsList()->front()->getMyAction() != PLAYER_ACTION_FOLD) {
myStartWindow->getSession()->showMyCards();
if(myConfig->readConfigInt("ShowFlipCardsAnimation")) { // with Eye-Candy
holeCardsArray[0][0]->startFlipCards(guiGameSpeed, QPixmap::fromImage(QImage(myCardDeckStyle->getCurrentDir()+QString::number(tempCardsIntArray[0], 10)+".png")), *flipside);
holeCardsArray[0][1]->startFlipCards(guiGameSpeed, QPixmap::fromImage(QImage(myCardDeckStyle->getCurrentDir()+QString::number(tempCardsIntArray[1], 10)+".png")), *flipside);
}
//set Player value (logging) //set Player value (logging)
currentHand->getSeatsList()->front()->setMyCardsFlip(1,1); currentHand->getSeatsList()->front()->setMyCardsFlip(1,1);
} }
@@ -2516,6 +2510,7 @@ void gameTableImpl::nextRoundCleanGui() {
myButtonsCheckable(FALSE); myButtonsCheckable(FALSE);
resetMyButtonsCheckStateMemory(); resetMyButtonsCheckStateMemory();
clearMyButtons(); clearMyButtons();
pushButton_showMyCards->hide();
} }
void gameTableImpl::stopTimer() { void gameTableImpl::stopTimer() {
@@ -3452,6 +3447,7 @@ void gameTableImpl::sendShowMyCardsSignal()
{ {
if(pushButton_showMyCards->isVisible()) { if(pushButton_showMyCards->isVisible()) {
showMyCards();
pushButton_showMyCards->hide(); pushButton_showMyCards->hide();
} }
} }