<Context> nodes

This commit is contained in:
Glenn Maynard
2006-08-17 06:42:32 +00:00
parent 7d9e5e2c5b
commit 9872638a7d
+22
View File
@@ -220,6 +220,28 @@ void Actor::LoadFromNode( const RString& sDir, const XNode* pNode )
lua_pop( L, 1 );
LUA->Release( L );
}
if( pChild->m_sName == "Context" )
{
RString sName;
if( !pChild->GetAttrValue( "Name", sName ) )
Dialog::OK( ssprintf("Context node in '%s' is missing the attribute \"Name\"", sDir.c_str()), "MISSING_ATTRIBUTE" );
LuaHelpers::RunAtExpressionS( sName );
RString s;
if( !pChild->GetAttrValue( "Value", s ) )
Dialog::OK( ssprintf("Context node in '%s' is missing the attribute \"Value\"", sDir.c_str()), "MISSING_ATTRIBUTE" );
Lua *L = LUA->Get();
this->PushContext(L);
lua_pushstring(L, sName );
LuaHelpers::RunScript( L, "return " + s, "", 1 );
lua_settable( L, -3 );
lua_pop( L, 1 );
LUA->Release(L);
}
}
FOREACH_CONST_Attr( pNode, pAttr )