add SOUND:IsTimingDelayed method and fixed SOUND:PlayMusicPart
PlayMusicPart does not immediately start the new music. IsTimingDelayed will return true until the new music has started. The "applyRate" argument of PlayMusicPart was being applied to the "align_beat" property. Added an additional argument to for "align_beat" and made "applyRate" work properly.
This commit is contained in:
@@ -834,6 +834,7 @@ public:
|
||||
float fadeOut = 0;
|
||||
bool loop= false;
|
||||
bool applyRate= false;
|
||||
bool alignBeat= true;
|
||||
if (lua_gettop(L) >= 4 && !lua_isnil(L,4))
|
||||
{
|
||||
fadeIn = FArg(4);
|
||||
@@ -846,16 +847,21 @@ public:
|
||||
if (lua_gettop(L) >= 7 && !lua_isnil(L,7))
|
||||
{
|
||||
applyRate = BArg(7);
|
||||
if (lua_gettop(L) >= 8 && !lua_isnil(L,8))
|
||||
{
|
||||
alignBeat = BArg(8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
p->PlayMusic(musicPath, NULL, loop, musicStart, musicLength,
|
||||
fadeIn, fadeOut, applyRate);
|
||||
fadeIn, fadeOut, alignBeat, applyRate);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int StopMusic( T* p, lua_State *L ) { p->StopMusic(); return 0; }
|
||||
static int StopMusic( T* p, lua_State *L ) { p->StopMusic(); return 0; }
|
||||
static int IsTimingDelayed( T* p, lua_State *L ) { lua_pushboolean( L, g_Playing->m_bTimingDelayed ); return 1; }
|
||||
|
||||
LunaGameSoundManager()
|
||||
{
|
||||
@@ -865,6 +871,7 @@ public:
|
||||
ADD_METHOD( GetPlayerBalance );
|
||||
ADD_METHOD( PlayMusicPart );
|
||||
ADD_METHOD( StopMusic );
|
||||
ADD_METHOD( IsTimingDelayed );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user