add "text," command so that elements can look up their text
This commit is contained in:
@@ -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<GameCommand>
|
||||
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<T>::Register( L );
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user