bind PlayerInfo
This commit is contained in:
@@ -2627,6 +2627,16 @@ Song *ScreenGameplay::GetNextCourseSong() const
|
|||||||
return m_apSongsQueue[iPlaySongIndex];
|
return m_apSongsQueue[iPlaySongIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PlayerInfo *ScreenGameplay::GetPlayerInfo( PlayerNumber pn )
|
||||||
|
{
|
||||||
|
FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi )
|
||||||
|
{
|
||||||
|
if( pi->m_pn == pn )
|
||||||
|
return &*pi;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void ScreenGameplay::SaveReplay()
|
void ScreenGameplay::SaveReplay()
|
||||||
{
|
{
|
||||||
FOREACH_HumanPlayer( pn )
|
FOREACH_HumanPlayer( pn )
|
||||||
@@ -2677,15 +2687,41 @@ class LunaScreenGameplay: public Luna<ScreenGameplay>
|
|||||||
public:
|
public:
|
||||||
static int GetNextCourseSong( T* p, lua_State *L ) { p->GetNextCourseSong()->PushSelf(L); return 1; }
|
static int GetNextCourseSong( T* p, lua_State *L ) { p->GetNextCourseSong()->PushSelf(L); return 1; }
|
||||||
static int Center1Player( T* p, lua_State *L ) { lua_pushboolean( L, p->Center1Player() ); return 1; }
|
static int Center1Player( T* p, lua_State *L ) { lua_pushboolean( L, p->Center1Player() ); return 1; }
|
||||||
|
static int GetPlayerInfo( T* p, lua_State *L )
|
||||||
|
{
|
||||||
|
PlayerNumber pn = Enum::Check<PlayerNumber>( L, 1 );
|
||||||
|
|
||||||
|
PlayerInfo *pInfo = p->GetPlayerInfo(pn);
|
||||||
|
if( pInfo == NULL )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
pInfo->PushSelf( L );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
LunaScreenGameplay()
|
LunaScreenGameplay()
|
||||||
{
|
{
|
||||||
ADD_METHOD( GetNextCourseSong );
|
ADD_METHOD( GetNextCourseSong );
|
||||||
ADD_METHOD( Center1Player );
|
ADD_METHOD( Center1Player );
|
||||||
|
ADD_METHOD( GetPlayerInfo );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
LUA_REGISTER_DERIVED_CLASS( ScreenGameplay, ScreenWithMenuElements )
|
LUA_REGISTER_DERIVED_CLASS( ScreenGameplay, ScreenWithMenuElements )
|
||||||
|
|
||||||
|
|
||||||
|
class LunaPlayerInfo: public Luna<PlayerInfo>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static int GetLifeMeter( T* p, lua_State *L ) { p->m_pLifeMeter->PushSelf(L); return 1; }
|
||||||
|
|
||||||
|
LunaPlayerInfo()
|
||||||
|
{
|
||||||
|
ADD_METHOD( GetLifeMeter );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
LUA_REGISTER_CLASS( PlayerInfo )
|
||||||
// lua end
|
// lua end
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -64,6 +64,11 @@ public:
|
|||||||
return PlayerNumberToString( m_pn );
|
return PlayerNumberToString( m_pn );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Lua
|
||||||
|
//
|
||||||
|
virtual void PushSelf( lua_State *L );
|
||||||
|
|
||||||
PlayerNumber m_pn;
|
PlayerNumber m_pn;
|
||||||
MultiPlayer m_mp;
|
MultiPlayer m_mp;
|
||||||
bool m_bIsDummy;
|
bool m_bIsDummy;
|
||||||
@@ -120,6 +125,7 @@ public:
|
|||||||
//
|
//
|
||||||
virtual void PushSelf( lua_State *L );
|
virtual void PushSelf( lua_State *L );
|
||||||
Song *GetNextCourseSong() const;
|
Song *GetNextCourseSong() const;
|
||||||
|
PlayerInfo *GetPlayerInfo( PlayerNumber pn );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool GenericTweenOn() const { return true; }
|
virtual bool GenericTweenOn() const { return true; }
|
||||||
|
|||||||
Reference in New Issue
Block a user