summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2021-04-06 18:24:21 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2021-04-06 18:24:21 +0300
commit455db074b0bd286031f075f251abe7caa5a2c76e (patch)
tree50f31d0ff18fffda21c933e679fe47c6305f267f /indra/newview
parente355f47d28dab442df494ffcb8f53165bd54033b (diff)
SL-14960 Add checkbox to turn off collision sound.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llviewermessage.cpp6
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_move.xml9
3 files changed, 26 insertions, 0 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index d4ef9cd974..0236720c20 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3748,6 +3748,17 @@
<key>Value</key>
<integer>1</integer>
</map>
+ <key>EnableCollisionSounds</key>
+ <map>
+ <key>Comment</key>
+ <string>Play sounds on collision</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>EnableMouselook</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 458fc3b13d..126d146ac6 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -38,6 +38,7 @@
#include "llfollowcamparams.h"
#include "llinventorydefines.h"
#include "lllslconstants.h"
+#include "llmaterialtable.h"
#include "llregionhandle.h"
#include "llsd.h"
#include "llsdserialize.h"
@@ -3857,6 +3858,11 @@ void process_sound_trigger(LLMessageSystem *msg, void **)
return;
}
+ if (LLMaterialTable::basic.isCollisionSound(sound_id) && !gSavedSettings.getBOOL("EnableCollisionSounds"))
+ {
+ return;
+ }
+
gAudiop->triggerSound(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX, pos_global);
}
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
index 8794e3bf95..864223e616 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
@@ -259,6 +259,15 @@
<combo_box.commit_callback
function="Pref.ClickActionChange"/>
</combo_box>
+ <check_box
+ control_name="EnableCollisionSounds"
+ height="20"
+ label="Play sound on collisions"
+ layout="topleft"
+ left="83"
+ name="sound_on_collisions"
+ top_pad="10"
+ width="200" />
<button
height="23"
label="Other Devices"