allow Lua expressions in text metrics by prepending @

This commit is contained in:
Glenn Maynard
2005-01-16 20:36:27 +00:00
parent 0849ef8a46
commit 39384227c4
5 changed files with 45 additions and 16 deletions
+16
View File
@@ -241,6 +241,22 @@ float Lua::RunExpressionF( const CString &str )
return result;
}
bool Lua::RunExpressionS( const CString &str, CString &sOut )
{
if( L == NULL )
OpenLua();
if( !RunExpression( str ) )
return false;
ASSERT( lua_gettop(L) > 0 );
sOut = lua_tostring( L, -1 );
lua_pop( L, -1 );
return true;
}
void Lua::Fail( lua_State *L, const CString &err )
{
lua_pushstring( L, err );