Skip to content

Commit

Permalink
playlist -> music_list
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Apr 24, 2017
1 parent dd81221 commit 6e2c065
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions data/lua/wml-tags.lua
Expand Up @@ -267,28 +267,29 @@ end

function wml_actions.music(cfg)
if cfg.play_once then
wesnoth.playlist.play(cfg.name)
wesnoth.music_list.play(cfg.name)
else
if not cfg.append then
if cfg.immediate then
wesnoth.playlist.current.once = true
wesnoth.music_list.current.once = true
end
wesnoth.playlist.clear()
wesnoth.music_list.clear()
end
wesnoth.playlist.add(cfg.name, not not cfg.immediate, cfg.ms_before or 0, cfg.ms_after or 0)
wesnoth.music_list.add(cfg.name, not not cfg.immediate, cfg.ms_before or 0, cfg.ms_after or 0)
local n = #wesnoth.music_list
if cfg.shuffle == false then
wesnoth.playlist[#wesnoth.playlist].shuffle = false
wesnoth.music_list[n].shuffle = false
end
if cfg.title ~= nil then
wesnoth.playlist[#wesnoth.playlist].title = cfg.title
wesnoth.music_list[n].title = cfg.title
end
end
end

function wml_actions.volume(cfg)
if cfg.music then
local rel = tonumber(cfg.music) or 100.0
wesnoth.playlist.volume = rel
wesnoth.music_list.volume = rel
end
if cfg.sound then
local rel = tonumber(cfg.sound) or 100.0
Expand Down
2 changes: 1 addition & 1 deletion data/lua/wml-utils.lua
Expand Up @@ -155,7 +155,7 @@ function utils.handle_event_commands(cfg, scope_type)
current_exit = "none"
end
-- Apply music alterations once all the commands have been processed.
wesnoth.playlist.force_refresh()
wesnoth.music_list.force_refresh()
return current_exit
end
Expand Down
2 changes: 1 addition & 1 deletion src/scripting/lua_audio.cpp
Expand Up @@ -230,7 +230,7 @@ namespace lua_audio {
lua_pushstring(L, "music playlist");
lua_setfield(L, -2, "__metatable");
lua_setmetatable(L, -2);
lua_setfield(L, -2, "playlist");
lua_setfield(L, -2, "music_list");
lua_pop(L, 1);

// The music track metatable
Expand Down

0 comments on commit 6e2c065

Please sign in to comment.