Merge branch 'master' of github.com:/pokerth/pokerth
This commit is contained in:
@@ -92,22 +92,11 @@ void ChatTools::receiveMessage(QString playerName, QString message, bool pm)
|
||||
QString tempMsg;
|
||||
|
||||
if(myChatType == INET_LOBBY_CHAT && playerName == "(chat bot)" && message.startsWith(myNick)) {
|
||||
|
||||
tempMsg = QString("<span style=\"font-weight:bold; color:red;\">"+message+"</span>");
|
||||
//play beep sound only in INET-lobby-chat
|
||||
if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification")) {
|
||||
myLobby->getMyW()->getMySoundEventHandler()->playSound("lobbychatnotify",0);
|
||||
}
|
||||
} else if(message.contains(myNick, Qt::CaseInsensitive)) {
|
||||
|
||||
switch (myChatType) {
|
||||
case INET_LOBBY_CHAT: {
|
||||
tempMsg = QString("<span style=\"font-weight:bold; color:"+myLobby->palette().link().color().name()+";\">"+message+"</span>");
|
||||
//play beep sound only in INET-lobby-chat
|
||||
// TODO dont play when message is from yourself
|
||||
if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification")) {
|
||||
myLobby->getMyW()->getMySoundEventHandler()->playSound("lobbychatnotify",0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case LAN_LOBBY_CHAT:
|
||||
@@ -157,15 +146,24 @@ void ChatTools::receiveMessage(QString playerName, QString message, bool pm)
|
||||
}
|
||||
|
||||
bool nickFoundOnIgnoreList = false;
|
||||
bool chatBotWarnNickFoundOnIgnoreList = false;
|
||||
list<std::string>::iterator it1;
|
||||
for(it1=ignoreList.begin(); it1 != ignoreList.end(); ++it1) {
|
||||
|
||||
if(playerName == QString::fromUtf8(it1->c_str())) {
|
||||
nickFoundOnIgnoreList = true;
|
||||
}
|
||||
if(myChatType == INET_LOBBY_CHAT && playerName == "(chat bot)" && message.startsWith(QString::fromUtf8(it1->c_str()))) {
|
||||
chatBotWarnNickFoundOnIgnoreList = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!nickFoundOnIgnoreList) {
|
||||
if(!nickFoundOnIgnoreList && !chatBotWarnNickFoundOnIgnoreList) {
|
||||
//play beep sound as notification
|
||||
if(myChatType == INET_LOBBY_CHAT && message.contains(myNick, Qt::CaseInsensitive) && playerName != myNick) {
|
||||
if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification")) {
|
||||
myLobby->getMyW()->getMySoundEventHandler()->playSound("lobbychatnotify",0);
|
||||
}
|
||||
}
|
||||
|
||||
if(!myConfig->readConfigInt("DisableChatEmoticons")) {
|
||||
tempMsg = checkForEmotes(tempMsg);
|
||||
|
||||
@@ -1024,7 +1024,7 @@ void gameLobbyDialogImpl::joinedNetworkGame(unsigned playerId, QString playerNam
|
||||
|
||||
void gameLobbyDialogImpl::addConnectedPlayer(unsigned playerId, QString playerName, bool isGameAdmin)
|
||||
{
|
||||
|
||||
GameInfo info(mySession->getClientGameInfo(mySession->getClientCurrentGameId()));
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget_connectedPlayers, 0);
|
||||
item->setData(0, Qt::UserRole, playerId);
|
||||
item->setData(0, Qt::DisplayRole, playerName);
|
||||
@@ -1032,7 +1032,7 @@ void gameLobbyDialogImpl::addConnectedPlayer(unsigned playerId, QString playerNa
|
||||
if(isGameAdmin) item->setBackground(0, QBrush(QColor(0, 255, 0, 127)));
|
||||
|
||||
if(this->isVisible() && inGame && myConfig->readConfigInt("PlayNetworkGameNotification")) {
|
||||
if(treeWidget_connectedPlayers->topLevelItemCount() < treeWidget_connectedPlayers->headerItem()->data(0, Qt::UserRole).toInt()) {
|
||||
if(treeWidget_connectedPlayers->topLevelItemCount() < info.data.maxNumberOfPlayers) {
|
||||
myW->getMySoundEventHandler()->playSound("playerconnected", 0);
|
||||
} else {
|
||||
myW->getMySoundEventHandler()->playSound("onlinegameready", 0);
|
||||
@@ -1449,7 +1449,6 @@ void gameLobbyDialogImpl::showGameDescription(bool show)
|
||||
label_gameDesc7->hide();
|
||||
tabWidget_playerSpectators->setTabText(0, tr("Players (%1)").arg(0));
|
||||
tabWidget_playerSpectators->setTabText(1, tr("Spectators (%1)").arg(0));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -449,6 +449,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
||||
pushButton_showMyCards->hide();
|
||||
|
||||
spectatorIcon = new QLabel(this);
|
||||
spectatorNumberLabel = new QLabel(this);
|
||||
|
||||
//style Game Table
|
||||
refreshGameTableStyle();
|
||||
@@ -3594,6 +3595,7 @@ void gameTableImpl::networkGameModification()
|
||||
#endif
|
||||
blinkingStartButtonAnimationTimer->stop();
|
||||
spectatorIcon->show();
|
||||
spectatorNumberLabel->show();
|
||||
refreshSpectatorsDisplay();
|
||||
}
|
||||
if(myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK) {
|
||||
@@ -3603,6 +3605,7 @@ void gameTableImpl::networkGameModification()
|
||||
pushButton_break->hide();
|
||||
#endif
|
||||
spectatorIcon->hide();
|
||||
spectatorNumberLabel->hide();
|
||||
}
|
||||
//Set the playing mode to "manual"
|
||||
#ifdef GUI_800x480
|
||||
@@ -4272,6 +4275,7 @@ void gameTableImpl::refreshGameTableStyle()
|
||||
label_handNumber->setText(HandString+":");
|
||||
label_gameNumber->setText(GameString+":");
|
||||
|
||||
myGameTableStyle->setSpectatorNumberLabelStyle(spectatorNumberLabel);
|
||||
}
|
||||
|
||||
void gameTableImpl::saveGameTableGeometry()
|
||||
@@ -4470,6 +4474,10 @@ void gameTableImpl::refreshSpectatorsDisplay()
|
||||
int iconY = 2;
|
||||
spectatorIcon->move(iconX,iconY);
|
||||
spectatorIcon->setPixmap(spectatorPix);
|
||||
int labelX = this->centralWidget()->geometry().width() - spectatorPix.width() - 1;
|
||||
int labelY = spectatorPix.height()+2;
|
||||
spectatorNumberLabel->setGeometry(labelX, labelY, 32, 14);
|
||||
spectatorNumberLabel->setText(QString("%1").arg(info.spectatorsDuringGame.size()));
|
||||
|
||||
QString spectatorList = QString("<b>"+tr("Spectators")+":</b><br>");
|
||||
PlayerIdList::const_iterator i = info.spectatorsDuringGame.begin();
|
||||
@@ -4481,9 +4489,12 @@ void gameTableImpl::refreshSpectatorsDisplay()
|
||||
}
|
||||
spectatorList.remove(spectatorList.size()-4,4);
|
||||
spectatorIcon->setToolTip(spectatorList);
|
||||
spectatorNumberLabel->setToolTip(spectatorList);
|
||||
} else {
|
||||
spectatorIcon->setToolTip("");
|
||||
spectatorIcon->clear();
|
||||
spectatorNumberLabel->setToolTip("");
|
||||
spectatorNumberLabel->clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -442,6 +442,7 @@ private:
|
||||
QLabel *playerTipLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||
QPixmap flipside;
|
||||
QLabel *spectatorIcon;
|
||||
QLabel *spectatorNumberLabel;
|
||||
|
||||
// Dialogs
|
||||
startWindowImpl *myStartWindow;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>225</width>
|
||||
<width>239</width>
|
||||
<height>271</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -78,9 +78,6 @@
|
||||
<string>Blinds</string>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radioButton_useSavedBlindsSettings">
|
||||
<property name="text">
|
||||
|
||||
@@ -1372,6 +1372,12 @@ void GameTableStyleReader::setCashLabelStyle(QLabel *cl)
|
||||
cl->setStyleSheet("QLabel { "+ font2String +" font-size: "+cashFontSize+"px; font-weight: bold; color: #"+PlayerCashTextColor+"; }");
|
||||
}
|
||||
|
||||
void GameTableStyleReader::setSpectatorNumberLabelStyle(QLabel *snl)
|
||||
{
|
||||
snl->setStyleSheet("QLabel { "+ font2String +" font-size: 12px; font-weight: bold; color: #"+MenuTextColor+"; }");
|
||||
snl->setAlignment(Qt::AlignHCenter);
|
||||
}
|
||||
|
||||
void GameTableStyleReader::setSetLabelStyle(QLabel *sl)
|
||||
{
|
||||
sl->setStyleSheet("QLabel { "+ font2String +" font-size: "+setLabelFontSize+"px; font-weight: bold; color: #"+PlayerBetTextColor+"; }");
|
||||
|
||||
@@ -222,10 +222,9 @@ public:
|
||||
void setVoteStringsStyle(QLabel*);
|
||||
void setBetValueInputStyle(QSpinBox*);
|
||||
void setSliderStyle(QSlider*);
|
||||
|
||||
void setTabWidgetStyle(QTabWidget*, QTabBar*);
|
||||
|
||||
void setWindowsGeometry(gameTableImpl*);
|
||||
void setSpectatorNumberLabelStyle(QLabel*);
|
||||
|
||||
//set pics and fonts and colors
|
||||
void setButtonsStyle(MyActionButton*, MyActionButton*, MyActionButton*, MyActionButton*, int);
|
||||
|
||||
Reference in New Issue
Block a user