Merge pull request #953 from Pablo-Dallegri/alerts-volume
Add volume adjustment for alerts
This commit is contained in:
commit
0d73f3cfcb
@ -661,6 +661,7 @@ namespace spades {
|
||||
layouter.AddVolumeSlider(_Tr("Preferences", "Chat Notify Sounds"), "cg_chatBeep");
|
||||
layouter.AddToggleField(_Tr("Preferences", "Hit Indicator"), "cg_hitIndicator");
|
||||
layouter.AddToggleField(_Tr("Preferences", "Show Alerts"), "cg_alerts");
|
||||
layouter.AddVolumeSlider(_Tr("Preferences", "Alert Sounds"), "cg_alertSounds");
|
||||
|
||||
layouter.AddHeading(_Tr("Preferences", "AoS 0.75/0.76 Compatibility"));
|
||||
layouter.AddToggleField(_Tr("Preferences", "Allow Unicode"), "cg_unicode");
|
||||
|
@ -56,6 +56,7 @@
|
||||
#include "NetClient.h"
|
||||
|
||||
DEFINE_SPADES_SETTING(cg_chatBeep, "1");
|
||||
DEFINE_SPADES_SETTING(cg_alertSounds, "1");
|
||||
|
||||
DEFINE_SPADES_SETTING(cg_serverAlert, "1");
|
||||
|
||||
@ -537,7 +538,9 @@ namespace spades {
|
||||
|
||||
void Client::PlayAlertSound() {
|
||||
Handle<IAudioChunk> chunk = audioDevice->RegisterSound("Sounds/Feedback/Alert.opus");
|
||||
audioDevice->PlayLocal(chunk.GetPointerOrNull(), AudioParam());
|
||||
AudioParam params;
|
||||
params.volume = (float)cg_alertSounds;
|
||||
audioDevice->PlayLocal(chunk.GetPointerOrNull(), params);
|
||||
}
|
||||
|
||||
/** Records chat message/game events to the log file. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user