EgtExecutor :
- aggiunte a Lua EgtGetLastPart, EgtGetPrevPart, EgtGetLastLayer e EgtGetPrevLayer - aggiunto parametro opzionale (separatore) a EgtSplitString di Lua - corrette (parametro di ritorno di tipo errato) EgtPackBox e EgtPackBoxCluster di Lua.
This commit is contained in:
@@ -159,6 +159,44 @@ LuaGetNextPart( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaGetLastPart( lua_State* L)
|
||||
{
|
||||
// nessuno o 1 parametro : [bOnlyVisible]
|
||||
bool bOnlyVisible = false ;
|
||||
LuaGetParam( L, 1, bOnlyVisible) ;
|
||||
LuaClearStack( L) ;
|
||||
// cerco ultimo pezzo
|
||||
int nId = ExeGetLastPart( bOnlyVisible) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nId) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaGetPrevPart( lua_State* L)
|
||||
{
|
||||
// 1 o 2 parametri : nPartId [, bOnlyVisible]
|
||||
int nPartId ;
|
||||
LuaCheckParam( L, 1, nPartId)
|
||||
bool bOnlyVisible = false ;
|
||||
LuaGetParam( L, 2, bOnlyVisible) ;
|
||||
LuaClearStack( L) ;
|
||||
// cerco pezzo precedente
|
||||
int nId = ExeGetPrevPart( nPartId, bOnlyVisible) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nId) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaGetFirstLayer( lua_State* L)
|
||||
@@ -199,6 +237,46 @@ LuaGetNextLayer( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaGetLastLayer( lua_State* L)
|
||||
{
|
||||
// 1 o 2 parametri : nPartId [, bOnlyVisible]
|
||||
int nPartId ;
|
||||
LuaCheckParam( L, 1, nPartId)
|
||||
bool bOnlyVisible = false ;
|
||||
LuaGetParam( L, 2, bOnlyVisible) ;
|
||||
LuaClearStack( L) ;
|
||||
// cerco l'ultimo layer del pezzo
|
||||
int nId = ExeGetLastLayer( nPartId, bOnlyVisible) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nId) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaGetPrevLayer( lua_State* L)
|
||||
{
|
||||
// 1 o 2 parametri : nLayerId [, bOnlyVisible]
|
||||
int nLayerId ;
|
||||
LuaCheckParam( L, 1, nLayerId)
|
||||
bool bOnlyVisible = false ;
|
||||
LuaGetParam( L, 2, bOnlyVisible) ;
|
||||
LuaClearStack( L) ;
|
||||
// cerco il precedente layer (ovviamente dello stesso pezzo)
|
||||
int nId = ExeGetPrevLayer( nLayerId, bOnlyVisible) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nId) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaEraseEmptyParts( lua_State* L)
|
||||
@@ -303,8 +381,12 @@ LuaInstallGdbPartLayer( LuaMgr& luaMgr)
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetPartCount", LuaGetPartCount) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetFirstPart", LuaGetFirstPart) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetNextPart", LuaGetNextPart) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetLastPart", LuaGetLastPart) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetPrevPart", LuaGetPrevPart) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetFirstLayer", LuaGetFirstLayer) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetNextLayer", LuaGetNextLayer) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetLastLayer", LuaGetLastLayer) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetPrevLayer", LuaGetPrevLayer) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtEraseEmptyParts", LuaEraseEmptyParts) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSelectPartObjs", LuaSelectPartObjs) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtDeselectPartObjs", LuaDeselectPartObjs) ;
|
||||
|
||||
Reference in New Issue
Block a user