break PlayerOptions selection into two screens (is there any other solution?)

add lines for Step selection and Character selection
This commit is contained in:
Chris Danford
2003-06-15 17:05:51 +00:00
parent 4dd5f4cc09
commit c743e97f6e
10 changed files with 450 additions and 155 deletions
+10 -1
View File
@@ -34,8 +34,17 @@ DisplayColor=16
TextureColor=16
AntiAliasing=0
[0003]
DriverRegex=Savage
Renderers=d3d,opengl // OpenGL driver doesn't support EXT_texture_env_combine
Width=640
Height=480
DisplayColor=16
TextureColor=16
AntiAliasing=0
[0004]
DriverRegex=OpenGL
DriverRegex=OpenGL // Please add a comment. What is this supposed to match? -Chris
Renderers=opengl
Width=640
Height=480
+29 -13
View File
@@ -482,7 +482,7 @@ MusicListOffCommand=
SleepAfterTweenOffSeconds=0.8
HelpText=Use &LEFT; &RIGHT; to select, then press START
TimerSeconds=40
NextScreen=ScreenSelectCharacter
NextScreen=ScreenSelectMusic
[GroupList]
StartX=0
@@ -2056,16 +2056,16 @@ PrevScreenOni=ScreenSelectCourse
PrevScreenEndless=ScreenSelectCourse
PrevScreenBattle=ScreenSelectMusic
PrevScreenRave=ScreenSelectMusic
NextScreenArcade=ScreenSongOptions
NextScreenNonstop=ScreenSongOptions
NextScreenOni=ScreenSongOptions
NextScreenEndless=ScreenSongOptions
NextScreenBattle=ScreenSongOptions
NextScreenRave=ScreenRaveOptions
NextScreenArcade=ScreenPlayerOptions2
NextScreenNonstop=ScreenPlayerOptions2
NextScreenOni=ScreenPlayerOptions2
NextScreenEndless=ScreenPlayerOptions2
NextScreenBattle=ScreenPlayerOptions2
NextScreenRave=ScreenPlayerOptions2
HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options START to accept changes
TimerSeconds=30
[ScreenRaveOptions]
[ScreenPlayerOptions2]
PrevScreenArcade=ScreenPlayerOptions
PrevScreenNonstop=ScreenPlayerOptions
PrevScreenOni=ScreenPlayerOptions
@@ -2077,16 +2077,32 @@ NextScreenNonstop=ScreenSongOptions
NextScreenOni=ScreenSongOptions
NextScreenEndless=ScreenSongOptions
NextScreenBattle=ScreenSongOptions
NextScreenRave=ScreenRaveOptions
HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options START to accept changes
TimerSeconds=30
[ScreenRaveOptions]
PrevScreenArcade=ScreenPlayerOptions2
PrevScreenNonstop=ScreenPlayerOptions2
PrevScreenOni=ScreenPlayerOptions2
PrevScreenEndless=ScreenPlayerOptions2
PrevScreenBattle=ScreenPlayerOptions2
PrevScreenRave=ScreenPlayerOptions2
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
[ScreenSongOptions]
PrevScreenArcade=ScreenPlayerOptions
PrevScreenNonstop=ScreenPlayerOptions
PrevScreenOni=ScreenPlayerOptions
PrevScreenEndless=ScreenPlayerOptions
PrevScreenBattle=ScreenPlayerOptions
PrevScreenArcade=ScreenPlayerOptions2
PrevScreenNonstop=ScreenPlayerOptions2
PrevScreenOni=ScreenPlayerOptions2
PrevScreenEndless=ScreenPlayerOptions2
PrevScreenBattle=ScreenPlayerOptions2
PrevScreenRave=ScreenRaveOptions
NextScreenArcade=ScreenStage
NextScreenNonstop=ScreenStage
+5
View File
@@ -190,3 +190,8 @@ void BPMDisplay::SetBPM( const Song* pSong )
ASSERT(0);
}
}
void BPMDisplay::DrawPrimitives()
{
ActorFrame::DrawPrimitives();
}
+1
View File
@@ -23,6 +23,7 @@ class BPMDisplay : public ActorFrame
public:
BPMDisplay();
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
void SetBPMRange( float fLowBPM, float fHighBPM );
void SetBPM( const Song* pSong );
void CycleRandomly();
+2
View File
@@ -255,6 +255,7 @@ void Screen::ClearMessageQueue( const ScreenMessage SM )
#include "ScreenMapControllers.h"
#include "ScreenMusicScroll.h"
#include "ScreenPlayerOptions.h"
#include "ScreenPlayerOptions2.h"
#include "ScreenSandbox.h"
#include "ScreenSelectCourse.h"
#include "ScreenSelectDifficulty.h"
@@ -321,6 +322,7 @@ Screen* Screen::Create( CString sClassName )
IF_RETURN( ScreenInputOptions );
IF_RETURN( ScreenMusicScroll );
IF_RETURN( ScreenPlayerOptions );
IF_RETURN( ScreenPlayerOptions2 );
IF_RETURN( ScreenSandbox );
IF_RETURN( ScreenSelectCourse );
IF_RETURN( ScreenSelectDifficulty );
+62 -135
View File
@@ -20,6 +20,8 @@
#include "NoteSkinManager.h"
#include "NoteFieldPositioning.h"
#include "ScreenSongOptions.h"
#include "Notes.h"
#include "Course.h"
#define PREV_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions","PrevScreen"+Capitalize(PlayModeToString(play_mode)))
#define NEXT_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions","NextScreen"+Capitalize(PlayModeToString(play_mode)))
@@ -27,29 +29,23 @@
enum {
PO_SPEED = 0,
PO_ACCEL,
PO_EFFECT,
PO_APPEAR,
PO_TURN,
PO_TRANSFORM,
PO_SCROLL,
PO_NOTE_SKIN,
PO_HOLD_NOTES,
PO_DARK,
PO_PERSPECTIVE,
PO_STEP,
NUM_PLAYER_OPTIONS_LINES
};
OptionRow g_PlayerOptionsLines[NUM_PLAYER_OPTIONS_LINES] = {
OptionRow( "Speed", "x0.25","x0.5","x0.75","x1","x1.5","x2","x3","x5","x8","C200","C300" ),
OptionRow( "Acceler\n-ation", "OFF","BOOST","BRAKE","WAVE","EXPAND","BOOMERANG" ),
OptionRow( "Effect", "OFF","DRUNK","DIZZY","MINI","FLIP","TORNADO" ),
OptionRow( "Appear\n-ance", "VISIBLE","HIDDEN","SUDDEN","STEALTH","BLINK", "R.VANISH" ),
OptionRow( "Turn", "OFF","MIRROR","LEFT","RIGHT","SHUFFLE","S.SHUFFLE" ),
OptionRow( "Trans\n-form", "OFF","LITTLE","WIDE","BIG","QUICK","SKIPPY" ),
OptionRow( "Scroll", "STANDARD","REVERSE" ),
OptionRow( "Note\nSkin", "" ),
OptionRow( "Holds", "OFF","ON" ),
OptionRow( "Dark", "OFF","ON" ),
OptionRow( "Perspec\n-tive", "" ),
OptionRow( "Step", "" )
};
@@ -64,23 +60,6 @@ ScreenPlayerOptions::ScreenPlayerOptions() :
NUM_PLAYER_OPTIONS_LINES,
true, false );
/* 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)
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 */
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 );
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("player options intro") );
}
@@ -88,36 +67,36 @@ ScreenPlayerOptions::ScreenPlayerOptions() :
void ScreenPlayerOptions::ImportOptions()
{
//
// fill in skin names
// fill in difficulty names
//
CStringArray arraySkinNames;
NOTESKIN->GetNoteSkinNames( arraySkinNames );
m_OptionRow[PO_NOTE_SKIN].choices.clear();
unsigned i;
for( i=0; i<arraySkinNames.size(); i++ )
m_OptionRow[PO_STEP].choices.clear();
if( GAMESTATE->m_pCurCourse ) // playing a course
{
arraySkinNames[i].MakeUpper();
m_OptionRow[PO_NOTE_SKIN].choices.push_back( arraySkinNames[i] );
m_OptionRow[PO_STEP].choices.push_back( "REGULAR" );
if( GAMESTATE->m_pCurCourse->HasDifficult() )
m_OptionRow[PO_STEP].choices.push_back( "DIFFICULT" );
}
else
{
vector<Notes*> vNotes;
GAMESTATE->m_pCurSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_NotesType );
SortNotesArrayByDifficulty( vNotes );
for( unsigned i=0; i<vNotes.size(); i++ )
{
CString s = vNotes[i]->GetDescription();
s.MakeUpper();
m_OptionRow[PO_STEP].choices.push_back( s );
}
}
m_OptionRow[PO_PERSPECTIVE].choices.clear();
m_OptionRow[PO_PERSPECTIVE].choices.push_back( "INCOMING" );
m_OptionRow[PO_PERSPECTIVE].choices.push_back( "OVERHEAD" );
m_OptionRow[PO_PERSPECTIVE].choices.push_back( "SPACE" );
CStringArray arrayPosNames;
GAMESTATE->m_pPosition->GetNamesForCurrentGame(arrayPosNames);
for( i=0; i<arrayPosNames.size(); i++ )
{
arrayPosNames[i].MakeUpper();
m_OptionRow[PO_PERSPECTIVE].choices.push_back( arrayPosNames[i] );
}
//
// highlight currently selected values
//
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMESTATE->IsHumanPlayer(p) )
continue; // skip
PlayerOptions &po = GAMESTATE->m_PlayerOptions[p];
if( !po.m_bTimeSpacing && po.m_fScrollSpeed == 0.25f ) m_iSelectedOption[p][PO_SPEED] = 0;
@@ -134,45 +113,32 @@ void ScreenPlayerOptions::ImportOptions()
else m_iSelectedOption[p][PO_SPEED] = 3;
m_iSelectedOption[p][PO_ACCEL] = po.GetFirstAccel()+1;
m_iSelectedOption[p][PO_EFFECT] = po.GetFirstEffect()+1;
m_iSelectedOption[p][PO_APPEAR] = po.GetFirstAppearance()+1;
m_iSelectedOption[p][PO_TURN] = po.m_Turn;
m_iSelectedOption[p][PO_TRANSFORM] = po.m_Transform;
m_iSelectedOption[p][PO_SCROLL] = po.m_fReverseScroll==1 ? 1 : 0 ;
// highlight currently selected skin
m_iSelectedOption[p][PO_NOTE_SKIN] = -1;
for( unsigned j=0; j<m_OptionRow[PO_NOTE_SKIN].choices.size(); j++ )
{
if( 0==stricmp(m_OptionRow[PO_NOTE_SKIN].choices[j], po.m_sNoteSkin) )
{
m_iSelectedOption[p][PO_NOTE_SKIN] = j;
break;
}
}
if( m_iSelectedOption[p][PO_NOTE_SKIN] == -1 )
m_iSelectedOption[p][PO_NOTE_SKIN] = 0;
m_iSelectedOption[p][PO_HOLD_NOTES] = po.m_bHoldNotes ? 1 : 0;
m_iSelectedOption[p][PO_DARK] = po.m_fDark ? 1 : 0;
/* Default: */
m_iSelectedOption[p][PO_PERSPECTIVE] = 1;
if(po.m_fPerspectiveTilt == -1)
m_iSelectedOption[p][PO_PERSPECTIVE] = 0;
else if(po.m_fPerspectiveTilt == 1)
m_iSelectedOption[p][PO_PERSPECTIVE] = 2;
else /* po.m_fPerspectiveTilt == 0 */
if( GAMESTATE->m_pCurCourse ) // playing a course
{
vector<CString> &choices = m_OptionRow[PO_PERSPECTIVE].choices;
for(unsigned n = 3; n < choices.size(); ++n)
if(!choices[n].CompareNoCase(GAMESTATE->m_PlayerOptions[p].m_sPositioning))
m_iSelectedOption[p][PO_PERSPECTIVE] = n;
if( GAMESTATE->m_bDifficultCourses )
m_iSelectedOption[p][PO_STEP] = 1;
else
m_iSelectedOption[p][PO_STEP] = 0;
}
else
{
vector<Notes*> vNotes;
GAMESTATE->m_pCurSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_NotesType );
SortNotesArrayByDifficulty( vNotes );
for( unsigned i=0; i<vNotes.size(); i++ )
{
if( GAMESTATE->m_pCurNotes[p] == vNotes[i] )
m_iSelectedOption[p][PO_STEP] = i;
}
}
po.Init();
}
}
@@ -180,6 +146,9 @@ void ScreenPlayerOptions::ExportOptions()
{
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMESTATE->IsHumanPlayer(p) )
continue; // skip
PlayerOptions &po = GAMESTATE->m_PlayerOptions[p];
po.Init();
@@ -201,34 +170,32 @@ void ScreenPlayerOptions::ExportOptions()
if( m_iSelectedOption[p][PO_ACCEL] != 0 )
po.SetOneAccel( (PlayerOptions::Accel)(m_iSelectedOption[p][PO_ACCEL]-1) );
if( m_iSelectedOption[p][PO_EFFECT] != 0 )
po.SetOneEffect( (PlayerOptions::Effect)(m_iSelectedOption[p][PO_EFFECT]-1) );
if( m_iSelectedOption[p][PO_APPEAR] != 0 )
po.SetOneAppearance( (PlayerOptions::Appearance)(m_iSelectedOption[p][PO_APPEAR]-1) );
po.m_Turn = (PlayerOptions::Turn)m_iSelectedOption[p][PO_TURN];
po.m_Transform = (PlayerOptions::Transform)m_iSelectedOption[p][PO_TRANSFORM];
po.m_fReverseScroll = (m_iSelectedOption[p][PO_SCROLL] == 1) ? 1.f : 0.f;
int iSelectedSkin = m_iSelectedOption[p][PO_NOTE_SKIN];
CString sNewSkin = m_OptionRow[PO_NOTE_SKIN].choices[iSelectedSkin];
po.m_sNoteSkin = sNewSkin;
po.m_bHoldNotes = (m_iSelectedOption[p][PO_HOLD_NOTES] == 1);
po.m_fDark = (m_iSelectedOption[p][PO_DARK] == 1) ? 1.f : 0.f;
switch(m_iSelectedOption[p][PO_PERSPECTIVE])
//
// apply difficulty selection
//
if( GAMESTATE->m_pCurCourse ) // playing a course
{
case 0: po.m_fPerspectiveTilt = -1; break;
case 2: po.m_fPerspectiveTilt = 1; break;
default:po.m_fPerspectiveTilt = 0; break;
if( m_iSelectedOption[p][PO_STEP] == 1 )
GAMESTATE->m_bDifficultCourses = true;
else
GAMESTATE->m_bDifficultCourses = false;
}
if(m_iSelectedOption[p][PO_PERSPECTIVE] > 2)
else
{
const int choice = m_iSelectedOption[p][PO_PERSPECTIVE];
GAMESTATE->m_PlayerOptions[p].m_sPositioning = m_OptionRow[PO_PERSPECTIVE].choices[choice];
vector<Notes*> vNotes;
GAMESTATE->m_pCurSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_NotesType );
SortNotesArrayByDifficulty( vNotes );
GAMESTATE->m_pCurNotes[p] = vNotes[ m_iSelectedOption[p][PO_STEP] ];
}
}
}
@@ -245,68 +212,28 @@ void ScreenPlayerOptions::GoToNextState()
{
if( GAMESTATE->m_bEditing )
SCREENMAN->PopTopScreen();
else if( m_bGoToOptions )
SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) );
else
SCREENMAN->SetNewScreen( ScreenSongOptions::GetNextScreen() );
SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) );
}
void ScreenPlayerOptions::Update( float fDelta )
{
ScreenOptions::Update( fDelta );
m_sprOptionsMessage.Update( fDelta );
}
void ScreenPlayerOptions::DrawPrimitives()
{
ScreenOptions::DrawPrimitives();
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 &&
type == IET_FIRST_PRESS &&
!m_Menu.m_In.IsTransitioning() &&
MenuI.IsValid() &&
MenuI.button == MENU_BUTTON_START &&
PREFSMAN->m_ShowSongOptions == PrefsManager::ASK )
{
if( m_bAcceptedChoices && !m_bGoToOptions )
{
m_bGoToOptions = true;
m_sprOptionsMessage.SetState( 1 );
SOUNDMAN->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;
}
ScreenOptions::HandleScreenMessage( SM );
}
-4
View File
@@ -31,10 +31,6 @@ private:
void GoToNextState();
void GoToPrevState();
bool m_bAcceptedChoices;
bool m_bGoToOptions;
Sprite m_sprOptionsMessage;
};
+297
View File
@@ -0,0 +1,297 @@
#include "global.h"
/*
-----------------------------------------------------------------------------
Class: ScreenPlayerOptions2
Desc: Select a song.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "ScreenPlayerOptions2.h"
#include "RageUtil.h"
#include "ScreenManager.h"
#include "RageLog.h"
#include "GameState.h"
#include "ThemeManager.h"
#include "AnnouncerManager.h"
#include "NoteSkinManager.h"
#include "NoteFieldPositioning.h"
#include "ScreenSongOptions.h"
#include "Character.h"
#define PREV_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions2","PrevScreen"+Capitalize(PlayModeToString(play_mode)))
#define NEXT_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions2","NextScreen"+Capitalize(PlayModeToString(play_mode)))
enum {
PO_EFFECT,
PO_TRANSFORM,
PO_NOTE_SKIN,
PO_PERSPECTIVE,
PO_CHARACTER,
NUM_PLAYER_OPTIONS2_LINES
};
OptionRow g_PlayerOptions2Lines[NUM_PLAYER_OPTIONS2_LINES] = {
OptionRow( "Effect", "OFF","DRUNK","DIZZY","MINI","FLIP","TORNADO" ),
OptionRow( "Trans\n-form", "OFF","LITTLE","WIDE","BIG","QUICK","SKIPPY" ),
OptionRow( "Note\nSkin", "" ),
OptionRow( "Perspec\n-tive", "" ),
OptionRow( "Character", "" ),
};
ScreenPlayerOptions2::ScreenPlayerOptions2() :
ScreenOptions("ScreenPlayerOptions2",true)
{
LOG->Trace( "ScreenPlayerOptions2::ScreenPlayerOptions2()" );
Init(
INPUTMODE_PLAYERS,
g_PlayerOptions2Lines,
NUM_PLAYER_OPTIONS2_LINES,
true, false );
/* 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)
m_Menu.m_Out.Load( THEME->GetPathToB("ScreenPlayerOptions2 direct out") ); /* direct to stage */
else if(PREFSMAN->m_ShowSongOptions == PrefsManager::ASK)
m_Menu.m_Out.Load( THEME->GetPathToB("ScreenPlayerOptions2 option out") ); /* optional song options */
m_sprOptionsMessage.Load( THEME->GetPathToG("ScreenPlayerOptions2 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 );
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("player options intro") );
}
void ScreenPlayerOptions2::ImportOptions()
{
//
// fill in skin names
//
CStringArray arraySkinNames;
NOTESKIN->GetNoteSkinNames( arraySkinNames );
m_OptionRow[PO_NOTE_SKIN].choices.clear();
unsigned i;
for( i=0; i<arraySkinNames.size(); i++ )
{
arraySkinNames[i].MakeUpper();
m_OptionRow[PO_NOTE_SKIN].choices.push_back( arraySkinNames[i] );
}
//
// fill in perspective names
//
m_OptionRow[PO_PERSPECTIVE].choices.clear();
m_OptionRow[PO_PERSPECTIVE].choices.push_back( "INCOMING" );
m_OptionRow[PO_PERSPECTIVE].choices.push_back( "OVERHEAD" );
m_OptionRow[PO_PERSPECTIVE].choices.push_back( "SPACE" );
CStringArray arrayPosNames;
GAMESTATE->m_pPosition->GetNamesForCurrentGame(arrayPosNames);
for( i=0; i<arrayPosNames.size(); i++ )
{
arrayPosNames[i].MakeUpper();
m_OptionRow[PO_PERSPECTIVE].choices.push_back( arrayPosNames[i] );
}
//
// fill in character names
//
m_OptionRow[PO_CHARACTER].choices.clear();
m_OptionRow[PO_CHARACTER].choices.push_back( "OFF" );
for( i=0; i<GAMESTATE->m_pCharacters.size(); i++ )
{
CString s = GAMESTATE->m_pCharacters[i]->m_sName;
s.MakeUpper();
m_OptionRow[PO_CHARACTER].choices.push_back( s );
}
//
// Init options
//
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMESTATE->IsHumanPlayer(p) )
continue; // skip
PlayerOptions &po = GAMESTATE->m_PlayerOptions[p];
po.Init();
m_iSelectedOption[p][PO_EFFECT] = po.GetFirstEffect()+1;
m_iSelectedOption[p][PO_TRANSFORM] = po.m_Transform;
// highlight currently selected skin
m_iSelectedOption[p][PO_NOTE_SKIN] = -1;
for( unsigned j=0; j<m_OptionRow[PO_NOTE_SKIN].choices.size(); j++ )
{
if( 0==stricmp(m_OptionRow[PO_NOTE_SKIN].choices[j], po.m_sNoteSkin) )
{
m_iSelectedOption[p][PO_NOTE_SKIN] = j;
break;
}
}
if( m_iSelectedOption[p][PO_NOTE_SKIN] == -1 )
m_iSelectedOption[p][PO_NOTE_SKIN] = 0;
/* Default: */
m_iSelectedOption[p][PO_PERSPECTIVE] = 1;
if(po.m_fPerspectiveTilt == -1)
m_iSelectedOption[p][PO_PERSPECTIVE] = 0;
else if(po.m_fPerspectiveTilt == 1)
m_iSelectedOption[p][PO_PERSPECTIVE] = 2;
else /* po.m_fPerspectiveTilt == 0 */
{
vector<CString> &choices = m_OptionRow[PO_PERSPECTIVE].choices;
for(unsigned n = 3; n < choices.size(); ++n)
if(!choices[n].CompareNoCase(GAMESTATE->m_PlayerOptions[p].m_sPositioning))
m_iSelectedOption[p][PO_PERSPECTIVE] = n;
}
for( i=0; i<GAMESTATE->m_pCharacters.size(); i++ )
if( GAMESTATE->m_pCurCharacters[p] == GAMESTATE->m_pCharacters[i] )
m_iSelectedOption[p][PO_CHARACTER] = i+1;
}
}
void ScreenPlayerOptions2::ExportOptions()
{
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMESTATE->IsHumanPlayer(p) )
continue; // skip
PlayerOptions &po = GAMESTATE->m_PlayerOptions[p];
po.Init();
if( m_iSelectedOption[p][PO_EFFECT] != 0 )
po.SetOneEffect( (PlayerOptions::Effect)(m_iSelectedOption[p][PO_EFFECT]-1) );
po.m_Transform = (PlayerOptions::Transform)m_iSelectedOption[p][PO_TRANSFORM];
int iSelectedSkin = m_iSelectedOption[p][PO_NOTE_SKIN];
CString sNewSkin = m_OptionRow[PO_NOTE_SKIN].choices[iSelectedSkin];
po.m_sNoteSkin = sNewSkin;
switch(m_iSelectedOption[p][PO_PERSPECTIVE])
{
case 0: po.m_fPerspectiveTilt = -1; break;
case 2: po.m_fPerspectiveTilt = 1; break;
default:po.m_fPerspectiveTilt = 0; break;
}
if(m_iSelectedOption[p][PO_PERSPECTIVE] > 2)
{
const int choice = m_iSelectedOption[p][PO_PERSPECTIVE];
GAMESTATE->m_PlayerOptions[p].m_sPositioning = m_OptionRow[PO_PERSPECTIVE].choices[choice];
}
if(m_iSelectedOption[p][PO_PERSPECTIVE] > 2)
{
const int choice = m_iSelectedOption[p][PO_PERSPECTIVE];
GAMESTATE->m_PlayerOptions[p].m_sPositioning = m_OptionRow[PO_PERSPECTIVE].choices[choice];
}
if( m_iSelectedOption[p][PO_CHARACTER] > 0 )
{
int choice = m_iSelectedOption[p][PO_CHARACTER] - 1;
GAMESTATE->m_pCurCharacters[p] = GAMESTATE->m_pCharacters[choice];
}
else
GAMESTATE->m_pCurCharacters[p] = NULL;
}
}
void ScreenPlayerOptions2::GoToPrevState()
{
if( GAMESTATE->m_bEditing )
SCREENMAN->PopTopScreen();
else
SCREENMAN->SetNewScreen( PREV_SCREEN(GAMESTATE->m_PlayMode) );
}
void ScreenPlayerOptions2::GoToNextState()
{
if( GAMESTATE->m_bEditing )
SCREENMAN->PopTopScreen();
else if( m_bGoToOptions )
SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) );
else
SCREENMAN->SetNewScreen( ScreenSongOptions::GetNextScreen() );
}
void ScreenPlayerOptions2::Update( float fDelta )
{
ScreenOptions::Update( fDelta );
m_sprOptionsMessage.Update( fDelta );
}
void ScreenPlayerOptions2::DrawPrimitives()
{
ScreenOptions::DrawPrimitives();
m_sprOptionsMessage.Draw();
}
void ScreenPlayerOptions2::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
if( !GAMESTATE->m_bEditing &&
type == IET_FIRST_PRESS &&
!m_Menu.m_In.IsTransitioning() &&
MenuI.IsValid() &&
MenuI.button == MENU_BUTTON_START &&
PREFSMAN->m_ShowSongOptions == PrefsManager::ASK )
{
if( m_bAcceptedChoices && !m_bGoToOptions )
{
m_bGoToOptions = true;
m_sprOptionsMessage.SetState( 1 );
SOUNDMAN->PlayOnce( THEME->GetPathToS("Common start") );
}
}
ScreenOptions::Input( DeviceI, type, GameI, MenuI, StyleI );
}
void ScreenPlayerOptions2::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;
}
ScreenOptions::HandleScreenMessage( SM );
}
+42
View File
@@ -0,0 +1,42 @@
#ifndef ScreenPlayerOptions2_H
#define ScreenPlayerOptions2_H
/*
-----------------------------------------------------------------------------
Class: ScreenPlayerOptions2
Desc: Select a song.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "ScreenOptions.h"
#include "PrefsManager.h"
class ScreenPlayerOptions2 : public ScreenOptions
{
public:
ScreenPlayerOptions2();
virtual void Update( float fDelta );
virtual void DrawPrimitives();
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
virtual void HandleScreenMessage( const ScreenMessage SM );
private:
void ImportOptions();
void ExportOptions();
void GoToNextState();
void GoToPrevState();
bool m_bAcceptedChoices;
bool m_bGoToOptions;
Sprite m_sprOptionsMessage;
};
#endif
+2 -2
View File
@@ -225,14 +225,14 @@ ScreenSelectMusic::~ScreenSelectMusic()
void ScreenSelectMusic::DrawPrimitives()
{
DISPLAY->LoadMenuPerspective(FOV);
// DISPLAY->LoadMenuPerspective(FOV);
m_Menu.DrawBottomLayer();
Screen::DrawPrimitives();
m_Menu.DrawTopLayer();
m_sprOptionsMessage.Draw();
DISPLAY->LoadMenuPerspective(0);
// DISPLAY->LoadMenuPerspective(0);
}
void ScreenSelectMusic::TweenOnScreen()