EgtExecutor :

- aggiunta funzione Exe e Lua GetBackground per colori top e bottom dello sfondo della scena.
This commit is contained in:
Dario Sassi
2019-09-19 13:48:57 +00:00
parent 922dc27c56
commit f90534e36e
2 changed files with 34 additions and 0 deletions
+11
View File
@@ -86,6 +86,17 @@ ExeSetBackground( Color TopCol, Color BottomCol, bool bRedraw)
return true ;
}
//-----------------------------------------------------------------------------
bool
ExeGetBackground( Color& TopCol, Color& BottomCol)
{
IEGrScene* pScene = GetCurrScene() ;
VERIFY_SCENE( pScene, false)
// recupero lo sfondo
pScene->GetBackground( TopCol, BottomCol) ;
return true ;
}
//-----------------------------------------------------------------------------
bool
ExeSetMarkAttribs( Color MarkCol)
+23
View File
@@ -38,6 +38,28 @@ LuaSetBackground( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetBackground( lua_State* L)
{
// nessun parametro
LuaClearStack( L) ;
// recupero lo sfondo
Color colTop ;
Color colBot ;
bool bOk = ExeGetBackground( colTop, colBot) ;
// restituisco il risultato
if ( bOk) {
LuaSetParam( L, colTop) ;
LuaSetParam( L, colBot) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 2 ;
}
//-------------------------------------------------------------------------------
static int
LuaDraw( lua_State* L)
@@ -237,6 +259,7 @@ LuaInstallScene( LuaMgr& luaMgr)
{
bool bOk = ( &luaMgr != nullptr) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetBackground", LuaSetBackground) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetBackground", LuaGetBackground) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtDraw", LuaDraw) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetShowMode", LuaSetShowMode) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetShowCurveDirection", LuaSetShowCurveDirection) ;