Acoustic notification when people join a hosted game

Patch by Polakrity.
Sound by Samulis.
Reviewed by: Imarok
Fixes: #4101
Differential Revision: https://code.wildfiregames.com/D932
This was SVN commit r22088.
This commit is contained in:
Imarok
2019-02-15 18:55:38 +00:00
parent 3480608625
commit 6fb7479109
5 changed files with 15 additions and 1 deletions
+1
View File
@@ -473,6 +473,7 @@ uigain = 0.7
[sound.notify]
nick = true ; Play a sound when someone mentions your name in the lobby or game
gamesetup.join = false ; Play a sound when a new client joins the game setup
[tinygettext]
debug = false ; Print error messages each time a translation for an English string is not found.
@@ -4,7 +4,8 @@
* And store the timestamp of last interaction for each notification.
*/
var g_SoundNotifications = {
"nick": { "soundfile": "audio/interface/ui/chat_alert.ogg", "threshold": 3000 }
"nick": { "soundfile": "audio/interface/ui/chat_alert.ogg", "threshold": 3000 },
"gamesetup.join": { "soundfile": "audio/interface/ui/gamesetup_join.ogg", "threshold": 0 }
};
/**
@@ -1617,6 +1617,9 @@ function onClientJoin(newGUID, newAssignments)
"username": playername
});
if (newGUID != Engine.GetPlayerGUID() && Object.keys(g_PlayerAssignments).length)
soundNotification("gamesetup.join");
let isRejoiningPlayer = newAssignments[newGUID].player != -1;
// Assign the client (or only buddies if prefered) to an unused playerslot and rejoining players to their old slot
@@ -308,6 +308,12 @@
"label": "Nick Notification",
"tooltip": "Receive audio notification when someone types your nick.",
"config": "sound.notify.nick"
},
{
"type": "boolean",
"label": "Game Setup - New Player Notification",
"tooltip": "Receive audio notification when a new client joins the game setup.",
"config": "sound.notify.gamesetup.join"
}
]
},