//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CBaseActionScreenFadeStartDialog::Init( void )
{
	LoadControlSettings( "resource\\BaseActionScreenFadeStartDialog.res" );

	BaseClass::Init();

	ScreenFade_t const *f = GetAction()->GetScreenFade();

	float duration = f->duration * (1.0f/(float)(1<<SCREENFADE_FRACBITS));
	float holdTime = f->holdTime * (1.0f/(float)(1<<SCREENFADE_FRACBITS));
	int fadein = f->fadeFlags & FFADE_IN;
	int fadeout = f->fadeFlags & FFADE_OUT;
	int fademodulate = f->fadeFlags & FFADE_MODULATE;
	int fadestayout = f->fadeFlags & FFADE_STAYOUT;
	int fadepurge = f->fadeFlags & FFADE_PURGE;
	int r = f->r;
	int g = f->g;
	int b = f->b;
	int a = f->a;

	m_pDuration->SetText( va( "%.3f", duration ) );
	m_pHoldTime->SetText( va( "%.3f", holdTime ) );
	m_pColor->SetText( va( "%i %i %i %i", r, g, b, a ) );
	m_pFFADE_IN->SetSelected( fadein );
	m_pFFADE_OUT->SetSelected( fadeout );
	m_pFFADE_MODULATE->SetSelected( fademodulate );
	m_pFFADE_STAYOUT->SetSelected( fadestayout );
	m_pFFADE_PURGE->SetSelected( fadepurge );

}
//-----------------------------------------------------------------------------
// Purpose: 
// Output : Returns true if changes were effected
//-----------------------------------------------------------------------------
bool CBaseActionZoomDialog::OnSaveChanges( void )
{
	bool bret = BaseClass::OnSaveChanges();

	char sz[ 512 ];
	m_pFinalFOV->GetText( sz, sizeof( sz ) );
	float f = (float)atof( sz );

	if ( GetAction()->m_flFinalFOV != f )
	{
		bret = true;
		GetAction()->m_flFinalFOV = f;
	}

	m_pOutRate->GetText( sz, sizeof( sz ) );
	f = (float)atof( sz );

	if ( GetAction()->m_flFOVRateOut != f )
	{
		bret = true;
		GetAction()->m_flFOVRateOut = f;
	}

	m_pInRate->GetText( sz, sizeof( sz ) );
	f = (float)atof( sz );

	if ( GetAction()->m_flFOVRateIn != f )
	{
		bret = true;
		GetAction()->m_flFOVRateIn = f;
	}

	m_pHoldTime->GetText( sz, sizeof( sz ) );
	f = (float)atof( sz );

	if ( GetAction()->m_flHoldTime != f )
	{
		bret = true;
		GetAction()->m_flHoldTime = f;
	}

	if ( m_pSpline->IsSelected() != GetAction()->m_bSpline )
	{
		bret = true;
		GetAction()->m_bSpline = m_pSpline->IsSelected();
	}

	if ( m_pStayout->IsSelected() != GetAction()->m_bStayout )
	{
		bret = true;
		GetAction()->m_bStayout = m_pStayout->IsSelected();
	}

	return bret;
}
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CBaseActionZoomDialog::Init( void )
{
	LoadControlSettings( "resource\\BaseActionZoomDialog.res" );

	BaseClass::Init();

	m_pFinalFOV->SetText( va( "%f", GetAction()->m_flFinalFOV ) );
	m_pOutRate->SetText( va( "%f", GetAction()->m_flFOVRateOut ) );
	m_pInRate->SetText( va( "%f", GetAction()->m_flFOVRateIn ) );
	m_pHoldTime->SetText( va( "%f", GetAction()->m_flHoldTime ) );

	m_pSpline->SetSelected( GetAction()->m_bSpline );
	m_pStayout->SetSelected( GetAction()->m_bStayout );
}