diff --git a/stepmania/src/GameCommand.cpp b/stepmania/src/GameCommand.cpp index 53bbc5f27b..ef81ee7511 100644 --- a/stepmania/src/GameCommand.cpp +++ b/stepmania/src/GameCommand.cpp @@ -31,6 +31,7 @@ void GameCommand::Init() { m_sName = ""; + m_sText = ""; m_bInvalid = true; m_iIndex = -1; m_pGame = NULL; @@ -214,6 +215,11 @@ void GameCommand::LoadOne( const Command& cmd ) m_sName = sValue; } + else if( sName == "text" ) + { + m_sText = sValue; + } + else if( sName == "mod" ) { if( m_sModifiers != "" ) @@ -1104,10 +1110,16 @@ class LunaGameCommand: public Luna public: LunaGameCommand() { LUA->Register( Register ); } - static int GetProfileID( T* p, lua_State *L ) { lua_pushstring(L, p->m_sProfileID ); return 1; } + static int GetName( T* p, lua_State *L ) { lua_pushstring(L, p->m_sName ); return 1; } + static int GetText( T* p, lua_State *L ) { lua_pushstring(L, p->m_sText ); return 1; } + static int GetIndex( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iIndex ); return 1; } + static int GetProfileID( T* p, lua_State *L ) { lua_pushstring(L, p->m_sProfileID ); return 1; } static void Register(lua_State *L) { + ADD_METHOD( GetName ) + ADD_METHOD( GetText ) + ADD_METHOD( GetIndex ) ADD_METHOD( GetProfileID ) Luna::Register( L ); diff --git a/stepmania/src/GameCommand.h b/stepmania/src/GameCommand.h index 5d31f7350b..4199bde19b 100644 --- a/stepmania/src/GameCommand.h +++ b/stepmania/src/GameCommand.h @@ -44,7 +44,8 @@ public: // so that we know the order of commands when it comes time to Apply. Commands m_Commands; - CString m_sName; // display name + CString m_sName; // choice name + CString m_sText; // display text bool m_bInvalid; CString m_sInvalidReason; int m_iIndex;