broadcast WorkoutGoalComplete
This commit is contained in:
@@ -37,6 +37,8 @@
|
|||||||
#include "UnlockManager.h"
|
#include "UnlockManager.h"
|
||||||
#include "ScreenManager.h"
|
#include "ScreenManager.h"
|
||||||
#include "Screen.h"
|
#include "Screen.h"
|
||||||
|
#include "WorkoutManager.h"
|
||||||
|
#include "Workout.h"
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <set>
|
#include <set>
|
||||||
@@ -787,6 +789,18 @@ void GameState::Update( float fDelta )
|
|||||||
MESSAGEMAN->Broadcast( (MessageID)(Message_GoalCompleteP1+p) );
|
MESSAGEMAN->Broadcast( (MessageID)(Message_GoalCompleteP1+p) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( WORKOUTMAN->m_pCurWorkout != NULL && !m_bWorkoutGoalComplete )
|
||||||
|
{
|
||||||
|
const StageStats &ssAccum = STATSMAN->GetAccumPlayedStageStats();
|
||||||
|
const StageStats &ssCurrent = STATSMAN->m_CurStageStats;
|
||||||
|
bool bGoalComplete = ssAccum.m_fGameplaySeconds + ssCurrent.m_fGameplaySeconds > WORKOUTMAN->m_pCurWorkout->m_iMinutes*60;
|
||||||
|
if( bGoalComplete )
|
||||||
|
{
|
||||||
|
MESSAGEMAN->Broadcast( "WorkoutGoalComplete" );
|
||||||
|
m_bWorkoutGoalComplete = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameState::SetCurGame( const Game *pGame )
|
void GameState::SetCurGame( const Game *pGame )
|
||||||
@@ -836,6 +850,7 @@ void GameState::ResetStageStatistics()
|
|||||||
|
|
||||||
m_bGoalComplete[p] = false;
|
m_bGoalComplete[p] = false;
|
||||||
}
|
}
|
||||||
|
m_bWorkoutGoalComplete = false;
|
||||||
|
|
||||||
|
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
|
|||||||
@@ -212,6 +212,7 @@ public:
|
|||||||
|
|
||||||
// used in workout
|
// used in workout
|
||||||
bool m_bGoalComplete[NUM_PLAYERS];
|
bool m_bGoalComplete[NUM_PLAYERS];
|
||||||
|
bool m_bWorkoutGoalComplete;
|
||||||
|
|
||||||
void RemoveAllActiveAttacks(); // called on end of song
|
void RemoveAllActiveAttacks(); // called on end of song
|
||||||
PlayerNumber GetBestPlayer() const;
|
PlayerNumber GetBestPlayer() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user