add logPlayerLeftMsg()

This commit is contained in:
doitux
2007-06-04 07:43:44 +00:00
parent be90c8141a
commit ffbe8ac924
8 changed files with 29 additions and 4 deletions
+20
View File
@@ -36,6 +36,8 @@ Log::Log(mainWindowImpl* w, ConfigFile *c) : myW(w), myConfig(c), myLogDir(0), m
connect(this, SIGNAL(signalLogPlayerWinsMsg(int, int)), this, SLOT(logPlayerWinsMsg(int, int)));
connect(this, SIGNAL(signalLogDealBoardCardsMsg(int, int, int, int, int, int)), this, SLOT(logDealBoardCardsMsg(int, int, int, int, int, int)));
connect(this, SIGNAL(signalLogFlipHoleCardsMsg(std::string, int, int, int, std::string)), this, SLOT(logFlipHoleCardsMsg(std::string, int, int, int, std::string)));
connect(this, SIGNAL(signalLogPlayerLeftMsg(int)), this, SLOT(logPlayerLeftMsg(int)));
logFileStreamString = "";
lastGameID = 0;
@@ -440,6 +442,24 @@ void Log::logFlipHoleCardsMsg(string playerName, int card1, int card2, int cards
}
void Log::logPlayerLeftMsg(int playerID) {
HandInterface *currentHand = myW->getSession().getCurrentGame()->getCurrentHand();
myW->textBrowser_Log->append( "<i>"+QString::fromUtf8(currentHand->getPlayerArray()[playerID]->getMyName().c_str())+" has left the game!</i>");
if(myConfig->readConfigInt("LogOnOff")) {
logFileStreamString += "<i>"+QString::fromUtf8(currentHand->getPlayerArray()[playerID]->getMyName().c_str())+" has left the game!</i><br>\n";
if(myConfig->readConfigInt("LogInterval") == 0) {
writeLogFileStream(logFileStreamString);
logFileStreamString = "";
}
}
}
QStringList Log::translateCardCode(int cardCode) {
int value = cardCode%13;
+3
View File
@@ -46,6 +46,8 @@ public slots:
void logPlayerWinsMsg(int playerID, int pot);
void logDealBoardCardsMsg(int roundID, int card1, int card2, int card3, int card4 = -1, int card5 = -1);
void logFlipHoleCardsMsg(std::string playerName, int card1, int card2, int cardsValueInt = -1, std::string showHas = "shows");
void logPlayerLeftMsg(int playerID);
public:
QStringList translateCardsValueCode(int cardsValueCode);
@@ -59,6 +61,7 @@ signals:
void signalLogPlayerWinsMsg(int playerID, int pot);
void signalLogDealBoardCardsMsg(int roundID, int card1, int card2, int card3, int card4 = -1, int card5 = -1);
void signalLogFlipHoleCardsMsg(std::string playerName, int card1, int card2, int cardsValueInt = -1, std::string showHas = "shows");
void signalLogPlayerLeftMsg(int playerID);
private:
+1 -3
View File
@@ -2510,9 +2510,7 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
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_S) { if(myConfig->readConfigInt("PlaySoundEffects")) mySDLPlayer->playSound("call"); } //s
if (event->key() == Qt::Key_A) { if(myConfig->readConfigInt("PlaySoundEffects")) mySDLPlayer->playSound("raise"); } //s
if (event->key() == Qt::Key_X) { if(myConfig->readConfigInt("PlaySoundEffects")) mySDLPlayer->playSound(""); } //s
if (event->key() == Qt::Key_S) { mySession->getGui()->logPlayerLeftMsg(2); } //s
// if (event->key() == Qt::Key_W) { qApp->quit(); } //s
if (event->key() == 16777249) {
pushButton_break->click();