Don't change player one's course difficulty preferenes. Play a sound when the difficulty changes.

This commit is contained in:
Steve Checkoway
2006-02-20 04:25:53 +00:00
parent bd36a41a35
commit 1946083107
7 changed files with 26 additions and 12 deletions
+1
View File
@@ -76,6 +76,7 @@ GameState::GameState() :
m_pCurTrail( Message_CurrentTrailP1Changed ),
m_bGameplayLeadIn( Message_GameplayLeadInChanged ),
m_stEdit( Message_EditStepsTypeChanged ),
m_cdEdit( Message_EditCourseDifficulityChanged ),
m_pEditSourceSteps( Message_EditSourceStepsChanged ),
m_stEditSource( Message_EditSourceStepsTypeChanged ),
m_iEditCourseEntryIndex( Message_EditCourseEntryIndexChanged ),
+1
View File
@@ -282,6 +282,7 @@ public:
// Edit stuff
//
BroadcastOnChange<StepsType> m_stEdit;
BroadcastOnChange<CourseDifficulty> m_cdEdit;
BroadcastOnChangePtr<Steps> m_pEditSourceSteps;
BroadcastOnChange<StepsType> m_stEditSource;
BroadcastOnChange<int> m_iEditCourseEntryIndex;
+1
View File
@@ -23,6 +23,7 @@ static const char *MessageNames[] = {
"CurrentTrailP2Changed",
"GameplayLeadInChanged",
"EditStepsTypeChanged",
"EditCourseDifficulityChanged",
"EditSourceStepsChanged",
"EditSourceStepsTypeChanged",
"PreferredDifficutyP1Changed",
+1
View File
@@ -18,6 +18,7 @@ enum Message
Message_CurrentTrailP2Changed,
Message_GameplayLeadInChanged,
Message_EditStepsTypeChanged,
Message_EditCourseDifficulityChanged,
Message_EditSourceStepsChanged,
Message_EditSourceStepsTypeChanged,
Message_PreferredDifficultyP1Changed,
+4 -3
View File
@@ -45,7 +45,7 @@ REGISTER_SCREEN_CLASS( ScreenOptionsEditCourse );
void ScreenOptionsEditCourse::Init()
{
ScreenOptions::Init();
ScreenOptionsEditCourseSubMenu::Init();
}
static LocalizedString ENTRY( "OptionTitles", "Entry %d" );
@@ -197,7 +197,7 @@ void ScreenOptionsEditCourse::AfterChangeValueInRow( int iRow, PlayerNumber pn )
// Regenerate Trails so that the new values propagate
GAMESTATE->m_pCurTrail[PLAYER_1].Set( NULL );
Trail *pTrail = pCourse->GetTrailForceRegenCache( GAMESTATE->m_stEdit, GAMESTATE->m_PreferredCourseDifficulty[PLAYER_1] );
Trail *pTrail = pCourse->GetTrailForceRegenCache( GAMESTATE->m_stEdit, GAMESTATE->m_cdEdit );
// cause overlay elements to refresh by changing the course
GAMESTATE->m_pCurCourse.Set( pCourse );
@@ -230,7 +230,7 @@ void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector<PlayerNumber
{
OptionRow &row = *m_pRows[iRow];
Course *pCourse = GAMESTATE->m_pCurCourse;
switch( iRow )
{
case EditCourseRow_Type:
@@ -249,6 +249,7 @@ void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector<PlayerNumber
break;
}
}
}
void ScreenOptionsEditCourse::ProcessMenuStart( const InputEventPlus &input )
+13 -9
View File
@@ -20,7 +20,7 @@ static void RefreshTrail()
if( pCourse == NULL )
return;
GAMESTATE->m_pCurCourse.Set( pCourse );
Trail *pTrail = pCourse->GetTrail( GAMESTATE->m_stEdit, GAMESTATE->m_PreferredCourseDifficulty[PLAYER_1] );
Trail *pTrail = pCourse->GetTrail( GAMESTATE->m_stEdit, GAMESTATE->m_cdEdit );
GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail );
}
@@ -43,7 +43,7 @@ static void SetNextCombination()
}
}
StepsTypeAndDifficulty curVal( GAMESTATE->m_stEdit, GAMESTATE->m_PreferredCourseDifficulty[PLAYER_1] );
StepsTypeAndDifficulty curVal( GAMESTATE->m_stEdit, GAMESTATE->m_cdEdit );
vector<StepsTypeAndDifficulty>::const_iterator iter = find( v.begin(), v.end(), curVal );
if( iter == v.end() || ++iter == v.end() )
iter = v.begin();
@@ -51,19 +51,23 @@ static void SetNextCombination()
curVal = *iter;
GAMESTATE->m_stEdit.Set( curVal.st );
GAMESTATE->m_PreferredCourseDifficulty[PLAYER_1].Set( curVal.cd );
GAMESTATE->m_cdEdit.Set( curVal.cd );
RefreshTrail();
}
void ScreenOptionsEditCourseSubMenu::Init()
{
m_soundDifficultyChanged.Load( THEME->GetPathS("ScreenEditCourseSubmenu", "difficulty changed") );
ScreenOptions::Init();
}
void ScreenOptionsEditCourseSubMenu::MenuSelect( const InputEventPlus &input )
{
if( input.type == IET_FIRST_PRESS )
{
SetNextCombination();
SCREENMAN->PlayInvalidSound();
m_soundDifficultyChanged.Play();
return;
}
@@ -107,7 +111,7 @@ static bool ValidateEditCourseName( const RString &sAnswer, RString &sErrorOut )
FOREACH_CONST( Course*, v, c )
{
if( GAMESTATE->m_pCurCourse.Get() == *c )
continue; // don't comepare name against ourself
continue; // don't compare name against ourself
if( (*c)->GetDisplayFullTitle() == sAnswer )
{
@@ -124,7 +128,7 @@ REGISTER_SCREEN_CLASS( ScreenOptionsManageCourses );
void ScreenOptionsManageCourses::Init()
{
ScreenOptions::Init();
ScreenOptionsEditCourseSubMenu::Init();
EDIT_MODE.Load( m_sName,"EditMode" );
}
@@ -132,7 +136,7 @@ void ScreenOptionsManageCourses::Init()
void ScreenOptionsManageCourses::BeginScreen()
{
if( GAMESTATE->m_stEdit == STEPS_TYPE_INVALID ||
GAMESTATE->m_PreferredCourseDifficulty[PLAYER_1] == DIFFICULTY_INVALID )
GAMESTATE->m_cdEdit == DIFFICULTY_INVALID )
{
SetNextCombination();
}
@@ -3,12 +3,17 @@
#include "ScreenOptions.h"
#include "GameConstantsAndTypes.h"
#include "RageSound.h"
class Course;
class ScreenOptionsEditCourseSubMenu : public ScreenOptions
{
RageSound m_soundDifficultyChanged;
public:
virtual void Init();
protected:
virtual void MenuSelect( const InputEventPlus &input );
};