starts human player input filed redesign - PART V (do remembered actions)
This commit is contained in:
@@ -1929,6 +1929,10 @@ void mainWindowImpl::dealHoleCards() {
|
|||||||
|
|
||||||
void mainWindowImpl::dealBeRoCards(int myBeRoID) {
|
void mainWindowImpl::dealBeRoCards(int myBeRoID) {
|
||||||
|
|
||||||
|
uncheckMyButtons();
|
||||||
|
myButtonsCheckable(FALSE);
|
||||||
|
clearMyButtons();
|
||||||
|
|
||||||
switch(myBeRoID) {
|
switch(myBeRoID) {
|
||||||
|
|
||||||
case 1: { dealFlopCards0(); }
|
case 1: { dealFlopCards0(); }
|
||||||
@@ -2099,6 +2103,12 @@ void mainWindowImpl::dealRiverCards2() {
|
|||||||
|
|
||||||
void mainWindowImpl::provideMyActions() {
|
void mainWindowImpl::provideMyActions() {
|
||||||
|
|
||||||
|
QString pushButtonFoldString;
|
||||||
|
QString pushButtonBetRaiseString;
|
||||||
|
QString lastPushButtonBetRaiseString = pushButton_BetRaise->text();
|
||||||
|
QString pushButtonCallCheckString;
|
||||||
|
QString lastPushButtonCallCheckString = pushButton_CallCheck->text();
|
||||||
|
|
||||||
|
|
||||||
Game *currentGame = mySession->getCurrentGame();
|
Game *currentGame = mySession->getCurrentGame();
|
||||||
HandInterface *currentHand = currentGame->getCurrentHand();
|
HandInterface *currentHand = currentGame->getCurrentHand();
|
||||||
@@ -2124,32 +2134,34 @@ void mainWindowImpl::provideMyActions() {
|
|||||||
|
|
||||||
case 0: {
|
case 0: {
|
||||||
if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
|
if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
|
||||||
pushButton_BetRaise->setText("Raise");
|
pushButtonBetRaiseString = "Raise";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentGame->getSeatsList()->front()->getMySet()== currentHand->getCurrentBeRo()->getHighestSet() && currentGame->getSeatsList()->front()->getMyButton() == 3) { pushButton_CallCheck->setText("Check"); }
|
if (currentGame->getSeatsList()->front()->getMySet()== currentHand->getCurrentBeRo()->getHighestSet() && currentGame->getSeatsList()->front()->getMyButton() == 3) { pushButtonCallCheckString = "Check"; }
|
||||||
else { pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" ); }
|
else { pushButtonCallCheckString = "Call "+QString::number(getMyCallAmount())+"$"; }
|
||||||
pushButton_Fold->setText("Fold");
|
|
||||||
|
pushButtonFoldString = "Fold";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1: {
|
case 1: {
|
||||||
|
|
||||||
if (currentHand->getCurrentBeRo()->getHighestSet() == 0 && pushButton_Fold->isCheckable()) {
|
if (currentHand->getCurrentBeRo()->getHighestSet() == 0 && pushButton_Fold->isCheckable()) {
|
||||||
pushButton_Fold->setText("Check / Fold");
|
pushButtonFoldString = "Check / Fold";
|
||||||
}
|
}
|
||||||
else { pushButton_Fold->setText("Fold"); }
|
else { pushButtonFoldString = "Fold"; }
|
||||||
|
|
||||||
// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl;
|
// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl;
|
||||||
if (currentHand->getCurrentBeRo()->getHighestSet() == 0) {
|
if (currentHand->getCurrentBeRo()->getHighestSet() == 0) {
|
||||||
|
|
||||||
if(pushButton_CallCheck->isCheckable()) { pushButton_CallCheck->setText("Check / Call"); }
|
if(pushButton_CallCheck->isCheckable()) { pushButtonCallCheckString = "Check / Call"; }
|
||||||
else { pushButton_CallCheck->setText("Check"); }
|
else { pushButtonCallCheckString = "Check"; }
|
||||||
pushButton_BetRaise->setText("Bet");
|
|
||||||
|
pushButtonBetRaiseString = "Bet";
|
||||||
}
|
}
|
||||||
if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) {
|
if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) {
|
||||||
pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" );
|
pushButtonCallCheckString = "Call "+QString::number(getMyCallAmount())+"$" ;
|
||||||
if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
|
if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
|
||||||
pushButton_BetRaise->setText("Raise");
|
pushButtonBetRaiseString = "Raise";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2157,21 +2169,21 @@ void mainWindowImpl::provideMyActions() {
|
|||||||
case 2: {
|
case 2: {
|
||||||
|
|
||||||
if (currentHand->getCurrentBeRo()->getHighestSet() == 0 && pushButton_Fold->isCheckable()) {
|
if (currentHand->getCurrentBeRo()->getHighestSet() == 0 && pushButton_Fold->isCheckable()) {
|
||||||
pushButton_Fold->setText("Check / Fold");
|
pushButtonFoldString = "Check / Fold";
|
||||||
}
|
}
|
||||||
else { pushButton_Fold->setText("Fold"); }
|
else { pushButtonFoldString = "Fold"; }
|
||||||
|
|
||||||
// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl;
|
// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl;
|
||||||
if (currentHand->getCurrentBeRo()->getHighestSet() == 0) {
|
if (currentHand->getCurrentBeRo()->getHighestSet() == 0) {
|
||||||
|
|
||||||
if(pushButton_CallCheck->isCheckable()) { pushButton_CallCheck->setText("Check / Call"); }
|
if(pushButton_CallCheck->isCheckable()) { pushButtonCallCheckString = "Check / Call"; }
|
||||||
else { pushButton_CallCheck->setText("Check"); }
|
else { pushButtonCallCheckString = "Check"; }
|
||||||
pushButton_BetRaise->setText("Bet");
|
pushButtonBetRaiseString = "Bet";
|
||||||
}
|
}
|
||||||
if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) {
|
if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) {
|
||||||
pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" );
|
pushButtonCallCheckString = "Call "+QString::number(getMyCallAmount())+"$" ;
|
||||||
if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
|
if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
|
||||||
pushButton_BetRaise->setText("Raise");
|
pushButtonBetRaiseString = "Raise";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2179,21 +2191,21 @@ void mainWindowImpl::provideMyActions() {
|
|||||||
case 3: {
|
case 3: {
|
||||||
|
|
||||||
if (currentHand->getCurrentBeRo()->getHighestSet() == 0 && pushButton_Fold->isCheckable()) {
|
if (currentHand->getCurrentBeRo()->getHighestSet() == 0 && pushButton_Fold->isCheckable()) {
|
||||||
pushButton_Fold->setText("Check / Fold");
|
pushButtonFoldString = "Check / Fold";
|
||||||
}
|
}
|
||||||
else { pushButton_Fold->setText("Fold"); }
|
else { pushButtonFoldString = "Fold"; }
|
||||||
|
|
||||||
// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl;
|
// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl;
|
||||||
if (currentHand->getCurrentBeRo()->getHighestSet() == 0) {
|
if (currentHand->getCurrentBeRo()->getHighestSet() == 0) {
|
||||||
|
|
||||||
if(pushButton_CallCheck->isCheckable()) { pushButton_CallCheck->setText("Check / Call"); }
|
if(pushButton_CallCheck->isCheckable()) { pushButtonCallCheckString = "Check / Call"; }
|
||||||
else { pushButton_CallCheck->setText("Check"); }
|
else { pushButtonCallCheckString = "Check"; }
|
||||||
pushButton_BetRaise->setText("Bet");
|
pushButtonBetRaiseString = "Bet";
|
||||||
}
|
}
|
||||||
if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) {
|
if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) {
|
||||||
pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" );
|
pushButtonCallCheckString = "Call "+QString::number(getMyCallAmount())+"$" ;
|
||||||
if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
|
if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
|
||||||
pushButton_BetRaise->setText("Raise");
|
pushButtonBetRaiseString = "Raise";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2201,6 +2213,14 @@ void mainWindowImpl::provideMyActions() {
|
|||||||
default: {}
|
default: {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if text changed on checked button --> uncheck to prevent unwanted actions
|
||||||
|
if((pushButtonCallCheckString != lastPushButtonCallCheckString && pushButton_CallCheck->isChecked()) || (pushButtonBetRaiseString != lastPushButtonBetRaiseString && pushButton_BetRaise->isChecked()) ) { uncheckMyButtons(); }
|
||||||
|
|
||||||
|
pushButton_Fold->setText(pushButtonFoldString);
|
||||||
|
pushButton_BetRaise->setText(pushButtonBetRaiseString);
|
||||||
|
pushButton_CallCheck->setText(pushButtonCallCheckString);
|
||||||
|
|
||||||
|
|
||||||
myBetRaise();
|
myBetRaise();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2284,9 +2304,6 @@ void mainWindowImpl::disableMyButtons() {
|
|||||||
// pushButton_CallCheck->setText("");
|
// pushButton_CallCheck->setText("");
|
||||||
// pushButton_Fold->setText("");
|
// pushButton_Fold->setText("");
|
||||||
|
|
||||||
myButtonsCheckable(TRUE);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void mainWindowImpl::myBetRaise() {
|
void mainWindowImpl::myBetRaise() {
|
||||||
@@ -2549,7 +2566,9 @@ void mainWindowImpl::pushButtonBetRaiseClicked(bool checked) {
|
|||||||
radioButton_manualAction->click();
|
radioButton_manualAction->click();
|
||||||
|
|
||||||
}
|
}
|
||||||
else {}
|
else {
|
||||||
|
pushButtonBetRaiseIsChecked = FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mySet();
|
mySet();
|
||||||
@@ -2573,7 +2592,9 @@ void mainWindowImpl::pushButtonCallCheckClicked(bool checked) {
|
|||||||
if(!radioButton_manualAction->isChecked())
|
if(!radioButton_manualAction->isChecked())
|
||||||
radioButton_manualAction->click();
|
radioButton_manualAction->click();
|
||||||
}
|
}
|
||||||
else {}
|
else {
|
||||||
|
pushButtonCallCheckIsChecked = FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myCallCheck();
|
myCallCheck();
|
||||||
@@ -2597,7 +2618,9 @@ void mainWindowImpl::pushButtonFoldClicked(bool checked) {
|
|||||||
if(!radioButton_manualAction->isChecked())
|
if(!radioButton_manualAction->isChecked())
|
||||||
radioButton_manualAction->click();
|
radioButton_manualAction->click();
|
||||||
}
|
}
|
||||||
else {}
|
else {
|
||||||
|
pushButtonFoldIsChecked = FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myFold();
|
myFold();
|
||||||
@@ -2621,7 +2644,9 @@ void mainWindowImpl::pushButtonAllInClicked(bool checked) {
|
|||||||
if(!radioButton_manualAction->isChecked())
|
if(!radioButton_manualAction->isChecked())
|
||||||
radioButton_manualAction->click();
|
radioButton_manualAction->click();
|
||||||
}
|
}
|
||||||
else {}
|
else {
|
||||||
|
pushButtonAllInIsChecked = FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myAllIn();
|
myAllIn();
|
||||||
@@ -2662,7 +2687,15 @@ void mainWindowImpl::nextPlayerAnimation() {
|
|||||||
refreshCash();
|
refreshCash();
|
||||||
|
|
||||||
//refresh actions for human player
|
//refresh actions for human player
|
||||||
provideMyActions();
|
|
||||||
|
if(currentHand->getLastPlayersTurn() == 0) {
|
||||||
|
myButtonsCheckable(FALSE);
|
||||||
|
clearMyButtons();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
myButtonsCheckable(TRUE);
|
||||||
|
provideMyActions();
|
||||||
|
}
|
||||||
|
|
||||||
nextPlayerAnimationTimer->start(nextPlayerSpeed1);
|
nextPlayerAnimationTimer->start(nextPlayerSpeed1);
|
||||||
}
|
}
|
||||||
@@ -2716,6 +2749,10 @@ void mainWindowImpl::postRiverRunAnimation1() { postRiverRunAnimation1Timer->sta
|
|||||||
|
|
||||||
void mainWindowImpl::postRiverRunAnimation2() {
|
void mainWindowImpl::postRiverRunAnimation2() {
|
||||||
|
|
||||||
|
uncheckMyButtons();
|
||||||
|
myButtonsCheckable(FALSE);
|
||||||
|
clearMyButtons();
|
||||||
|
|
||||||
// int i;
|
// int i;
|
||||||
HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand();
|
HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand();
|
||||||
|
|
||||||
@@ -3535,6 +3572,8 @@ void mainWindowImpl::nextRoundCleanGui() {
|
|||||||
|
|
||||||
//fix press mouse button during bankrupt with anti-peek-mode
|
//fix press mouse button during bankrupt with anti-peek-mode
|
||||||
this->mouseOverFlipCards(FALSE);
|
this->mouseOverFlipCards(FALSE);
|
||||||
|
|
||||||
|
uncheckMyButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
void mainWindowImpl::stopTimer() {
|
void mainWindowImpl::stopTimer() {
|
||||||
@@ -4090,6 +4129,21 @@ void mainWindowImpl::mouseOverFlipCards(bool front) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mainWindowImpl::uncheckMyButtons() {
|
||||||
|
|
||||||
|
pushButton_BetRaise->setChecked(FALSE);
|
||||||
|
pushButton_CallCheck->setChecked(FALSE);
|
||||||
|
pushButton_Fold->setChecked(FALSE);
|
||||||
|
pushButton_AllIn->setChecked(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void mainWindowImpl::clearMyButtons() {
|
||||||
|
|
||||||
|
pushButton_BetRaise->setText("");
|
||||||
|
pushButton_CallCheck->setText("");
|
||||||
|
pushButton_Fold->setText("");
|
||||||
|
}
|
||||||
|
|
||||||
void mainWindowImpl::myButtonsCheckable(bool state) {
|
void mainWindowImpl::myButtonsCheckable(bool state) {
|
||||||
|
|
||||||
if(state) {
|
if(state) {
|
||||||
|
|||||||
@@ -310,6 +310,8 @@ public slots:
|
|||||||
|
|
||||||
void mouseOverFlipCards(bool front);
|
void mouseOverFlipCards(bool front);
|
||||||
|
|
||||||
|
void uncheckMyButtons();
|
||||||
|
void clearMyButtons();
|
||||||
void myButtonsCheckable(bool state);
|
void myButtonsCheckable(bool state);
|
||||||
|
|
||||||
void changePlayingMode();
|
void changePlayingMode();
|
||||||
|
|||||||
Reference in New Issue
Block a user