From efeabffb8ec06560fd933deded2ff87e450cbcb3 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 22 Feb 2005 01:50:44 +0000 Subject: [PATCH] allow calling Lua from GameCommand --- stepmania/src/GameCommand.cpp | 8 ++++++++ stepmania/src/GameCommand.h | 1 + 2 files changed, 9 insertions(+) diff --git a/stepmania/src/GameCommand.cpp b/stepmania/src/GameCommand.cpp index 8d3161d5aa..bde1d593e2 100644 --- a/stepmania/src/GameCommand.cpp +++ b/stepmania/src/GameCommand.cpp @@ -39,6 +39,7 @@ void GameCommand::Init() m_sModifiers = ""; m_sAnnouncer = ""; m_sScreen = ""; + m_sLuaFunction = ""; m_pSong = NULL; m_pSteps = NULL; m_pCourse = NULL; @@ -210,6 +211,11 @@ void GameCommand::Load( int iIndex, const Commands& cmds ) m_sModifiers += sValue; } + else if( sName == "lua" ) + { + m_sLuaFunction = sValue; + } + else if( sName == "screen" ) { m_sScreen = sValue; @@ -622,6 +628,8 @@ void GameCommand::Apply( const vector &vpns ) const if( m_sModifiers != "" ) FOREACH_CONST( PlayerNumber, vpns, pn ) GAMESTATE->ApplyModifiers( *pn, m_sModifiers ); + if( m_sLuaFunction != "" ) + LUA->RunScript( m_sLuaFunction, "in", 0 ); if( m_sScreen != "" ) SCREENMAN->SetNewScreen( m_sScreen ); if( m_pSong ) diff --git a/stepmania/src/GameCommand.h b/stepmania/src/GameCommand.h index e80cb00d0c..351c908669 100644 --- a/stepmania/src/GameCommand.h +++ b/stepmania/src/GameCommand.h @@ -47,6 +47,7 @@ public: CString m_sAnnouncer; CString m_sModifiers; CString m_sScreen; + CString m_sLuaFunction; Song* m_pSong; Steps* m_pSteps; Course* m_pCourse;