void CCollectedAchievements::Enter()
{
	CBaseMenuState::Enter();
	SetBGImageID(GetAssets()->aAchievementBGID);
	SetBGHeight(GetTM()->GetTextureHeight(GetAssets()->aAchievementBGID));
	SetBGWidth(GetTM()->GetTextureWidth(GetAssets()->aAchievementBGID));
	//CenterBGImage();
	GetFMOD()->PlaySound(GetAssets()->aMinimalKesoID);
	GetFMOD()->SetVolume(GetAssets()->aMinimalKesoID  , GetGame()->GetMusicVolume());

}
//-------------------------------------------------------------------------------------------------
void BachAssetListView::dropEvent( QDropEvent * event )
{
	if ( !mShowingCollection || !bach_editor_mode )
		return;

	DEBG( "dropEvent 1!" );
    if ( event->source() == this &&
    	 mCurrentDropTarget.isValid() &&
    	 mCurrentCollection.isValid() )
    {
    	DEBG( "dropEvent 2.2!" );

    	if ( !RecordDrag::canDecode( event->mimeData() ) )
    		return;

    	BachAssetList bal;
    	GetAssets( mCurrentCollection, mShowExcluded, bal );


    	RecordList dropped;
    	RecordDrag::decode( event->mimeData(), &dropped );

    	BachAssetIter it = bal.begin();

    	// first, do all the items UP to the item into which it should be inserted before
    	int position = 0;
    	for( ; it != bal.end() ; ++it )
    	{
    		BachAsset ba = (*it);

    		if ( mCurrentDropTarget == ba )
    			break;

    		if ( dropped.contains( ba ) )
    			continue;

    		BachBucketMap bbm = BachBucketMap::recordByBucketAndAsset( mCurrentCollection, ba );
    		DEBG( "Position1:"+QString::number(position)+":"+ba.path() );

    		bbm.setPosition( position );
    		bbm.commit();

    		++position;
    	}

    	// then do all the dropped ones
    	for ( RecordIter it = dropped.begin() ; it != dropped.end() ; ++it )
    	{
    		BachAsset ba = *it;
    		// find the map used
    		BachBucketMap bbm = BachBucketMap::recordByBucketAndAsset( mCurrentCollection, ba );

    		DEBG( "Position2:"+QString::number(position)+":"+bbm.bachAsset().path() );

    		bbm.setPosition( position );
    		bbm.commit();

    		++position;
    	}

    	// then do all the ones past the end
    	for( ; it != bal.end() ; ++it )
    	{
    		BachAsset ba = (*it);

    		if ( dropped.contains( ba ) )
    			continue;

    		BachBucketMap bbm = BachBucketMap::recordByBucketAndAsset( mCurrentCollection, ba );
    		DEBG( "Position3:"+QString::number(position)+":"+ba.path() );

    		bbm.setPosition( position );
    		bbm.commit();

    		++position;
    	}

    	BachAssetList bal1;
    	GetAssets( mCurrentCollection, mShowExcluded, bal1 );

    	model()->updateRecords( BachAssetList() );
    	model()->append( bal1 );
        event->acceptProposedAction();
    }
}
void CCollectedAchievements::Render()
{
	//draw each of the achievements 
	//write description next to each
	GetTM()->DrawWithZSort(GetAssets()->aAchievementBGID, 0,0,0.1f, 0.8f,0.8f, NULL, 0.0f, 0.0f, 0.0f, D3DCOLOR_XRGB(80,80,80));
	GetTM()->Draw(GetAssets()->aAvenged, 10,0, 0.8f,0.8f, &m_rRect, 0.0f,0.0f,0.0f, D3DCOLOR_ARGB(m_nAlpha[7], 255,255,255));
	GetBitmapFont()->DrawString("KILLED THE SHREDDER", 390, 10,0.05f, 0.6f,D3DCOLOR_ARGB(255,0,255,0));
	GetBitmapFont()->DrawString("KILLED THE SHREDDER", 392, 12,0.051f, 0.6f,D3DCOLOR_ARGB(255,255,0,0));
	GetTM()->Draw(GetAssets()->aBreakGame, 10,70, 0.8f,0.8f, &m_rRect, 0.0f,0.0f,0.0f, D3DCOLOR_ARGB(m_nAlpha[3], 255,255,255));
	GetBitmapFont()->DrawString("ALL ACHIEVEMENTS UNLOCKED", 390, 80, 0.05f, 0.6f,D3DCOLOR_ARGB(255,0,255,0));
	GetBitmapFont()->DrawString("ALL ACHIEVEMENTS UNLOCKED", 392, 82, 0.051f, 0.6f,D3DCOLOR_ARGB(255,255,0,0));
	GetTM()->Draw(GetAssets()->aCowabunga, 10,150, 0.8f,0.8f, &m_rRect, 0.0f,0.0f,0.0f, D3DCOLOR_ARGB(m_nAlpha[1], 255,255,255));
	GetBitmapFont()->DrawString("LEVEL UP", 390, 160,0.05f, 0.6f,D3DCOLOR_ARGB(255,0,255,0));
	GetBitmapFont()->DrawString("LEVEL UP", 392, 162,0.051f, 0.6f,D3DCOLOR_ARGB(255,255,0,0));
	GetTM()->Draw(GetAssets()->aFlipNow, 10,230, 0.8f,0.8f, &m_rRect, 0.0f,0.0f,0.0f, D3DCOLOR_ARGB(m_nAlpha[2], 255,255,255));
	GetBitmapFont()->DrawString("ALL TURTLES DEAD", 390, 240,0.05f, 0.6f,D3DCOLOR_ARGB(255,0,255,0));
	GetBitmapFont()->DrawString("ALL TURTLES DEAD", 392, 242,0.051f, 0.6f,D3DCOLOR_ARGB(255,255,0,0));
	GetTM()->Draw(GetAssets()->aLessonInPain, 10,310, 0.8f,0.8f, &m_rRect, 0.0f,0.0f,0.0f, D3DCOLOR_ARGB(m_nAlpha[5], 255,255,255));
	GetBitmapFont()->DrawString("KILL 30 ENEMIES", 390, 320,0.05f, 0.6f,D3DCOLOR_ARGB(255,0,255,0));
	GetBitmapFont()->DrawString("KILL 30 ENEMIES", 392, 322,0.051f, 0.6f,D3DCOLOR_ARGB(255,255,0,0));
	GetTM()->Draw(GetAssets()->aMegaKill, 10,390, 0.8f,0.8f, &m_rRect, 0.0f,0.0f,0.0f, D3DCOLOR_ARGB(m_nAlpha[6], 255,255,255));
	GetBitmapFont()->DrawString("1 TURTLE KILLS 3 NINJAS", 400, 390,0.05f, 0.6f,D3DCOLOR_ARGB(255,0,255,0));
	GetBitmapFont()->DrawString("1 TURTLE KILLS 3 NINJAS", 402, 392,0.051f, 0.6f,D3DCOLOR_ARGB(255,255,0,0));
	GetTM()->Draw(GetAssets()->aPartyTime, 10,470, 0.8f,0.8f, &m_rRect, 0.0f,0.0f,0.0f, D3DCOLOR_ARGB(m_nAlpha[0], 255,255,255));
	GetBitmapFont()->DrawString("START NEW GAME", 390, 480,0.05f, 0.6f,D3DCOLOR_ARGB(255,0,255,0));
	GetBitmapFont()->DrawString("START NEW GAME", 392, 482,0.051f, 0.6f,D3DCOLOR_ARGB(255,255,0,0));
	GetTM()->Draw(GetAssets()->aQuickFingers, 10,550, 0.8f,0.8f, &m_rRect, 0.0f,0.0f,0.0f, D3DCOLOR_ARGB(m_nAlpha[9], 255,255,255));
	GetBitmapFont()->DrawString("100 PERCENT ON QTE", 390, 560,0.05f, 0.6f,D3DCOLOR_ARGB(255,0,255,0));
	GetBitmapFont()->DrawString("100 PERCENT ON QTE", 392, 562,0.051f, 0.6f,D3DCOLOR_ARGB(255,255,0,0));
	GetTM()->Draw(GetAssets()->aStrikeHard, 10,630, 0.8f,0.8f, &m_rRect, 0.0f,0.0f,0.0f, D3DCOLOR_ARGB(m_nAlpha[4], 255,255,255));
	GetBitmapFont()->DrawString("FIRST MAP COMPLETE", 390, 640,0.05f, 0.6f,D3DCOLOR_ARGB(255,0,255,0));
	GetBitmapFont()->DrawString("FIRST MAP COMPLETE", 392, 642,0.051f, 0.6f,D3DCOLOR_ARGB(255,255,0,0));
	GetTM()->Draw(GetAssets()->aTrueNinja, 10,710, 0.8f,0.8f, &m_rRect, 0.0f,0.0f,0.0f, D3DCOLOR_ARGB(m_nAlpha[8], 255,255,255));
	GetBitmapFont()->DrawString("UNLOCK ALL SKILLS", 390, 720,0.05f, 0.6f,D3DCOLOR_ARGB(255,0,255,0));
	GetBitmapFont()->DrawString("UNLOCK ALL SKILLS", 392, 722,0.051f, 0.6f,D3DCOLOR_ARGB(255,255,0,0));

	GetBitmapFont()->DrawString("ESC OR CLICK",		  825, 700, 0.05f, 0.4f, D3DCOLOR_ARGB(255,0,255,0));
	GetBitmapFont()->DrawString("TO GO BACK",		  840, 735, 0.05f, 0.4f, D3DCOLOR_ARGB(255,0,255,0));

}
void CCollectedAchievements::Exit()
{
	GetFMOD()->StopSound(GetAssets()->aMinimalKesoID);
	GetFMOD()->ResetSound(GetAssets()->aMinimalKesoID);
	CBaseMenuState::Exit();
}