implementing: make raise-blind sound optional (#127)

This commit is contained in:
doitux
2012-03-27 09:38:45 +00:00
parent 295610fbf9
commit 9ee82a05c5
4 changed files with 23 additions and 11 deletions
+2 -1
View File
@@ -50,7 +50,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
myConfigState = OK;
// !!!! Revisionsnummer der Configdefaults !!!!!
configRev = 96;
configRev = 97;
//standard defaults
logOnOffDefault = "1";
@@ -160,6 +160,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
configList.push_back(ConfigInfo("PlayGameActions", CONFIG_TYPE_INT, "1"));
configList.push_back(ConfigInfo("PlayLobbyChatNotification", CONFIG_TYPE_INT, "1"));
configList.push_back(ConfigInfo("PlayNetworkGameNotification", CONFIG_TYPE_INT, "1"));
configList.push_back(ConfigInfo("PlayBlindRaiseNotification", CONFIG_TYPE_INT, "1"));
configList.push_back(ConfigInfo("NumberOfPlayers", CONFIG_TYPE_INT, "10"));
configList.push_back(ConfigInfo("StartCash", CONFIG_TYPE_INT, "5000"));
configList.push_back(ConfigInfo("FirstSmallBlind", CONFIG_TYPE_INT, "10"));
+9 -2
View File
@@ -790,14 +790,14 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QCheckBox" name="checkBox_playLobbyChatNotification">
<property name="text">
<string>Play lobby chat notifications</string>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QCheckBox" name="checkBox_playNetworkGameNotification">
<property name="text">
<string>Play network/internet game notifications like &quot;player joined the game&quot;</string>
@@ -807,6 +807,13 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_playBlindRaiseSound">
<property name="text">
<string>Play blind raise notification</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -478,6 +478,7 @@ void settingsDialogImpl::prepareDialog()
checkBox_playGameActions->setChecked(myConfig->readConfigInt("PlayGameActions"));
checkBox_playLobbyChatNotification->setChecked(myConfig->readConfigInt("PlayLobbyChatNotification"));
checkBox_playNetworkGameNotification->setChecked(myConfig->readConfigInt("PlayNetworkGameNotification"));
checkBox_playBlindRaiseSound->setChecked(myConfig->readConfigInt("PlayBlindRaiseNotification"));
//Log
groupBox_logOnOff->setChecked(myConfig->readConfigInt("LogOnOff"));
@@ -745,6 +746,7 @@ void settingsDialogImpl::isAccepted()
myConfig->writeConfigInt("PlayGameActions", checkBox_playGameActions->isChecked());
myConfig->writeConfigInt("PlayLobbyChatNotification", checkBox_playLobbyChatNotification->isChecked());
myConfig->writeConfigInt("PlayNetworkGameNotification", checkBox_playNetworkGameNotification->isChecked());
myConfig->writeConfigInt("PlayBlindRaiseNotification", checkBox_playBlindRaiseSound->isChecked());
// Log
myConfig->writeConfigInt("LogOnOff", groupBox_logOnOff->isChecked());
+10 -8
View File
@@ -27,14 +27,16 @@ void SoundEvents::blindsWereSet(int sB)
lastSBValue = sB;
++lastSBLevel;
if(lastSBLevel == 1 || lastSBLevel == 2) {
mySDLPlayer->playSound("blinds_raises_level1", 0);
}
if(lastSBLevel == 3 || lastSBLevel == 4) {
mySDLPlayer->playSound("blinds_raises_level2", 0);
}
if(lastSBLevel >= 5) {
mySDLPlayer->playSound("blinds_raises_level3", 0);
if(myConfig->readConfigInt("PlayBlindRaiseNotification")) {
if(lastSBLevel == 1 || lastSBLevel == 2) {
mySDLPlayer->playSound("blinds_raises_level1", 0);
}
if(lastSBLevel == 3 || lastSBLevel == 4) {
mySDLPlayer->playSound("blinds_raises_level2", 0);
}
if(lastSBLevel >= 5) {
mySDLPlayer->playSound("blinds_raises_level3", 0);
}
}
}
}