add LifeMeter binding in ScreenHowToPlay and ScreenGameplay
remove GetPlayerInfo binding (currently unused)
This commit is contained in:
@@ -151,6 +151,22 @@ void ScreenAttract::GoToStartScreen( RString sScreenName )
|
|||||||
SCREENMAN->SetNewScreen( START_SCREEN(sScreenName) );
|
SCREENMAN->SetNewScreen( START_SCREEN(sScreenName) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// lua start
|
||||||
|
#include "LuaBinding.h"
|
||||||
|
|
||||||
|
class LunaScreenAttract: public Luna<ScreenAttract>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
LunaScreenAttract()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
LUA_REGISTER_DERIVED_CLASS( ScreenAttract, ScreenWithMenuElements )
|
||||||
|
// lua end
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2003-2004 Chris Danford
|
* (c) 2003-2004 Chris Danford
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ public:
|
|||||||
|
|
||||||
virtual ScreenType GetScreenType() const { return attract; }
|
virtual ScreenType GetScreenType() const { return attract; }
|
||||||
|
|
||||||
|
//
|
||||||
|
// Lua
|
||||||
|
//
|
||||||
|
virtual void PushSelf( lua_State *L );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void StartPlayingMusic();
|
virtual void StartPlayingMusic();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2675,15 +2675,15 @@ 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 )
|
static int GetLifeMeter( T* p, lua_State *L )
|
||||||
{
|
{
|
||||||
PlayerNumber pn = Enum::Check<PlayerNumber>( L, 1 );
|
PlayerNumber pn = Enum::Check<PlayerNumber>( L, 1 );
|
||||||
|
|
||||||
PlayerInfo *pInfo = p->GetPlayerInfo(pn);
|
LifeMeter *pLM = p->GetPlayerInfo(pn)->m_pLifeMeter;
|
||||||
if( pInfo == NULL )
|
if( pLM == NULL )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pInfo->PushSelf( L );
|
pLM->PushSelf( L );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2691,7 +2691,7 @@ public:
|
|||||||
{
|
{
|
||||||
ADD_METHOD( GetNextCourseSong );
|
ADD_METHOD( GetNextCourseSong );
|
||||||
ADD_METHOD( Center1Player );
|
ADD_METHOD( Center1Player );
|
||||||
ADD_METHOD( GetPlayerInfo );
|
ADD_METHOD( GetLifeMeter );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ public:
|
|||||||
//
|
//
|
||||||
virtual void PushSelf( lua_State *L );
|
virtual void PushSelf( lua_State *L );
|
||||||
Song *GetNextCourseSong() const;
|
Song *GetNextCourseSong() const;
|
||||||
|
LifeMeter *GetLifeMeter( PlayerNumber pn );
|
||||||
PlayerInfo *GetPlayerInfo( PlayerNumber pn );
|
PlayerInfo *GetPlayerInfo( PlayerNumber pn );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -325,6 +325,30 @@ void ScreenHowToPlay::DrawPrimitives()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// lua start
|
||||||
|
#include "LuaBinding.h"
|
||||||
|
|
||||||
|
class LunaScreenHowToPlay: public Luna<ScreenHowToPlay>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static int GetLifeMeter( T* p, lua_State *L )
|
||||||
|
{
|
||||||
|
//PlayerNumber pn = Enum::Check<PlayerNumber>( L, 1 );
|
||||||
|
|
||||||
|
p->m_pLifeMeterBar->PushSelf( L );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
LunaScreenHowToPlay()
|
||||||
|
{
|
||||||
|
ADD_METHOD( GetLifeMeter );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
LUA_REGISTER_DERIVED_CLASS( ScreenHowToPlay, ScreenAttract )
|
||||||
|
// lua end
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2001-2004 Chris Danford, Thad Ward
|
* (c) 2001-2004 Chris Danford, Thad Ward
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -19,9 +19,15 @@ public:
|
|||||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Lua
|
||||||
|
//
|
||||||
|
virtual void PushSelf( lua_State *L );
|
||||||
|
|
||||||
|
|
||||||
|
LifeMeterBar *m_pLifeMeterBar;
|
||||||
protected:
|
protected:
|
||||||
virtual void Step();
|
virtual void Step();
|
||||||
LifeMeterBar *m_pLifeMeterBar;
|
|
||||||
PlayerPlus m_Player;
|
PlayerPlus m_Player;
|
||||||
Model *m_pmCharacter;
|
Model *m_pmCharacter;
|
||||||
Model *m_pmDancePad;
|
Model *m_pmDancePad;
|
||||||
|
|||||||
Reference in New Issue
Block a user