Special case kickbox autogen added. GameState now has a member for passing args from the theme to the autogen, only used by kickbox for kick recovery time.

This commit is contained in:
Kyzentun
2015-01-26 19:43:15 -07:00
parent b6e9d188c3
commit c69cf1ef4e
5 changed files with 233 additions and 2 deletions
+28
View File
@@ -3094,6 +3094,32 @@ public:
return 0;
}
static int GetAutoGenFarg(T* p, lua_State *L)
{
int i= IArg(1) - 1;
if(i < 0) { lua_pushnil(L); return 1; }
size_t si= static_cast<size_t>(i);
if(si >= p->m_autogen_fargs.size()) { lua_pushnil(L); return 1; }
lua_pushnumber(L, p->GetAutoGenFarg(si));
return 1;
}
static int SetAutoGenFarg(T* p, lua_State* L)
{
int i= IArg(1) - 1;
if(i < 0)
{
luaL_error(L, "%i is not a valid autogen arg index.", i);
}
float v= FArg(2);
size_t si= static_cast<size_t>(i);
while(si >= p->m_autogen_fargs.size())
{
p->m_autogen_fargs.push_back(0.0f);
}
p->m_autogen_fargs[si]= v;
COMMON_RETURN_SELF;
}
LunaGameState()
{
ADD_METHOD( IsPlayerEnabled );
@@ -3218,6 +3244,8 @@ public:
ADD_METHOD( SetCurrentStyle );
ADD_METHOD( SetCurrentPlayMode );
ADD_METHOD( SetStepsForEditMode );
ADD_METHOD( GetAutoGenFarg );
ADD_METHOD( SetAutoGenFarg );
}
};