Player action timeout - display is working, function still missing.

This commit is contained in:
lotodore
2007-06-07 23:24:22 +00:00
parent fb274284f5
commit 9a29830532
12 changed files with 65 additions and 36 deletions
+2
View File
@@ -87,6 +87,8 @@ void GuiWrapper::flipHolecardsAllIn() { myW->signalFlipHolecardsAllIn(); }
void GuiWrapper::nextRoundCleanGui() { myW->signalNextRoundCleanGui(); }
void GuiWrapper::meInAction() { myW->signalMeInAction(); }
void GuiWrapper::startTimeoutAnimation(int playerId, int timeoutSec) { myW->signalStartTimeoutAnimation(playerId, timeoutSec); }
void GuiWrapper::stopTimeoutAnimation(int playerId) { myW->signalStopTimeoutAnimation(playerId); }
void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) { myLog->signalLogPlayerActionMsg(QString::fromUtf8(playerName.c_str()), action, setValue); }
void GuiWrapper::logNewGameHandMsg(int gameID, int handID) { myLog->signalLogNewGameHandMsg(gameID, handID); }
+2
View File
@@ -80,6 +80,8 @@ public:
void nextRoundCleanGui();
void meInAction();
void startTimeoutAnimation(int playerId, int timeoutSec);
void stopTimeoutAnimation(int playerId);
void logPlayerActionMsg(std::string playerName, int action, int setValue) ;
void logNewGameHandMsg(int gameID, int handID) ;
+13 -11
View File
@@ -585,6 +585,8 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
connect(this, SIGNAL(signalRefreshGameLabels(int)), this, SLOT(refreshGameLabels(int)));
connect(this, SIGNAL(signalMeInAction()), this, SLOT(meInAction()));
connect(this, SIGNAL(signalStartTimeoutAnimation(int, int)), this, SLOT(startTimeoutAnimation(int, int)));
connect(this, SIGNAL(signalStopTimeoutAnimation(int)), this, SLOT(stopTimeoutAnimation(int)));
connect(this, SIGNAL(signalDealHoleCards()), this, SLOT(dealHoleCards()));
connect(this, SIGNAL(signalDealFlopCards0()), this, SLOT(dealFlopCards0()));
@@ -719,6 +721,7 @@ void mainWindowImpl::callCreateNetworkGameDialog() {
//temporarely static until ai is enabled in network
// gameData.guiSpeed = myCreateNetworkGameDialog->spinBox_gameSpeed->value();
gameData.guiSpeed = 4;
gameData.playerActionTimeoutSec = myCreateNetworkGameDialog->spinBox_netTimeOutPlayerAction->value();
myStartNetworkGameDialog->setSession(&myServerGuiInterface->getSession());
myStartNetworkGameDialog->treeWidget->clear();
@@ -1500,6 +1503,16 @@ void mainWindowImpl::meInAction() {
}
}
void mainWindowImpl::startTimeoutAnimation(int playerId, int timeoutSec) {
assert(playerId >= 0 && playerId < mySession->getCurrentGame()->getStartQuantityPlayers());
setLabelArray[playerId]->startTimeOutAnimation(timeoutSec);
}
void mainWindowImpl::stopTimeoutAnimation(int playerId) {
assert(playerId >= 0 && playerId < mySession->getCurrentGame()->getStartQuantityPlayers());
setLabelArray[playerId]->stopTimeOutAnimation();
}
void mainWindowImpl::disableMyButtons() {
//clear userWidgets
@@ -1758,15 +1771,6 @@ void mainWindowImpl::myAllIn(){
myActionDone();
}
void mainWindowImpl::userActionTimeOutReached() {
//TODO
// automatic check, fold
cout << "timeoutaction" << endl;
}
void mainWindowImpl::myActionDone() {
// If a network client is running, we need
@@ -2514,8 +2518,6 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
if (event->key() == Qt::Key_F3) { pushButton_BetRaise->click(); }
if (event->key() == Qt::Key_F10) { switchLeftToolBox(); }
if (event->key() == Qt::Key_F11) { switchRightToolBox(); }
if (event->key() == Qt::Key_D) { setLabelArray[0]->startTimeOutAnimation(myConfig->readConfigInt("NetTimeOutPlayerAction")); } //f
if (event->key() == Qt::Key_E) { setLabelArray[0]->stopTimeOutAnimation(); } //f
// if (event->key() == Qt::Key_W) { qApp->quit(); } //s
if (event->key() == 16777249) {
pushButton_break->click();
+5 -2
View File
@@ -86,6 +86,8 @@ signals:
void signalRefreshGameLabels(int);
void signalMeInAction();
void signalStartTimeoutAnimation(int playerId, int timeoutSec);
void signalStopTimeoutAnimation(int playerId);
void signalDealHoleCards();
void signalDealFlopCards0();
@@ -152,6 +154,9 @@ public slots:
void callCreateNetworkGameDialog();
void callJoinNetworkGameDialog();
void startTimeoutAnimation(int playerId, int timoutSec);
void stopTimeoutAnimation(int playerId);
void myBetRaise();
void myFoldAllin();
void myCallCheckSet();
@@ -251,8 +256,6 @@ public slots:
void localGameModification();
void networkGameModification();
void userActionTimeOutReached();
void quitPokerTH();
private:
+3 -3
View File
@@ -57,9 +57,9 @@ void MySetLabel::nextTimeOutAnimationFrame() {
update();
}
else {
stopTimeOutAnimation();
//callback
myW->userActionTimeOutReached();
stopTimeOutAnimation();
// no callback is called here.
// the server initiates any action required.
}
}