From ecb9f91a720d7898f1670e517a6d6458da3a9e79 Mon Sep 17 00:00:00 2001 From: doitux Date: Thu, 18 Oct 2007 09:20:54 +0000 Subject: [PATCH] starts human player input filed redesign - PART IV (do remembered actions) --- .../default/playeraction_03_0.6_checked.png | Bin 0 -> 1805 bytes .../default/playeraction_05_0.6_checked.png | Bin 0 -> 1778 bytes .../default/playeraction_07_0.6_checked.png | Bin 0 -> 1701 bytes src/gui/qt/mainwindow/mainwindowimpl.cpp | 248 ++++++++++++------ src/gui/qt/mainwindow/mainwindowimpl.h | 6 + 5 files changed, 176 insertions(+), 78 deletions(-) create mode 100644 data/gfx/gui/table/default/playeraction_03_0.6_checked.png create mode 100644 data/gfx/gui/table/default/playeraction_05_0.6_checked.png create mode 100644 data/gfx/gui/table/default/playeraction_07_0.6_checked.png diff --git a/data/gfx/gui/table/default/playeraction_03_0.6_checked.png b/data/gfx/gui/table/default/playeraction_03_0.6_checked.png new file mode 100644 index 0000000000000000000000000000000000000000..51807be50eec1508ca1e650a91328c5415f969a1 GIT binary patch literal 1805 zcmV+o2lDudP)uZ~9oIE>ocOYrbI#1y zhqK;`S*NyDacWh`m{ngf+vRQaO0B<_r&@^C?1PYz{_+s?A?fY)&8MyR= zq06IRW9B7FkOL}&C8IeH4KbLtU?>8HYNO$k&5f~_zyFO5@7=d0F{HsR06#&Udd9#^ zz#>4-;lG`ZKmF3{j}8ux{?OIxI!GZPs5sl;Qe`RcL>8l2GF^$)M)uxwd)qUQKXmsw zNaO%`Q#lP?4HgOEJooDUmR)Zh-!`7heH&5$f`U{RCf%*hf|$#pVE~F@kvMb97gzlJ z*`GdiBpP+br*fL9fRUuh`SbDaYk%|Np64^JdnYWi3$Rdrs)41tc;O080}kpX#jr{I zy?yPfUp@beM-DR~o1jkbzXFplnM1qYdcWb1d)|C^$T8#lV$mgH92>Ykk-z_UGa1M1CJ?-7sJZKB2mm;jOL#-0fGTZ7|o{d z|I<51_TARH=19Izqo#5gIXp6E?LL~iE2rHSgd~D+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vXXu0mjfakN&{ literal 0 HcmV?d00001 diff --git a/data/gfx/gui/table/default/playeraction_05_0.6_checked.png b/data/gfx/gui/table/default/playeraction_05_0.6_checked.png new file mode 100644 index 0000000000000000000000000000000000000000..b22a6ebc5cf5e22057062963c18d4c58e3862641 GIT binary patch literal 1778 zcmV=e|u{n`2t8#AdGYEoqcGiZVmAh$NBRBDPf%9+m1x$f@nJ@=gF`Sr&+cOADowPmz>eSYw8 z2OHp>|_lKFRzZEK`v{@;KJ0HL!Dp0WSj3efOq0HV=ALV%PY z!GKVTsq3(7xgHy6#<(Tof~zN4o*-fXT7eY+-AK*)tOJwcqyS(^kPR2KX-jw2?!Emp zyN`QQ4*rsxq#2gElCf=(h;Zts#X4(i>_c}fuW7riKH)gf(0~iTI}^pBGgK8RL6NpS znQ`x~IoiB=gr{k%%Ky`et-@uLq;>X>qY zoejWIrviu002Z4xq93*NOn&eEW2<^k=oOAf7eNRMLIh7S-l(*q7zQ*0%=vf}?KRbM z?Q1X8t)D(U*2jQzDz%~0xuDFSs$%s^osB=XWnamnJ4)FAnqjexHIlLrU}=|QPrTTPB?7=S(_g-LPJVukqguOFH9`S#3u4LKFk z0)+HI39E|{m(mA@*;g8+5VLga(~niHxMlJ9KNOH1sxnl}6%i19XKioYhEMz6Naw`O z5ElLhhC(rmA*C$HVFt7gpz*kR0^VBPT=nvGP4ON8`EWc_%q58!NNn4cy`|rgi(%V7 zDAEqp1qPOKhDHeL%XoLLX~}F~(vBnz;M*FgWSp0IH?+`nTG+h|B#B=5HmrR1X)2E9ZIK-m2oV?gQXHJA=7=B)!OdG zZdhn%hbc^olVk(bahS&qxUvSq24Dw&A^`}aF6RU^x^UN05=}eQO?Ghc1mI+akswNE zXhOduV~~~s=3Fxh>M`(JK7vq@bx*$dB5Ab@!sY@b(g1T#WlM!S)&Q6UP99qs1g4Ri zxs8)tIZpJAk096U$>7&R6~;hQ-Z6|WcpuiR)A6WQBW6i1z;(4E6SvXZ>k5EFhb#lj zxd04PkSz&TEPt=9WH<0rMe8tn?sSpe^c7NIx(ZAZ9JnQxCao@acf>*4hy{ceZdEm< zn&xm8{#0IZVCGy(xr^#(SNC38r6g7O#0kF+!=@Hf-tMRX4nZ)Tn0YbpuB?QoLhZ_7 zz*NMcmM*}Kefw$ufTDSWqYNa6Kx3@z)P>;>Rw+VdC3Zfr%xz zMclh?Gd}3}0}aeb45sExA!uNfrsP$n@KJz80UEFfT^H8!nknbQb3={C5z=btynuIo zqxxjymwbIX&o}vvso)C=djl|ACgtOT0%g&D19C!z-neq9^PLNL7&1gP(g2l&LgLN$ zqYWFrh;Q)NuJ^mvwx2Bx>n)LSQzcbv37}yHSoueJfOb_>x;tNdxbNP@SLcr~4IiKq z#h%$n%?c9E<13v5v+KQQE$9w-{zMkE4$)Ys@8IvB%^AaIxSBv~K=~&o^$$zt=bpQ9 ze!hzd4nn~$PUlMsL*QB=@#ebtjFzp5m-`)i0b4Q(5$<4{&4H3s7!D@vv;t|be|*$y zdFsBt7nWU4F&Lnn?&60w4tt=}(h*dqe!vZ(5_v*_BO4)AADS z(F8!m{k+@Qm^NY;gsg4r6B8@+PtkZV;O4h-e~+qUJ`%yt)i%phrml^~%fLU+2%tXX>Y_yaqfzTdT4~)P@jr zBV%CV!MNABq_J)SJecL=Kn%ae^4~1upCZOFq?DfN(Y`C@UthL)kx=Q`zj?9HUr3U3 Uple~FSpWb407*qoM6N<$f<-M&f&c&j literal 0 HcmV?d00001 diff --git a/data/gfx/gui/table/default/playeraction_07_0.6_checked.png b/data/gfx/gui/table/default/playeraction_07_0.6_checked.png new file mode 100644 index 0000000000000000000000000000000000000000..17b3fc54dd2104aa3c0c200913afc4f7186c014b GIT binary patch literal 1701 zcmV;W23q-vP)yewAykBAT>}ZmjY$mZRu{i-92Y!eCTOC*=|eQ7}9R% zOD6kpE-&-T_y7K9W){%W>V>GU50yb+VKrxl7M+S@o3v&i(Ui0+WvpB zE*HE!D{Lbs09XLz!@!{)z`_Y+MsGKzA78U;>Vqq_u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)$ znd#@EfY+ide+ag?&PQY(^*#G|S=I+jsuY9-R2)4xGTYm;)eK;q0B-#g^t9|h=eMha zKC8Mu2T)v3N&gnh@U?gf@*4TL+_-<~%x20;vjHgpCAxE!J^_=&ahw=KM9{~o2ZkgR vY`C(n>M1CF2BsT`wEDUF`kydbT7A~P$(y@0^Nq3j00000NkvXXu0mjf;y4&w literal 0 HcmV?d00001 diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 5c28ec37..7232fb65 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -59,7 +59,7 @@ using namespace std; mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent) - : QMainWindow(parent), myChat(NULL), myConfig(c), gameSpeed(0), myActionIsBet(0), myActionIsRaise(0), breakAfterActualHand(FALSE) + : QMainWindow(parent), myChat(NULL), myConfig(c), gameSpeed(0), myActionIsBet(0), myActionIsRaise(0), pushButtonBetRaiseIsChecked(FALSE), pushButtonCallCheckIsChecked(FALSE), pushButtonFoldIsChecked(FALSE), pushButtonAllInIsChecked(FALSE), myButtonsAreCheckable(FALSE), breakAfterActualHand(FALSE) { int i; @@ -483,9 +483,9 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent) groupBoxArray[0]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow_0.6.png) }"); //Human player button - pushButton_BetRaise->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; QPushButton }"); - pushButton_CallCheck->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }"); - pushButton_Fold->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }"); + pushButton_BetRaise->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0;} QPushButton:unchecked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); } QPushButton:checked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6_checked.png); }"); + pushButton_CallCheck->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0;} QPushButton:unchecked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); } QPushButton:checked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6_checked.png); }"); + pushButton_Fold->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0;} QPushButton:unchecked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); } QPushButton:checked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6_checked.png); }"); spinBox_set->setStyleSheet("QSpinBox { "+ font2String +" font-size: 10px; font-weight: bold; background-color: #1D3B00; color: #F0F0F0; } QSpinBox:disabled { background-color: #316300; color: #6d7b5f }"); @@ -2103,70 +2103,105 @@ void mainWindowImpl::provideMyActions() { Game *currentGame = mySession->getCurrentGame(); HandInterface *currentHand = currentGame->getCurrentHand(); - switch (currentHand->getActualRound()) { - - case 0: { - if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { - pushButton_BetRaise->setText("Raise"); - } - - if (currentGame->getSeatsList()->front()->getMySet()== currentHand->getCurrentBeRo()->getHighestSet() && currentGame->getSeatsList()->front()->getMyButton() == 3) { pushButton_CallCheck->setText("Check"); } - else { pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" ); } - pushButton_Fold->setText("Fold"); - } - break; - case 1: { + if(/*pushButton_BetRaise->isCheckable() && */(currentHand->getSeatsList()->front()->getMyAction() == PLAYER_ACTION_ALLIN || currentHand->getSeatsList()->front()->getMyAction() == PLAYER_ACTION_FOLD)) { - pushButton_Fold->setText("Fold"); + pushButton_BetRaise->setText(""); + pushButton_CallCheck->setText(""); + pushButton_Fold->setText(""); -// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl; - if (currentHand->getCurrentBeRo()->getHighestSet() == 0) { - pushButton_CallCheck->setText("Check"); - pushButton_BetRaise->setText("Bet"); - } - if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) { - pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" ); - if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { + pushButton_AllIn->setDisabled(TRUE); + horizontalSlider_bet->setDisabled(TRUE); + spinBox_set->setDisabled(TRUE); + + myButtonsCheckable(FALSE); + } + else { + pushButton_AllIn->setEnabled(TRUE); + horizontalSlider_bet->setEnabled(TRUE); + spinBox_set->setEnabled(TRUE); + + switch (currentHand->getActualRound()) { + + case 0: { + if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { pushButton_BetRaise->setText("Raise"); } - } - } - break; - case 2: { - pushButton_Fold->setText("Fold"); - -// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl; - if (currentHand->getCurrentBeRo()->getHighestSet() == 0) { - pushButton_CallCheck->setText("Check"); - pushButton_BetRaise->setText("Bet"); + if (currentGame->getSeatsList()->front()->getMySet()== currentHand->getCurrentBeRo()->getHighestSet() && currentGame->getSeatsList()->front()->getMyButton() == 3) { pushButton_CallCheck->setText("Check"); } + else { pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" ); } + pushButton_Fold->setText("Fold"); } - if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) { - pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" ); - if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { - pushButton_BetRaise->setText("Raise"); + break; + case 1: { + + if (currentHand->getCurrentBeRo()->getHighestSet() == 0 && pushButton_Fold->isCheckable()) { + pushButton_Fold->setText("Check / Fold"); + } + else { pushButton_Fold->setText("Fold"); } + + // cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl; + if (currentHand->getCurrentBeRo()->getHighestSet() == 0) { + + if(pushButton_CallCheck->isCheckable()) { pushButton_CallCheck->setText("Check / Call"); } + else { pushButton_CallCheck->setText("Check"); } + pushButton_BetRaise->setText("Bet"); + } + if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) { + pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" ); + if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { + pushButton_BetRaise->setText("Raise"); + } } } - } - break; - case 3: { + break; + case 2: { + + if (currentHand->getCurrentBeRo()->getHighestSet() == 0 && pushButton_Fold->isCheckable()) { + pushButton_Fold->setText("Check / Fold"); + } + else { pushButton_Fold->setText("Fold"); } - pushButton_Fold->setText("Fold"); - -// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl; - if (currentHand->getCurrentBeRo()->getHighestSet() == 0) { - pushButton_CallCheck->setText("Check"); - pushButton_BetRaise->setText("Bet"); - } - if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) { - pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" ); - if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { - pushButton_BetRaise->setText("Raise"); + // cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl; + if (currentHand->getCurrentBeRo()->getHighestSet() == 0) { + + if(pushButton_CallCheck->isCheckable()) { pushButton_CallCheck->setText("Check / Call"); } + else { pushButton_CallCheck->setText("Check"); } + pushButton_BetRaise->setText("Bet"); + } + if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) { + pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" ); + if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { + pushButton_BetRaise->setText("Raise"); + } } } - } - break; - default: {} + break; + case 3: { + + if (currentHand->getCurrentBeRo()->getHighestSet() == 0 && pushButton_Fold->isCheckable()) { + pushButton_Fold->setText("Check / Fold"); + } + else { pushButton_Fold->setText("Fold"); } + + // cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl; + if (currentHand->getCurrentBeRo()->getHighestSet() == 0) { + + if(pushButton_CallCheck->isCheckable()) { pushButton_CallCheck->setText("Check / Call"); } + else { pushButton_CallCheck->setText("Check"); } + pushButton_BetRaise->setText("Bet"); + } + if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) { + pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" ); + if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { + pushButton_BetRaise->setText("Raise"); + } + } + } + break; + default: {} + } + + myBetRaise(); } } @@ -2191,11 +2226,17 @@ void mainWindowImpl::meInAction() { statusBar()->showMessage(tr("F1 - All-In | F2 - Bet/Raise | F3 - Check/Call | F4 - Fold"), 15000); } } - + + //paint actions on buttons provideMyActions(); - myBetRaise(); + //do remembered action + if( pushButtonBetRaiseIsChecked ) { pushButton_BetRaise->click(); pushButtonBetRaiseIsChecked = FALSE;} + if( pushButtonCallCheckIsChecked ) { pushButton_CallCheck->click(); pushButtonCallCheckIsChecked = FALSE;} + if( pushButtonFoldIsChecked ) { pushButton_Fold->click(); pushButtonFoldIsChecked = FALSE;} + if( pushButtonAllInIsChecked ) { pushButton_AllIn->click(); pushButtonAllInIsChecked = FALSE;} + //automatic mode switch (playingMode) { case 0: // Manual mode break; @@ -2227,14 +2268,16 @@ void mainWindowImpl::stopTimeoutAnimation(int playerId) { void mainWindowImpl::disableMyButtons() { + HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand(); + //clear userWidgets spinBox_set->setMinimum(0); horizontalSlider_bet->setMinimum(0); -// spinBox_set->setValue(0); - spinBox_set->clear(); - horizontalSlider_bet->setValue(0); - spinBox_set->setDisabled(TRUE); - horizontalSlider_bet->setDisabled(TRUE); + spinBox_set->setMaximum(currentHand->getSeatsList()->front()->getMyCash()); + horizontalSlider_bet->setMaximum(currentHand->getSeatsList()->front()->getMyCash()); + spinBox_set->setValue(0); +// spinBox_set->setDisabled(TRUE); +// horizontalSlider_bet->setDisabled(TRUE); // spinBox_set->hide(); // pushButton_BetRaise->show(); // pushButton_BetRaise->setText(""); @@ -2255,12 +2298,12 @@ void mainWindowImpl::myBetRaise() { myBet(); } else { - spinBox_set->setMinimum(0); - horizontalSlider_bet->setMinimum(0); - spinBox_set->setValue(0); - horizontalSlider_bet->setValue(0); - spinBox_set->setDisabled(TRUE); - horizontalSlider_bet->setDisabled(TRUE); +// spinBox_set->setMinimum(0); +// horizontalSlider_bet->setMinimum(0); +// spinBox_set->setValue(0); +// horizontalSlider_bet->setValue(0); +// spinBox_set->setDisabled(TRUE); +// horizontalSlider_bet->setDisabled(TRUE); } } @@ -2354,11 +2397,15 @@ void mainWindowImpl::myBet(){ HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand(); + spinBox_set->setMinimum(currentHand->getSmallBlind()*2); horizontalSlider_bet->setMinimum(currentHand->getSmallBlind()*2); spinBox_set->setMaximum(currentHand->getSeatsList()->front()->getMyCash()); horizontalSlider_bet->setMaximum(currentHand->getSeatsList()->front()->getMyCash()); - spinBox_set->setValue(spinBox_set->minimum()); + +// if(!myButtonsAreCheckable) +// spinBox_set->setValue(spinBox_set->minimum()); + horizontalSlider_bet->setSingleStep(10); if(lineEdit_ChatInput->text() == "") { spinBox_set->setFocus(); @@ -2376,7 +2423,10 @@ void mainWindowImpl::myRaise(){ horizontalSlider_bet->setMinimum(currentHand->getCurrentBeRo()->getHighestSet() - currentHand->getSeatsList()->front()->getMySet() + currentHand->getCurrentBeRo()->getMinimumRaise()); spinBox_set->setMaximum(currentHand->getSeatsList()->front()->getMyCash()); horizontalSlider_bet->setMaximum(currentHand->getSeatsList()->front()->getMyCash()); - spinBox_set->setValue(spinBox_set->minimum()); + +// if(!myButtonsAreCheckable && spinBox_set->value != spinBox_set->minimum()) +// spinBox_set->setValue(spinBox_set->minimum()); + horizontalSlider_bet->setSingleStep(10); if(lineEdit_ChatInput->text() == "") { spinBox_set->setFocus(); @@ -2478,6 +2528,16 @@ void mainWindowImpl::pushButtonBetRaiseClicked(bool checked) { pushButton_CallCheck->setChecked(FALSE); pushButton_Fold->setChecked(FALSE); pushButton_AllIn->setChecked(FALSE); + + pushButtonCallCheckIsChecked = FALSE; + pushButtonFoldIsChecked = FALSE; + pushButtonAllInIsChecked = FALSE; + + pushButtonBetRaiseIsChecked = TRUE; + + if(!radioButton_manualAction->isChecked()) + radioButton_manualAction->click(); + } else {} } @@ -2493,6 +2553,15 @@ void mainWindowImpl::pushButtonCallCheckClicked(bool checked) { pushButton_Fold->setChecked(FALSE); pushButton_BetRaise->setChecked(FALSE); pushButton_AllIn->setChecked(FALSE); + + pushButtonAllInIsChecked = FALSE; + pushButtonFoldIsChecked = FALSE; + pushButtonBetRaiseIsChecked = FALSE; + + pushButtonCallCheckIsChecked = TRUE; + + if(!radioButton_manualAction->isChecked()) + radioButton_manualAction->click(); } else {} } @@ -2508,6 +2577,15 @@ void mainWindowImpl::pushButtonFoldClicked(bool checked) { pushButton_CallCheck->setChecked(FALSE); pushButton_BetRaise->setChecked(FALSE); pushButton_AllIn->setChecked(FALSE); + + pushButtonAllInIsChecked = FALSE; + pushButtonCallCheckIsChecked = FALSE; + pushButtonBetRaiseIsChecked = FALSE; + + pushButtonFoldIsChecked = TRUE; + + if(!radioButton_manualAction->isChecked()) + radioButton_manualAction->click(); } else {} } @@ -2523,6 +2601,15 @@ void mainWindowImpl::pushButtonAllInClicked(bool checked) { pushButton_CallCheck->setChecked(FALSE); pushButton_BetRaise->setChecked(FALSE); pushButton_Fold->setChecked(FALSE); + + pushButtonFoldIsChecked = FALSE; + pushButtonCallCheckIsChecked = FALSE; + pushButtonBetRaiseIsChecked = FALSE; + + pushButtonAllInIsChecked = TRUE; + + if(!radioButton_manualAction->isChecked()) + radioButton_manualAction->click(); } else {} } @@ -4004,9 +4091,11 @@ void mainWindowImpl::myButtonsCheckable(bool state) { pushButton_AllIn->setCheckable(TRUE); //design - pushButton_BetRaise->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #28E74B; }"); - pushButton_CallCheck->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #009DFF; }"); - pushButton_Fold->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #FF1E1E; }"); + pushButton_BetRaise->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #7DFF95;} QPushButton:unchecked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); } QPushButton:checked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6_checked.png); }"); + pushButton_CallCheck->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #7DCDFF;} QPushButton:unchecked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); } QPushButton:checked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6_checked.png); }"); + pushButton_Fold->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #FF7D7D;} QPushButton:unchecked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); } QPushButton:checked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6_checked.png); }"); + + myButtonsAreCheckable = TRUE; } else { //not checkable @@ -4017,10 +4106,13 @@ void mainWindowImpl::myButtonsCheckable(bool state) { pushButton_AllIn->setCheckable(FALSE); //design - pushButton_BetRaise->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; QPushButton }"); - pushButton_CallCheck->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }"); - pushButton_Fold->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }"); + pushButton_BetRaise->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0;} QPushButton:unchecked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); } QPushButton:checked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6_checked.png); }"); + pushButton_CallCheck->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0;} QPushButton:unchecked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); } QPushButton:checked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6_checked.png); }"); + pushButton_Fold->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0;} QPushButton:unchecked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); } QPushButton:checked { background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6_checked.png); }"); + + myButtonsAreCheckable = FALSE; } + } void mainWindowImpl::closeEvent(QCloseEvent* /*event*/) { quitPokerTH(); } diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index 5468a27e..ba8e47cd 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -448,6 +448,12 @@ private: bool myActionIsBet; bool myActionIsRaise; + bool pushButtonBetRaiseIsChecked; + bool pushButtonCallCheckIsChecked; + bool pushButtonFoldIsChecked; + bool pushButtonAllInIsChecked; + bool myButtonsAreCheckable; + bool breakAfterActualHand; bool flipHolecardsAllInAlreadyDone;