Started work on the Banner Scrolling List style Music Select (as used by pump/ez2/para/3ddx/bm/3rd mix and older). It's far from finished, but is a start, also updated some para graphics. This compiles in VC6. the Project will compile it all, as for any other makefiles kicking around (like unix makefiles) I dont know whats what so these have not been updated. Thanks.

This commit is contained in:
Andrew Livy
2002-12-05 03:49:46 +00:00
parent 29ed126829
commit ceb2fc0c25
12 changed files with 227 additions and 781 deletions
+89
View File
@@ -0,0 +1,89 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: MusicBannerWheel
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Andrew Livy
-----------------------------------------------------------------------------
*/
#include "MusicBannerWheel.h"
#include "RageUtil.h"
#include "GameState.h"
#include "PrefsManager.h"
#include "SongManager.h"
#include "ThemeManager.h"
#include "RageMusic.h"
#define MAXBANNERS 5
#define BANNERSPACING 200
MusicBannerWheel::MusicBannerWheel()
{
currentPos=0;
m_ScrollingList.SetXY( 0, 0 );
m_ScrollingList.SetSpacing( BANNERSPACING );
this->AddChild( &m_ScrollingList );
SetNewPos(currentPos);
PlayMusicSample();
}
void MusicBannerWheel::SetNewPos(int NewPos)
{
CArray<Song*, Song*> arraySongs = SONGMAN->m_pSongs;
Song* pSong;
// TODO: OPTIMIZE THIS. (SO IT LOADS THE ENTIRE SONG LIST)
CStringArray asGraphicPaths;
for( unsigned j=0; j<arraySongs.size() && j < MAXBANNERS; j++ )
{
pSong = arraySongs[j];
if( pSong == NULL ) asGraphicPaths.push_back(THEME->GetPathTo("Graphics","fallback banner"));
else if (pSong->HasBanner()) asGraphicPaths.push_back(pSong->GetBannerPath());
else if (PREFSMAN->m_bUseBGIfNoBanner && pSong->HasBackground() ) asGraphicPaths.push_back(pSong->GetBannerPath());
else asGraphicPaths.push_back(THEME->GetPathTo("Graphics","fallback banner"));
}
m_ScrollingList.Load( asGraphicPaths );
}
Song* MusicBannerWheel::GetSelectedSong()
{
CArray<Song*, Song*> arraySongs = SONGMAN->m_pSongs;
Song* pSong;
pSong=arraySongs[m_ScrollingList.GetSelection()];
return(pSong);
}
void MusicBannerWheel::PlayMusicSample()
{
Song* pSong = GetSelectedSong();
if( pSong && pSong->HasMusic() )
{
MUSIC->Stop();
MUSIC->Load( pSong->GetMusicPath() );
MUSIC->Play( true, pSong->m_fMusicSampleStartSeconds, pSong->m_fMusicSampleLengthSeconds );
}
}
void MusicBannerWheel::BannersLeft()
{
m_ScrollingList.Left();
PlayMusicSample();
}
void MusicBannerWheel::BannersRight()
{
m_ScrollingList.Right();
PlayMusicSample();
}
MusicBannerWheel::~MusicBannerWheel()
{
}