From fefcfa04f1a99dc724a3e20f21d2a1f6a23c1065 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 1 Mar 2005 01:15:22 +0000 Subject: [PATCH] add BroadcastOnExport and ReloadRowMessages --- stepmania/src/OptionRowHandler.cpp | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index 423359e130..0d74648c41 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -47,6 +47,7 @@ public: vector ListEntries; GameCommand Default; bool m_bUseModNameForIcon; + vector m_vsBroadcastOnExport; OptionRowHandlerList::OptionRowHandlerList() { Init(); } virtual void Init() @@ -55,6 +56,7 @@ public: ListEntries.clear(); Default.Init(); m_bUseModNameForIcon = false; + m_vsBroadcastOnExport.clear(); } virtual void Load( OptionRowDefinition &defOut, CString sParam ) { @@ -111,6 +113,11 @@ public: } } else if( sName == "exportonchange" ) defOut.m_bExportOnChange = true; + else if( sName == "broadcastonexport" ) + { + for( unsigned i=1; iBroadcast( *s ); return 0; } @@ -601,6 +612,31 @@ public: lua_pop( LUA->L, 1 ); /* pop EnabledForPlayers table */ + /* Iterate over the "ReloadRowMessages" table. */ + lua_pushstring( LUA->L, "ReloadRowMessages" ); + lua_gettable( LUA->L, -2 ); + if( !lua_isnil( LUA->L, -1 ) ) + { + if( !lua_istable( LUA->L, -1 ) ) + RageException::Throw( "\"%s\" \"ReloadRowMessages\" is not a table", sLuaFunction.c_str() ); + + lua_pushnil( LUA->L ); + while( lua_next(LUA->L, -2) != 0 ) + { + /* `key' is at index -2 and `value' at index -1 */ + const char *pValue = lua_tostring( LUA->L, -1 ); + if( pValue == NULL ) + RageException::Throw( "\"%s\" Column entry is not a string", sLuaFunction.c_str() ); + LOG->Trace( "'%s'", pValue); + + m_vsReloadRowMessages.push_back( pValue ); + + lua_pop( LUA->L, 1 ); /* removes `value'; keeps `key' for next iteration */ + } + } + lua_pop( LUA->L, 1 ); /* pop ReloadRowMessages table */ + + /* Look for "ExportOnChange" value. */ lua_pushstring( LUA->L, "ExportOnChange" ); lua_gettable( LUA->L, -2 );