add "disqualify" graphic to options screen for options that make a song easier

This commit is contained in:
Chris Danford
2004-03-08 07:49:01 +00:00
parent 10015303e9
commit df72631f6c
11 changed files with 111 additions and 1 deletions
+8
View File
@@ -2847,6 +2847,14 @@ ExplanationTogetherOnCommand=wrapwidthpixels,1000;horizalign,left;cropright,1;li
ExplanationZoom=0.5
ExplanationP1OnCommand=wrapwidthpixels,500;horizalign,left;cropright,1;linear,0.5;cropright,0
ExplanationP2OnCommand=wrapwidthpixels,500;horizalign,right;cropright,1;linear,0.5;cropright,0
DisqualifyP1X=0
DisqualifyP1Y=0
DisqualifyP1OnCommand=
DisqualifyP1OffCommand=
DisqualifyP2X=0
DisqualifyP2Y=0
DisqualifyP2OnCommand=
DisqualifyP2OffCommand=
PlayerNameP1X=0
PlayerNameP1Y=0
PlayerNameP1OnCommand=hidden,1
+29
View File
@@ -18,6 +18,8 @@
#include "GameState.h"
#include "NoteFieldPositioning.h"
#include "NoteSkinManager.h"
#include "song.h"
#include "Course.h"
#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYSIZE(arr); ++Z ) arr[Z]=1.0f; }
@@ -537,3 +539,30 @@ bool PlayerOptions::operator==( const PlayerOptions &other ) const
#undef COMPARE
return true;
}
bool PlayerOptions::IsHandicapForSong( Song* pSong )
{
if( m_bTimeSpacing && pSong->HasSignificantBpmChangesOrStops() )
return true;
if( m_bTransforms[TRANSFORM_NOHOLDS] ) return true;
if( m_bTransforms[TRANSFORM_NOMINES] ) return true;
if( m_bTransforms[TRANSFORM_NOJUMPS] ) return true;
if( m_bTransforms[TRANSFORM_NOHANDS] ) return true;
if( m_bTransforms[TRANSFORM_NOQUADS] ) return true;
if( m_bTransforms[TRANSFORM_PLANTED] ) return true;
if( m_bTransforms[TRANSFORM_TWISTER] ) return true;
return false;
}
bool PlayerOptions::IsHandicapForCourse( Course* pCourse )
{
for( int i=0; i<pCourse->m_entries.size(); i++ )
{
const CourseEntry& ce = pCourse->m_entries[i];
if( IsHandicapForSong(ce.pSong) )
return true;
}
return false;
}
+8
View File
@@ -11,6 +11,9 @@
-----------------------------------------------------------------------------
*/
class Song;
class Course;
struct PlayerOptions
{
PlayerOptions() { Init(); };
@@ -134,6 +137,11 @@ struct PlayerOptions
void SetOneAppearance( Appearance a );
void SetOneScroll( Scroll s );
void ToggleOneTurn( Turn t );
// return true if any mods being used will make the song(s) easier
bool IsHandicapForSong( Song* pSong );
bool IsHandicapForCourse( Course* pCourse );
};
#endif
+9
View File
@@ -439,6 +439,15 @@ void ScreenOptions::Init( InputMode im, OptionRowData OptionRows[], int iNumOpti
ASSERT(0);
}
for( int p=0; p<NUM_PLAYERS; p++ )
{
m_sprDisqualify[p].Load( THEME->GetPathToG( "ScreenOptions disqualify") );
m_sprDisqualify[p]->SetName( "ScreenOptions", ssprintf("DisqualifyP%i",p+1) );
UtilSetXYAndOnCommand( m_sprDisqualify[p], "ScreenOptions" );
m_sprDisqualify[p]->SetHidden( true ); // unhide later if handicapping options are discovered
m_framePage.AddChild( m_sprDisqualify[p] );
}
m_sprFrame.Load( THEME->GetPathToG( "ScreenOptions frame") );
m_sprFrame->SetXY( CENTER_X, CENTER_Y );
m_framePage.AddChild( m_sprFrame );
+3
View File
@@ -170,6 +170,9 @@ protected:
AutoActor m_sprMore;
bool m_bMoreShown, m_bWasOnExit[NUM_PLAYERS];
// show if the current selections will disqualify a high score
AutoActor m_sprDisqualify[NUM_PLAYERS];
// TRICKY: People hold Start to get to PlayerOptions, then
// the repeat events cause them to zip to the bottom. So, ignore
+35
View File
@@ -52,6 +52,8 @@ ScreenPlayerOptions::ScreenPlayerOptions( CString sClassName ) :
m_bGoToOptions = ( PREFSMAN->m_ShowSongOptions == PrefsManager::YES );
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("player options intro") );
UpdateDisqualified();
}
@@ -134,6 +136,10 @@ void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventTyp
}
ScreenOptionsMaster::Input( DeviceI, type, GameI, MenuI, StyleI );
// UGLY: Update m_Disqualified whenever Start is pressed
if( MenuI.IsValid() && MenuI.button == MENU_BUTTON_START )
UpdateDisqualified();
}
void ScreenPlayerOptions::HandleScreenMessage( const ScreenMessage SM )
@@ -164,3 +170,32 @@ void ScreenPlayerOptions::HandleScreenMessage( const ScreenMessage SM )
ScreenOptionsMaster::HandleScreenMessage( SM );
}
void ScreenPlayerOptions::UpdateDisqualified()
{
// save current player options
PlayerOptions po[2];
{
for( int p=0; p<NUM_PLAYERS; p++ )
{
po[p] = GAMESTATE->m_PlayerOptions[p];
}
}
// export the currently selection options, which will fill GAMESTATE->m_PlayerOptions
this->ExportOptions();
{
for( int p=0; p<NUM_PLAYERS; p++ )
{
bool bIsHandicap = GAMESTATE->IsCourseMode() ?
GAMESTATE->m_PlayerOptions[p].IsHandicapForCourse( GAMESTATE->m_pCurCourse ) :
GAMESTATE->m_PlayerOptions[p].IsHandicapForSong( GAMESTATE->m_pCurSong );
m_sprDisqualify[p]->SetHidden( !bIsHandicap );
// restore previous player options in case the user escapes back after this
GAMESTATE->m_PlayerOptions[p] = po[p];
}
}
}
+2
View File
@@ -25,6 +25,8 @@ private:
void GoToNextState();
void GoToPrevState();
void UpdateDisqualified();
bool m_bAcceptedChoices;
bool m_bGoToOptions;
bool m_bAskOptionsMessage;
+10
View File
@@ -1679,3 +1679,13 @@ void Song::FreeAllLoadedFromProfiles()
this->RemoveNotes( pSteps );
}
}
bool Song::HasSignificantBpmChangesOrStops() const
{
// Don't consider BPM changes that only are only for maintaining sync as
// a real BpmChange.
if( m_DisplayBPMType == DISPLAY_SPECIFIED )
return false;
return m_Timing.HasBpmChangesOrStops();
}
+5
View File
@@ -252,6 +252,11 @@ void TimingData::ShiftRows( float fStartBeat, float fBeatsToShift )
}
}
bool TimingData::HasBpmChangesOrStops() const
{
return m_BPMSegments.size()>1 || m_StopSegments.size()>0;
}
/*
* Copyright (c) 2001-2004 by the person(s) listed below. All rights reserved.
* Chris Danford
+1
View File
@@ -38,6 +38,7 @@ public:
return fBeat;
}
float GetElapsedTimeFromBeat( float fBeat ) const;
bool HasBpmChangesOrStops() const;
// used for editor fix - expand/contract needs to move BPMSegments
// and StopSegments that land during/after the edited range.
+1 -1
View File
@@ -174,7 +174,7 @@ public:
void GetBeatAndBPSFromElapsedTime( float fElapsedTime, float &fBeatOut, float &fBPSOut, bool &bFreezeOut ) const { m_Timing.GetBeatAndBPSFromElapsedTime( fElapsedTime, fBeatOut, fBPSOut, bFreezeOut ); }
float GetBeatFromElapsedTime( float fElapsedTime ) const { return m_Timing.GetBeatFromElapsedTime( fElapsedTime ); }
float GetElapsedTimeFromBeat( float fBeat ) const { return m_Timing.GetElapsedTimeFromBeat( fBeat ); }
bool HasSignificantBpmChangesOrStops() const;
vector<Steps*> m_apNotes;