From b492263f820ad5fbccf24fc10b7fcbeac0994556 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 26 Feb 2006 21:32:52 +0000 Subject: [PATCH] closer to a fixed Reload --- stepmania/src/OptionRowHandler.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index 29977dc9bc..e5edcf5f06 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -827,17 +827,17 @@ public: LUA->Release(L); } - virtual void ReLoadInternal( OptionRowDefinition &defOut ) + virtual bool Reload() { Lua *L = LUA->Get(); /* Run the Lua expression. It should return a table. */ const Command &command = m_cmds.v[0]; - RString sName = command.m_vsArgs[0]; - m_pLuaTable->SetFromExpression( sName ); + RString sLuaFunction = command.m_vsArgs[1]; + m_pLuaTable->SetFromExpression( sLuaFunction ); 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 ); @@ -848,7 +848,7 @@ public: if( !lua_isnil( 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 @@ -870,6 +870,8 @@ public: ASSERT( lua_gettop(L) == 0 ); LUA->Release(L); + + return true; } virtual void ImportOption( const vector &vpns, vector vbSelectedOut[NUM_PLAYERS] ) const { @@ -981,11 +983,6 @@ public: // XXX: allow specifying the mask return 0; } - - virtual bool Reload() - { - return true; - } }; class OptionRowHandlerConfig : public OptionRowHandler