Пример #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 CFlashUIMCTemplateCreateNode::ProcessEvent( EFlowEvent event,SActivationInfo* pActInfo )
{
	if (event == eFE_Initialize)
	{
		m_TmplDescHelper.UpdateObjectDesc( GetPortString( pActInfo, eI_UIMovieClipTmpl ), pActInfo, true );
		m_ParentDescHelper.UpdateObjectDesc( GetPortString( pActInfo, eI_UIParentMovieClip ), pActInfo, false );

		if (GetParentDesc() && m_TmplDescHelper.GetElement() != m_ParentDescHelper.GetElement())
		{
			UIACTION_WARNING( "FG: Can't attach \"%s\" on parent MC \"%s\" (they must be part of the same UIElement!), referenced at node \"%s\"", GetPortString( pActInfo, eI_UIMovieClipTmpl ).c_str(), GetPortString( pActInfo, eI_UIParentMovieClip ).c_str(), pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ));
			m_ParentDescHelper.Reset();
		}
	}
	else if (event == eFE_Activate)
	{
		if (IsPortActive( pActInfo, eI_UIMovieClipTmpl ))
		{
			m_TmplDescHelper.UpdateObjectDesc( GetPortString( pActInfo, eI_UIMovieClipTmpl ), pActInfo, true );
		}

		IUIElement* pElement = GetElement();
		if (IsPortActive( pActInfo, eI_UIParentMovieClip ))
		{
			m_ParentDescHelper.UpdateObjectDesc( GetPortString( pActInfo, eI_UIParentMovieClip ), pActInfo, false );

			if (GetParentDesc() && m_TmplDescHelper.GetElement() != m_ParentDescHelper.GetElement())
			{
				UIACTION_WARNING( "FG: Can't attach \"%s\" on parent MC \"%s\" (they must be part of the same UIElement!), referenced at node \"%s\"", GetPortString( pActInfo, eI_UIMovieClipTmpl ).c_str(), GetPortString( pActInfo, eI_UIParentMovieClip ).c_str(), pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ));
				m_ParentDescHelper.Reset();
			}
		}


		// if m_pCurrentParen was null we also allow to pass a template name!
		if (GetParentDesc() == NULL)
		{
			if (!m_ParentDescHelper.UpdateTmplDesc( GetPortString( pActInfo, eI_UIParentMovieClip ), pActInfo ))
				return;
		}

		if (GetElement() && IsPortActive(pActInfo, eI_Create))
		{
			const int instanceId = GetPortInt( pActInfo, eI_InstanceID );
			string    name       = GetPortString( pActInfo, eI_NewInstanceName );

			SPerInstanceCall3< const SUIMovieClipDesc*, const SUIMovieClipDesc*, string & > caller;
			if (!caller.Execute(GetElement(), instanceId, functor(*this, &CFlashUIMCTemplateCreateNode::CreateMoviclip), GetTemplateDesc(), GetParentDesc(), name, false))
			{
				UIACTION_WARNING( "FG: UIElement \"%s\" called get CreateMovieClip for multiple instances! (passed instanceId %i), referenced at node \"%s\"", GetElement()->GetName(),instanceId, pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ));
			}

			ActivateOutput( pActInfo, eO_InstanceName, name );
			ActivateOutput( pActInfo, eO_OnCreate, true );
		}
	}

}
Пример #4
0
void CFlashUIMCPosRotScaleBaseNode::ProcessEvent( EFlowEvent event,SActivationInfo* pActInfo )
{
	if (event == eFE_Initialize)
	{
		UpdateObjectDesc( GetPortString( pActInfo, GetInputPort(eI_UIMovieClip)), pActInfo, m_isTemplate );
	}
	else if (event == eFE_Activate)
	{
		if (IsPortActive( pActInfo, GetInputPort(eI_UIMovieClip)))
		{
			UpdateObjectDesc( GetPortString( pActInfo, GetInputPort(eI_UIMovieClip)), pActInfo, m_isTemplate );
		}

		if (IsTemplate() && !UpdateTmplDesc( GetPortString( pActInfo, GetInputPort(eI_TemplateInstanceName)), pActInfo ))
			return;

		if (GetElement())
		{
			const int instanceId = GetPortInt( pActInfo, GetInputPort(eI_InstanceID));
			if (IsPortActive ( pActInfo, GetInputPort(eI_Set)))
			{
				const Vec3 pos   = GetPortVec3( pActInfo, GetInputPort(eI_Pos));
				const Vec3 rot   = GetPortVec3( pActInfo, GetInputPort(eI_Rot));
				const Vec3 scale = GetPortVec3( pActInfo, GetInputPort(eI_Scale));

				SPerInstanceCall3< const Vec3 &, const Vec3 &, const Vec3 & > caller;
				caller.Execute(GetElement(), instanceId, functor(*this, &CFlashUIMCPosRotScaleBaseNode::SetValues), pos, rot, scale);

				ActivateOutput( pActInfo, eO_OnSet, true );
				ActivateOutput( pActInfo, eO_Pos, pos );
				ActivateOutput( pActInfo, eO_Rot, rot );
				ActivateOutput( pActInfo, eO_Scale, scale );
			}
			else if (IsPortActive( pActInfo, GetInputPort(eI_Get)))
			{
				Vec3 pos;
				Vec3 rot;
				Vec3 scale;

				SPerInstanceCall3< Vec3 &, Vec3 &, Vec3 & > caller;
				if (!caller.Execute(GetElement(), instanceId, functor(*this, &CFlashUIMCPosRotScaleBaseNode::GetValues), pos, rot, scale, false))
				{
					UIACTION_WARNING( "FG: UIElement \"%s\" called get PosRotScale for multiple instances! (passed instanceId %i), referenced at node \"%s\"", GetElement()->GetName(),instanceId, pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ));
				}

				ActivateOutput( pActInfo, eO_Pos, pos );
				ActivateOutput( pActInfo, eO_Rot, rot );
				ActivateOutput( pActInfo, eO_Scale, scale );
			}
		}
	}
}
Пример #5
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 );
        }
    }
}