Can now skip from group to group on ez2/pump song select using codes -- note; currently enters infinite loop if there is only 1 group and code entered -- will fix this later
This commit is contained in:
@@ -47,7 +47,9 @@ const CString g_sCodeNames[CodeDetector::NUM_CODES] = {
|
||||
"RandomVanish",
|
||||
"CancelAll",
|
||||
"NextTheme",
|
||||
"NextAnnouncer"
|
||||
"NextAnnouncer",
|
||||
"NextBannerGroup",
|
||||
"NextBannerGroup2"
|
||||
};
|
||||
|
||||
const unsigned MAX_CODE_LENGTH = 10;
|
||||
@@ -120,6 +122,11 @@ void CodeDetector::RefreshCacheItems()
|
||||
RefreshCacheItem( i );
|
||||
}
|
||||
|
||||
bool CodeDetector::EnteredNextBannerGroup( GameController controller )
|
||||
{
|
||||
return EnteredCode(controller,CODE_BW_NEXT_GROUP) || EnteredCode(controller,CODE_BW_NEXT_GROUP2);
|
||||
}
|
||||
|
||||
bool CodeDetector::EnteredEasierDifficulty( GameController controller )
|
||||
{
|
||||
return EnteredCode(controller,CODE_EASIER1) || EnteredCode(controller,CODE_EASIER2);
|
||||
|
||||
@@ -43,6 +43,8 @@ public:
|
||||
CODE_CANCEL_ALL,
|
||||
CODE_NEXT_THEME,
|
||||
CODE_NEXT_ANNOUNCER,
|
||||
CODE_BW_NEXT_GROUP,
|
||||
CODE_BW_NEXT_GROUP2,
|
||||
NUM_CODES // leave this at the end
|
||||
};
|
||||
|
||||
@@ -52,6 +54,8 @@ public:
|
||||
static bool EnteredNextSort( GameController controller );
|
||||
static bool DetectAndAdjustMusicOptions( GameController controller );
|
||||
static bool EnteredCode( GameController controller, Code code );
|
||||
static bool EnteredNextBannerGroup( GameController controller );
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -280,6 +280,38 @@ void MusicBannerWheel::LoadSongData()
|
||||
}
|
||||
|
||||
|
||||
void MusicBannerWheel::ScanToNextGroup()
|
||||
{
|
||||
if(arraySongs.size() < 2)
|
||||
return; // forget it -- no point groupscanning
|
||||
int localPos = currentPos;
|
||||
int startingPos = localPos;
|
||||
Song* pSong;
|
||||
pSong = arraySongs[currentPos];
|
||||
CString currentGroupName = pSong->m_sGroupName;
|
||||
localPos++;
|
||||
while(localPos != startingPos)
|
||||
{
|
||||
if(localPos >= arraySongs.size()-1)
|
||||
{
|
||||
localPos = 0;
|
||||
}
|
||||
pSong = arraySongs[localPos];
|
||||
if(currentGroupName != pSong->m_sGroupName)
|
||||
{
|
||||
break;
|
||||
}
|
||||
localPos++;
|
||||
}
|
||||
int iCount = 5;
|
||||
currentPos = localPos-iCount;
|
||||
while(iCount > 0)
|
||||
{
|
||||
BannersRight();
|
||||
iCount--;
|
||||
}
|
||||
}
|
||||
|
||||
Song* MusicBannerWheel::GetSelectedSong()
|
||||
{
|
||||
Song* pSong;
|
||||
|
||||
@@ -35,6 +35,7 @@ public:
|
||||
void StartBouncing();
|
||||
void StopBouncing();
|
||||
void SetScanMode(bool Scanmode);
|
||||
void ScanToNextGroup();
|
||||
|
||||
private:
|
||||
void SetNewPos(int NewPos);
|
||||
|
||||
@@ -248,6 +248,14 @@ void ScreenEz2SelectMusic::Input( const DeviceInput& DeviceI, const InputEventTy
|
||||
{
|
||||
UpdateOptions(pn,1);
|
||||
}
|
||||
|
||||
if( CodeDetector::EnteredNextBannerGroup(GameI.controller))
|
||||
{
|
||||
m_MusicBannerWheel.ScanToNextGroup();
|
||||
MusicChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
if( type != IET_FIRST_PRESS )
|
||||
{
|
||||
m_bScanning = true;
|
||||
|
||||
Reference in New Issue
Block a user