Pump Song Select now with 'bouncing' icons when selected.
This commit is contained in:
@@ -288,6 +288,16 @@ Song* MusicBannerWheel::GetSelectedSong()
|
|||||||
return(pSong);
|
return(pSong);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MusicBannerWheel::StartBouncing()
|
||||||
|
{
|
||||||
|
m_ScrollingList.StartBouncing();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MusicBannerWheel::StopBouncing()
|
||||||
|
{
|
||||||
|
m_ScrollingList.StopBouncing();
|
||||||
|
}
|
||||||
|
|
||||||
void MusicBannerWheel::PlayMusicSample()
|
void MusicBannerWheel::PlayMusicSample()
|
||||||
{
|
{
|
||||||
Song* pSong = GetSelectedSong();
|
Song* pSong = GetSelectedSong();
|
||||||
@@ -301,6 +311,7 @@ void MusicBannerWheel::PlayMusicSample()
|
|||||||
|
|
||||||
void MusicBannerWheel::BannersLeft()
|
void MusicBannerWheel::BannersLeft()
|
||||||
{
|
{
|
||||||
|
StopBouncing();
|
||||||
if(currentPos==0)
|
if(currentPos==0)
|
||||||
currentPos=arraySongs.size()-1;
|
currentPos=arraySongs.size()-1;
|
||||||
else
|
else
|
||||||
@@ -327,6 +338,7 @@ void MusicBannerWheel::BannersLeft()
|
|||||||
|
|
||||||
void MusicBannerWheel::BannersRight()
|
void MusicBannerWheel::BannersRight()
|
||||||
{
|
{
|
||||||
|
StopBouncing();
|
||||||
if(currentPos>=arraySongs.size()-1)
|
if(currentPos>=arraySongs.size()-1)
|
||||||
currentPos=0;
|
currentPos=0;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ public:
|
|||||||
Song* GetSelectedSong();
|
Song* GetSelectedSong();
|
||||||
int CheckSongsExist() { return SongsExist; }
|
int CheckSongsExist() { return SongsExist; }
|
||||||
void PlayMusicSample();
|
void PlayMusicSample();
|
||||||
|
void StartBouncing();
|
||||||
|
void StopBouncing();
|
||||||
private:
|
private:
|
||||||
void SetNewPos(int NewPos);
|
void SetNewPos(int NewPos);
|
||||||
void LoadSongData();
|
void LoadSongData();
|
||||||
|
|||||||
@@ -332,6 +332,7 @@ void ScreenEz2SelectMusic::MenuStart( PlayerNumber pn )
|
|||||||
if(PREVIEWMUSICMODE == 1 && iConfirmSelection == 0)
|
if(PREVIEWMUSICMODE == 1 && iConfirmSelection == 0)
|
||||||
{
|
{
|
||||||
iConfirmSelection = 1;
|
iConfirmSelection = 1;
|
||||||
|
m_MusicBannerWheel.StartBouncing();
|
||||||
m_MusicBannerWheel.PlayMusicSample();
|
m_MusicBannerWheel.PlayMusicSample();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,12 +52,17 @@ Initializes Variables for the ScrollingList
|
|||||||
****************************************/
|
****************************************/
|
||||||
ScrollingList::ScrollingList()
|
ScrollingList::ScrollingList()
|
||||||
{
|
{
|
||||||
|
m_iBouncingState = 0;
|
||||||
|
m_fNextTween = 0;
|
||||||
m_iBannerPrefs = BANNERPREFS_EZ2;
|
m_iBannerPrefs = BANNERPREFS_EZ2;
|
||||||
m_iSpriteType = SPRITE_TYPE_SPRITE;
|
m_iSpriteType = SPRITE_TYPE_SPRITE;
|
||||||
m_iSelection = 0;
|
m_iSelection = 0;
|
||||||
m_fSelectionLag = 0;
|
m_fSelectionLag = 0;
|
||||||
m_iSpacing = DEFAULT_SPACING;
|
m_iSpacing = DEFAULT_SPACING;
|
||||||
m_iNumVisible = DEFAULT_VISIBLE_ELEMENTS;
|
m_iNumVisible = DEFAULT_VISIBLE_ELEMENTS;
|
||||||
|
m_iBounceDir=0;
|
||||||
|
m_iBounceWait=0;
|
||||||
|
m_RippleCSprite.SetXY(0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScrollingList::UseSpriteType(int NewSpriteType)
|
void ScrollingList::UseSpriteType(int NewSpriteType)
|
||||||
@@ -86,6 +91,31 @@ void ScrollingList::Unload()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScrollingList::StartBouncing()
|
||||||
|
{
|
||||||
|
m_iBouncingState = 1;
|
||||||
|
if(m_iSpriteType == SPRITE_TYPE_SPRITE)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_RippleCSprite.Load( m_apCSprites[m_iSelection]->GetTexturePath() );
|
||||||
|
m_RippleCSprite.SetXY( m_apCSprites[m_iSelection]->GetX(), m_apCSprites[m_iSelection]->GetY() );
|
||||||
|
m_RippleCSprite.SetZoom( 2.0f );
|
||||||
|
m_RippleCSprite.SetDiffuse( RageColor(1,1,1,0.5f));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScrollingList::StopBouncing()
|
||||||
|
{
|
||||||
|
m_iBouncingState = 0;
|
||||||
|
if(m_iSpriteType == SPRITE_TYPE_SPRITE)
|
||||||
|
m_apSprites[m_iSelection]->SetZoom( 1.0f );
|
||||||
|
else
|
||||||
|
m_apCSprites[m_iSelection]->SetZoom( 1.0f );
|
||||||
|
}
|
||||||
|
|
||||||
/************************************
|
/************************************
|
||||||
Allows us to create a graphic element
|
Allows us to create a graphic element
|
||||||
in the scrolling list
|
in the scrolling list
|
||||||
@@ -245,6 +275,55 @@ void ScrollingList::Update( float fDeltaTime )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if(m_iBouncingState) // bouncing
|
||||||
|
{
|
||||||
|
if(m_fNextTween <= 0) // we're ready to update stuff
|
||||||
|
{
|
||||||
|
m_fNextTween = 0.1f; // reset the tween count
|
||||||
|
if(m_apCSprites[m_iSelection]->GetZoom() >= 1.2f && m_iBounceDir == 1) // if we're over biggest boundary
|
||||||
|
{
|
||||||
|
m_iBounceDir = 2; // next phase will be a wait
|
||||||
|
m_apCSprites[m_iSelection]->SetZoom( m_apCSprites[m_iSelection]->GetZoom() - 0.25f); // make it smaller
|
||||||
|
m_RippleCSprite.SetZoom( m_RippleCSprite.GetZoom() - 0.30f); // make the ripple smaller
|
||||||
|
}
|
||||||
|
else if(m_apCSprites[m_iSelection]->GetZoom() <= 1.0f && m_iBounceDir == 0) // if we're over smallest boundary
|
||||||
|
{
|
||||||
|
m_iBounceDir = 1; // next phase will be making graphic bigger
|
||||||
|
m_apCSprites[m_iSelection]->SetZoom( m_apCSprites[m_iSelection]->GetZoom() + 0.25f); // make it bigger
|
||||||
|
m_RippleCSprite.SetZoom( m_RippleCSprite.GetZoom() + 0.30f); // make ripple bigger
|
||||||
|
m_RippleCSprite.SetDiffuse( RageColor(1,1,1,0.5f)); // make ripple appear semi transparent
|
||||||
|
}
|
||||||
|
else if(m_iBounceDir == 0 && m_apCSprites[m_iSelection]->GetZoom() != 1.0f) // travelling smaller
|
||||||
|
{
|
||||||
|
m_apCSprites[m_iSelection]->SetZoom( m_apCSprites[m_iSelection]->GetZoom() - 0.25f); // make smaller
|
||||||
|
m_RippleCSprite.SetZoom( m_RippleCSprite.GetZoom() - 0.30f); // make smaller
|
||||||
|
}
|
||||||
|
else if(m_iBounceDir == 1 && m_apCSprites[m_iSelection]->GetZoom() != 1.2f) // travelling bigger
|
||||||
|
{
|
||||||
|
m_apCSprites[m_iSelection]->SetZoom( m_apCSprites[m_iSelection]->GetZoom() + 0.25f); // make bigger
|
||||||
|
m_RippleCSprite.SetZoom( m_RippleCSprite.GetZoom() + 0.30f ); // make bigger
|
||||||
|
}
|
||||||
|
else if(m_iBounceDir == 2) // we're waiting before doing bounce processes again
|
||||||
|
{
|
||||||
|
if(m_iBounceWait == 0) // if we're at 0 from last time....
|
||||||
|
m_iBounceWait = 3; // start wait at 3
|
||||||
|
else
|
||||||
|
m_iBounceWait--; // otherwise decrease by 1
|
||||||
|
|
||||||
|
if(m_iBounceWait == 2) // if we're one moment after start of wait
|
||||||
|
m_RippleCSprite.SetDiffuse( RageColor(1,1,1,0.0f)); // hide the ripple
|
||||||
|
|
||||||
|
if(m_iBounceWait == 0) // if we just turned to 0
|
||||||
|
m_iBounceDir = 0; // go to the 'make smaller' stage. as we SHOULD already be pretty small, we should start increasing in size a couple phases on.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_fNextTween -= fDeltaTime; // update the tween time.
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
for( unsigned i=0; i<m_apCSprites.size(); i++ )
|
for( unsigned i=0; i<m_apCSprites.size(); i++ )
|
||||||
m_apCSprites[i]->Update( fDeltaTime );
|
m_apCSprites[i]->Update( fDeltaTime );
|
||||||
}
|
}
|
||||||
@@ -352,4 +431,14 @@ void ScrollingList::DrawPrimitives()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(m_iSpriteType == SPRITE_TYPE_SPRITE)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(m_iBouncingState)
|
||||||
|
{
|
||||||
|
m_RippleCSprite.Draw();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,17 +35,27 @@ public:
|
|||||||
void SetNumberVisible( int iNumVisibleElements );
|
void SetNumberVisible( int iNumVisibleElements );
|
||||||
void SetSpacing( int iSpacingInPixels );
|
void SetSpacing( int iSpacingInPixels );
|
||||||
void UseSpriteType(int NewSpriteType);
|
void UseSpriteType(int NewSpriteType);
|
||||||
|
void StartBouncing();
|
||||||
|
void StopBouncing();
|
||||||
void Left();
|
void Left();
|
||||||
void Right();
|
void Right();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
int m_iBouncingState;
|
||||||
|
int m_iBounceDir;
|
||||||
|
int m_iBounceWait;
|
||||||
|
|
||||||
int m_iBannerPrefs;
|
int m_iBannerPrefs;
|
||||||
int m_iSpriteType;
|
int m_iSpriteType;
|
||||||
int m_iSelection;
|
int m_iSelection;
|
||||||
float m_fSelectionLag;
|
float m_fSelectionLag;
|
||||||
int m_iSpacing;
|
int m_iSpacing;
|
||||||
int m_iNumVisible;
|
int m_iNumVisible;
|
||||||
|
float m_fNextTween;
|
||||||
|
|
||||||
|
CroppedSprite m_RippleCSprite;
|
||||||
|
|
||||||
vector<Sprite*> m_apSprites; // stores the list of elements (left to right)
|
vector<Sprite*> m_apSprites; // stores the list of elements (left to right)
|
||||||
vector<CroppedSprite*> m_apCSprites; // stores the list of elements (left to right)
|
vector<CroppedSprite*> m_apCSprites; // stores the list of elements (left to right)
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user