From 8fda0047425dd67c09fee5ff7d4dc196ea759e7f Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 6 Dec 2005 12:39:43 +0000 Subject: [PATCH] add Lua binding --- stepmania/src/RageUtil.cpp | 2 ++ stepmania/src/Steps.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 92076a1d30..6467d98ec3 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -1596,6 +1596,8 @@ CString Basename( const CString &dir ) return dir.substr( start, end-start+1 ); } +LuaFunction( Basename, Basename( SArg(1) ) ) + /* Return all but the last named component of dir: * a/b/c -> a/b/ * a/b/c/ -> a/b/ diff --git a/stepmania/src/Steps.cpp b/stepmania/src/Steps.cpp index eb1c1fa194..20eed784da 100644 --- a/stepmania/src/Steps.cpp +++ b/stepmania/src/Steps.cpp @@ -365,6 +365,7 @@ public: 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 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) { @@ -372,6 +373,7 @@ public: ADD_METHOD( GetDifficulty ); ADD_METHOD( GetDescription ); ADD_METHOD( GetMeter ); + ADD_METHOD( GetFilename ); Luna::Register( L ); }