New Lua Bindings: Profile:SetCharacter(sCharID), GAMESTATE:GetCharacter(PlayerNumber), GAMESTATE:SetCharacter(PlayerNumber,sCharID)

This commit is contained in:
AJ Kelly
2010-12-18 14:42:07 -06:00
parent ac92794e43
commit a8de96107f
4 changed files with 21 additions and 0 deletions
+9
View File
@@ -2448,6 +2448,13 @@ public:
DEFINE_METHOD( GetCurMusicSeconds, m_fMusicSeconds )
DEFINE_METHOD( GetWorkoutGoalComplete, m_bWorkoutGoalComplete )
static int GetCharacter( T* p, lua_State *L ) { p->m_pCurCharacters[Enum::Check<PlayerNumber>(L, 1)]->PushSelf(L); return 1; }
static int SetCharacter( T* p, lua_State *L ){
Character* c = CHARMAN->GetCharacterFromID(SArg(2));
if (c)
p->m_pCurCharacters[Enum::Check<PlayerNumber>(L, 1)] = c;
return 0;
}
LunaGameState()
{
@@ -2543,6 +2550,8 @@ public:
ADD_METHOD( UnjoinPlayer );
ADD_METHOD( GetSongPercent );
ADD_METHOD( GetCurMusicSeconds );
ADD_METHOD( GetCharacter );
ADD_METHOD( SetCharacter );
}
};