From 6e2c06598dd271cea0f35a89161b48983b18b46a Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 23 Apr 2017 05:47:15 -0400 Subject: [PATCH] playlist -> music_list --- data/lua/wml-tags.lua | 15 ++++++++------- data/lua/wml-utils.lua | 2 +- src/scripting/lua_audio.cpp | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/data/lua/wml-tags.lua b/data/lua/wml-tags.lua index 515078927bb3..4a43933274d2 100644 --- a/data/lua/wml-tags.lua +++ b/data/lua/wml-tags.lua @@ -267,20 +267,21 @@ 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 @@ -288,7 +289,7 @@ 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 diff --git a/data/lua/wml-utils.lua b/data/lua/wml-utils.lua index c46ec6f67bbe..7be8925ebc9b 100644 --- a/data/lua/wml-utils.lua +++ b/data/lua/wml-utils.lua @@ -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 diff --git a/src/scripting/lua_audio.cpp b/src/scripting/lua_audio.cpp index 24bf4c02b3cc..5a94f549f3fd 100644 --- a/src/scripting/lua_audio.cpp +++ b/src/scripting/lua_audio.cpp @@ -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