show cards button gui action hopefully implemented ;-)
This commit is contained in:
+4501
-4491
File diff suppressed because it is too large
Load Diff
@@ -178,8 +178,8 @@ public:
|
||||
|
||||
void setNetSessionData(boost::shared_ptr<SessionData> session);
|
||||
boost::shared_ptr<SessionData> getNetSessionData();
|
||||
|
||||
|
||||
bool checkIfINeedToShowCards();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -515,3 +515,13 @@ boost::shared_ptr<SessionData> ClientPlayer::getNetSessionData()
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -181,6 +181,8 @@ private:
|
||||
bool myWinnerState;
|
||||
|
||||
boost::shared_ptr<SessionData> myNetSessionData;
|
||||
|
||||
bool checkIfINeedToShowCards();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -115,6 +115,8 @@ public:
|
||||
|
||||
virtual void setNetSessionData(boost::shared_ptr<SessionData> session) =0;
|
||||
virtual boost::shared_ptr<SessionData> getNetSessionData() =0;
|
||||
|
||||
virtual bool checkIfINeedToShowCards() =0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user