add Lua binding
This commit is contained in:
@@ -1596,6 +1596,8 @@ CString Basename( const CString &dir )
|
|||||||
return dir.substr( start, end-start+1 );
|
return dir.substr( start, end-start+1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LuaFunction( Basename, Basename( SArg(1) ) )
|
||||||
|
|
||||||
/* Return all but the last named component of dir:
|
/* Return all but the last named component of dir:
|
||||||
* a/b/c -> a/b/
|
* a/b/c -> a/b/
|
||||||
* a/b/c/ -> a/b/
|
* a/b/c/ -> a/b/
|
||||||
|
|||||||
@@ -365,6 +365,7 @@ public:
|
|||||||
static int GetDifficulty( T* p, lua_State *L ) { lua_pushnumber(L, p->GetDifficulty() ); return 1; }
|
static int GetDifficulty( T* p, lua_State *L ) { lua_pushnumber(L, p->GetDifficulty() ); return 1; }
|
||||||
static int GetDescription( T* p, lua_State *L ) { lua_pushstring(L, p->GetDescription() ); return 1; }
|
static int GetDescription( T* p, lua_State *L ) { lua_pushstring(L, p->GetDescription() ); return 1; }
|
||||||
static int GetMeter( T* p, lua_State *L ) { lua_pushnumber(L, p->GetMeter() ); return 1; }
|
static int GetMeter( T* p, lua_State *L ) { lua_pushnumber(L, p->GetMeter() ); return 1; }
|
||||||
|
static int GetFilename( T* p, lua_State *L ) { lua_pushstring(L, p->GetFilename() ); return 1; }
|
||||||
|
|
||||||
static void Register(lua_State *L)
|
static void Register(lua_State *L)
|
||||||
{
|
{
|
||||||
@@ -372,6 +373,7 @@ public:
|
|||||||
ADD_METHOD( GetDifficulty );
|
ADD_METHOD( GetDifficulty );
|
||||||
ADD_METHOD( GetDescription );
|
ADD_METHOD( GetDescription );
|
||||||
ADD_METHOD( GetMeter );
|
ADD_METHOD( GetMeter );
|
||||||
|
ADD_METHOD( GetFilename );
|
||||||
|
|
||||||
Luna<T>::Register( L );
|
Luna<T>::Register( L );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user