ingame chat is disbaled for guest, ignore context menu ingame
This commit is contained in:
@@ -3561,7 +3561,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1024</width>
|
<width>1024</width>
|
||||||
<height>27</height>
|
<height>26</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuView">
|
<widget class="QMenu" name="menuView">
|
||||||
|
|||||||
@@ -58,11 +58,11 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
||||||
: QMainWindow(parent), myChat(NULL), myConfig(c), gameSpeed(0), myActionIsBet(0), myActionIsRaise(0), pushButtonBetRaiseIsChecked(FALSE), pushButtonCallCheckIsChecked(FALSE), pushButtonFoldIsChecked(FALSE), pushButtonAllInIsChecked(FALSE), myButtonsAreCheckable(FALSE), breakAfterCurrentHand(FALSE), currentGameOver(FALSE), betSliderChangedByInput(FALSE), myLastPreActionBetValue(0)
|
: QMainWindow(parent), myChat(NULL), myConfig(c), gameSpeed(0), myActionIsBet(0), myActionIsRaise(0), pushButtonBetRaiseIsChecked(FALSE), pushButtonCallCheckIsChecked(FALSE), pushButtonFoldIsChecked(FALSE), pushButtonAllInIsChecked(FALSE), myButtonsAreCheckable(FALSE), breakAfterCurrentHand(FALSE), currentGameOver(FALSE), betSliderChangedByInput(FALSE), guestMode(FALSE), myLastPreActionBetValue(0)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// this->setStyle(new QPlastiqueStyle);
|
// this->setStyle(new QPlastiqueStyle);
|
||||||
|
|
||||||
//for statistic development
|
//for statistic development
|
||||||
for(i=0; i<15; i++) {
|
for(i=0; i<15; i++) {
|
||||||
@@ -77,11 +77,11 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
//Sound
|
//Sound
|
||||||
mySDLPlayer = new SDLPlayer(myConfig);
|
mySDLPlayer = new SDLPlayer(myConfig);
|
||||||
|
|
||||||
// Init game table style
|
// Init game table style
|
||||||
myGameTableStyle = new GameTableStyleReader(myConfig, this);
|
myGameTableStyle = new GameTableStyleReader(myConfig, this);
|
||||||
myGameTableStyle->readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentGameTableStyle").c_str()));
|
myGameTableStyle->readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentGameTableStyle").c_str()));
|
||||||
|
|
||||||
// Init card deck style
|
// Init card deck style
|
||||||
myCardDeckStyle = new CardDeckStyleReader(myConfig, this);
|
myCardDeckStyle = new CardDeckStyleReader(myConfig, this);
|
||||||
myCardDeckStyle->readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentCardDeckStyle").c_str()));
|
myCardDeckStyle->readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentCardDeckStyle").c_str()));
|
||||||
|
|
||||||
@@ -347,7 +347,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
for (i=0; i<5; i++) { boardCardsArray[i]->raise(); }
|
for (i=0; i<5; i++) { boardCardsArray[i]->raise(); }
|
||||||
|
|
||||||
//fix for away string bug in righttabwidget on windows
|
//fix for away string bug in righttabwidget on windows
|
||||||
#if (defined _WIN32) || (defined __APPLE__)
|
#if (defined _WIN32) || (defined __APPLE__)
|
||||||
tabWidget_Right->setTabText(0, " "+tabWidget_Right->tabText(0)+" ");
|
tabWidget_Right->setTabText(0, " "+tabWidget_Right->tabText(0)+" ");
|
||||||
tabWidget_Right->setTabText(1, " "+tabWidget_Right->tabText(1)+" ");
|
tabWidget_Right->setTabText(1, " "+tabWidget_Right->tabText(1)+" ");
|
||||||
tabWidget_Right->setTabText(2, " "+tabWidget_Right->tabText(2)+" ");
|
tabWidget_Right->setTabText(2, " "+tabWidget_Right->tabText(2)+" ");
|
||||||
@@ -374,20 +374,20 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
this->setFocus();
|
this->setFocus();
|
||||||
|
|
||||||
//windowicon
|
//windowicon
|
||||||
// QString windowIconString();
|
// QString windowIconString();
|
||||||
this->setWindowIcon(QIcon(myAppDataPath+"gfx/gui/misc/windowicon.png"));
|
this->setWindowIcon(QIcon(myAppDataPath+"gfx/gui/misc/windowicon.png"));
|
||||||
|
|
||||||
//Statusbar
|
//Statusbar
|
||||||
if(myConfig->readConfigInt("ShowStatusbarMessages")) {
|
if(myConfig->readConfigInt("ShowStatusbarMessages")) {
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
// statusBar()->showMessage(tr("Cmd+N to start a new game"));
|
// statusBar()->showMessage(tr("Cmd+N to start a new game"));
|
||||||
#else
|
#else
|
||||||
// statusBar()->showMessage(tr("Ctrl+N to start a new game"));
|
// statusBar()->showMessage(tr("Ctrl+N to start a new game"));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dialogs
|
// Dialogs
|
||||||
myChat = new ChatTools(lineEdit_ChatInput, myConfig, INGAME_CHAT, textBrowser_Chat);
|
myChat = new ChatTools(lineEdit_ChatInput, myConfig, INGAME_CHAT, textBrowser_Chat);
|
||||||
myChat->setMyStyle(myGameTableStyle);
|
myChat->setMyStyle(myGameTableStyle);
|
||||||
|
|
||||||
@@ -630,7 +630,7 @@ void gameTableImpl::applySettings(settingsDialogImpl* mySettingsDialog) {
|
|||||||
|
|
||||||
//Check for anti-peek mode
|
//Check for anti-peek mode
|
||||||
if(myStartWindow->getSession()->getCurrentGame()) {
|
if(myStartWindow->getSession()->getCurrentGame()) {
|
||||||
// check if human player is already active
|
// check if human player is already active
|
||||||
if(myStartWindow->getSession()->getCurrentGame()->getSeatsList()->front()->getMyActiveStatus()) {
|
if(myStartWindow->getSession()->getCurrentGame()->getSeatsList()->front()->getMyActiveStatus()) {
|
||||||
|
|
||||||
QPixmap tempCardsPixmapArray[2];
|
QPixmap tempCardsPixmapArray[2];
|
||||||
@@ -1298,7 +1298,7 @@ void gameTableImpl::dealRiverCards1() {
|
|||||||
|
|
||||||
boardCardsArray[4]->setPixmap(*flipside, TRUE);
|
boardCardsArray[4]->setPixmap(*flipside, TRUE);
|
||||||
|
|
||||||
// QTimer::singleShot(dealCardsSpeed, this, SLOT( dealRiverCards2() ));
|
// QTimer::singleShot(dealCardsSpeed, this, SLOT( dealRiverCards2() ));
|
||||||
dealRiverCards1Timer->start(dealCardsSpeed);
|
dealRiverCards1Timer->start(dealCardsSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1424,7 +1424,7 @@ void gameTableImpl::provideMyActions(int mode) {
|
|||||||
//if text changed on checked button --> uncheck to prevent unwanted actions
|
//if text changed on checked button --> uncheck to prevent unwanted actions
|
||||||
if((pushButtonCallCheckString != lastPushButtonCallCheckString && pushButton_CallCheck->isChecked())) {
|
if((pushButtonCallCheckString != lastPushButtonCallCheckString && pushButton_CallCheck->isChecked())) {
|
||||||
|
|
||||||
// cout << "jo" << endl;
|
// cout << "jo" << endl;
|
||||||
uncheckMyButtons();
|
uncheckMyButtons();
|
||||||
resetMyButtonsCheckStateMemory();
|
resetMyButtonsCheckStateMemory();
|
||||||
}
|
}
|
||||||
@@ -1441,7 +1441,7 @@ void gameTableImpl::provideMyActions(int mode) {
|
|||||||
pushButton_AllIn->setText(pushButtonAllInString);
|
pushButton_AllIn->setText(pushButtonAllInString);
|
||||||
|
|
||||||
refreshActionButtonFKeyIndicator();
|
refreshActionButtonFKeyIndicator();
|
||||||
// myBetRaise();
|
// myBetRaise();
|
||||||
|
|
||||||
if(pushButton_BetRaise->text().startsWith(RaiseString)) {
|
if(pushButton_BetRaise->text().startsWith(RaiseString)) {
|
||||||
|
|
||||||
@@ -1503,9 +1503,9 @@ void gameTableImpl::meInAction() {
|
|||||||
|
|
||||||
if(myConfig->readConfigInt("ShowStatusbarMessages")) {
|
if(myConfig->readConfigInt("ShowStatusbarMessages")) {
|
||||||
if ( myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0 ) {
|
if ( myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0 ) {
|
||||||
// // statusBar()->showMessage(tr("F1 - Fold | F2 - Check/Call | F3 - Bet/Raise | F4 - All-In"), 15000);
|
// // statusBar()->showMessage(tr("F1 - Fold | F2 - Check/Call | F3 - Bet/Raise | F4 - All-In"), 15000);
|
||||||
} else {
|
} else {
|
||||||
// statusBar()->showMessage(tr("F1 - All-In | F2 - Bet/Raise | F3 - Check/Call | F4 - Fold"), 15000);
|
// statusBar()->showMessage(tr("F1 - All-In | F2 - Bet/Raise | F3 - Check/Call | F4 - Fold"), 15000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1596,7 +1596,7 @@ void gameTableImpl::myFold(){
|
|||||||
//set that i was the last active player. need this for unhighlighting groupbox
|
//set that i was the last active player. need this for unhighlighting groupbox
|
||||||
currentHand->setLastPlayersTurn(0);
|
currentHand->setLastPlayersTurn(0);
|
||||||
|
|
||||||
// statusBar()->clearMessage();
|
// statusBar()->clearMessage();
|
||||||
|
|
||||||
//Spiel läuft weiter
|
//Spiel läuft weiter
|
||||||
myActionDone();
|
myActionDone();
|
||||||
@@ -1612,7 +1612,7 @@ void gameTableImpl::myCheck() {
|
|||||||
//set that i was the last active player. need this for unhighlighting groupbox
|
//set that i was the last active player. need this for unhighlighting groupbox
|
||||||
currentHand->setLastPlayersTurn(0);
|
currentHand->setLastPlayersTurn(0);
|
||||||
|
|
||||||
// statusBar()->clearMessage();
|
// statusBar()->clearMessage();
|
||||||
|
|
||||||
//Spiel läuft weiter
|
//Spiel läuft weiter
|
||||||
myActionDone();
|
myActionDone();
|
||||||
@@ -1681,7 +1681,7 @@ void gameTableImpl::myCall(){
|
|||||||
//set that i was the last active player. need this for unhighlighting groupbox
|
//set that i was the last active player. need this for unhighlighting groupbox
|
||||||
currentHand->setLastPlayersTurn(0);
|
currentHand->setLastPlayersTurn(0);
|
||||||
|
|
||||||
// statusBar()->clearMessage();
|
// statusBar()->clearMessage();
|
||||||
|
|
||||||
//Spiel läuft weiter
|
//Spiel läuft weiter
|
||||||
myActionDone();
|
myActionDone();
|
||||||
@@ -1694,7 +1694,7 @@ void gameTableImpl::mySet(){
|
|||||||
HandInterface *currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand();
|
HandInterface *currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand();
|
||||||
int tempCash = currentHand->getSeatsList()->front()->getMyCash();
|
int tempCash = currentHand->getSeatsList()->front()->getMyCash();
|
||||||
|
|
||||||
// cout << "Set-Value " << getBetRaisePushButtonValue() << endl;
|
// cout << "Set-Value " << getBetRaisePushButtonValue() << endl;
|
||||||
currentHand->getSeatsList()->front()->setMySet(getBetRaisePushButtonValue());
|
currentHand->getSeatsList()->front()->setMySet(getBetRaisePushButtonValue());
|
||||||
|
|
||||||
if (getBetRaisePushButtonValue() >= tempCash ) {
|
if (getBetRaisePushButtonValue() >= tempCash ) {
|
||||||
@@ -1736,7 +1736,7 @@ void gameTableImpl::mySet(){
|
|||||||
currentHand->getBoard()->collectSets();
|
currentHand->getBoard()->collectSets();
|
||||||
refreshPot();
|
refreshPot();
|
||||||
|
|
||||||
// statusBar()->clearMessage();
|
// statusBar()->clearMessage();
|
||||||
|
|
||||||
//set that i was the last active player. need this for unhighlighting groupbox
|
//set that i was the last active player. need this for unhighlighting groupbox
|
||||||
currentHand->setLastPlayersTurn(0);
|
currentHand->setLastPlayersTurn(0);
|
||||||
@@ -1799,7 +1799,7 @@ void gameTableImpl::pushButtonBetRaiseClicked(bool checked) {
|
|||||||
if(!radioButton_manualAction->isChecked())
|
if(!radioButton_manualAction->isChecked())
|
||||||
radioButton_manualAction->click();
|
radioButton_manualAction->click();
|
||||||
|
|
||||||
// myLastPreActionBetValue = lineEdit_betValue->value();
|
// myLastPreActionBetValue = lineEdit_betValue->value();
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -2000,11 +2000,11 @@ void gameTableImpl::postRiverRunAnimation2() {
|
|||||||
|
|
||||||
if(!flipHolecardsAllInAlreadyDone) {
|
if(!flipHolecardsAllInAlreadyDone) {
|
||||||
|
|
||||||
//TODO - Turn cards like in the rules
|
//TODO - Turn cards like in the rules
|
||||||
|
|
||||||
// postRiverRunAnimation2_flipHoleCards1Timer->start(nextPlayerSpeed2);
|
// postRiverRunAnimation2_flipHoleCards1Timer->start(nextPlayerSpeed2);
|
||||||
|
|
||||||
// //Config? mit oder ohne Eye-Candy?
|
// //Config? mit oder ohne Eye-Candy?
|
||||||
if(myConfig->readConfigInt("ShowFlipCardsAnimation")) {
|
if(myConfig->readConfigInt("ShowFlipCardsAnimation")) {
|
||||||
// mit Eye-Candy
|
// mit Eye-Candy
|
||||||
|
|
||||||
@@ -2058,7 +2058,7 @@ void gameTableImpl::postRiverRunAnimation2() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int tempCardsIntArray[2];
|
int tempCardsIntArray[2];
|
||||||
// int i;
|
// int i;
|
||||||
for (it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
for (it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
||||||
(*it_c)->getMyCards(tempCardsIntArray);
|
(*it_c)->getMyCards(tempCardsIntArray);
|
||||||
if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
|
if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
|
||||||
@@ -2087,12 +2087,12 @@ void gameTableImpl::postRiverRunAnimation2_flipHoleCards1() {
|
|||||||
|
|
||||||
void gameTableImpl::postRiverRunAnimation2_flipHoleCards2() {
|
void gameTableImpl::postRiverRunAnimation2_flipHoleCards2() {
|
||||||
|
|
||||||
// if() {
|
// if() {
|
||||||
// postRiverRunAnimation2_flipHoleCards1Timer->start(nextPlayerSpeed2);
|
// postRiverRunAnimation2_flipHoleCards1Timer->start(nextPlayerSpeed2);
|
||||||
// }
|
// }
|
||||||
// else {
|
// else {
|
||||||
// postRiverRunAnimation2Timer->start(postRiverRunAnimationSpeed);
|
// postRiverRunAnimation2Timer->start(postRiverRunAnimationSpeed);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2117,9 +2117,9 @@ void gameTableImpl::postRiverRunAnimation3() {
|
|||||||
for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
||||||
if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD && (*it_c)->getMyCardsValueInt() == currentHand->getCurrentBeRo()->getHighestCardsValue() ) {
|
if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD && (*it_c)->getMyCardsValueInt() == currentHand->getCurrentBeRo()->getHighestCardsValue() ) {
|
||||||
|
|
||||||
// QPalette tempPalette = groupBoxArray[i]->palette();
|
// QPalette tempPalette = groupBoxArray[i]->palette();
|
||||||
// tempPalette.setColor(QPalette::Window, highlight);
|
// tempPalette.setColor(QPalette::Window, highlight);
|
||||||
// groupBoxArray[i]->setPalette(tempPalette);
|
// groupBoxArray[i]->setPalette(tempPalette);
|
||||||
actionLabelArray[(*it_c)->getMyID()]->setPixmap(QPixmap::fromImage(QImage(myGameTableStyle->getActionPic(7))));
|
actionLabelArray[(*it_c)->getMyID()]->setPixmap(QPixmap::fromImage(QImage(myGameTableStyle->getActionPic(7))));
|
||||||
|
|
||||||
//show winnercards if more than one player is active TODO
|
//show winnercards if more than one player is active TODO
|
||||||
@@ -2129,9 +2129,9 @@ void gameTableImpl::postRiverRunAnimation3() {
|
|||||||
int bestHandPos[5];
|
int bestHandPos[5];
|
||||||
(*it_c)->getMyBestHandPosition(bestHandPos);
|
(*it_c)->getMyBestHandPosition(bestHandPos);
|
||||||
|
|
||||||
// for(j=0; j<5; j++) {
|
// for(j=0; j<5; j++) {
|
||||||
// cout << bestHandPos[j] << endl;
|
// cout << bestHandPos[j] << endl;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
//index 0 testen --> Karte darf nicht im MyBestHand Position Array drin sein, es darf nicht nur ein Spieler Aktiv sein, die Config fordert die Animation
|
//index 0 testen --> Karte darf nicht im MyBestHand Position Array drin sein, es darf nicht nur ein Spieler Aktiv sein, die Config fordert die Animation
|
||||||
bool index0 = TRUE;
|
bool index0 = TRUE;
|
||||||
@@ -2180,15 +2180,15 @@ void gameTableImpl::postRiverRunAnimation3() {
|
|||||||
//Pro Spieler den Cash aus dem Player und dem Label auslesen. Player_cash - Label_cash = Gewinnsumme
|
//Pro Spieler den Cash aus dem Player und dem Label auslesen. Player_cash - Label_cash = Gewinnsumme
|
||||||
int pot = (*it_c)->getLastMoneyWon();
|
int pot = (*it_c)->getLastMoneyWon();
|
||||||
//Wenn River dann auch das Blatt loggen!
|
//Wenn River dann auch das Blatt loggen!
|
||||||
// if (textLabel_handLabel->text() == "River") {
|
// if (textLabel_handLabel->text() == "River") {
|
||||||
|
|
||||||
//set Player value (logging)
|
//set Player value (logging)
|
||||||
(*it_c)->setMyWinnerState(true, pot);
|
(*it_c)->setMyWinnerState(true, pot);
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// else {
|
// else {
|
||||||
// myLog->logPlayerWinsMsg(i, pot);
|
// myLog->logPlayerWinsMsg(i, pot);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
@@ -2273,7 +2273,7 @@ void gameTableImpl::postRiverRunAnimation5() {
|
|||||||
|
|
||||||
void gameTableImpl::postRiverRunAnimation6() {
|
void gameTableImpl::postRiverRunAnimation6() {
|
||||||
|
|
||||||
// int i;
|
// int i;
|
||||||
HandInterface *currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand();
|
HandInterface *currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand();
|
||||||
|
|
||||||
refreshCash();
|
refreshCash();
|
||||||
@@ -2484,7 +2484,7 @@ void gameTableImpl::nextRoundCleanGui() {
|
|||||||
pushButton_break->setText(tr("Stop"));
|
pushButton_break->setText(tr("Stop"));
|
||||||
}
|
}
|
||||||
//Clear Statusbarmessage
|
//Clear Statusbarmessage
|
||||||
// statusBar()->clearMessage();
|
// statusBar()->clearMessage();
|
||||||
|
|
||||||
//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);
|
||||||
@@ -2582,7 +2582,7 @@ void gameTableImpl::breakButtonClicked() {
|
|||||||
|
|
||||||
void gameTableImpl::keyPressEvent ( QKeyEvent * event ) {
|
void gameTableImpl::keyPressEvent ( QKeyEvent * event ) {
|
||||||
|
|
||||||
// cout << event->key() << endl;
|
// cout << event->key() << endl;
|
||||||
|
|
||||||
bool ctrlPressed = FALSE;
|
bool ctrlPressed = FALSE;
|
||||||
|
|
||||||
@@ -2634,12 +2634,12 @@ void gameTableImpl::keyPressEvent ( QKeyEvent * event ) {
|
|||||||
}
|
}
|
||||||
if (event->key() == Qt::Key_Up && lineEdit_ChatInput->hasFocus()) {
|
if (event->key() == Qt::Key_Up && lineEdit_ChatInput->hasFocus()) {
|
||||||
if((keyUpDownChatCounter + 1) <= myChat->getChatLinesHistorySize()) { keyUpDownChatCounter++; }
|
if((keyUpDownChatCounter + 1) <= myChat->getChatLinesHistorySize()) { keyUpDownChatCounter++; }
|
||||||
// std::cout << "Up keyUpDownChatCounter: " << keyUpDownChatCounter << "\n";
|
// std::cout << "Up keyUpDownChatCounter: " << keyUpDownChatCounter << "\n";
|
||||||
myChat->showChatHistoryIndex(keyUpDownChatCounter);
|
myChat->showChatHistoryIndex(keyUpDownChatCounter);
|
||||||
}
|
}
|
||||||
else if(event->key() == Qt::Key_Down && lineEdit_ChatInput->hasFocus()) {
|
else if(event->key() == Qt::Key_Down && lineEdit_ChatInput->hasFocus()) {
|
||||||
if((keyUpDownChatCounter - 1) >= 0) { keyUpDownChatCounter--; }
|
if((keyUpDownChatCounter - 1) >= 0) { keyUpDownChatCounter--; }
|
||||||
// std::cout << "Down keyUpDownChatCounter: " << keyUpDownChatCounter << "\n";
|
// std::cout << "Down keyUpDownChatCounter: " << keyUpDownChatCounter << "\n";
|
||||||
myChat->showChatHistoryIndex(keyUpDownChatCounter);
|
myChat->showChatHistoryIndex(keyUpDownChatCounter);
|
||||||
}
|
}
|
||||||
else { keyUpDownChatCounter = 0; }
|
else { keyUpDownChatCounter = 0; }
|
||||||
@@ -2659,11 +2659,11 @@ void gameTableImpl::changePlayingMode() {
|
|||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
|
|
||||||
// case 0: { statusBar()->showMessage(tr("Manual mode set. You've got to choose yourself now."), 5000); }
|
// case 0: { statusBar()->showMessage(tr("Manual mode set. You've got to choose yourself now."), 5000); }
|
||||||
break;
|
break;
|
||||||
// case 1: { statusBar()->showMessage(tr("Auto mode set: Check or call any."), 5000); }
|
// case 1: { statusBar()->showMessage(tr("Auto mode set: Check or call any."), 5000); }
|
||||||
break;
|
break;
|
||||||
// case 2: { statusBar()->showMessage(tr("Auto mode set: Check or fold."), 5000); }
|
// case 2: { statusBar()->showMessage(tr("Auto mode set: Check or fold."), 5000); }
|
||||||
break;
|
break;
|
||||||
default: { /*cout << "changePlayingMode ERROR!!!!" << endl;*/ }
|
default: { /*cout << "changePlayingMode ERROR!!!!" << endl;*/ }
|
||||||
|
|
||||||
@@ -2867,6 +2867,12 @@ void gameTableImpl::networkGameModification() {
|
|||||||
|
|
||||||
//restore saved windows geometry
|
//restore saved windows geometry
|
||||||
restoreGameTableGeometry();
|
restoreGameTableGeometry();
|
||||||
|
|
||||||
|
if(myStartWindow->getSession()->getClientPlayerInfo(myStartWindow->getSession()->getClientUniquePlayerId()).isGuest) {
|
||||||
|
guestUserMode();
|
||||||
|
}
|
||||||
|
else { registeredUserMode(); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void gameTableImpl::mouseOverFlipCards(bool front) {
|
void gameTableImpl::mouseOverFlipCards(bool front) {
|
||||||
@@ -3065,7 +3071,7 @@ void gameTableImpl::leaveCurrentNetworkGame() {
|
|||||||
if (myStartWindow->getSession()->isNetworkClientRunning()) {
|
if (myStartWindow->getSession()->isNetworkClientRunning()) {
|
||||||
|
|
||||||
|
|
||||||
// T O D O !!!!!!! anzeigen? aus myMessageDialog auslesen per Config!!!!!!! T O D O
|
// T O D O !!!!!!! anzeigen? aus myMessageDialog auslesen per Config!!!!!!! T O D O
|
||||||
|
|
||||||
myMessageDialogImpl dialog(myConfig, this);
|
myMessageDialogImpl dialog(myConfig, this);
|
||||||
|
|
||||||
@@ -3301,7 +3307,7 @@ void gameTableImpl::refreshGameTableStyle()
|
|||||||
myGameTableStyle->setSliderStyle(horizontalSlider_bet);
|
myGameTableStyle->setSliderStyle(horizontalSlider_bet);
|
||||||
myGameTableStyle->setSliderStyle(horizontalSlider_speed);
|
myGameTableStyle->setSliderStyle(horizontalSlider_speed);
|
||||||
|
|
||||||
// away radiobuttons
|
// away radiobuttons
|
||||||
myGameTableStyle->setAwayRadioButtonsStyle(radioButton_manualAction);
|
myGameTableStyle->setAwayRadioButtonsStyle(radioButton_manualAction);
|
||||||
myGameTableStyle->setAwayRadioButtonsStyle(radioButton_autoCheckFold);
|
myGameTableStyle->setAwayRadioButtonsStyle(radioButton_autoCheckFold);
|
||||||
myGameTableStyle->setAwayRadioButtonsStyle(radioButton_autoCheckCallAny);
|
myGameTableStyle->setAwayRadioButtonsStyle(radioButton_autoCheckCallAny);
|
||||||
@@ -3392,3 +3398,18 @@ void gameTableImpl::netClientPlayerLeft(unsigned playerId) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gameTableImpl::registeredUserMode()
|
||||||
|
{
|
||||||
|
lineEdit_ChatInput->clear();
|
||||||
|
lineEdit_ChatInput->setEnabled(true);
|
||||||
|
guestMode = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void gameTableImpl::guestUserMode()
|
||||||
|
{
|
||||||
|
lineEdit_ChatInput->setText("Chat is avaiable only for registered members");
|
||||||
|
lineEdit_ChatInput->setDisabled(true);
|
||||||
|
guestMode = true;
|
||||||
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class CardDeckStyleReader;
|
|||||||
class SDLPlayer;
|
class SDLPlayer;
|
||||||
|
|
||||||
class gameTableImpl: public QMainWindow, public Ui::gameTable {
|
class gameTableImpl: public QMainWindow, public Ui::gameTable {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
gameTableImpl(ConfigFile *c = 0, QMainWindow *parent = 0);
|
gameTableImpl(ConfigFile *c = 0, QMainWindow *parent = 0);
|
||||||
@@ -59,14 +59,14 @@ public:
|
|||||||
~gameTableImpl();
|
~gameTableImpl();
|
||||||
|
|
||||||
boost::shared_ptr<Session> getSession();
|
boost::shared_ptr<Session> getSession();
|
||||||
void setStartWindow(startWindowImpl* s) { myStartWindow = s; }
|
|
||||||
|
|
||||||
void setLog(Log* l) { myLog = l; }
|
|
||||||
|
|
||||||
SDLPlayer* getMySDLPlayer() const { return mySDLPlayer; }
|
SDLPlayer* getMySDLPlayer() const { return mySDLPlayer; }
|
||||||
ChatTools* getMyChat() const { return myChat; }
|
ChatTools* getMyChat() const { return myChat; }
|
||||||
|
ConfigFile* getMyConfig() const { return myConfig; }
|
||||||
GameTableStyleReader* getMyGameTableStyle() const { return myGameTableStyle; }
|
GameTableStyleReader* getMyGameTableStyle() const { return myGameTableStyle; }
|
||||||
|
bool getGuestMode() const { return guestMode; }
|
||||||
|
|
||||||
|
void setStartWindow(startWindowImpl* s) { myStartWindow = s; }
|
||||||
|
void setLog(Log* l) { myLog = l; }
|
||||||
|
|
||||||
void setSpeeds();
|
void setSpeeds();
|
||||||
|
|
||||||
@@ -303,6 +303,9 @@ public slots:
|
|||||||
void restoreGameTableGeometry();
|
void restoreGameTableGeometry();
|
||||||
|
|
||||||
void netClientPlayerLeft(unsigned playerId);
|
void netClientPlayerLeft(unsigned playerId);
|
||||||
|
void registeredUserMode();
|
||||||
|
void guestUserMode();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
boost::shared_ptr<GuiInterface> myServerGuiInterface;
|
boost::shared_ptr<GuiInterface> myServerGuiInterface;
|
||||||
@@ -366,7 +369,7 @@ private:
|
|||||||
|
|
||||||
QPixmap *flipside;
|
QPixmap *flipside;
|
||||||
|
|
||||||
// Dialogs
|
// Dialogs
|
||||||
startWindowImpl *myStartWindow;
|
startWindowImpl *myStartWindow;
|
||||||
|
|
||||||
//Sound
|
//Sound
|
||||||
@@ -406,6 +409,7 @@ private:
|
|||||||
bool currentGameOver;
|
bool currentGameOver;
|
||||||
bool flipHolecardsAllInAlreadyDone;
|
bool flipHolecardsAllInAlreadyDone;
|
||||||
bool betSliderChangedByInput;
|
bool betSliderChangedByInput;
|
||||||
|
bool guestMode;
|
||||||
|
|
||||||
// statistic testing
|
// statistic testing
|
||||||
int statisticArray[15];
|
int statisticArray[15];
|
||||||
@@ -437,7 +441,7 @@ private:
|
|||||||
QString TurnString;
|
QString TurnString;
|
||||||
QString RiverString;
|
QString RiverString;
|
||||||
|
|
||||||
friend class GuiWrapper;
|
friend class GuiWrapper;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
#include "session.h"
|
#include "session.h"
|
||||||
#include "playerinterface.h"
|
#include "playerinterface.h"
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
|
#include "mymessagedialogimpl.h"
|
||||||
|
#include "chattools.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -23,10 +25,13 @@ MyAvatarLabel::MyAvatarLabel(QGroupBox* parent)
|
|||||||
{
|
{
|
||||||
|
|
||||||
myContextMenu = new QMenu;
|
myContextMenu = new QMenu;
|
||||||
action_VoteForKick = new QAction(QIcon(":/gfx/list_remove_user.png"), tr("Start vote to kick this user"), myContextMenu);
|
action_VoteForKick = new QAction(QIcon(":/gfx/list_remove_user.png"), tr("Start vote to kick this player"), myContextMenu);
|
||||||
myContextMenu->addAction(action_VoteForKick);
|
myContextMenu->addAction(action_VoteForKick);
|
||||||
|
action_IgnorePlayer = new QAction(QIcon(":/gfx/im-ban-user.png"), tr("Ignore Player"), myContextMenu);
|
||||||
|
myContextMenu->addAction(action_IgnorePlayer);
|
||||||
|
|
||||||
connect( action_VoteForKick, SIGNAL ( triggered() ), this, SLOT ( sendTriggerVoteOnKickSignal() ) );
|
connect( action_VoteForKick, SIGNAL ( triggered() ), this, SLOT ( sendTriggerVoteOnKickSignal() ) );
|
||||||
|
connect( action_IgnorePlayer, SIGNAL ( triggered() ), this, SLOT ( putPlayerOnIgnoreList() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -37,7 +42,7 @@ MyAvatarLabel::~MyAvatarLabel()
|
|||||||
void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event ) {
|
void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event ) {
|
||||||
|
|
||||||
assert(myW->getSession()->getCurrentGame());
|
assert(myW->getSession()->getCurrentGame());
|
||||||
if (myW->getSession()->isNetworkClientRunning()) {
|
if (myW->getSession()->isNetworkClientRunning() && !myW->getGuestMode()) {
|
||||||
|
|
||||||
PlayerListIterator it = myW->getSession()->getCurrentGame()->getSeatsList()->begin();
|
PlayerListIterator it = myW->getSession()->getCurrentGame()->getSeatsList()->begin();
|
||||||
//only active players are allowed to start a vote
|
//only active players are allowed to start a vote
|
||||||
@@ -53,6 +58,17 @@ void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event ) {
|
|||||||
if(activePlayerCounter > 2 && !voteRunning ) setVoteOnKickContextMenuEnabled(TRUE);
|
if(activePlayerCounter > 2 && !voteRunning ) setVoteOnKickContextMenuEnabled(TRUE);
|
||||||
else setVoteOnKickContextMenuEnabled(FALSE);
|
else setVoteOnKickContextMenuEnabled(FALSE);
|
||||||
|
|
||||||
|
action_IgnorePlayer->setEnabled(true);
|
||||||
|
|
||||||
|
int j=0;
|
||||||
|
for (it_c=currentGame->getSeatsList()->begin(); it_c!=currentGame->getSeatsList()->end(); it_c++) {
|
||||||
|
|
||||||
|
if(myId == j && myW->getSession()->getClientPlayerInfo((*it_c)->getMyUniqueID()).isGuest) {
|
||||||
|
action_IgnorePlayer->setDisabled(true);
|
||||||
|
}
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
|
||||||
int i=0;
|
int i=0;
|
||||||
for (it_c=currentGame->getSeatsList()->begin(); it_c!=currentGame->getSeatsList()->end(); it_c++) {
|
for (it_c=currentGame->getSeatsList()->begin(); it_c!=currentGame->getSeatsList()->end(); it_c++) {
|
||||||
|
|
||||||
@@ -105,3 +121,40 @@ void MyAvatarLabel::paintEvent(QPaintEvent*) {
|
|||||||
painter.drawPixmap(0,0,myPixmap);
|
painter.drawPixmap(0,0,myPixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MyAvatarLabel::playerIsOnIgnoreList(QString playerName) {
|
||||||
|
|
||||||
|
list<std::string> playerIgnoreList = myW->getMyConfig()->readConfigStringList("PlayerIgnoreList");
|
||||||
|
list<std::string>::iterator it1;
|
||||||
|
for(it1= playerIgnoreList.begin(); it1 != playerIgnoreList.end(); it1++) {
|
||||||
|
|
||||||
|
if(playerName == QString::fromUtf8(it1->c_str())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MyAvatarLabel::putPlayerOnIgnoreList() {
|
||||||
|
|
||||||
|
QStringList list;
|
||||||
|
PlayerListConstIterator it_c;
|
||||||
|
|
||||||
|
for (it_c=myW->getSession()->getCurrentGame()->getSeatsList()->begin(); it_c!=myW->getSession()->getCurrentGame()->getSeatsList()->end(); it_c++) {
|
||||||
|
list << QString::fromUtf8((*it_c)->getMyName().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!playerIsOnIgnoreList(list.at(myId))) {
|
||||||
|
|
||||||
|
myMessageDialogImpl dialog(myW->getMyConfig(), this);
|
||||||
|
if(dialog.exec(4, tr("You will no longer recieve chat messages or game invitations from this user.<br>Do you really want to put player <b>%1</b> on ignore list?").arg(list.at(myId)), tr("PokerTH - Question"), QPixmap(":/gfx/im-ban-user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false ) == QDialog::Accepted) {
|
||||||
|
|
||||||
|
std::list<std::string> playerIgnoreList = myW->getMyConfig()->readConfigStringList("PlayerIgnoreList");
|
||||||
|
playerIgnoreList.push_back(list.at(myId).toUtf8().constData());
|
||||||
|
myW->getMyConfig()->writeConfigStringList("PlayerIgnoreList", playerIgnoreList);
|
||||||
|
myW->getMyConfig()->writeBuffer();
|
||||||
|
|
||||||
|
myW->getMyChat()->refreshIgnoreList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -37,15 +37,18 @@ public slots:
|
|||||||
void setEnabledContextMenu(bool);
|
void setEnabledContextMenu(bool);
|
||||||
void setVoteOnKickContextMenuEnabled(bool);
|
void setVoteOnKickContextMenuEnabled(bool);
|
||||||
void setVoteRunning ( bool theValue ) { voteRunning = theValue; }
|
void setVoteRunning ( bool theValue ) { voteRunning = theValue; }
|
||||||
|
|
||||||
void setPixmap ( const QPixmap &, const bool = FALSE);
|
void setPixmap ( const QPixmap &, const bool = FALSE);
|
||||||
|
|
||||||
void paintEvent(QPaintEvent*);
|
void paintEvent(QPaintEvent*);
|
||||||
|
void putPlayerOnIgnoreList();
|
||||||
|
bool playerIsOnIgnoreList(QString playerName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
gameTableImpl *myW;
|
gameTableImpl *myW;
|
||||||
QMenu *myContextMenu;
|
QMenu *myContextMenu;
|
||||||
QAction *action_VoteForKick;
|
QAction *action_VoteForKick;
|
||||||
|
QAction *action_IgnorePlayer;
|
||||||
|
|
||||||
QPixmap myPixmap;
|
QPixmap myPixmap;
|
||||||
|
|
||||||
int myId;
|
int myId;
|
||||||
|
|||||||
Reference in New Issue
Block a user