Add setting to disable music

This commit is contained in:
Wuzzy 2024-11-20 01:47:45 +01:00
parent 3d50976821
commit 1a2082bcee
2 changed files with 7 additions and 0 deletions

View File

@ -4,6 +4,7 @@ local GAIN = 0.7
local registered_tracks = {}
local music_enabled = core.settings:get_bool("eb_music", true)
local current_track = nil
local track_handle = nil
@ -17,6 +18,9 @@ eb_music.stop_track = function()
end
eb_music.play_track = function(track_id)
if not music_enabled then
return
end
if current_track == track_id and current_track ~= nil then
return
end
@ -40,3 +44,4 @@ end
eb_music.register_music("temple", {soundname="eb_music_temple_of_eyeballs"})
eb_music.register_music("hall", {soundname="eb_music_hall_of_forgotten_sight"})
eb_music.register_music("spooky", {soundname="eb_music_spooky_eyeballs"})

2
settingtypes.txt Normal file
View File

@ -0,0 +1,2 @@
# If true, background music will be played.
eb_music (Play music) bool true