wesnoth/wesnoth-old — pull request #85 by cbeck88 (2013-12-04 20:27:18+00:00)
Title: Party full bell

I decided to do a little coding to fulfill a feature request made originally on forums, later posted to bugs.w.o here:

https://gna.org/bugs/?21211

The change is very simple, in multiplayer_connect.cpp I add 3 lines to function connect::update_player_list. This function already may call ui::set_user_list which can produce sounds when players are added or leave. After that event I add a check, if the engine says there are no slots available and the silent flag is off, then ask ui to play the "turn bell" sound, which alerts host that game is ready to start. I also must include sound.hpp in multiplayer_connect.cpp.

I think this is the appropriate place to add this code, as ui::set_user_list does not have the engine in its scope. It might be a bit annoying if in some circumstance, update_player_list is called again and again and the bell plays many times -- as far as I know there is no circumstance where this happens, limited testing suggests good performance.