diff --git a/LuaMenu/configs/gameConfig/byar/lobbyMusic/event/boombox/Iza Laine - Beyond All Rhythm.mp3 b/LuaMenu/configs/gameConfig/byar/lobbyMusic/event/aprilfools/Iza Laine - Beyond All Rhythm.mp3 similarity index 100% rename from LuaMenu/configs/gameConfig/byar/lobbyMusic/event/boombox/Iza Laine - Beyond All Rhythm.mp3 rename to LuaMenu/configs/gameConfig/byar/lobbyMusic/event/aprilfools/Iza Laine - Beyond All Rhythm.mp3 diff --git a/LuaMenu/configs/gameConfig/byar/lobbyMusic/event/xmas/Leon Devereux - Waystation Theta (Christmass Edition).ogg b/LuaMenu/configs/gameConfig/byar/lobbyMusic/event/xmas/Leon Devereux - Waystation Theta (Christmass Edition).ogg new file mode 100644 index 000000000..c73d316e5 Binary files /dev/null and b/LuaMenu/configs/gameConfig/byar/lobbyMusic/event/xmas/Leon Devereux - Waystation Theta (Christmass Edition).ogg differ diff --git a/LuaMenu/widgets/snd_music_lite.lua b/LuaMenu/widgets/snd_music_lite.lua index 4ba6140d0..1a6035069 100644 --- a/LuaMenu/widgets/snd_music_lite.lua +++ b/LuaMenu/widgets/snd_music_lite.lua @@ -47,12 +47,18 @@ local function GetRandomTrack(previousTrack) end nextTrack = peaceTrackList[peaceTracksIndex] elseif (previousTrackType == "peace" or (not peaceTrackList[1])) and introTrackList[1] then -- we're checking if there are any intro tracks - trackType = "intro" - introTracksIndex = introTracksIndex + 1 - if not introTrackList[introTracksIndex] then - introTracksIndex = 1 + if math.random() <= 0.1 and (tonumber(os.date("%m")) == 4 and tonumber(os.date("%d")) == 1 and math.random() <= 0.25) then + nextTrack = aprilfoolsTrackList[math.random(#aprilfoolsTrackList)] + elseif math.random() <= 0.1 and (tonumber(os.date("%m")) == 12 and tonumber(os.date("%d")) >= 12) then + nextTrack = xmasTrackList[math.random(#xmasTrackList)] + else + trackType = "intro" + introTracksIndex = introTracksIndex + 1 + if not introTrackList[introTracksIndex] then + introTracksIndex = 1 + end + nextTrack = introTrackList[introTracksIndex] end - nextTrack = introTrackList[introTracksIndex] end if nextTrack and trackType then @@ -188,7 +194,7 @@ function widget:Initialize() Spring.Echo("RANDOMSEED", math.ceil(os.clock()*1000000)) randomTrackList = {} - booxmboxTrackList = {} + aprilfoolsTrackList = {} local originalSoundtrackEnabled = Spring.GetConfigInt('UseSoundtrackNew', 1) local customSoundtrackEnabled = Spring.GetConfigInt('UseSoundtrackCustom', 1) local allowedExtensions = "{*.ogg,*.mp3}" @@ -199,8 +205,11 @@ function widget:Initialize() randomTrackList = playlistMerge(randomTrackList, VFS.DirList(musicDirOriginal, allowedExtensions)) end if true then - local musicDirEventBoombox = 'luamenu/configs/gameconfig/byar/lobbyMusic/event/boombox' - booxmboxTrackList = VFS.DirList(musicDirEventBoombox, allowedExtensions) + local musicDirEventAprilFools = 'luamenu/configs/gameconfig/byar/lobbyMusic/event/aprilfools' + aprilfoolsTrackList = VFS.DirList(musicDirEventAprilFools, allowedExtensions) + + local musicDirEventXmas = 'luamenu/configs/gameconfig/byar/lobbyMusic/event/xmas' + xmasTrackList = VFS.DirList(musicDirEventXmas, allowedExtensions) end -- Custom Soundtrack List @@ -243,9 +252,11 @@ function widget:Initialize() end for i = 1,1000 do - if Spring.GetConfigInt("boomboxcaptured", 0) == 1 then -- Play Beyond All Rhythm once on next launch after capturing a boombox - openTrack = booxmboxTrackList[math.random(1,#booxmboxTrackList)] + if Spring.GetConfigInt("boomboxcaptured", 0) == 1 or (tonumber(os.date("%m")) == 4 and tonumber(os.date("%d")) == 1 and math.random() <= 0.25) then -- Play Beyond All Rhythm once on next launch after capturing a boombox + openTrack = aprilfoolsTrackList[math.random(1,#aprilfoolsTrackList)] Spring.SetConfigInt("boomboxcaptured", 0) + elseif tonumber(os.date("%m")) == 12 and tonumber(os.date("%d")) >= 12 then -- Xmas event + openTrack = xmasTrackList[math.random(1,#xmasTrackList)] end if openTrack then break