Game bindings
This commit is contained in:
@@ -115,6 +115,25 @@ TapNoteScore Game::MapTapNoteScore( TapNoteScore tns ) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// lua start
|
||||||
|
#include "LuaBinding.h"
|
||||||
|
|
||||||
|
class LunaGame: public Luna<Game>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LunaGame() { LUA->Register( Register ); }
|
||||||
|
|
||||||
|
static int GetName( T* p, lua_State *L ) { lua_pushstring( L, p->m_szName ); return 1; }
|
||||||
|
static void Register( Lua *L )
|
||||||
|
{
|
||||||
|
ADD_METHOD( GetName )
|
||||||
|
Luna<T>::Register( L );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
LUA_REGISTER_CLASS( Game )
|
||||||
|
// lua end
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2001-2002 Chris Danford
|
* (c) 2001-2002 Chris Danford
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include "MenuInput.h"
|
#include "MenuInput.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
|
|
||||||
|
struct lua_State;
|
||||||
|
|
||||||
const int MAX_STYLES_PER_GAME = 10;
|
const int MAX_STYLES_PER_GAME = 10;
|
||||||
|
|
||||||
@@ -61,6 +62,11 @@ public:
|
|||||||
TapNoteScore m_mapGreatTo;
|
TapNoteScore m_mapGreatTo;
|
||||||
TapNoteScore m_mapGoodTo;
|
TapNoteScore m_mapGoodTo;
|
||||||
TapNoteScore m_mapBooTo;
|
TapNoteScore m_mapBooTo;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Lua
|
||||||
|
//
|
||||||
|
void PushSelf( lua_State *L );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1977,6 +1977,7 @@ void GameState::RevertSyncChanges()
|
|||||||
|
|
||||||
// lua start
|
// lua start
|
||||||
#include "LuaBinding.h"
|
#include "LuaBinding.h"
|
||||||
|
#include "Game.h"
|
||||||
|
|
||||||
class LunaGameState: public Luna<GameState>
|
class LunaGameState: public Luna<GameState>
|
||||||
{
|
{
|
||||||
@@ -2099,7 +2100,7 @@ public:
|
|||||||
PlayerNumber pn = (PlayerNumber)IArg(1);
|
PlayerNumber pn = (PlayerNumber)IArg(1);
|
||||||
lua_pushboolean(L, p->GetStageResult(pn)==RESULT_WIN); return 1;
|
lua_pushboolean(L, p->GetStageResult(pn)==RESULT_WIN); return 1;
|
||||||
}
|
}
|
||||||
|
static int GetCurrentGame( T* p, lua_State *L ) { const_cast<Game*>(p->GetCurrentGame())->PushSelf( L ); return 1; }
|
||||||
static void Register(lua_State *L)
|
static void Register(lua_State *L)
|
||||||
{
|
{
|
||||||
ADD_METHOD( IsPlayerEnabled )
|
ADD_METHOD( IsPlayerEnabled )
|
||||||
@@ -2148,6 +2149,7 @@ public:
|
|||||||
ADD_METHOD( GetPremium )
|
ADD_METHOD( GetPremium )
|
||||||
ADD_METHOD( IsSyncDataChanged )
|
ADD_METHOD( IsSyncDataChanged )
|
||||||
ADD_METHOD( IsWinner )
|
ADD_METHOD( IsWinner )
|
||||||
|
ADD_METHOD( GetCurrentGame )
|
||||||
|
|
||||||
Luna<T>::Register( L );
|
Luna<T>::Register( L );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user