mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-26 22:10:58 +00:00
make the lobby play music defined in a [lobby_music] wml tag...
...and set it to default_playlist + main menu theme. Fixes bug #15668.
This commit is contained in:
parent
2da0389d81
commit
2069817fe7
@ -15,3 +15,12 @@
|
||||
{multiplayer/scenarios/}
|
||||
|
||||
{multiplayer/eras.cfg}
|
||||
|
||||
[lobby_music]
|
||||
{DEFAULT_MUSIC_PLAYLIST}
|
||||
[music]
|
||||
name=main_menu.ogg
|
||||
ms_before=12000
|
||||
append=yes
|
||||
[/music]
|
||||
[/lobby_music]
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "playcampaign.hpp"
|
||||
#include "upload_log.hpp"
|
||||
#include "formula_string_utils.hpp"
|
||||
#include "sound.hpp"
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
@ -521,9 +522,21 @@ static void do_preferences_dialog(game_display& disp, const config& game_config)
|
||||
|
||||
static void enter_lobby_mode(game_display& disp, const config& game_config, mp::chat& chat, config& gamelist)
|
||||
{
|
||||
|
||||
|
||||
mp::ui::result res;
|
||||
|
||||
while (true) {
|
||||
const config &cfg = game_config.child("lobby_music");
|
||||
if (cfg) {
|
||||
foreach (const config &i, cfg.child_range("music")) {
|
||||
sound::play_music_config(i);
|
||||
}
|
||||
sound::commit_music_changes();
|
||||
} else {
|
||||
sound::empty_playlist();
|
||||
sound::stop_music();
|
||||
}
|
||||
lobby_info li(game_config);
|
||||
gui2::tlobby_main dlg(game_config, li, disp);
|
||||
dlg.set_preferences_callback(
|
||||
|
Loading…
x
Reference in New Issue
Block a user