Feature: New API and looping sound fix.
parent
6f16870421
commit
b7f51351f0
|
@ -2,10 +2,6 @@
|
||||||
|
|
||||||
Mod that adds hard breathing sound below the dyspnea threshold level.
|
Mod that adds hard breathing sound below the dyspnea threshold level.
|
||||||
|
|
||||||
**Warnings:**
|
|
||||||
|
|
||||||
Unfortunately there is a problem right now with sound looping - it won't loop. I will try to find a solution.
|
|
||||||
|
|
||||||
**How to install:**
|
**How to install:**
|
||||||
|
|
||||||
http://wiki.minetest.com/wiki/Installing_mods
|
http://wiki.minetest.com/wiki/Installing_mods
|
||||||
|
|
16
init.lua
16
init.lua
|
@ -1,19 +1,25 @@
|
||||||
local sound_handlers = {}
|
local sound_handlers = {}
|
||||||
|
|
||||||
minetest_wadsprint.api.events:on("dyspnea",function(event)
|
minetest_wadsprint.api.events:on("dyspnea-on",
|
||||||
if event.value == true then
|
function(event)
|
||||||
sound_handlers[event.player.name] = minetest.sound_play(
|
sound_handlers[event.player.name] = minetest.sound_play(
|
||||||
{
|
{
|
||||||
loop = true,
|
|
||||||
name = "minetest_wadsprint_dyspnea_hardbreath",
|
name = "minetest_wadsprint_dyspnea_hardbreath",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
loop = true,
|
||||||
object = event.player.obj,
|
object = event.player.obj,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
else
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
minetest_wadsprint.api.events:on("dyspnea-off",
|
||||||
|
function(event)
|
||||||
if sound_handlers[event.player.name] ~= nil then
|
if sound_handlers[event.player.name] ~= nil then
|
||||||
minetest.sound_stop(sound_handlers[event.player.name])
|
minetest.sound_stop(sound_handlers[event.player.name])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
BIN
util/version.png
BIN
util/version.png
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in New Issue