revert PlayerOptions changes

This commit is contained in:
Chris Danford
2003-09-05 07:34:13 +00:00
parent 23a543d7e0
commit e0b3160528
4 changed files with 82 additions and 127 deletions
+6 -6
View File
@@ -2313,12 +2313,12 @@ PrevScreenOni=ScreenSelectCourse
PrevScreenEndless=ScreenSelectCourse
PrevScreenBattle=ScreenSelectMusic
PrevScreenRave=ScreenSelectMusic
NextScreenArcade=ScreenStage
NextScreenNonstop=ScreenStage
NextScreenOni=ScreenStage
NextScreenEndless=ScreenStage
NextScreenBattle=ScreenStage
NextScreenRave=ScreenStage
NextScreenArcade=ScreenSongOptions
NextScreenNonstop=ScreenSongOptions
NextScreenOni=ScreenSongOptions
NextScreenEndless=ScreenSongOptions
NextScreenBattle=ScreenSongOptions
NextScreenRave=ScreenSongOptions
HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options START to accept changes
TimerSeconds=30
Beginner=BEGINNER
+16 -16
View File
@@ -38,7 +38,7 @@ enum {
MO_SHOWSTATS,
MO_COINS_PER_CREDIT,
MO_JOINT_PREMIUM,
// MO_SHOW_SONG_OPTIONS,
MO_SHOW_SONG_OPTIONS,
NUM_MACHINE_OPTIONS_LINES
};
@@ -56,7 +56,7 @@ OptionRow g_MachineOptionsLines[NUM_MACHINE_OPTIONS_LINES] = {
OptionRow( "Show\nStats", true, "OFF","ON" ),
OptionRow( "Coins Per\nCredit", true, "1","2","3","4","5","6","7","8" ),
OptionRow( "Joint\nPremium", true, "OFF","ON" ),
// OptionRow( "Song\nOptions", true, "HIDE","SHOW","ASK" ),
OptionRow( "Song\nOptions", true, "HIDE","SHOW","ASK" ),
};
ScreenMachineOptions::ScreenMachineOptions() :
@@ -118,13 +118,13 @@ void ScreenMachineOptions::ImportOptions()
m_iSelectedOption[0][MO_SHOWSTATS] = PREFSMAN->m_bShowStats ? 1:0;
m_iSelectedOption[0][MO_COINS_PER_CREDIT] = PREFSMAN->m_iCoinsPerCredit - 1;
m_iSelectedOption[0][MO_JOINT_PREMIUM] = PREFSMAN->m_bJointPremium ? 1:0;
// switch(PREFSMAN->m_ShowSongOptions)
// {
// case PrefsManager::YES: m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS] = 1; break;
// case PrefsManager::NO: m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS] = 0; break;
// case PrefsManager::ASK: m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS] = 2; break;
// default: ASSERT(0);
// }
switch(PREFSMAN->m_ShowSongOptions)
{
case PrefsManager::YES: m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS] = 1; break;
case PrefsManager::NO: m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS] = 0; break;
case PrefsManager::ASK: m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS] = 2; break;
default: ASSERT(0);
}
}
void ScreenMachineOptions::ExportOptions()
@@ -189,13 +189,13 @@ void ScreenMachineOptions::ExportOptions()
PREFSMAN->m_iCoinsPerCredit = m_iSelectedOption[0][MO_COINS_PER_CREDIT] + 1;
PREFSMAN->m_bJointPremium = m_iSelectedOption[0][MO_JOINT_PREMIUM] == 1;
// switch(m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS])
// {
// case 0: PREFSMAN->m_ShowSongOptions = PrefsManager::NO; break;
// case 1: PREFSMAN->m_ShowSongOptions = PrefsManager::YES; break;
// case 2: PREFSMAN->m_ShowSongOptions = PrefsManager::ASK; break;
// default: ASSERT(0);
// }
switch(m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS])
{
case 0: PREFSMAN->m_ShowSongOptions = PrefsManager::NO; break;
case 1: PREFSMAN->m_ShowSongOptions = PrefsManager::YES; break;
case 2: PREFSMAN->m_ShowSongOptions = PrefsManager::ASK; break;
default: ASSERT(0);
}
}
void ScreenMachineOptions::GoToPrevState()
+19 -10
View File
@@ -125,19 +125,20 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRows[], int iNumOptionLi
int r;
for( r=0; r<m_iNumOptionRows; r++ ) // foreach line
{
vector<BitmapText *> & textItems = m_textItems[r];
const OptionRow &optline = m_OptionRow[r];
unsigned c;
m_framePage.AddChild( &m_sprBullets[r] );
m_framePage.AddChild( &m_textTitles[r] );
const OptionRow &optline = m_OptionRow[r];
float fX = ITEMS_START_X; // indent 70 pixels
for( c=0; c<optline.choices.size(); c++ )
{
BitmapText *bt = new BitmapText;
m_textItems[r].push_back( bt );
textItems.push_back( bt );
bt->LoadFromFont( THEME->GetPathToF("ScreenOptions item") );
bt->SetText( optline.choices[c] );
@@ -156,8 +157,8 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRows[], int iNumOptionLi
// It goes off the edge of the screen. Re-init with the "long row" style.
m_bRowIsLong[r] = true;
for( unsigned j=0; j<optline.choices.size(); j++ ) // for each option on this line
delete m_textItems[r][j];
m_textItems[r].clear();
delete textItems[j];
textItems.clear();
for( unsigned p=0; p<NUM_PLAYERS; p++ )
{
@@ -165,12 +166,12 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRows[], int iNumOptionLi
continue;
BitmapText *bt = new BitmapText;
m_textItems[r].push_back( bt );
textItems.push_back( bt );
const int iChoiceInRow = m_iSelectedOption[p][r];
bt->LoadFromFont( THEME->GetPathToF("ScreenOptions item") );
bt->SetText( m_OptionRow[r].choices[iChoiceInRow] );
bt->SetText( optline.choices[iChoiceInRow] );
bt->SetZoom( ITEMS_ZOOM );
bt->EnableShadow( false );
@@ -186,8 +187,8 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRows[], int iNumOptionLi
}
}
for( c=0; c<m_textItems[r].size(); c++ )
m_framePage.AddChild( m_textItems[r][c] );
for( c=0; c<textItems.size(); c++ )
m_framePage.AddChild( textItems[c] );
}
InitOptionsText();
@@ -267,7 +268,6 @@ void ScreenOptions::GetWidthXY( PlayerNumber pn, int iRow, int &iWidthOut, int &
bLotsOfOptions? (bOneChoice? 0:pn):
m_iSelectedOption[pn][iRow];
ASSERT( iOptionInRow < m_textItems[iRow].size() );
BitmapText &text = *m_textItems[iRow][iOptionInRow];
iWidthOut = int(roundf( text.GetWidestLineWidthInSourcePixels() * text.GetZoomX() ));
@@ -314,6 +314,9 @@ void ScreenOptions::PositionUnderlines()
// Set the position of the underscores showing the current choice for each option line.
for( int p=0; p<NUM_PLAYERS; p++ ) // foreach player
{
if( !GAMESTATE->IsHumanPlayer(p) )
continue; // skip
for( int i=0; i<m_iNumOptionRows; i++ ) // foreach options line
{
OptionsCursor &underline = m_Underline[p][i];
@@ -347,6 +350,9 @@ void ScreenOptions::PositionIcons()
{
for( int p=0; p<NUM_PLAYERS; p++ ) // foreach player
{
if( !GAMESTATE->IsHumanPlayer(p) )
continue;
for( int i=0; i<m_iNumOptionRows; i++ ) // foreach options line
{
OptionIcon &icon = m_OptionIcons[p][i];
@@ -414,6 +420,9 @@ void ScreenOptions::PositionCursors()
// Set the position of the underscores showing the current choice for each option line.
for( int p=0; p<NUM_PLAYERS; p++ ) // foreach player
{
if( !GAMESTATE->IsHumanPlayer(p) )
continue;
int i=m_iCurrentRow[p];
OptionsCursor &highlight = m_Highlight[p];
+41 -95
View File
@@ -42,14 +42,7 @@ enum {
PO_PERSPECTIVE,
PO_STEP,
PO_CHARACTER,
SO_LIFE,
SO_DRAIN,
SO_BAT_LIVES,
SO_FAIL,
SO_ASSIST,
SO_RATE,
SO_AUTOSYNC,
SO_SAVE,
NUM_PLAYER_OPTIONS_LINES
};
OptionRow g_PlayerOptionsLines[NUM_PLAYER_OPTIONS_LINES] = {
@@ -66,14 +59,6 @@ OptionRow g_PlayerOptionsLines[NUM_PLAYER_OPTIONS_LINES] = {
OptionRow( "Perspec\n-tive", false, "" ),
OptionRow( "Step", false, "" ),
OptionRow( "Charac\n-ter", false, "" ),
OptionRow( "Life\nType", true, "BAR","BATTERY" ),
OptionRow( "Bar\nDrain", true, "NORMAL","NO RECOVER","SUDDEN DEATH" ),
OptionRow( "Bat\nLives", true, "1","2","3","4","5","6","7","8","9","10" ),
OptionRow( "Fail", true, "ARCADE","END OF SONG","OFF" ),
OptionRow( "Assist\nTick", true, "OFF", "ON" ),
OptionRow( "Rate", true, "0.3x","0.4x","0.5x","0.6x","0.7x","0.8x","0.9x","1.0x","1.1x","1.2x","1.3x","1.4x","1.5x","1.6x","1.7x","1.8x","1.9x","2.0x" ),
OptionRow( "Auto\nAdjust", true, "OFF", "ON" ),
OptionRow( "Save\nScores", true, "OFF", "ON" ),
};
static const PlayerOptions::Effect ChoosableEffects[] =
@@ -100,20 +85,20 @@ ScreenPlayerOptions::ScreenPlayerOptions() :
/* If we're going to "press start for more options" or skipping options
* entirely, we need a different fade out. XXX: this is a hack */
// if(PREFSMAN->m_ShowSongOptions == PrefsManager::NO)
if(PREFSMAN->m_ShowSongOptions == PrefsManager::NO)
m_Menu.m_Out.Load( THEME->GetPathToB("ScreenPlayerOptions direct out") ); /* direct to stage */
// else if(PREFSMAN->m_ShowSongOptions == PrefsManager::ASK)
// m_Menu.m_Out.Load( THEME->GetPathToB("ScreenPlayerOptions option out") ); /* optional song options */
else if(PREFSMAN->m_ShowSongOptions == PrefsManager::ASK)
m_Menu.m_Out.Load( THEME->GetPathToB("ScreenPlayerOptions option out") ); /* optional song options */
// m_sprOptionsMessage.Load( THEME->GetPathToG("ScreenPlayerOptions options") );
// m_sprOptionsMessage.StopAnimating();
// m_sprOptionsMessage.SetXY( CENTER_X, CENTER_Y );
// m_sprOptionsMessage.SetZoom( 1 );
// m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) );
m_sprOptionsMessage.Load( THEME->GetPathToG("ScreenPlayerOptions options") );
m_sprOptionsMessage.StopAnimating();
m_sprOptionsMessage.SetXY( CENTER_X, CENTER_Y );
m_sprOptionsMessage.SetZoom( 1 );
m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) );
//this->AddChild( &m_sprOptionsMessage ); // we have to draw this manually over the top of transitions
m_bAcceptedChoices = false;
// m_bGoToOptions = ( PREFSMAN->m_ShowSongOptions == PrefsManager::YES );
m_bGoToOptions = ( PREFSMAN->m_ShowSongOptions == PrefsManager::YES );
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("player options intro") );
}
@@ -290,29 +275,6 @@ void ScreenPlayerOptions::ImportOptions()
/* Why do this? We don't want to erase if we back out. */
// po.Init();
}
SongOptions &so = GAMESTATE->m_SongOptions;
m_iSelectedOption[0][SO_LIFE] = so.m_LifeType;
m_iSelectedOption[0][SO_DRAIN] = so.m_DrainType;
m_iSelectedOption[0][SO_BAT_LIVES] = so.m_iBatteryLives-1;
if ( m_iSelectedOption[0][SO_BAT_LIVES] < 0 )
m_iSelectedOption[0][SO_BAT_LIVES] = 3; // default in case value is invalid
m_iSelectedOption[0][SO_FAIL] = so.m_FailType;
m_iSelectedOption[0][SO_ASSIST] = so.m_bAssistTick;
m_iSelectedOption[0][SO_AUTOSYNC] = so.m_bAutoSync;
m_iSelectedOption[0][SO_SAVE] = so.m_bSaveScore;
m_iSelectedOption[0][SO_RATE] = 7; // in case we don't match below
for( i=0; i<g_PlayerOptionsLines[SO_RATE].choices.size(); i++ )
{
float fThisRate = (float) atof(g_PlayerOptionsLines[SO_RATE].choices[i]);
if( fThisRate == so.m_fMusicRate )
m_iSelectedOption[0][SO_RATE] = i;
}
}
void ScreenPlayerOptions::ExportOptions()
@@ -427,25 +389,6 @@ void ScreenPlayerOptions::ExportOptions()
GAMESTATE->m_pCurCharacters[p] = GAMESTATE->m_pCharacters[choice];
}
}
SongOptions &so = GAMESTATE->m_SongOptions;
so.m_LifeType = (SongOptions::LifeType)m_iSelectedOption[0][SO_LIFE];
so.m_DrainType = (SongOptions::DrainType)m_iSelectedOption[0][SO_DRAIN];
so.m_iBatteryLives = m_iSelectedOption[0][SO_BAT_LIVES]+1;
if( so.m_FailType != (SongOptions::FailType)m_iSelectedOption[0][SO_FAIL] )
{
/* The user is changing the fail mode explicitly; stop messing with it. */
GAMESTATE->m_bChangedFailType = true;
so.m_FailType = (SongOptions::FailType)m_iSelectedOption[0][SO_FAIL];
}
so.m_bAssistTick = !!m_iSelectedOption[0][SO_ASSIST];
so.m_bAutoSync = !!m_iSelectedOption[0][SO_AUTOSYNC];
so.m_bSaveScore = !!m_iSelectedOption[0][SO_SAVE];
int iSel = m_iSelectedOption[0][SO_RATE];
so.m_fMusicRate = (float) atof( g_PlayerOptionsLines[SO_RATE].choices[iSel] );
}
void ScreenPlayerOptions::GoToPrevState()
@@ -466,10 +409,10 @@ void ScreenPlayerOptions::GoToNextState()
{
GAMESTATE->AdjustFailType();
// if( m_bGoToOptions )
if( m_bGoToOptions )
SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) );
// else
// SCREENMAN->SetNewScreen( ScreenSongOptions::GetNextScreen() );
else
SCREENMAN->SetNewScreen( ScreenSongOptions::GetNextScreen() );
}
}
@@ -477,19 +420,19 @@ void ScreenPlayerOptions::GoToNextState()
void ScreenPlayerOptions::Update( float fDelta )
{
ScreenOptions::Update( fDelta );
// m_sprOptionsMessage.Update( fDelta );
m_sprOptionsMessage.Update( fDelta );
}
void ScreenPlayerOptions::DrawPrimitives()
{
ScreenOptions::DrawPrimitives();
// m_sprOptionsMessage.Draw();
m_sprOptionsMessage.Draw();
}
void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
/* if( !GAMESTATE->m_bEditing &&
if( !GAMESTATE->m_bEditing &&
type == IET_FIRST_PRESS &&
!m_Menu.m_In.IsTransitioning() &&
MenuI.IsValid() &&
@@ -503,33 +446,36 @@ void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventTyp
SOUND->PlayOnce( THEME->GetPathToS("Common start") );
}
}
*/
ScreenOptions::Input( DeviceI, type, GameI, MenuI, StyleI );
}
void ScreenPlayerOptions::HandleScreenMessage( const ScreenMessage SM )
{
// if(PREFSMAN->m_ShowSongOptions == PrefsManager::ASK)
// switch( SM )
// {
// case SM_BeginFadingOut: // when the user accepts the page of options
// {
// m_bAcceptedChoices = true;
//
// float fShowSeconds = m_Menu.m_Out.GetLengthSeconds();
//
// // show "hold START for options"
// m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) );
// m_sprOptionsMessage.BeginTweening( 0.15f ); // fade in
// m_sprOptionsMessage.SetZoomY( 1 );
// m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,1) );
// m_sprOptionsMessage.BeginTweening( fShowSeconds-0.3f ); // sleep
// m_sprOptionsMessage.BeginTweening( 0.15f ); // fade out
// m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) );
// m_sprOptionsMessage.SetZoomY( 0 );
// }
// break;
// }
if( PREFSMAN->m_ShowSongOptions == PrefsManager::ASK )
{
switch( SM )
{
case SM_BeginFadingOut: // when the user accepts the page of options
{
m_bAcceptedChoices = true;
float fShowSeconds = m_Menu.m_Out.GetLengthSeconds();
// show "hold START for options"
m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) );
m_sprOptionsMessage.BeginTweening( 0.15f ); // fade in
m_sprOptionsMessage.SetZoomY( 1 );
m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,1) );
m_sprOptionsMessage.BeginTweening( fShowSeconds-0.3f ); // sleep
m_sprOptionsMessage.BeginTweening( 0.15f ); // fade out
m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) );
m_sprOptionsMessage.SetZoomY( 0 );
}
break;
}
}
ScreenOptions::HandleScreenMessage( SM );
}