void CFlashUIWorldScreenPosNode::ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { if ( event == eFE_Initialize ) { UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo ); } else if ( event == eFE_Activate ) { if ( IsPortActive( pActInfo, eI_UIElement ) ) { UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo ); } if ( IsPortActive( pActInfo, eI_Get ) ) { const int instanceId = GetPortInt(pActInfo, eI_InstanceID); Vec3 worldPos = GetPortVec3(pActInfo, eI_WorldPos); Vec3 offset = GetPortVec3(pActInfo, eI_Offset); const bool scaleMode = GetPortBool(pActInfo, eI_ScaleMode); SPerInstanceCall3< Vec3&, Vec3&, bool > caller; if ( !caller.Execute(GetElement(), instanceId, functor(*this, &CFlashUIWorldScreenPosNode::GetScreenPosFromWorld), worldPos, offset, scaleMode, false) ) { UIACTION_WARNING( "FG: UIElement \"%s\" called get screenpos for multiple instances! (passed instanceId %i), referenced at node \"%s\"", GetPortString(pActInfo, eI_UIElement).c_str(), instanceId, pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ) ); } ActivateOutput( pActInfo, eO_ScreenPos, worldPos); ActivateOutput( pActInfo, eO_Scale, offset.z); ActivateOutput( pActInfo, eO_IsOnScreen, offset.x == 0 && offset.y == 0); offset.z = 0; ActivateOutput( pActInfo, eO_OverScanBorder, offset); ActivateOutput( pActInfo, eO_OnGet, true ); } } }
void CFlashUIAdvanceNode::ProcessEvent( EFlowEvent event,SActivationInfo *pActInfo ) { if ( event == eFE_Initialize ) { UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo ); } else if ( event == eFE_Activate ) { if ( IsPortActive( pActInfo, eI_UIElement ) ) { UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo ); } if ( IsPortActive( pActInfo, eI_Advance ) ) { const float delta = GetPortFloat(pActInfo, eI_Delta); const int instanceId = GetPortInt( pActInfo, eI_InstanceID ); SPerInstanceCall1<float> caller1; caller1.Execute( GetElement(), instanceId, functor(*this, &CFlashUIAdvanceNode::Advance), delta); ActivateOutput( pActInfo, eO_OnAdvance, true ); } } }
void CFlashUIScreenPosNode::ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { if ( event == eFE_Initialize ) { UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo ); } else if ( event == eFE_Activate ) { if ( IsPortActive( pActInfo, eI_UIElement ) ) { UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo ); } if ( IsPortActive( pActInfo, eI_Get ) ) { const int instanceId = GetPortInt(pActInfo, eI_InstanceID); float px = GetPortFloat(pActInfo, eI_PX); float py = GetPortFloat(pActInfo, eI_PY); const bool scaleMode = GetPortBool(pActInfo, eI_ScaleMode); SPerInstanceCall3< float&, float&, bool > caller; if ( !caller.Execute(GetElement(), instanceId, functor(*this, &CFlashUIScreenPosNode::GetScreenPos), px, py, scaleMode, false) ) { UIACTION_WARNING( "FG: UIElement \"%s\" called get screenpos for multiple instances! (passed instanceId %i), referenced at node \"%s\"", GetPortString(pActInfo, eI_UIElement).c_str(), instanceId, pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ) ); } ActivateOutput( pActInfo, eO_OnGet, true ); ActivateOutput(pActInfo, eO_PX, px); ActivateOutput(pActInfo, eO_PY, py); } } }
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { switch (event) { case eFE_Initialize: break; case eFE_Activate: if (IsPortActive(pActInfo, EIP_Enable)) { CActor* pLocalActor = static_cast<CActor*>(g_pGame->GetIGameFramework()->GetClientActor()); if ( pLocalActor != NULL) { PlayerActor::Stumble::StumbleParameters stumbleParameters; stumbleParameters.minDamping = GetPortFloat(pActInfo, EIP_MinDamping); stumbleParameters.maxDamping = GetPortFloat(pActInfo, EIP_MaxDamping); stumbleParameters.periodicTime = GetPortFloat(pActInfo, EIP_PeriodicTime); stumbleParameters.strengthX = GetPortFloat(pActInfo, EIP_StrengthX); stumbleParameters.strengthY = GetPortFloat(pActInfo, EIP_StrengthY); stumbleParameters.randomness = GetPortFloat(pActInfo, EIP_Randomness); pLocalActor->EnableStumbling(&stumbleParameters); } } else if (IsPortActive(pActInfo, EIP_Disable)) { CActor* pLocalActor = static_cast<CActor*>(g_pGame->GetIGameFramework()->GetClientActor()); if ( pLocalActor != NULL) { pLocalActor->DisableStumbling(); } } break; } }
void CFlowNode_ScreenFader::ProcessActivateEvent(SActivationInfo* activationInformation) { if (InputEntityIsLocalPlayer(activationInformation) == false) return; if (IsPortActive(activationInformation, eInputPorts_FadeIn)) { const float fadeInTime = GetPortFloat(activationInformation, eInputPorts_FadeInTime); const Vec3 fadeColor = GetPortVec3(activationInformation, eInputPorts_FadeColor); const string texture = GetPortString(activationInformation, eInputPorts_Texture); const bool useCurrentColor = GetPortBool(activationInformation, eInputPorts_UseCurrentColor); ColorF color; color.Set(fadeColor.x, fadeColor.y, fadeColor.z); m_environment.GetGame().FadeInScreen(texture, color, fadeInTime, useCurrentColor); } else if (IsPortActive(activationInformation, eInputPorts_FadeOut)) { const float fadeOutTime = GetPortFloat(activationInformation, eInputPorts_FadeOutTime); const Vec3 fadeColor = GetPortVec3(activationInformation, eInputPorts_FadeColor); const string texture = GetPortString(activationInformation, eInputPorts_Texture); const bool useCurrentColor = GetPortBool(activationInformation, eInputPorts_UseCurrentColor); ColorF color; color.Set(fadeColor.x, fadeColor.y, fadeColor.z); m_environment.GetGame().FadeOutScreen(texture, color, fadeOutTime, useCurrentColor); } }
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { switch (event) { case eFE_Activate: { CPlayer* pClientPlayer = (CPlayer*)g_pGame->GetIGameFramework()->GetClientActor(); if (pClientPlayer) { if (IsPortActive(pActInfo, INP_ENABLE)) { if (gEnv->IsCutscenePlaying()) pClientPlayer->GetPlayerHealthGameEffect().SetActive( true ); pClientPlayer->GetPlayerHealthGameEffect().ExternalSetEffectIntensity( GetPortFloat( pActInfo, INP_INTENSITY )); pClientPlayer->GetPlayerHealthGameEffect().EnableExternalControl( true ); } if (IsPortActive(pActInfo, INP_INTENSITY)) pClientPlayer->GetPlayerHealthGameEffect().ExternalSetEffectIntensity( GetPortFloat( pActInfo, INP_INTENSITY )); if (IsPortActive(pActInfo, INP_DISABLE)) { pClientPlayer->GetPlayerHealthGameEffect().EnableExternalControl( false ); if (gEnv->IsCutscenePlaying()) pClientPlayer->GetPlayerHealthGameEffect().SetActive( false ); } } break; } } }
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { if (InputEntityIsLocalPlayer( pActInfo )) { switch (event) { case eFE_Initialize: { m_actInfo = *pActInfo; Register(true); } break; case eFE_Activate: { m_actInfo = *pActInfo; if (IsPortActive(pActInfo, EIP_Enable)) { Register(true); } if (IsPortActive(pActInfo, EIP_Disable)) { Register(false); } } break; } } }
virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo) { switch(event) { case eFE_Initialize: m_actInfo = *pActInfo; CMiniMapInfo::GetInstance()->UpdateLevelInfo(); m_entityId = GetEntityId(pActInfo); break; case eFE_Activate: if(IsPortActive(pActInfo, eI_Trigger)) TriggerPorts(pActInfo); if(IsPortActive(pActInfo, eI_Disable)) UnRegisterEntity(); if(IsPortActive(pActInfo, eI_Enable)) { UnRegisterEntity(); m_entityId = GetEntityId(pActInfo); RegisterEntity(); } break; } }
virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo) { CPersistantStats* pStats = g_pGame->GetPersistantStats(); CRY_ASSERT(pStats != NULL); if (!pStats) return; switch (event) { case eFE_Activate: { bool saveProfile = false; if (IsPortActive(pActInfo, EIP_FlagTutorialAsPlayed)) { int val = pStats->GetStat( EIPS_TutorialAlreadyPlayed ); pStats->SetClientStat( EIPS_TutorialAlreadyPlayed, val + 1 ); saveProfile = true; } if (IsPortActive(pActInfo, EIP_FlagTutorialAsNOTPlayed)) { pStats->SetClientStat( EIPS_TutorialAlreadyPlayed, 0 ); saveProfile = true; } if (IsPortActive(pActInfo, EIP_GetFlagState)) { int val = pStats->GetStat( EIPS_TutorialAlreadyPlayed ); ActivateOutput( pActInfo, OUT_HasBeenPlayed, val!=0 ); } if (saveProfile) g_pGame->GetProfileOptions()->SaveProfile(ePR_All); } break; } }
void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { switch (event) { case eFE_Initialize: { m_active = false; m_actInfo = *pActInfo; // Keep a copy of the activation info to be able to use the output ports #if CRY_PLATFORM_DURANGO // Register listener if (gEnv->pSystem->GetIInput()->GetKinectInput()) { gEnv->pSystem->GetIInput()->GetKinectInput()->RegisterKinectAudioListener(this,"CSpeechRecognitionListenerNode"); } #endif } break; case eFE_Activate: { if(IsPortActive(pActInfo,eI_Enable)) { m_active = true; } if(IsPortActive(pActInfo,eI_Disable)) { m_active = false; } } break; } }
void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { switch (event) { case eFE_Activate: if (IsPortActive(pActInfo,eIP_Get)) { Vec3 v; gEnv->p3DEngine->GetGlobalParameter(E3DPARAM_SKY_MOONROTATION, v); ActivateOutput(pActInfo, eOP_Latitude, v.x); ActivateOutput(pActInfo, eOP_Longitude, v.y); } if (IsPortActive(pActInfo, eIP_Set)) { Vec3 v(ZERO); v.x = GetPortFloat(pActInfo, eIP_Latitude); v.y = GetPortFloat(pActInfo, eIP_Longitude); gEnv->p3DEngine->SetGlobalParameter(E3DPARAM_SKY_MOONROTATION, v); ActivateOutput(pActInfo, eOP_Latitude, v.x); ActivateOutput(pActInfo, eOP_Longitude, v.y); bool forceUpdate = GetPortBool( pActInfo, eIP_ForceUpdate ); ITimeOfDay* pTOD = gEnv->p3DEngine->GetTimeOfDay(); if (forceUpdate && pTOD ) pTOD->Update( true, true ); } } }
virtual void ProcessEvent( EFlowEvent event, SActivationInfo * pActInfo ) { switch (event) { case eFE_Initialize: if (gEnv->IsEditor()) m_bTriggered = false; break; case eFE_Activate: if (m_bTriggered == false) { for (int i=0; i<6; i++) { if (IsPortActive(pActInfo, i)) { ActivateOutput(pActInfo, 0, GetPortAny(pActInfo, i)); m_bTriggered = true; break; } } } if (IsPortActive(pActInfo, 6)) m_bTriggered = false; break; } }
void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { if (event == eFE_Activate || event == eFE_Initialize) { if (IsPortActive(pActInfo, INP_ACTIVE)) { bool active = GetPortBool(pActInfo, 0); if (active) m_pGF->GetIItemSystem()->RegisterListener(this); else m_pGF->GetIItemSystem()->UnregisterListener(this); } if (IsPortActive(pActInfo, INP_CHECK)) { IActor* pActor = GetInputActor( pActInfo ); if (pActor) { IInventory* pInventory = pActor->GetInventory(); if (pInventory) { IEntity* pEntityItem = gEnv->pEntitySystem->GetEntity( pInventory->GetCurrentItem() ); TriggerOutputs( pActInfo, pEntityItem ); } } } } }
virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo) { switch (event) { case eFE_Activate: { IEntity* pEntity = pActInfo->pEntity; if(!pEntity) return; m_delayResult = GetPortBool(pActInfo, EIP_DelayResult); if(IsPortActive(pActInfo, EIP_Enable)) { m_actInfo = *pActInfo; m_entityId = pEntity->GetId(); SetEnabled(true); } else if(IsPortActive(pActInfo, EIP_Disable)) { SetEnabled(false); } break; } } }
virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo) { switch (event) { case eFE_Activate: { if(IsPortActive(pActInfo, EIP_FailCurrentScan)) { SHUDEvent _event(eHUDEvent_OnControlCurrentTacticalScan); _event.AddData(SHUDEventData(false)); // Delay result _event.AddData(SHUDEventData(false)); CHUDEventDispatcher::CallEvent(_event); ActivateOutput(pActInfo, EOP_Failed, true); } else if(IsPortActive(pActInfo, EIP_SucceedCurrentScan)) { SHUDEvent _event(eHUDEvent_OnControlCurrentTacticalScan); _event.AddData(SHUDEventData(false)); // Delay result _event.AddData(SHUDEventData(true)); CHUDEventDispatcher::CallEvent(_event); ActivateOutput(pActInfo, EOP_Succeeded, true); } break; } } }
virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo) { switch(event) { case eFE_Activate: CGameRules *pGR = g_pGame->GetGameRules(); if(!pGR) return; if(!pActInfo->pEntity) return; const bool bUseVapor = GetPortBool(pActInfo, EIP_Vapor); if(IsPortActive(pActInfo, EIP_Freeze)) { pGR->FreezeEntity(pActInfo->pEntity->GetId(), true, bUseVapor, true); ActivateOutput(pActInfo, EOP_Frozen, true); } else if(IsPortActive(pActInfo, EIP_UnFreeze)) { pGR->FreezeEntity(pActInfo->pEntity->GetId(), false, bUseVapor); ActivateOutput(pActInfo, EOP_UnFrozen, true); } break; } }
void CFlashUIMCTemplateRemoveNode::ProcessEvent( EFlowEvent event,SActivationInfo* pActInfo ) { if (event == eFE_Initialize) { UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo ); } else if (event == eFE_Activate) { if (IsPortActive( pActInfo, eI_UIElement )) { UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo ); } if (!UpdateTmplDesc( GetPortString( pActInfo, eI_TemplateInstanceName ), pActInfo )) return; if (GetElement() && IsPortActive(pActInfo, eI_Remove)) { const int instanceId = GetPortInt( pActInfo, eI_InstanceID ); SPerInstanceCall1< const SUIMovieClipDesc* > caller; caller.Execute(GetElement(), instanceId, functor(*this, &CFlashUIMCTemplateRemoveNode::RemoveMoviclip), GetTmplDesc(true), false); ActivateOutput( pActInfo, eO_OnRemove, true ); } } }
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { switch (event) { case eFE_Activate: { IEntity* pEntity = pActInfo->pEntity; if (pEntity != 0) { ENanoMode nanoMode = NANOMODE_LAST; if (IsPortActive(pActInfo, EIP_Cloak)) nanoMode = NANOMODE_CLOAK; else if (IsPortActive(pActInfo, EIP_Speed)) nanoMode = NANOMODE_SPEED; else if (IsPortActive(pActInfo, EIP_Strength)) nanoMode = NANOMODE_STRENGTH; else if (IsPortActive(pActInfo, EIP_Defense)) nanoMode = NANOMODE_DEFENSE; if (nanoMode != NANOMODE_LAST) { const bool bAsian = GetPortBool(pActInfo, EIP_Asian); CNanoSuit::SNanoMaterial* pNanoMat = CNanoSuit::GetNanoMaterial(nanoMode, bAsian); if (pNanoMat) { CNanoSuit::AssignNanoMaterialToEntity(pEntity, pNanoMat); ActivateOutput(pActInfo, EOP_Done, true); } } } } break; } }
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { switch (event) { case eFE_Activate: { if (pActInfo->pEntity == 0) return; CPlayer* pPlayer = GetPlayer(pActInfo->pEntity->GetId()); if (pPlayer == 0) return; int8 newState = -1; if(IsPortActive(pActInfo, EIP_Open)) newState = 2; else if(IsPortActive(pActInfo, EIP_Close)) newState = 1; else if(IsPortActive(pActInfo, EIP_Remove)) { newState = 0; pPlayer->EnableParachute(false); } if (newState != -1) pPlayer->ChangeParachuteState(newState); if (IsPortActive(pActInfo, EIP_FreeFall)) pPlayer->ForceFreeFall(); } break; } }
//------------------------------------------------------------------------ void CFlowVehicleAttachment::ProcessEvent(EFlowEvent flowEvent, SActivationInfo* pActivationInfo) { CFlowVehicleBase::ProcessEvent(flowEvent, pActivationInfo); if (!GetVehicle()) return; switch (flowEvent) { case eFE_Initialize: { if (m_attachedId) { Attach(pActivationInfo, false); } break; } case eFE_Activate: { if ( IsPortActive(pActivationInfo, IN_DETACH) ) { Attach(pActivationInfo, false); } else if ( IsPortActive(pActivationInfo, IN_ATTACH) ) { Attach(pActivationInfo, true); } break; } } }
void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { switch (event) { case eFE_Activate: if (IsPortActive(pActInfo,eIP_Get)) { ITimeOfDay* pTOD = gEnv->p3DEngine->GetTimeOfDay(); if (pTOD) { ActivateOutput(pActInfo, eOP_Latitude, pTOD->GetSunLatitude()); ActivateOutput(pActInfo, eOP_Longitude, pTOD->GetSunLongitude()); } } if (IsPortActive(pActInfo, eIP_Set)) { ITimeOfDay* pTOD = gEnv->p3DEngine->GetTimeOfDay(); if (pTOD) { float latitude = GetPortFloat(pActInfo, eIP_Latitude); float longitude = GetPortFloat(pActInfo, eIP_Longitude); pTOD->SetSunPos( longitude, latitude ); bool forceUpdate = GetPortBool( pActInfo, eIP_ForceUpdate ); pTOD->Update(true, forceUpdate); ActivateOutput(pActInfo, eOP_Latitude, latitude); ActivateOutput(pActInfo, eOP_Longitude, longitude); } } break; } }
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { switch (event) { case eFE_Initialize: { UpdateListenerStatus( pActInfo ); m_actInfo = *pActInfo; ReadFactionFromInp( pActInfo ); break; } case eFE_Activate: { if (IsPortActive( pActInfo, IN_FACTION )) ReadFactionFromInp( pActInfo ); if (IsPortActive(pActInfo, IN_ENABLED)) { UpdateListenerStatus( pActInfo ); // this will automatically cause an AlertnessChanged() call from the AiCounters, so we dont need to manually update in this case } if (IsPortActive(pActInfo, IN_CHECK)) { UpdateOutputs( g_pGame->GetGameAISystem()->GetAICounters().GetAlertnessCounter().GetAlertnessGlobal() ); } break; } } }
void CFlashUIElementInstanceNode::ProcessEvent( EFlowEvent event,SActivationInfo* pActInfo ) { switch (event) { case eFE_Initialize: pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true); m_events.clear(); m_events.init( pActInfo->pGraph ); if (GetElement()) GetElement()->RemoveEventListener(this); UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo ); if (GetElement()) GetElement()->AddEventListener(this, "CFlashUIElementInstanceNode"); break; case eFE_Activate: if (IsPortActive( pActInfo, eI_InstanceID ) || IsPortActive( pActInfo, eI_UIElement )) { if (GetElement()) GetElement()->RemoveEventListener(this); UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo ); if (GetElement()) GetElement()->AddEventListener(this, "CFlashUIElementInstanceNode"); } if (IsPortActive( pActInfo, eI_DestroyInstance )) { const int instanceId = GetPortInt(pActInfo, eI_InstanceID); SPerInstanceCall0 caller; caller.Execute(GetElement(), instanceId, functor(*this, &CFlashUIElementInstanceNode::DestroyInstance)); } break; case eFE_Update: FlushNextEvent(pActInfo); break; } }
virtual void ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo) { switch (event) { case eFE_Activate: { if (IsPortActive(pActInfo, eIP_Load) || IsPortActive(pActInfo, eIP_Save)) { IPlayerProfile* pProfile = NULL; if (IPlayerProfileManager* pProfileMan = gEnv->pGame->GetIGameFramework()->GetIPlayerProfileManager()) { const char* user = pProfileMan->GetCurrentUser(); pProfile = pProfileMan->GetCurrentProfile(user); if (!pProfile) break; if (IsPortActive(pActInfo, eIP_Save)) { pProfileMan->SaveOnlineAttributes(pProfile); } else { pProfileMan->LoadOnlineAttributes(pProfile); } ActivateOutput(pActInfo, eOP_Done, 1); } } } break; } }
void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { if(eFE_Activate == event) { const bool bAttach = IsPortActive(pActInfo, EIP_ATTACH); const bool bDetach = IsPortActive(pActInfo, EIP_DETACH); if (!bAttach && !bDetach) return; IActor* pActor = GetActor(pActInfo); if (pActor == 0) return; const string& className = GetPortString(pActInfo, EIP_WEAPON); CWeapon* pWeapon = static_cast<CWeapon*> ( className.empty() ? GetWeapon(pActor) : GetWeapon(pActor, className.c_str()) ); if (pWeapon != 0) { ItemString acc = ItemString(GetPortString(pActInfo, EIP_ACCESSORY)); if (bAttach && pWeapon->GetAccessory(acc) == 0) { pWeapon->SwitchAccessory(acc); ActivateOutput(pActInfo, EOP_ATTACHED, true); } else if (bDetach && pWeapon->GetAccessory(acc) != 0) { pWeapon->SwitchAccessory(acc); ActivateOutput(pActInfo, EOP_DETACHED, true); } } } }
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { m_actInfo = *pActInfo; switch(event) { case eFE_Initialize: { m_bOutputScreenCoords = GetPortBool(pActInfo, EIP_Screen); m_bOutputWorldCoords = GetPortBool(pActInfo, EIP_World); m_bOutputDeltaCoords = GetPortBool(pActInfo, EIP_DeltaScreen); break; } case eFE_Activate: { if(IsPortActive(pActInfo, EIP_Enable)) { if (gEnv->pHardwareMouse) gEnv->pHardwareMouse->AddListener(this); if (GetISystem() && GetISystem()->GetIInput()) GetISystem()->GetIInput()->AddEventListener(this); m_bOutputScreenCoords = GetPortBool(pActInfo, EIP_Screen); m_bOutputWorldCoords = GetPortBool(pActInfo, EIP_World); m_bOutputDeltaCoords = GetPortBool(pActInfo, EIP_DeltaScreen); m_enabled = true; } if(IsPortActive(pActInfo, EIP_Disable)) { if (gEnv->pHardwareMouse) gEnv->pHardwareMouse->RemoveListener(this); if (GetISystem() && GetISystem()->GetIInput()) GetISystem()->GetIInput()->RemoveEventListener(this); m_enabled = false; } if(IsPortActive(pActInfo, EIP_World)) { m_bOutputWorldCoords = GetPortBool(pActInfo, EIP_World); } if(IsPortActive(pActInfo, EIP_Screen)) { m_bOutputScreenCoords = GetPortBool(pActInfo, EIP_Screen); } if(IsPortActive(pActInfo, EIP_DeltaScreen)) { m_bOutputDeltaCoords = GetPortBool(pActInfo, EIP_DeltaScreen); } break; } } }
VIRTUAL void ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo) { switch (event) { case eFE_Initialize: { Init(pActInfo); break; } case eFE_Activate: { if (IsPortActive(pActInfo, eIn_RtpcValue)) { SetValue(pActInfo->pEntity, GetPortFloat(pActInfo, eIn_RtpcValue)); } if (IsPortActive(pActInfo, eIn_RtpcName)) { GetRtpcID(pActInfo); } break; } } }
void CFlowNode_WatchCodeCheckpoint::ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo) { switch(event) { case eFE_Initialize: { m_actInfo = *pActInfo; RemoveAsWatcher(); // Reset state m_checkPointIdx = ~0; m_pCheckPoint = NULL; } break; case eFE_Activate: { if(IsPortActive(pActInfo,eInputPorts_StartWatching)) { StartWatching(pActInfo); } else if(IsPortActive(pActInfo,eInputPorts_StopWatching)) { StopWatching(pActInfo); } } break; } }
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { switch (event) { case eFE_Activate: const int nDrawPlayer = GetPortInt(pActInfo, EIP_DrawPlayer); if (IsPortActive(pActInfo, EIP_Link)) { IEntity* pEntity = gEnv->pEntitySystem->GetEntity(GetPortEntityId(pActInfo, EIP_Target)); if (pEntity) { CActor *pPlayerActor = static_cast<CActor*>(gEnv->pGame->GetIGameFramework()->GetClientActor()); if (pPlayerActor) { SActorStats* pActorStats = pPlayerActor->GetActorStats(); if (pActorStats) { if (nDrawPlayer == -1) pActorStats->isHidden = true; else if (nDrawPlayer == 1) pActorStats->isHidden = false; } m_Position = pEntity->GetWorldPos(); m_Rotation = pEntity->GetWorldRotation(); pPlayerActor->LinkToEntity(pEntity->GetId()); ActivateOutput(pActInfo, EOP_Linked, true); } } } if (IsPortActive(pActInfo, EIP_Unlink)) { CActor *pPlayerActor = static_cast<CActor*>(gEnv->pGame->GetIGameFramework()->GetClientActor()); if (pPlayerActor) { SActorStats* pActorStats = pPlayerActor->GetActorStats(); if (pActorStats) { if (nDrawPlayer == -1) pActorStats->isHidden = true; else if (nDrawPlayer == 1) pActorStats->isHidden = false; } bool keepTransform = GetPortBool(pActInfo, EIP_KeepTransform); pPlayerActor->LinkToEntity(0, keepTransform); if(!keepTransform) { pPlayerActor->GetEntity()->SetPos(m_Position); pPlayerActor->GetEntity()->SetRotation(m_Rotation); } ActivateOutput(pActInfo, EOP_Unlinked, true); } } break; } }
void CFlowNode_SimulateInput::ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo) { if(event == eFE_Activate) { bool isPressPort = IsPortActive(pActInfo, eInputPorts_Press); bool isReleasePort = IsPortActive(pActInfo, eInputPorts_Release); bool isHoldPort = IsPortActive(pActInfo, eInputPorts_Hold); bool triggerResponse = false; int playerInputEvent; int nodeOutput; if(isPressPort) { triggerResponse = true; playerInputEvent = eAAM_OnPress; nodeOutput = eOutputPort_Pressed; } else if(isHoldPort) { triggerResponse = true; playerInputEvent = eAAM_OnHold; nodeOutput = eOutputPort_Held; } else if(isReleasePort) { triggerResponse = true; playerInputEvent = eAAM_OnRelease; nodeOutput = eOutputPort_Released; } if(triggerResponse) { CActor *pClientActor = static_cast<CActor *>(g_pGame->GetIGameFramework()->GetClientActor()); if(pClientActor) { if(pClientActor->GetActorClass() == CPlayer::GetActorClassType()) { CPlayer *pClientPlayer = static_cast<CPlayer *>(pClientActor); const char *action = GetPortString(pActInfo, eInputPorts_Action).c_str(); const float inputValue = GetPortFloat(pActInfo, eInputPorts_Value); IPlayerInput *pPlayerInput = pClientPlayer->GetPlayerInput(); if(pPlayerInput) { CODECHECKPOINT(SimulateInput_ProcessEvent_SendAction); pPlayerInput->OnAction(action, playerInputEvent, isPressPort ? clamp(inputValue, 0.0f, 1.0f) : 0.0f); } } } ActivateOutput(pActInfo, nodeOutput, true); } } }