Moved implementation of [sound] to Lua.

This commit is contained in:
Guillaume Melquiond 2010-07-26 21:21:20 +00:00
parent 12371ef7a2
commit 992b045afc
2 changed files with 4 additions and 11 deletions

View file

@ -412,3 +412,7 @@ function wml_actions.store_unit(cfg)
end
end
end
function wml_actions.sound(cfg)
wesnoth.play_sound(cfg.name, cfg["repeat"])
end

View file

@ -720,17 +720,6 @@ WML_HANDLER_FUNCTION(volume, /*event_info*/, cfg)
}
WML_HANDLER_FUNCTION(sound, /*event_info*/, cfg)
{
play_controller *controller = resources::controller;
if(controller->is_skipping_replay()) {
return;
}
std::string sound = cfg["name"];
const int repeats = lexical_cast_default<int>(cfg["repeat"], 0);
sound::play_sound(sound, sound::SOUND_FX, repeats);
}
static void color_adjust(const vconfig& cfg)
{
game_display &screen = *resources::screen;