[Character] Added GetDisplayName Lua binding.

This commit is contained in:
AJ Kelly
2011-01-10 16:49:41 -06:00
parent 9e29a843a5
commit 45b1664147
2 changed files with 8 additions and 5 deletions
+3 -4
View File
@@ -17,7 +17,6 @@ bool Character::Load( RString sCharDir )
sCharDir += "/";
m_sCharDir = sCharDir;
// save ID
{
vector<RString> as;
@@ -61,7 +60,7 @@ bool Character::Load( RString sCharDir )
// get optional display name
ini.GetValue( "Character", "DisplayName", m_sDisplayName );
// get optional InitCommand
RString s;
ini.GetValue( "Character", "InitCommand", s );
@@ -70,7 +69,6 @@ bool Character::Load( RString sCharDir )
return true;
}
RString GetRandomFileInDir( RString sDir )
{
vector<RString> asFiles;
@@ -81,7 +79,6 @@ RString GetRandomFileInDir( RString sDir )
return asFiles[RandomInt(asFiles.size())];
}
RString Character::GetModelPath() const
{
RString s = m_sCharDir + "model.txt";
@@ -214,6 +211,7 @@ public:
static int GetDanceAnimationPath( T* p, lua_State *L ) { lua_pushstring(L, p->GetDanceAnimationPath() ); return 1; }
static int GetCharacterDir( T* p, lua_State *L ) { lua_pushstring(L, p->m_sCharDir ); return 1; }
static int GetCharacterID( T* p, lua_State *L ) { lua_pushstring(L, p->m_sCharacterID ); return 1; }
static int GetDisplayName( T* p, lua_State *L ) { lua_pushstring(L, p->GetDisplayName() ); return 1; }
LunaCharacter()
{
@@ -228,6 +226,7 @@ public:
ADD_METHOD( GetDanceAnimationPath );
ADD_METHOD( GetCharacterDir );
ADD_METHOD( GetCharacterID );
ADD_METHOD( GetDisplayName );
}
};