use RunScriptOnStack
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "XmlFile.h"
|
||||
#include "LuaManager.h"
|
||||
#include "ActorUtil.h"
|
||||
#include "RageLog.h"
|
||||
#include "RageUtil.h"
|
||||
#include "LuaBinding.h"
|
||||
|
||||
@@ -41,7 +42,10 @@ void DynamicActorScroller::LoadFromNode( const XNode *pNode )
|
||||
ASSERT( !lua_isnil(L, -1) );
|
||||
lua_pushnil( L );
|
||||
lua_pushnil( L );
|
||||
lua_call( L, 2, 1 ); // 2 args, 1 results
|
||||
|
||||
RString sError;
|
||||
if( !LuaHelpers::RunScriptOnStack(L, sError, 2, 1) ) // 2 args, 1 result
|
||||
LOG->Warn( "Error running LoadFunction: %s", sError.c_str() );
|
||||
|
||||
m_iNumItems = (int) luaL_checknumber( L, -1 );
|
||||
lua_pop( L, 1 );
|
||||
@@ -117,7 +121,11 @@ void DynamicActorScroller::ConfigureActor( Actor *pActor, int iItem )
|
||||
ASSERT( !lua_isnil(L, -1) );
|
||||
pActor->PushSelf( L );
|
||||
LuaHelpers::Push( L, iItem );
|
||||
lua_call( L, 2, 0 ); // 2 args, 0 results
|
||||
|
||||
RString sError;
|
||||
if( !LuaHelpers::RunScriptOnStack(L, sError, 2, 0) ) // 2 args, 0 results
|
||||
LOG->Warn( "Error running LoadFunction: %s", sError.c_str() );
|
||||
|
||||
LUA->Release(L);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "MenuTimer.h"
|
||||
#include "RageLog.h"
|
||||
#include "RageUtil.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "ThemeManager.h"
|
||||
@@ -165,7 +166,9 @@ void MenuTimer::SetText( float fSeconds )
|
||||
LuaHelpers::Push( L, fSeconds );
|
||||
|
||||
// call function with 1 argument and 1 result
|
||||
lua_call(L, 1, 1);
|
||||
RString sError;
|
||||
if( !LuaHelpers::RunScriptOnStack(L, sError, 1, 1) )
|
||||
LOG->Warn( "Error running Text%iFormatFunction: %s", i+1, sError.c_str() );
|
||||
|
||||
RString sText;
|
||||
LuaHelpers::Pop( L, sText );
|
||||
|
||||
@@ -168,7 +168,9 @@ void PercentageDisplay::Refresh()
|
||||
m_Format.PushSelf( L );
|
||||
ASSERT( !lua_isnil(L, -1) );
|
||||
LuaHelpers::Push( L, fPercentDancePoints );
|
||||
lua_call( L, 1, 1 ); // 1 args, 1 result
|
||||
RString sError;
|
||||
if( !LuaHelpers::RunScriptOnStack(L, sError, 1, 1) ) // 1 arg, 1 result
|
||||
LOG->Warn( "Error running FormatPercentScore: %s", sError.c_str() );
|
||||
LuaHelpers::Pop( L, sNumToDisplay );
|
||||
LUA->Release(L);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user