Skip to content

Commit

Permalink
use gamestate bool to determine whether or not a playlist course is b…
Browse files Browse the repository at this point in the history
…eing played and disable screengameplay internal elements because they are redundant with theme elements
  • Loading branch information
MinaciousGrace committed Jun 10, 2017
1 parent 43314e8 commit 9005ee5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/AdjustSync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void AdjustSync::ResetAutosync()
bool AdjustSync::IsSyncDataChanged()
{
// Can't sync in course mode :joy_cat: -mina
if(SONGMAN->playlistcourse == "")
if(!GAMESTATE->IsPlaylistCourse())
return false;

vector<RString> vs;
Expand Down Expand Up @@ -169,7 +169,7 @@ void AdjustSync::HandleAutosync( float fNoteOffBySeconds, float fStepTime )

void AdjustSync::HandleSongEnd()
{
if (SONGMAN->playlistcourse == "")
if (!GAMESTATE->IsPlaylistCourse())
return;

if( GAMESTATE->m_SongOptions.GetCurrent().m_AutosyncType == AutosyncType_Tempo )
Expand Down
2 changes: 2 additions & 0 deletions src/GameState.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ class GameState
int GetLoadingCourseSongIndex() const;

RString GetEtternaVersion() { return "0.55"; }
bool isplaylistcourse = false;
bool IsPlaylistCourse() { return isplaylistcourse; }
bool CountNotesSeparately();

// State Info used during gameplay
Expand Down
15 changes: 9 additions & 6 deletions src/ScreenGameplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,11 @@ void ScreenGameplay::Init()
}

// Add stage / SongNumber

FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi )
{
// Theme already contains all of this... so we don't need it? -mina
/*
ASSERT( pi->m_ptextStepsDescription == NULL );
pi->m_ptextStepsDescription = new BitmapText;
pi->m_ptextStepsDescription->LoadFromFont( THEME->GetPathF(m_sName,"StepsDescription") );
Expand All @@ -657,7 +660,7 @@ void ScreenGameplay::Init()
pi->m_pStepsDisplay->PlayCommand( "Set" + pi->GetName() );
LOAD_ALL_COMMANDS_AND_SET_XY( pi->m_pStepsDisplay );
this->AddChild( pi->m_pStepsDisplay );

*/
/*
switch( GAMESTATE->m_PlayMode )
{
Expand Down Expand Up @@ -2175,7 +2178,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
m_skipped_song);


if (SONGMAN->playlistcourse != "") {
if (GAMESTATE->IsPlaylistCourse()) {
m_apSongsQueue.erase(m_apSongsQueue.begin(), m_apSongsQueue.begin() + 1);
FOREACH_EnabledPlayerInfo(m_vPlayerInfo, pi)
pi->m_vpStepsQueue.erase(pi->m_vpStepsQueue.begin(), pi->m_vpStepsQueue.begin() + 1);
Expand Down Expand Up @@ -2252,9 +2255,9 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
Message msg("SongFinished");
MESSAGEMAN->Broadcast(msg);

if (SONGMAN->playlistcourse != "") {
if (GAMESTATE->IsPlaylistCourse()) {
SONGMAN->allplaylists[SONGMAN->playlistcourse].courseruns.emplace_back(playlistscorekeys);
SONGMAN->playlistcourse = "";
GAMESTATE->isplaylistcourse = false;
}

TweenOffScreen();
Expand Down Expand Up @@ -2337,7 +2340,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )

m_sNextScreen = GetPrevScreen();

if( AdjustSync::IsSyncDataChanged() && SONGMAN->playlistcourse != "")
if( AdjustSync::IsSyncDataChanged() && GAMESTATE->IsPlaylistCourse())
ScreenSaveSync::PromptSaveSync( SM_GoToPrevScreen );
else
HandleScreenMessage( SM_GoToPrevScreen );
Expand All @@ -2350,7 +2353,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
if( GAMESTATE->m_SongOptions.GetCurrent().m_bSaveReplay )
SaveReplay();

if( AdjustSync::IsSyncDataChanged() && SONGMAN->playlistcourse != "")
if( AdjustSync::IsSyncDataChanged() && GAMESTATE->IsPlaylistCourse())
ScreenSaveSync::PromptSaveSync( SM_GoToNextScreen );
else
HandleScreenMessage( SM_GoToNextScreen );
Expand Down
1 change: 1 addition & 0 deletions src/ScreenSelectMusic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1836,6 +1836,7 @@ class LunaScreenSelectMusic : public Luna<ScreenSelectMusic>
return 1;

SONGMAN->playlistcourse = name;
GAMESTATE->isplaylistcourse = true;
p->GetMusicWheel()->SelectSong(pl.chartlist[0].songptr);
GAMESTATE->m_SongOptions.GetPreferred().m_fMusicRate = pl.chartlist[0].rate;
p->SelectCurrent(PLAYER_1);
Expand Down
2 changes: 1 addition & 1 deletion src/StepsDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void StepsDisplay::SetFromSteps( const Steps* pSteps )
return;
}

SetParams params = { pSteps, pSteps->GetMeter(), pSteps->m_StepsType, pSteps->GetDifficulty() };
SetParams params = { pSteps, 2934, pSteps->m_StepsType, pSteps->GetDifficulty() };
SetInternal( params );
}

Expand Down

0 comments on commit 9005ee5

Please sign in to comment.