mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Sound API: Add fading sounds
This commit is contained in:
parent
f1d7a26b7c
commit
bd921a7916
14 changed files with 248 additions and 19 deletions
|
@ -455,6 +455,16 @@ int ModApiServer::l_sound_stop(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ModApiServer::l_sound_fade(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
s32 handle = luaL_checkinteger(L, 1);
|
||||
float step = luaL_checknumber(L, 2);
|
||||
float gain = luaL_checknumber(L, 3);
|
||||
getServer(L)->fadeSound(handle, step, gain);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// is_singleplayer()
|
||||
int ModApiServer::l_is_singleplayer(lua_State *L)
|
||||
{
|
||||
|
@ -518,6 +528,7 @@ void ModApiServer::Initialize(lua_State *L, int top)
|
|||
API_FCT(show_formspec);
|
||||
API_FCT(sound_play);
|
||||
API_FCT(sound_stop);
|
||||
API_FCT(sound_fade);
|
||||
|
||||
API_FCT(get_player_information);
|
||||
API_FCT(get_player_privs);
|
||||
|
|
|
@ -68,6 +68,9 @@ private:
|
|||
// sound_stop(handle)
|
||||
static int l_sound_stop(lua_State *L);
|
||||
|
||||
// sound_fade(handle, step, gain)
|
||||
static int l_sound_fade(lua_State *L);
|
||||
|
||||
// get_player_privs(name, text)
|
||||
static int l_get_player_privs(lua_State *L);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue