added more music control and added a new less obnoxious track
This commit is contained in:
parent
b688037a93
commit
1553713a80
|
@ -31,6 +31,7 @@ bed_enabled = true
|
|||
|
||||
# if music players are usable
|
||||
music_enable = true
|
||||
music_track = music_greyarms
|
||||
|
||||
# if dynamically changing weather is enabled
|
||||
weather_enable = true
|
||||
|
|
|
@ -5,6 +5,7 @@ By Kaadmy, for Pixture
|
|||
Music license:
|
||||
music_catsong: Dan Knoflicek(CC0)
|
||||
music_wonderful_nightmare.ogg: SpiderDave(CC0)
|
||||
music_greyarms.ogg: Tozan(CC0)
|
||||
|
||||
Texture license: WTFPL
|
||||
Source License: WTFPL
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
music = {}
|
||||
|
||||
music.default_track = minetest.setting_get("music_track") or "music_catsong"
|
||||
|
||||
music.players = {} -- music players
|
||||
|
||||
if minetest.setting_getbool("music_enable") then
|
||||
|
@ -31,10 +33,10 @@ if minetest.setting_getbool("music_enable") then
|
|||
if music.players[dp] == nil then
|
||||
music.players[dp] = {
|
||||
["handle"] = minetest.sound_play(
|
||||
"music_catsong",
|
||||
music.default_track,
|
||||
{
|
||||
pos = pos,
|
||||
gain = 0.5,
|
||||
gain = 0.3,
|
||||
}),
|
||||
["timer"] = 0,
|
||||
["pos"] = pos,
|
||||
|
@ -43,10 +45,10 @@ if minetest.setting_getbool("music_enable") then
|
|||
music.players[dp]["timer"] = 0
|
||||
minetest.sound_stop(music.players[dp]["handle"])
|
||||
music.players[dp]["handle"] = minetest.sound_play(
|
||||
"music_catsong",
|
||||
music.default_track,
|
||||
{
|
||||
pos = pos,
|
||||
gain = 0.5,
|
||||
gain = 0.3,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue