diff options
author | John Fultz <jfultz@wolfram.com> | 2019-01-14 02:46:35 -0600 |
---|---|---|
committer | John Fultz <jfultz@wolfram.com> | 2019-01-14 02:47:01 -0600 |
commit | 2c6b3b89da2a728ba6683d9f4455139372beb21b (patch) | |
tree | 17e01fc5b5e736ec42b9b5e406371f03b1da216b /quacker/quacker.cpp | |
parent | 3938bd82ac4ac35916c83b378776159952f744eb (diff) |
Fix #21, committing a phoney cannot be canceled.
When going back to edit history, typing a
phoney correctly brought up a dialog, but
indicating you wanted to cancel the phoney
play didn't stop the play from going down,
or a subsequent computer player from making
its play.
Diffstat (limited to 'quacker/quacker.cpp')
-rw-r--r-- | quacker/quacker.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/quacker/quacker.cpp b/quacker/quacker.cpp index 275003f..2734ac8 100644 --- a/quacker/quacker.cpp +++ b/quacker/quacker.cpp @@ -269,8 +269,10 @@ bool TopLevel::askToCarryOn(const QString &text) return QMessageBox::question(this, tr("Verify Play - Quackle"), dialogText(text), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes; } -void TopLevel::setCandidateMove(const Quackle::Move &move) +void TopLevel::setCandidateMove(const Quackle::Move &move, bool *carryOnPtr) { + if (carryOnPtr != nullptr) + *carryOnPtr = true; if (!m_game->hasPositions() || (move.action == Quackle::Move::Place && move.tiles().empty())) return; @@ -371,7 +373,11 @@ void TopLevel::setCandidateMove(const Quackle::Move &move) } if (!carryOn) + { + if (carryOnPtr != nullptr) + *carryOnPtr = false; return; + } if (playHasIllegalWords && QuackleIO::UtilSettings::self()->scoreInvalidAsZero) prettiedMove.score = 0; @@ -818,7 +824,7 @@ void TopLevel::plugIntoMatrix(View *view) { plugIntoBaseMatrix(view); - connect(view, SIGNAL(setCandidateMove(const Quackle::Move &)), this, SLOT(setCandidateMove(const Quackle::Move &))); + connect(view, SIGNAL(setCandidateMove(const Quackle::Move &, bool *)), this, SLOT(setCandidateMove(const Quackle::Move &, bool *))); connect(view, SIGNAL(removeCandidateMoves(const Quackle::MoveList &)), this, SLOT(removeCandidateMoves(const Quackle::MoveList &))); connect(view, SIGNAL(commit()), this, SLOT(commit())); connect(view, SIGNAL(setRack(const Quackle::Rack &)), this, SLOT(setRack(const Quackle::Rack &))); |