diff --git a/src/config/configfile.cpp b/src/config/configfile.cpp index a63cdf21..7e2f9b0e 100644 --- a/src/config/configfile.cpp +++ b/src/config/configfile.cpp @@ -55,7 +55,7 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0) if(strcmp(argv[i], "--nowriteaccess") == 0) { noWriteAccess = 1; } } // !!!! Revisionsnummer der Configdefaults !!!!! - configRev = 42; + configRev = 44; //standard defaults logOnOffDefault = "1"; @@ -161,11 +161,13 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0) configList.push_back(ConfigInfo("ShowBlindButtons", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("AntiPeekMode", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("AlternateFKeysUserActionMode", CONFIG_TYPE_INT, "0")); - configList.push_back(ConfigInfo("PlaySoundEffects", CONFIG_TYPE_INT, "1")); - configList.push_back(ConfigInfo("SoundVolume", CONFIG_TYPE_INT, "8")); configList.push_back(ConfigInfo("FlipsideTux", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("FlipsideOwn", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("FlipsideOwnFile", CONFIG_TYPE_STRING, "")); + configList.push_back(ConfigInfo("PlaySoundEffects", CONFIG_TYPE_INT, "1")); + configList.push_back(ConfigInfo("SoundVolume", CONFIG_TYPE_INT, "8")); + configList.push_back(ConfigInfo("PlayGameActions", CONFIG_TYPE_INT, "1")); + configList.push_back(ConfigInfo("PlayLobbyChatNotification", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("NumberOfPlayers", CONFIG_TYPE_INT, "7")); configList.push_back(ConfigInfo("StartCash", CONFIG_TYPE_INT, "3000")); configList.push_back(ConfigInfo("FirstSmallBlind", CONFIG_TYPE_INT, "10")); @@ -181,7 +183,6 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0) configList.push_back(ConfigInfo("AfterMBAlwaysRaiseValue", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("AfterMBStayAtLastBlind", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("GameSpeed", CONFIG_TYPE_INT, "4")); - configList.push_back(ConfigInfo("EngineVersion", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("PauseBetweenHands", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("ShowGameSettingsDialogOnNewGame", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("NetNumberOfPlayers", CONFIG_TYPE_INT, "7")); @@ -199,7 +200,6 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0) configList.push_back(ConfigInfo("NetAfterMBAlwaysRaiseValue", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("NetAfterMBStayAtLastBlind", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("NetGameSpeed", CONFIG_TYPE_INT, "4")); - configList.push_back(ConfigInfo("NetEngineVersion", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("NetTimeOutPlayerAction", CONFIG_TYPE_INT, "20")); configList.push_back(ConfigInfo("ServerPassword", CONFIG_TYPE_STRING, "")); configList.push_back(ConfigInfo("ServerUseIpv6", CONFIG_TYPE_INT, "0")); diff --git a/src/gui/qt/gamelobbydialog/lobbychat/lobbychat.cpp b/src/gui/qt/gamelobbydialog/lobbychat/lobbychat.cpp index 7662830f..4c52537b 100644 --- a/src/gui/qt/gamelobbydialog/lobbychat/lobbychat.cpp +++ b/src/gui/qt/gamelobbydialog/lobbychat/lobbychat.cpp @@ -118,7 +118,8 @@ void LobbyChat::displayMessage(QString playerName, QString message) { QString tempMsg; if(message.contains(QString::fromUtf8(myConfig->readConfigString("MyName").c_str()), Qt::CaseInsensitive)) { tempMsg = QString(""+message+""); - myLobby->getMyW()->getMySDLPlayer()->playSound("lobbychatnotify",0); + if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification")) + myLobby->getMyW()->getMySDLPlayer()->playSound("lobbychatnotify",0); } else { tempMsg = message; diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 8d06fb58..4c928f16 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -1419,7 +1419,8 @@ void mainWindowImpl::refreshAction(int playerID, int playerAction) { actionLabelArray[playerID]->setPixmap(QPixmap(myAppDataPath +"gfx/gui/table/default/action_"+actionArray[playerAction]+".png")); //play sounds if exist - mySDLPlayer->playSound(actionArray[playerAction].toStdString(), playerID); + if(myConfig->readConfigInt("PlayGameActions")) + mySDLPlayer->playSound(actionArray[playerAction].toStdString(), playerID); } if (playerAction == 1) { // FOLD diff --git a/src/gui/qt/settingsdialog.ui b/src/gui/qt/settingsdialog.ui index 3dc6a8d6..2e922a97 100644 --- a/src/gui/qt/settingsdialog.ui +++ b/src/gui/qt/settingsdialog.ui @@ -280,99 +280,6 @@ p, li { white-space: pre-wrap; } - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - Play sound effects - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Sound Volume: - - - - - - - - 20 - 0 - - - - 10 - - - - - - - 1 - - - 10 - - - 8 - - - Qt::Horizontal - - - - - - - - - Qt::Vertical - - - - 20 - 281 - - - - @@ -390,6 +297,115 @@ p, li { white-space: pre-wrap; } + + + + Play sound effects + + + true + + + true + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Sound Volume: + + + + + + + + 20 + 0 + + + + 10 + + + + + + + 1 + + + 10 + + + 8 + + + Qt::Horizontal + + + + + + + + + Sound Categories + + + + 0 + + + + + Play game actions sounds like "check", "call", "raise" + + + + + + + Play notifications for lobby chat + + + + + + + + + + + + + Qt::Vertical + + + + 400 + 321 + + + + @@ -639,40 +655,20 @@ p, li { white-space: pre-wrap; } - - - - - Engine Version: - - - - - - - - 0.4 (current) - - - - - - - Pause between hands (press "start" button to go on) - + Show game settings dialog on every new game - + Qt::Vertical @@ -680,7 +676,7 @@ p, li { white-space: pre-wrap; } 400 - 161 + 181 @@ -928,26 +924,6 @@ p, li { white-space: pre-wrap; } - - - - - Engine Version for computer opponents: - - - - - - - - 0.4 (current) - - - - - - - @@ -971,14 +947,14 @@ p, li { white-space: pre-wrap; } - + Qt::Horizontal - + Network Server Settings @@ -1076,7 +1052,7 @@ p, li { white-space: pre-wrap; } - + Qt::Vertical @@ -1084,7 +1060,7 @@ p, li { white-space: pre-wrap; } 400 - 16 + 41 @@ -3022,14 +2998,12 @@ p, li { white-space: pre-wrap; } spinBox_startCash spinBox_firstSmallBlind spinBox_gameSpeed - comboBox_engineVersion checkBox_pauseBetweenHands checkBox_showGameSettingsDialogOnNewGame spinBox_netQuantityPlayers spinBox_netStartCash spinBox_netFirstSmallBlind spinBox_netGameSpeed - comboBox_netEngineVersion spinBox_netTimeOutPlayerAction spinBox_serverPort lineEdit_serverPassword diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index 443dbc7f..bf55467f 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -72,8 +72,6 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva // label_36->hide(); // spinBox_netGameSpeed->hide(); // -// label_18->hide(); -// comboBox_netEngineVersion->hide(); } void settingsDialogImpl::exec() { @@ -123,7 +121,6 @@ void settingsDialogImpl::exec() { spinBox_gameSpeed->setValue(myConfig->readConfigInt("GameSpeed")); checkBox_pauseBetweenHands->setChecked(myConfig->readConfigInt("PauseBetweenHands")); checkBox_showGameSettingsDialogOnNewGame->setChecked(myConfig->readConfigInt("ShowGameSettingsDialogOnNewGame")); - comboBox_engineVersion->setCurrentIndex(myConfig->readConfigInt("EngineVersion")); //Network Game Settings spinBox_netQuantityPlayers->setValue(myConfig->readConfigInt("NetNumberOfPlayers")); @@ -136,7 +133,6 @@ void settingsDialogImpl::exec() { radioButton_netAlwaysDoubleBlinds->setChecked(myConfig->readConfigInt("NetAlwaysDoubleBlinds")); radioButton_netManualBlindsOrder->setChecked(myConfig->readConfigInt("NetManualBlindsOrder")); spinBox_netGameSpeed->setValue(myConfig->readConfigInt("NetGameSpeed")); - comboBox_netEngineVersion->setCurrentIndex(myConfig->readConfigInt("NetEngineVersion")); spinBox_netTimeOutPlayerAction->setValue(myConfig->readConfigInt("NetTimeOutPlayerAction")); spinBox_serverPort->setValue(myConfig->readConfigInt("ServerPort")); lineEdit_serverPassword->setText(QString::fromUtf8(myConfig->readConfigString("ServerPassword").c_str())); @@ -168,8 +164,6 @@ void settingsDialogImpl::exec() { checkBox_showBlindButtons->setChecked(myConfig->readConfigInt("ShowBlindButtons")); checkBox_antiPeekMode->setChecked(myConfig->readConfigInt("AntiPeekMode")); checkBox_alternateFKeysUserActionMode->setChecked(myConfig->readConfigInt("AlternateFKeysUserActionMode")); - checkBox_playSoundEffects->setChecked(myConfig->readConfigInt("PlaySoundEffects")); - horizontalSlider_soundVolume->setValue(myConfig->readConfigInt("SoundVolume")); radioButton_flipsideTux->setChecked(myConfig->readConfigInt("FlipsideTux")); radioButton_flipsideOwn->setChecked(myConfig->readConfigInt("FlipsideOwn")); if(radioButton_flipsideOwn->isChecked()) { @@ -178,6 +172,12 @@ void settingsDialogImpl::exec() { } lineEdit_OwnFlipsideFilename->setText(QString::fromUtf8(myConfig->readConfigString("FlipsideOwnFile").c_str())); + //Sound + groupBox_playSoundEffects->setChecked(myConfig->readConfigInt("PlaySoundEffects")); + horizontalSlider_soundVolume->setValue(myConfig->readConfigInt("SoundVolume")); + checkBox_playGameActions->setChecked(myConfig->readConfigInt("PlayGameActions")); + checkBox_playLobbyChatNotification->setChecked(myConfig->readConfigInt("PlayLobbyChatNotification")); + //Log groupBox_logOnOff->setChecked(myConfig->readConfigInt("LogOnOff")); lineEdit_logDir->setText(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str())); @@ -244,7 +244,6 @@ void settingsDialogImpl::isAccepted() { myConfig->writeConfigInt("AlwaysDoubleBlinds", radioButton_alwaysDoubleBlinds->isChecked()); myConfig->writeConfigInt("ManualBlindsOrder", radioButton_manualBlindsOrder->isChecked()); myConfig->writeConfigInt("GameSpeed", spinBox_gameSpeed->value()); - myConfig->writeConfigInt("EngineVersion", comboBox_engineVersion->currentIndex()); myConfig->writeConfigInt("PauseBetweenHands", checkBox_pauseBetweenHands->isChecked()); myConfig->writeConfigInt("ShowGameSettingsDialogOnNewGame", checkBox_showGameSettingsDialogOnNewGame->isChecked()); @@ -259,7 +258,6 @@ void settingsDialogImpl::isAccepted() { myConfig->writeConfigInt("NetAlwaysDoubleBlinds", radioButton_netAlwaysDoubleBlinds->isChecked()); myConfig->writeConfigInt("NetManualBlindsOrder", radioButton_netManualBlindsOrder->isChecked()); myConfig->writeConfigInt("NetGameSpeed", spinBox_netGameSpeed->value()); - myConfig->writeConfigInt("NetEngineVersion", comboBox_netEngineVersion->currentIndex()); myConfig->writeConfigInt("NetTimeOutPlayerAction", spinBox_netTimeOutPlayerAction->value()); myConfig->writeConfigInt("ServerPort", spinBox_serverPort->value()); myConfig->writeConfigString("ServerPassword", lineEdit_serverPassword->text().toUtf8().constData()); @@ -289,8 +287,6 @@ void settingsDialogImpl::isAccepted() { myConfig->writeConfigInt("ShowBlindButtons", checkBox_showBlindButtons->isChecked()); myConfig->writeConfigInt("AntiPeekMode", checkBox_antiPeekMode->isChecked()); myConfig->writeConfigInt("AlternateFKeysUserActionMode", checkBox_alternateFKeysUserActionMode->isChecked()); - myConfig->writeConfigInt("PlaySoundEffects", checkBox_playSoundEffects->isChecked()); - myConfig->writeConfigInt("SoundVolume", horizontalSlider_soundVolume->value()); myConfig->writeConfigInt("FlipsideTux", radioButton_flipsideTux->isChecked()); myConfig->writeConfigInt("FlipsideOwn", radioButton_flipsideOwn->isChecked()); @@ -304,6 +300,12 @@ void settingsDialogImpl::isAccepted() { } } + //Sound + myConfig->writeConfigInt("PlaySoundEffects", groupBox_playSoundEffects->isChecked()); + myConfig->writeConfigInt("SoundVolume", horizontalSlider_soundVolume->value()); + myConfig->writeConfigInt("PlayGameActions", checkBox_playGameActions->isChecked()); + myConfig->writeConfigInt("PlayLobbyChatNotification", checkBox_playLobbyChatNotification->isChecked()); + // Log myConfig->writeConfigInt("LogOnOff", groupBox_logOnOff->isChecked()); if (myConfig->readConfigInt("LogOnOff")) {