closer to a fixed Reload

This commit is contained in:
Glenn Maynard
2006-02-26 21:32:52 +00:00
parent 2de0170202
commit b492263f82
+7 -10
View File
@@ -827,17 +827,17 @@ public:
LUA->Release(L); LUA->Release(L);
} }
virtual void ReLoadInternal( OptionRowDefinition &defOut ) virtual bool Reload()
{ {
Lua *L = LUA->Get(); Lua *L = LUA->Get();
/* Run the Lua expression. It should return a table. */ /* Run the Lua expression. It should return a table. */
const Command &command = m_cmds.v[0]; const Command &command = m_cmds.v[0];
RString sName = command.m_vsArgs[0]; RString sLuaFunction = command.m_vsArgs[1];
m_pLuaTable->SetFromExpression( sName ); m_pLuaTable->SetFromExpression( sLuaFunction );
if( m_pLuaTable->GetLuaType() != LUA_TTABLE ) if( m_pLuaTable->GetLuaType() != LUA_TTABLE )
RageException::Throw( "Result of \"%s\" is not a table", sName.c_str() ); RageException::Throw( "Result of \"%s\" is not a table", sLuaFunction.c_str() );
m_pLuaTable->PushSelf( L ); m_pLuaTable->PushSelf( L );
@@ -848,7 +848,7 @@ public:
if( !lua_isnil( L, -1 ) ) if( !lua_isnil( L, -1 ) )
{ {
if( !lua_istable( L, -1 ) ) if( !lua_istable( L, -1 ) )
RageException::Throw( "\"%s\" \"EnabledForPlayers\" is not a table", sName.c_str() ); RageException::Throw( "\"%s\" \"EnabledForPlayers\" is not a table", sLuaFunction.c_str() );
m_Def.m_vEnabledForPlayers.clear(); // and fill in with supplied PlayerNumbers below m_Def.m_vEnabledForPlayers.clear(); // and fill in with supplied PlayerNumbers below
@@ -870,6 +870,8 @@ public:
ASSERT( lua_gettop(L) == 0 ); ASSERT( lua_gettop(L) == 0 );
LUA->Release(L); LUA->Release(L);
return true;
} }
virtual void ImportOption( const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const virtual void ImportOption( const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
{ {
@@ -981,11 +983,6 @@ public:
// XXX: allow specifying the mask // XXX: allow specifying the mask
return 0; return 0;
} }
virtual bool Reload()
{
return true;
}
}; };
class OptionRowHandlerConfig : public OptionRowHandler class OptionRowHandlerConfig : public OptionRowHandler