本文整理汇总了C++中ToolFramework_PostToolMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ ToolFramework_PostToolMessage函数的具体用法?C++ ToolFramework_PostToolMessage怎么用?C++ ToolFramework_PostToolMessage使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ToolFramework_PostToolMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Assert
void CClientTools::OnRemoveEntity( C_BaseEntity *ent )
{
if ( !ent )
{
Assert( 0 );
return;
}
HTOOLHANDLE handle = ent->GetToolHandle();
ent->SetToolHandle( (HTOOLHANDLE)0 );
if ( handle == (HTOOLHANDLE)0 )
{
Assert( 0 );
return;
}
int idx = m_Handles.Find( HToolEntry_t( handle ) );
if ( idx == m_Handles.InvalidIndex() )
{
Assert( 0 );
return;
}
// Send deletion message to tool interface
if ( m_bInRecordingMode )
{
KeyValues *kv = new KeyValues( "deleted" );
ToolFramework_PostToolMessage( handle, kv );
kv->deleteThis();
}
m_Handles.RemoveAt( idx );
m_ActiveHandles.FindAndRemove( handle );
}
示例2: RecordSprite
//-----------------------------------------------------------------------------
// Recording
//-----------------------------------------------------------------------------
static inline void RecordSprite( const Vector& start, int nModelIndex,
float flScale, int nBrightness )
{
if ( !ToolsEnabled() )
return;
if ( clienttools->IsInRecordingMode() )
{
const model_t* pModel = (nModelIndex != 0) ? modelinfo->GetModel( nModelIndex ) : NULL;
const char *pModelName = pModel ? modelinfo->GetModelName( pModel ) : "";
KeyValues *msg = new KeyValues( "TempEntity" );
msg->SetInt( "te", TE_SPRITE_SINGLE );
msg->SetString( "name", "TE_Sprite" );
msg->SetFloat( "time", gpGlobals->curtime );
msg->SetFloat( "originx", start.x );
msg->SetFloat( "originy", start.y );
msg->SetFloat( "originz", start.z );
msg->SetString( "model", pModelName );
msg->SetFloat( "scale", flScale );
msg->SetInt( "brightness", nBrightness );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
}
示例3: VPROF_BUDGET
//================================================================================
// Pensamiento
//================================================================================
void CInternalLight::Update( const Vector &vecPos, const Vector &vecForward, const Vector &vecRight, const Vector &vecUp )
{
VPROF_BUDGET( __FUNCTION__, VPROF_BUDGETGROUP_SHADOW_DEPTH_TEXTURING );
// No esta encendida
if ( !IsOn() )
return;
FlashlightState_t state;
// Actualizamos el estado
if ( !UpdateState( state, vecPos, vecForward, vecRight, vecUp ) )
return;
// Actualizamos la proyección de la luz
UpdateLightProjection( state );
#ifndef NO_TOOLFRAMEWORK
if ( clienttools->IsInRecordingMode() ) {
KeyValues *msg = new KeyValues( "FlashlightState" );
msg->SetFloat( "time", gpGlobals->curtime );
msg->SetInt( "entindex", m_iEntIndex );
msg->SetInt( "flashlightHandle", m_nLightHandle );
msg->SetPtr( "flashlightState", &state );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
#endif
}
示例4: KeyValues
//-----------------------------------------------------------------------------
// Recording
//-----------------------------------------------------------------------------
void C_TEExplosion::RecordExplosion( )
{
if ( !ToolsEnabled() )
return;
if ( clienttools->IsInRecordingMode() )
{
const model_t* pModel = (m_nModelIndex != 0) ? modelinfo->GetModel( m_nModelIndex ) : NULL;
const char *pModelName = pModel ? modelinfo->GetModelName( pModel ) : "";
KeyValues *msg = new KeyValues( "TempEntity" );
msg->SetInt( "te", TE_EXPLOSION );
msg->SetString( "name", "TE_Explosion" );
msg->SetFloat( "time", gpGlobals->curtime );
msg->SetFloat( "originx", m_vecOrigin.x );
msg->SetFloat( "originy", m_vecOrigin.y );
msg->SetFloat( "originz", m_vecOrigin.z );
msg->SetFloat( "directionx", m_vecNormal.x );
msg->SetFloat( "directiony", m_vecNormal.y );
msg->SetFloat( "directionz", m_vecNormal.z );
msg->SetString( "model", pModelName );
msg->SetFloat( "scale", m_fScale );
msg->SetInt( "framerate", m_nFrameRate );
msg->SetInt( "flags", m_nFlags );
msg->SetInt( "materialtype", m_chMaterialType );
msg->SetInt( "radius", m_nRadius );
msg->SetInt( "magnitude", m_nMagnitude );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
}
示例5: RecordSparks
//-----------------------------------------------------------------------------
// Recording
//-----------------------------------------------------------------------------
static inline void RecordSparks( const Vector &start, int nMagnitude, int nTrailLength, const Vector &direction )
{
if ( !ToolsEnabled() )
return;
if ( clienttools->IsInRecordingMode() )
{
KeyValues *msg = new KeyValues( "TempEntity" );
msg->SetInt( "te", TE_SPARKS );
msg->SetString( "name", "TE_Sparks" );
msg->SetFloat( "time", gpGlobals->curtime );
msg->SetFloat( "originx", start.x );
msg->SetFloat( "originy", start.y );
msg->SetFloat( "originz", start.z );
msg->SetFloat( "directionx", direction.x );
msg->SetFloat( "directiony", direction.y );
msg->SetFloat( "directionz", direction.z );
msg->SetInt( "magnitude", nMagnitude );
msg->SetInt( "traillength", nTrailLength );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
}
示例6: KeyValues
//================================================================================
// Apaga y destruye la luz
//================================================================================
void CInternalLight::TurnOff()
{
// No esta encendida
if ( !IsOn() )
return;
m_bIsOn = false;
// Destruimos la luz
if ( m_nLightHandle != CLIENTSHADOW_INVALID_HANDLE ) {
g_pClientShadowMgr->DestroyFlashlight( m_nLightHandle );
m_nLightHandle = CLIENTSHADOW_INVALID_HANDLE;
}
#ifndef NO_TOOLFRAMEWORK
if ( clienttools->IsInRecordingMode() ) {
KeyValues *msg = new KeyValues( "FlashlightState" );
msg->SetFloat( "time", gpGlobals->curtime );
msg->SetInt( "entindex", m_iEntIndex );
msg->SetInt( "flashlightHandle", m_nLightHandle );
msg->SetPtr( "flashlightState", NULL );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
#endif
}
示例7: RecordMuzzleFlash
//-----------------------------------------------------------------------------
// Recording
//-----------------------------------------------------------------------------
static inline void RecordMuzzleFlash( const Vector &start, const QAngle &angles, float scale, int type )
{
if ( !ToolsEnabled() )
return;
if ( clienttools->IsInRecordingMode() )
{
KeyValues *msg = new KeyValues( "TempEntity" );
msg->SetInt( "te", TE_MUZZLE_FLASH );
msg->SetString( "name", "TE_MuzzleFlash" );
msg->SetFloat( "time", gpGlobals->curtime );
msg->SetFloat( "originx", start.x );
msg->SetFloat( "originy", start.y );
msg->SetFloat( "originz", start.z );
msg->SetFloat( "anglesx", angles.x );
msg->SetFloat( "anglesy", angles.y );
msg->SetFloat( "anglesz", angles.z );
msg->SetFloat( "scale", scale );
msg->SetInt( "type", type );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
}
示例8: RecordDecal
//-----------------------------------------------------------------------------
// Recording
//-----------------------------------------------------------------------------
static inline void RecordDecal( const Vector &pos, const Vector &start,
int entity, int hitbox, int index )
{
if ( !ToolsEnabled() )
return;
if ( clienttools->IsInRecordingMode() )
{
// FIXME: Can't record on entities yet
if ( entity != 0 )
return;
KeyValues *msg = new KeyValues( "TempEntity" );
msg->SetInt( "te", TE_DECAL );
msg->SetString( "name", "TE_Decal" );
msg->SetFloat( "time", gpGlobals->curtime );
msg->SetFloat( "originx", pos.x );
msg->SetFloat( "originy", pos.y );
msg->SetFloat( "originz", pos.z );
msg->SetFloat( "startx", start.x );
msg->SetFloat( "starty", start.y );
msg->SetFloat( "startz", start.z );
msg->SetInt( "hitbox", hitbox );
msg->SetString( "decalname", effects->Draw_DecalNameFromIndex( index ) );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
}
示例9: RecordBloodSprite
//-----------------------------------------------------------------------------
// Recording
//-----------------------------------------------------------------------------
static inline void RecordBloodSprite( const Vector &start, const Vector &direction,
int r, int g, int b, int a, int nSprayModelIndex, int nDropModelIndex, int size )
{
if ( !ToolsEnabled() )
return;
if ( clienttools->IsInRecordingMode() )
{
Color clr( r, g, b, a );
const model_t* pSprayModel = (nSprayModelIndex != 0) ? modelinfo->GetModel( nSprayModelIndex ) : NULL;
const model_t* pDropModel = (nDropModelIndex != 0) ? modelinfo->GetModel( nDropModelIndex ) : NULL;
const char *pSprayModelName = pSprayModel ? modelinfo->GetModelName( pSprayModel ) : "";
const char *pDropModelName = pDropModel ? modelinfo->GetModelName( pDropModel ) : "";
KeyValues *msg = new KeyValues( "TempEntity" );
msg->SetInt( "te", TE_BLOOD_SPRITE );
msg->SetString( "name", "TE_BloodSprite" );
msg->SetFloat( "time", gpGlobals->curtime );
msg->SetFloat( "originx", start.x );
msg->SetFloat( "originy", start.y );
msg->SetFloat( "originz", start.z );
msg->SetFloat( "directionx", direction.x );
msg->SetFloat( "directiony", direction.y );
msg->SetFloat( "directionz", direction.z );
msg->SetColor( "color", clr );
msg->SetString( "spraymodel", pSprayModelName );
msg->SetString( "dropmodel", pDropModelName );
msg->SetInt( "size", size );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
}
示例10: RecordPhysicsProp
//-----------------------------------------------------------------------------
// Recording
//-----------------------------------------------------------------------------
static inline void RecordPhysicsProp( const Vector& start, const QAngle &angles,
const Vector& vel, int nModelIndex, int flags, int nSkin, int nEffects )
{
if ( !ToolsEnabled() )
return;
if ( clienttools->IsInRecordingMode() )
{
const model_t* pModel = (nModelIndex != 0) ? modelinfo->GetModel( nModelIndex ) : NULL;
const char *pModelName = pModel ? modelinfo->GetModelName( pModel ) : "";
KeyValues *msg = new KeyValues( "TempEntity" );
msg->SetInt( "te", TE_PHYSICS_PROP );
msg->SetString( "name", "TE_PhysicsProp" );
msg->SetFloat( "time", gpGlobals->curtime );
msg->SetFloat( "originx", start.x );
msg->SetFloat( "originy", start.y );
msg->SetFloat( "originz", start.z );
msg->SetFloat( "anglesx", angles.x );
msg->SetFloat( "anglesy", angles.y );
msg->SetFloat( "anglesz", angles.z );
msg->SetFloat( "velx", vel.x );
msg->SetFloat( "vely", vel.y );
msg->SetFloat( "velz", vel.z );
msg->SetString( "model", pModelName );
msg->SetInt( "breakmodel", flags );
msg->SetInt( "skin", nSkin );
msg->SetInt( "effects", nEffects );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
}
示例11: KeyValues
CRecordEffectOwner::~CRecordEffectOwner()
{
if ( m_bToolsEnabled )
{
KeyValues *msg = new KeyValues( "EffectsOwner" );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
}
示例12: ToolsEnabled
//-----------------------------------------------------------------------------
// Helper class to indicate ownership of effects
//-----------------------------------------------------------------------------
CRecordEffectOwner::CRecordEffectOwner( C_BaseEntity *pEntity, bool bIsViewModel )
{
m_bToolsEnabled = ToolsEnabled() && clienttools->IsInRecordingMode();
if ( m_bToolsEnabled )
{
KeyValues *msg = new KeyValues( "EffectsOwner" );
msg->SetInt( "viewModel", bIsViewModel );
ToolFramework_PostToolMessage( pEntity ? pEntity->GetToolHandle() : HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
}
示例13: AttachToEntity
void CClientTools::OnEntityCreated( CBaseEntity *pEntity )
{
if ( !m_bInRecordingMode )
return;
HTOOLHANDLE h = AttachToEntity( pEntity );
// Send deletion message to tool interface
KeyValues *kv = new KeyValues( "created" );
ToolFramework_PostToolMessage( h, kv );
kv->deleteThis();
}
示例14: VPROF_BUDGET
//-----------------------------------------------------------------------------
// Purpose: Do the headlight
//-----------------------------------------------------------------------------
void CFlashlightEffect::UpdateLight( int nEntIdx, const Vector &vecPos, const Vector &vecForward, const Vector &vecRight,
const Vector &vecUp, float flFov, float flFarZ, float flLinearAtten, bool castsShadows, const char* pTextureName )
{
VPROF_BUDGET( __FUNCTION__, VPROF_BUDGETGROUP_SHADOW_DEPTH_TEXTURING );
m_nEntIndex = nEntIdx;
m_flFov = flFov;
m_flFarZ = flFarZ;
m_flLinearAtten = flLinearAtten;
if ( m_bCastsShadows != castsShadows )
{
// requires recreation of the flashlight
LightOff();
}
m_bCastsShadows = castsShadows;
UpdateFlashlightTexture( pTextureName );
FlashlightState_t state;
if ( UpdateDefaultFlashlightState( state, vecPos, vecForward, vecRight, vecUp, castsShadows ) == false )
{
return;
}
if( m_FlashlightHandle == CLIENTSHADOW_INVALID_HANDLE )
{
m_FlashlightHandle = g_pClientShadowMgr->CreateFlashlight( state );
}
else
{
if( !r_flashlightlockposition.GetBool() )
{
g_pClientShadowMgr->UpdateFlashlightState( m_FlashlightHandle, state );
}
}
g_pClientShadowMgr->UpdateProjectedTexture( m_FlashlightHandle, true );
#ifndef NO_TOOLFRAMEWORK
if ( clienttools->IsInRecordingMode() )
{
KeyValues *msg = new KeyValues( "FlashlightState" );
msg->SetFloat( "time", gpGlobals->curtime );
msg->SetInt( "entindex", m_nEntIndex );
msg->SetInt( "flashlightHandle", m_FlashlightHandle );
msg->SetPtr( "flashlightState", &state );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
#endif
}
示例15: AttachToEntity
void CClientTools::OnEntityCreated( CBaseEntity *pEntity )
{
if ( !ToolsEnabled() )
return;
HTOOLHANDLE h = AttachToEntity( pEntity );
// Send deletion message to tool interface
KeyValues *kv = new KeyValues( "created" );
kv->SetPtr( "esr", ( void* )pEntity );
ToolFramework_PostToolMessage( h, kv );
kv->deleteThis();
}