Some more loops.

This commit is contained in:
Jason Felds
2013-05-01 23:12:51 -04:00
parent 596056b8c3
commit fb66e2139f
+9 -10
View File
@@ -232,16 +232,15 @@ void ScreenOptions::InitMenu( const vector<OptionRowHandler*> &vHands )
m_frameContainer.SortByDrawOrder(); m_frameContainer.SortByDrawOrder();
FOREACH( OptionRow*, m_pRows, p ) int iIndex = 0;
for (OptionRow *p : m_pRows)
{ {
int iIndex = p - m_pRows.begin();
Lua *L = LUA->Get(); Lua *L = LUA->Get();
LuaHelpers::Push( L, iIndex ); LuaHelpers::Push( L, iIndex++ );
(*p)->m_pLuaInstance->Set( L, "iIndex" ); p->m_pLuaInstance->Set( L, "iIndex" );
LUA->Release( L ); LUA->Release( L );
(*p)->RunCommands( ROW_INIT_COMMAND ); p->RunCommands( ROW_INIT_COMMAND );
} }
// poke once at all the explanation metrics so that we catch missing ones early // poke once at all the explanation metrics so that we catch missing ones early
@@ -334,8 +333,8 @@ void ScreenOptions::TweenOnScreen()
{ {
ScreenWithMenuElements::TweenOnScreen(); ScreenWithMenuElements::TweenOnScreen();
FOREACH( OptionRow*, m_pRows, p ) for (OptionRow *p : m_pRows)
(*p)->RunCommands( ROW_ON_COMMAND ); p->RunCommands( ROW_ON_COMMAND );
m_frameContainer.SortByDrawOrder(); m_frameContainer.SortByDrawOrder();
} }
@@ -344,8 +343,8 @@ void ScreenOptions::TweenOffScreen()
{ {
ScreenWithMenuElements::TweenOffScreen(); ScreenWithMenuElements::TweenOffScreen();
FOREACH( OptionRow*, m_pRows, p ) for (OptionRow *p : m_pRows)
(*p)->RunCommands( ROW_OFF_COMMAND ); p->RunCommands( ROW_OFF_COMMAND );
} }
ScreenOptions::~ScreenOptions() ScreenOptions::~ScreenOptions()