コード例 #1
0
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 );
        }
    }
}
コード例 #2
0
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);
        }
    }
}
コード例 #3
0
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 );
        }
    }
}
コード例 #4
0
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 );
		}
	}

}
コード例 #5
0
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;
	}
}
コード例 #6
0
void CFlashUIConstraintsNode::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 );
        }

        const int instanceId = GetPortInt( pActInfo, eI_InstanceID );
        if ( IsPortActive( pActInfo, eI_Get ) )
        {
            IUIElement::SUIConstraints constraints;
            SPerInstanceCall1< IUIElement::SUIConstraints& > caller;
            if ( !caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIConstraintsNode::GetConstraints), constraints, false) )
            {
                UIACTION_WARNING( "FG: UIElement \"%s\" can't get Constraints 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_PosType, (int) constraints.eType );
            ActivateOutput( pActInfo, eO_Left, constraints.iLeft );
            ActivateOutput( pActInfo, eO_Top, constraints.iTop );
            ActivateOutput( pActInfo, eO_Width, constraints.iWidth );
            ActivateOutput( pActInfo, eO_Height, constraints.iHeight );
            ActivateOutput( pActInfo, eO_Scale, constraints.bScale );
            ActivateOutput( pActInfo, eO_HAlign, (int) constraints.eHAlign );
            ActivateOutput( pActInfo, eO_VAlign, (int) constraints.eVAlign );
            ActivateOutput( pActInfo, eO_Maximize, constraints.bMax );
            ActivateOutput( pActInfo, eO_OnGet, true );
        }

        if ( IsPortActive( pActInfo, eI_Set ) )
        {
            IUIElement::SUIConstraints constraints;
            constraints.eType = (IUIElement::SUIConstraints::EPositionType) GetPortInt( pActInfo, eI_PosType );
            constraints.iLeft = GetPortInt( pActInfo, eI_Left );
            constraints.iTop = GetPortInt( pActInfo, eI_Top );
            constraints.iWidth = GetPortInt( pActInfo, eI_Width );
            constraints.iHeight = GetPortInt( pActInfo, eI_Height );
            constraints.eHAlign = (IUIElement::SUIConstraints::EPositionAlign) GetPortInt( pActInfo, eI_HAlign );
            constraints.eVAlign = (IUIElement::SUIConstraints::EPositionAlign) GetPortInt( pActInfo, eI_VAlign );
            constraints.bScale = GetPortBool( pActInfo, eI_Scale );
            constraints.bMax = GetPortBool( pActInfo, eI_Maximize );

            SPerInstanceCall1< const IUIElement::SUIConstraints& > caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIConstraintsNode::SetConstraints), constraints);

            ActivateOutput( pActInfo, eO_OnSet, true );
        }
    }
}
コード例 #7
0
void CFlashUILayerNode::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 );
        }

        const int instanceId =  GetPortInt( pActInfo, eI_InstanceID );

        if ( IsPortActive( pActInfo, eI_Get ) )
        {
            int layer = 0;

            SPerInstanceCall1< int& > caller;
            if ( !caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUILayerNode::GetLayer), layer, false) )
            {
                UIACTION_WARNING( "FG: UIElement \"%s\" called get layer 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_Layer, layer );
            ActivateOutput( pActInfo, eO_OnGet, true );
        }

        if ( IsPortActive( pActInfo, eI_Set ) )
        {
            const int layer = GetPortInt( pActInfo, eI_Layer );

            SPerInstanceCall1< int > caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUILayerNode::SetLayer), layer );

            ActivateOutput( pActInfo, eO_OnSet, true );
        }
    }
}
コード例 #8
0
void CFlashUIDisplayConfigNode::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 );
        }

        const int instanceId =  GetPortInt( pActInfo, eI_InstanceID );

        if ( IsPortActive( pActInfo, eI_Get ) )
        {
            SPerInstanceCall1< SActivationInfo* > caller;
            if ( !caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayConfigNode::GetFromInstance), pActInfo, false) )
            {
                UIACTION_WARNING( "FG: UIElement \"%s\" called get flags 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 );
        }

        if ( IsPortActive( pActInfo, eI_Set ) )
        {
            const float alpha = GetPortFloat( pActInfo, eI_Alpha );
            const int layer = GetPortInt( pActInfo, eI_Layer );
            const uint64 flags = GetFlags( pActInfo );

            SPerInstanceCall3< uint64, float, int > caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayConfigNode::SetToInstance), flags, alpha, layer );
            ActivateOutput( pActInfo, eO_OnSet, true );
        }
    }
}
コード例 #9
0
void CFlashUIElementListenerNode::ProcessEvent( EFlowEvent event,SActivationInfo* pActInfo )
{
	switch (event)
	{
	case eFE_Initialize:
	{
		pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true);
		m_events.clear();
		m_events.init( pActInfo->pGraph );
		ClearListener();
		UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
		m_iCurrInstanceId = GetPortInt(pActInfo, eI_InstanceID);
		if (m_iCurrInstanceId < -1)
			m_iCurrInstanceId = -1;

		SPerInstanceCall0 caller;
		caller.Execute(GetElement(), m_iCurrInstanceId, functor(*this, &CFlashUIElementListenerNode::RegisterAsListener));
	}
	break;
	case eFE_Activate:
		if (IsPortActive( pActInfo, eI_InstanceID ) || IsPortActive( pActInfo, eI_UIElement ))
		{
			ClearListener();
			UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
			m_iCurrInstanceId = GetPortInt(pActInfo, eI_InstanceID);
			if (m_iCurrInstanceId < -1)
				m_iCurrInstanceId = -1;

			SPerInstanceCall0 caller;
			caller.Execute(GetElement(), m_iCurrInstanceId, functor(*this, &CFlashUIElementListenerNode::RegisterAsListener));
		}
		break;
	case eFE_Update:
		FlushNextEvent(pActInfo);
		break;
	}
}
コード例 #10
0
void CFlashUIDisplayNode::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 );
        }

        const int instanceId = GetPortInt( pActInfo, eI_InstanceID );

        if ( IsPortActive( pActInfo, eI_Show ) )
        {
            SPerInstanceCall1< bool > caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayNode::SetVisible), true);
            ActivateOutput( pActInfo, eO_OnShow, true );
        }

        if ( IsPortActive( pActInfo, eI_Hide ) )
        {
            SPerInstanceCall1< bool > caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayNode::SetVisible), false);
            ActivateOutput( pActInfo, eO_OnHide, true );
        }

        if ( IsPortActive( pActInfo, eI_Unload ) )
        {
            SPerInstanceCall0 caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayNode::Unload));
            ActivateOutput( pActInfo, eO_OnUnload, true );
        }

        if ( IsPortActive( pActInfo, eI_RequestHide ) )
        {
            SPerInstanceCall0 caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayNode::RequestHide));
            ActivateOutput( pActInfo, eO_OnRequestHide, true );
        }

        if ( IsPortActive( pActInfo, eI_Init ) )
        {
            SPerInstanceCall0 caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayNode::Init));
            ActivateOutput( pActInfo, eO_OnInit, true );
        }

        if ( IsPortActive( pActInfo, eI_Reload ) )
        {
            SPerInstanceCall0 caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayNode::Reload));
            ActivateOutput( pActInfo, eO_OnReload, true );
        }

        if ( IsPortActive( pActInfo, eI_UnloadBootstrapper ) )
        {
            if (GetElement()) GetElement()->UnloadBootStrapper();
            ActivateOutput( pActInfo, eO_OnUnloadBootstrapper, true );
        }

        if ( IsPortActive( pActInfo, eI_ReloadBootstrapper ) )
        {
            if (GetElement()) GetElement()->ReloadBootStrapper();
            ActivateOutput( pActInfo, eO_OnReloadBootstrapper, true );
        }
    }
}