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
+18 -22
View File
@@ -2024,23 +2024,16 @@ void gameTableImpl::postRiverRunAnimation2() {
//TempArrays
QPixmap tempCardsPixmapArray[2];
int tempCardsIntArray[2];
int antiPeekMode = myConfig->readConfigInt("AntiPeekMode");
int showFlipcardAnimation = myConfig->readConfigInt("ShowFlipCardsAnimation");
int antiPeekMode = myConfig->readConfigInt("AntiPeekMode");
int j;
for (it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
(*it_c)->getMyCards(tempCardsIntArray);
if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
// TODO
//only some players need to show cards directly. if i dont kneed the show i get the button
if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD && (*it_c)->checkIfINeedToShowCards()) {
if((*it_c)->getMyID() || ((*it_c)->getMyID()==0 && antiPeekMode) ) {
for(j=0; j<2; j++) {
if(showFlipcardAnimation) { // with Eye-Candy
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);
}
}
}
//set Player value (logging)
(*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!!
flipHolecardsAllInAlreadyDone = TRUE;
flipHolecardsAllInAlreadyDone = TRUE;
}
}
else {
int tempCardsIntArray[2];
// int i;
for (it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
(*it_c)->getMyCards(tempCardsIntArray);
if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
@@ -2419,10 +2407,16 @@ void gameTableImpl::showMyCards() {
//TempArrays
int tempCardsIntArray[2];
HandInterface *currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand();
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) {
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)
currentHand->getSeatsList()->front()->setMyCardsFlip(1,1);
}
@@ -2516,6 +2510,7 @@ void gameTableImpl::nextRoundCleanGui() {
myButtonsCheckable(FALSE);
resetMyButtonsCheckStateMemory();
clearMyButtons();
pushButton_showMyCards->hide();
}
void gameTableImpl::stopTimer() {
@@ -3452,6 +3447,7 @@ void gameTableImpl::sendShowMyCardsSignal()
{
if(pushButton_showMyCards->isVisible()) {
showMyCards();
pushButton_showMyCards->hide();
}
}