2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2002-05-20 08:59:37 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
2002-08-27 03:59:22 +00:00
|
|
|
Class: ScreenPlayerOptions
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
Desc: Select a song.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
2002-08-27 03:59:22 +00:00
|
|
|
Chris Danford
|
2002-05-20 08:59:37 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ScreenPlayerOptions.h"
|
|
|
|
|
#include "RageUtil.h"
|
|
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "RageLog.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "GameState.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#include "ThemeManager.h"
|
|
|
|
|
#include "AnnouncerManager.h"
|
2003-07-26 23:05:16 +00:00
|
|
|
#include "RageSounds.h"
|
2003-02-17 12:19:42 +00:00
|
|
|
#include "NoteSkinManager.h"
|
2003-04-18 02:13:23 +00:00
|
|
|
#include "NoteFieldPositioning.h"
|
2003-04-21 22:36:45 +00:00
|
|
|
#include "ScreenSongOptions.h"
|
2003-06-16 03:44:15 +00:00
|
|
|
#include "Character.h"
|
2003-08-03 00:13:55 +00:00
|
|
|
#include "Steps.h"
|
2003-06-15 17:05:51 +00:00
|
|
|
#include "Course.h"
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-16 22:49:40 +00:00
|
|
|
#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)))
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
PO_SPEED = 0,
|
2003-01-25 11:05:12 +00:00
|
|
|
PO_ACCEL,
|
2003-06-16 03:44:15 +00:00
|
|
|
PO_EFFECT,
|
2002-05-20 08:59:37 +00:00
|
|
|
PO_APPEAR,
|
|
|
|
|
PO_TURN,
|
2003-06-16 03:44:15 +00:00
|
|
|
PO_TRANSFORM,
|
2002-05-20 08:59:37 +00:00
|
|
|
PO_SCROLL,
|
2003-06-16 03:44:15 +00:00
|
|
|
PO_NOTE_SKIN,
|
2002-05-27 08:23:27 +00:00
|
|
|
PO_HOLD_NOTES,
|
2003-08-24 17:20:58 +00:00
|
|
|
PO_HIDE,
|
2003-06-16 03:44:15 +00:00
|
|
|
PO_PERSPECTIVE,
|
2003-06-15 17:05:51 +00:00
|
|
|
PO_STEP,
|
2003-06-16 03:44:15 +00:00
|
|
|
PO_CHARACTER,
|
2003-08-23 22:04:57 +00:00
|
|
|
SO_LIFE,
|
|
|
|
|
SO_DRAIN,
|
|
|
|
|
SO_BAT_LIVES,
|
|
|
|
|
SO_FAIL,
|
|
|
|
|
SO_ASSIST,
|
|
|
|
|
SO_RATE,
|
|
|
|
|
SO_AUTOSYNC,
|
2003-09-04 21:24:50 +00:00
|
|
|
SO_SAVE,
|
2002-05-20 08:59:37 +00:00
|
|
|
NUM_PLAYER_OPTIONS_LINES
|
|
|
|
|
};
|
2003-03-15 19:25:37 +00:00
|
|
|
OptionRow g_PlayerOptionsLines[NUM_PLAYER_OPTIONS_LINES] = {
|
2003-08-23 22:04:57 +00:00
|
|
|
OptionRow( "Speed", false, "x0.25","x0.5","x0.75","x1","x1.5","x2","x3","x5","x8","C200","C300" ),
|
|
|
|
|
OptionRow( "Acceler\n-ation", false, "OFF","BOOST","BRAKE","WAVE","EXPAND","BOOMERANG" ),
|
|
|
|
|
OptionRow( "Effect", false, "OFF","DRUNK","DIZZY","MINI","FLIP","TORNADO","TIPSY" ),
|
|
|
|
|
OptionRow( "Appear\n-ance", false, "VISIBLE","HIDDEN","SUDDEN","STEALTH","BLINK", "R.VANISH" ),
|
|
|
|
|
OptionRow( "Turn", false, "OFF","MIRROR","LEFT","RIGHT","SHUFFLE","S.SHUFFLE" ),
|
|
|
|
|
OptionRow( "Trans\n-form", false, "OFF","LITTLE","WIDE","BIG","QUICK","SKIPPY","MINES" ),
|
|
|
|
|
OptionRow( "Scroll", false, "STANDARD","REVERSE","SPLIT","ALTERNATE" ),
|
|
|
|
|
OptionRow( "Note\nSkin", false, "" ),
|
|
|
|
|
OptionRow( "Holds", false, "OFF","ON" ),
|
2003-08-24 17:20:58 +00:00
|
|
|
OptionRow( "Hide", false, "OFF","DARK","BLIND"),
|
2003-08-23 22:04:57 +00:00
|
|
|
OptionRow( "Perspec\n-tive", false, "" ),
|
|
|
|
|
OptionRow( "Step", false, "" ),
|
2003-08-28 07:38:09 +00:00
|
|
|
OptionRow( "Charac\n-ter", false, "" ),
|
2003-08-23 22:04:57 +00:00
|
|
|
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" ),
|
2003-09-04 21:24:50 +00:00
|
|
|
OptionRow( "Auto\nAdjust", true, "OFF", "ON" ),
|
|
|
|
|
OptionRow( "Save\nScores", true, "OFF", "ON" ),
|
2002-05-20 08:59:37 +00:00
|
|
|
};
|
|
|
|
|
|
2003-07-10 02:56:21 +00:00
|
|
|
static const PlayerOptions::Effect ChoosableEffects[] =
|
|
|
|
|
{
|
|
|
|
|
PlayerOptions::EFFECT_DRUNK,
|
|
|
|
|
PlayerOptions::EFFECT_DIZZY,
|
|
|
|
|
PlayerOptions::EFFECT_MINI,
|
|
|
|
|
PlayerOptions::EFFECT_FLIP,
|
|
|
|
|
PlayerOptions::EFFECT_TORNADO,
|
2003-08-16 23:34:47 +00:00
|
|
|
PlayerOptions::EFFECT_TIPSY,
|
2003-07-10 02:56:21 +00:00
|
|
|
PlayerOptions::NUM_EFFECTS
|
|
|
|
|
};
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
ScreenPlayerOptions::ScreenPlayerOptions() :
|
2003-03-09 00:55:49 +00:00
|
|
|
ScreenOptions("ScreenPlayerOptions",true)
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2002-07-31 19:40:40 +00:00
|
|
|
LOG->Trace( "ScreenPlayerOptions::ScreenPlayerOptions()" );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
Init(
|
2003-08-23 22:04:57 +00:00
|
|
|
INPUTMODE_INDIVIDUAL,
|
2002-05-20 08:59:37 +00:00
|
|
|
g_PlayerOptionsLines,
|
2002-09-03 22:31:06 +00:00
|
|
|
NUM_PLAYER_OPTIONS_LINES,
|
2003-08-23 22:04:57 +00:00
|
|
|
false );
|
2002-08-01 05:11:11 +00:00
|
|
|
|
2003-06-16 03:44:15 +00:00
|
|
|
/* 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 */
|
2003-08-29 05:10:53 +00:00
|
|
|
// if(PREFSMAN->m_ShowSongOptions == PrefsManager::NO)
|
2003-06-16 03:44:15 +00:00
|
|
|
m_Menu.m_Out.Load( THEME->GetPathToB("ScreenPlayerOptions direct out") ); /* direct to stage */
|
2003-08-29 05:10:53 +00:00
|
|
|
// 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) );
|
2003-06-16 03:44:15 +00:00
|
|
|
//this->AddChild( &m_sprOptionsMessage ); // we have to draw this manually over the top of transitions
|
|
|
|
|
|
|
|
|
|
m_bAcceptedChoices = false;
|
2003-08-29 05:10:53 +00:00
|
|
|
// m_bGoToOptions = ( PREFSMAN->m_ShowSongOptions == PrefsManager::YES );
|
2003-06-16 03:44:15 +00:00
|
|
|
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("player options intro") );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenPlayerOptions::ImportOptions()
|
|
|
|
|
{
|
2003-06-15 17:05:51 +00:00
|
|
|
// fill in difficulty names
|
|
|
|
|
m_OptionRow[PO_STEP].choices.clear();
|
2003-08-11 02:18:13 +00:00
|
|
|
if( GAMESTATE->m_bEditing )
|
|
|
|
|
{
|
|
|
|
|
m_OptionRow[PO_STEP].choices.push_back( "" );
|
|
|
|
|
}
|
|
|
|
|
else if( GAMESTATE->m_pCurCourse ) // playing a course
|
2003-02-17 12:19:42 +00:00
|
|
|
{
|
2003-06-16 03:44:15 +00:00
|
|
|
m_OptionRow[PO_STEP].choices.push_back( "REGULAR" );
|
2003-08-07 06:36:34 +00:00
|
|
|
if( GAMESTATE->m_pCurCourse->HasDifficult( GAMESTATE->GetCurrentStyleDef()->m_StepsType ) )
|
2003-06-15 17:05:51 +00:00
|
|
|
m_OptionRow[PO_STEP].choices.push_back( "DIFFICULT" );
|
2003-02-17 12:19:42 +00:00
|
|
|
}
|
2003-08-11 02:18:13 +00:00
|
|
|
else if( GAMESTATE->m_pCurSong ) // playing a song
|
2003-04-18 02:13:23 +00:00
|
|
|
{
|
2003-08-03 00:13:55 +00:00
|
|
|
vector<Steps*> vNotes;
|
2003-08-10 08:58:11 +00:00
|
|
|
GAMESTATE->m_pCurSong->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
2003-06-15 17:05:51 +00:00
|
|
|
SortNotesArrayByDifficulty( vNotes );
|
|
|
|
|
for( unsigned i=0; i<vNotes.size(); i++ )
|
|
|
|
|
{
|
|
|
|
|
CString s = vNotes[i]->GetDescription();
|
|
|
|
|
s.MakeUpper();
|
2003-08-08 10:01:55 +00:00
|
|
|
|
|
|
|
|
// convert to theme-defined values
|
|
|
|
|
s = ConvertParamToThemeDifficulty(s);
|
|
|
|
|
|
2003-06-16 03:44:15 +00:00
|
|
|
m_OptionRow[PO_STEP].choices.push_back( s );
|
2003-06-15 17:05:51 +00:00
|
|
|
}
|
2003-04-18 02:13:23 +00:00
|
|
|
}
|
|
|
|
|
|
2003-06-15 17:05:51 +00:00
|
|
|
//
|
2003-06-16 03:44:15 +00:00
|
|
|
// fill in skin names
|
2003-06-15 17:05:51 +00:00
|
|
|
//
|
2003-06-16 03:44:15 +00:00
|
|
|
CStringArray arraySkinNames;
|
|
|
|
|
NOTESKIN->GetNoteSkinNames( arraySkinNames );
|
|
|
|
|
|
|
|
|
|
m_OptionRow[PO_NOTE_SKIN].choices.clear();
|
|
|
|
|
|
|
|
|
|
unsigned i;
|
|
|
|
|
for( i=0; i<arraySkinNames.size(); i++ )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2003-06-16 03:44:15 +00:00
|
|
|
arraySkinNames[i].MakeUpper();
|
|
|
|
|
m_OptionRow[PO_NOTE_SKIN].choices.push_back( arraySkinNames[i] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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();
|
2003-06-27 08:06:22 +00:00
|
|
|
m_OptionRow[PO_CHARACTER].choices.push_back( "OFF" );
|
2003-06-16 03:44:15 +00:00
|
|
|
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 );
|
|
|
|
|
}
|
|
|
|
|
|
2003-06-15 17:05:51 +00:00
|
|
|
|
2003-06-16 03:44:15 +00:00
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2002-07-23 01:41:40 +00:00
|
|
|
PlayerOptions &po = GAMESTATE->m_PlayerOptions[p];
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-24 06:16:04 +00:00
|
|
|
if( !po.m_bTimeSpacing && po.m_fScrollSpeed == 0.25f ) m_iSelectedOption[p][PO_SPEED] = 0;
|
|
|
|
|
else if( !po.m_bTimeSpacing && po.m_fScrollSpeed == 0.5f ) m_iSelectedOption[p][PO_SPEED] = 1;
|
|
|
|
|
else if( !po.m_bTimeSpacing && po.m_fScrollSpeed == 0.75f ) m_iSelectedOption[p][PO_SPEED] = 2;
|
|
|
|
|
else if( !po.m_bTimeSpacing && po.m_fScrollSpeed == 1.0f ) m_iSelectedOption[p][PO_SPEED] = 3;
|
|
|
|
|
else if( !po.m_bTimeSpacing && po.m_fScrollSpeed == 1.5f ) m_iSelectedOption[p][PO_SPEED] = 4;
|
|
|
|
|
else if( !po.m_bTimeSpacing && po.m_fScrollSpeed == 2.0f ) m_iSelectedOption[p][PO_SPEED] = 5;
|
|
|
|
|
else if( !po.m_bTimeSpacing && po.m_fScrollSpeed == 3.0f ) m_iSelectedOption[p][PO_SPEED] = 6;
|
|
|
|
|
else if( !po.m_bTimeSpacing && po.m_fScrollSpeed == 5.0f ) m_iSelectedOption[p][PO_SPEED] = 7;
|
2003-05-28 18:42:33 +00:00
|
|
|
else if( !po.m_bTimeSpacing && po.m_fScrollSpeed == 8.0f ) m_iSelectedOption[p][PO_SPEED] = 8;
|
|
|
|
|
else if( po.m_bTimeSpacing && po.m_fScrollBPM == 200 ) m_iSelectedOption[p][PO_SPEED] = 9;
|
2003-04-24 06:16:04 +00:00
|
|
|
else if( po.m_bTimeSpacing && po.m_fScrollBPM == 300 ) m_iSelectedOption[p][PO_SPEED] = 10;
|
2003-02-26 23:26:57 +00:00
|
|
|
else m_iSelectedOption[p][PO_SPEED] = 3;
|
2003-01-25 11:05:12 +00:00
|
|
|
|
2003-02-26 23:26:57 +00:00
|
|
|
m_iSelectedOption[p][PO_ACCEL] = po.GetFirstAccel()+1;
|
2003-07-10 02:56:21 +00:00
|
|
|
|
|
|
|
|
const PlayerOptions::Effect e = po.GetFirstEffect();
|
|
|
|
|
m_iSelectedOption[p][PO_EFFECT] = 0;
|
|
|
|
|
for( i = 0; ChoosableEffects[i] != PlayerOptions::NUM_EFFECTS; ++i )
|
|
|
|
|
if( ChoosableEffects[i] == e )
|
|
|
|
|
m_iSelectedOption[p][PO_EFFECT] = i+1;
|
|
|
|
|
|
|
|
|
|
// m_iSelectedOption[p][PO_EFFECT] = po.GetFirstEffect()+1;
|
2003-02-26 23:26:57 +00:00
|
|
|
m_iSelectedOption[p][PO_APPEAR] = po.GetFirstAppearance()+1;
|
|
|
|
|
m_iSelectedOption[p][PO_TURN] = po.m_Turn;
|
2003-06-16 03:44:15 +00:00
|
|
|
m_iSelectedOption[p][PO_TRANSFORM] = po.m_Transform;
|
2003-08-17 00:15:54 +00:00
|
|
|
m_iSelectedOption[p][PO_SCROLL] = po.GetFirstScroll()+1;
|
2003-02-17 12:19:42 +00:00
|
|
|
|
|
|
|
|
|
2003-06-16 03:44:15 +00:00
|
|
|
// 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;
|
|
|
|
|
|
|
|
|
|
|
2002-05-27 08:23:27 +00:00
|
|
|
m_iSelectedOption[p][PO_HOLD_NOTES] = po.m_bHoldNotes ? 1 : 0;
|
2003-08-24 17:20:58 +00:00
|
|
|
m_iSelectedOption[p][PO_HIDE] = po.m_fBlind ? 2 : (po.m_fDark ? 1 : 0);
|
2003-04-16 22:49:40 +00:00
|
|
|
|
2003-08-11 02:18:13 +00:00
|
|
|
|
|
|
|
|
if( GAMESTATE->m_bEditing )
|
|
|
|
|
{
|
|
|
|
|
m_iSelectedOption[p][PO_STEP] = 0;
|
|
|
|
|
}
|
|
|
|
|
else if( GAMESTATE->m_pCurCourse ) // playing a course
|
2003-06-18 00:07:56 +00:00
|
|
|
{
|
2003-08-24 21:30:04 +00:00
|
|
|
// support for difficult on one side and normal on other is not supported
|
|
|
|
|
// force same choice on both sides
|
|
|
|
|
g_PlayerOptionsLines[PO_STEP].bOneChoiceForAllPlayers = true;
|
|
|
|
|
|
2003-07-17 22:44:17 +00:00
|
|
|
if( GAMESTATE->m_bDifficultCourses &&
|
2003-08-07 06:36:34 +00:00
|
|
|
GAMESTATE->m_pCurCourse->HasDifficult( GAMESTATE->GetCurrentStyleDef()->m_StepsType ) )
|
2003-06-18 00:07:56 +00:00
|
|
|
m_iSelectedOption[p][PO_STEP] = 1;
|
|
|
|
|
else
|
|
|
|
|
m_iSelectedOption[p][PO_STEP] = 0;
|
|
|
|
|
}
|
2003-08-11 02:18:13 +00:00
|
|
|
else if( GAMESTATE->m_pCurSong ) // playing a song
|
2003-06-18 00:07:56 +00:00
|
|
|
{
|
2003-08-03 00:13:55 +00:00
|
|
|
vector<Steps*> vNotes;
|
2003-08-10 08:58:11 +00:00
|
|
|
GAMESTATE->m_pCurSong->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
2003-06-18 00:07:56 +00:00
|
|
|
SortNotesArrayByDifficulty( vNotes );
|
|
|
|
|
for( unsigned i=0; i<vNotes.size(); i++ )
|
|
|
|
|
{
|
|
|
|
|
if( GAMESTATE->m_pCurNotes[p] == vNotes[i] )
|
|
|
|
|
m_iSelectedOption[p][PO_STEP] = i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-06-16 03:44:15 +00:00
|
|
|
/* 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 */
|
2003-04-18 02:13:23 +00:00
|
|
|
{
|
2003-06-16 03:44:15 +00:00
|
|
|
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;
|
2003-04-18 02:13:23 +00:00
|
|
|
}
|
2003-06-16 03:44:15 +00:00
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
2003-07-10 02:56:21 +00:00
|
|
|
/* Why do this? We don't want to erase if we back out. */
|
|
|
|
|
// po.Init();
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
2003-08-23 22:04:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
SongOptions &so = GAMESTATE->m_SongOptions;
|
|
|
|
|
|
|
|
|
|
m_iSelectedOption[0][SO_LIFE] = so.m_LifeType;
|
2003-08-29 04:17:04 +00:00
|
|
|
m_iSelectedOption[0][SO_DRAIN] = so.m_DrainType;
|
2003-08-23 22:04:57 +00:00
|
|
|
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;
|
2003-09-04 21:24:50 +00:00
|
|
|
m_iSelectedOption[0][SO_SAVE] = so.m_bSaveScore;
|
2003-08-23 22:04:57 +00:00
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenPlayerOptions::ExportOptions()
|
|
|
|
|
{
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2002-07-23 01:41:40 +00:00
|
|
|
PlayerOptions &po = GAMESTATE->m_PlayerOptions[p];
|
2003-07-10 02:56:21 +00:00
|
|
|
/* Why do this? We don't necessarily set everything in po, so we shouldn't
|
|
|
|
|
* erase everything. */
|
|
|
|
|
// po.Init();
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-08-10 00:39:28 +00:00
|
|
|
// if player isn't enabled, don't bother parsing options
|
|
|
|
|
// **very important for nonstop difficulties**
|
|
|
|
|
if (!GAMESTATE->IsPlayerEnabled(p))
|
|
|
|
|
continue;
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
switch( m_iSelectedOption[p][PO_SPEED] )
|
|
|
|
|
{
|
2003-04-24 06:16:04 +00:00
|
|
|
case 0: po.m_bTimeSpacing = false; po.m_fScrollSpeed = 0.25f; break;
|
|
|
|
|
case 1: po.m_bTimeSpacing = false; po.m_fScrollSpeed = 0.5f; break;
|
|
|
|
|
case 2: po.m_bTimeSpacing = false; po.m_fScrollSpeed = 0.75f; break;
|
|
|
|
|
case 3: po.m_bTimeSpacing = false; po.m_fScrollSpeed = 1.0f; break;
|
|
|
|
|
case 4: po.m_bTimeSpacing = false; po.m_fScrollSpeed = 1.5f; break;
|
|
|
|
|
case 5: po.m_bTimeSpacing = false; po.m_fScrollSpeed = 2.0f; break;
|
|
|
|
|
case 6: po.m_bTimeSpacing = false; po.m_fScrollSpeed = 3.0f; break;
|
|
|
|
|
case 7: po.m_bTimeSpacing = false; po.m_fScrollSpeed = 5.0f; break;
|
|
|
|
|
case 8: po.m_bTimeSpacing = false; po.m_fScrollSpeed = 8.0f; break;
|
2003-08-09 21:19:59 +00:00
|
|
|
case 9: po.m_bTimeSpacing = true; po.m_fScrollSpeed = 1.0f; po.m_fScrollBPM = 200; break;
|
|
|
|
|
case 10:po.m_bTimeSpacing = true; po.m_fScrollSpeed = 1.0f; po.m_fScrollBPM = 300; break;
|
2003-04-16 22:49:40 +00:00
|
|
|
default: ASSERT(0);
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2003-07-12 19:20:01 +00:00
|
|
|
ZERO( po.m_fAccels );
|
2003-02-26 23:26:57 +00:00
|
|
|
if( m_iSelectedOption[p][PO_ACCEL] != 0 )
|
|
|
|
|
po.SetOneAccel( (PlayerOptions::Accel)(m_iSelectedOption[p][PO_ACCEL]-1) );
|
2003-07-10 02:56:21 +00:00
|
|
|
|
|
|
|
|
/* Don't change effects that aren't displayed. */
|
|
|
|
|
for( int i = 0; ChoosableEffects[i] != PlayerOptions::NUM_EFFECTS; ++i )
|
|
|
|
|
{
|
|
|
|
|
const bool on = (i+1 == m_iSelectedOption[p][PO_EFFECT]);
|
|
|
|
|
const PlayerOptions::Effect e = ChoosableEffects[i];
|
|
|
|
|
|
|
|
|
|
po.m_fEffects[e] = on? 1.0f:0.0f;
|
|
|
|
|
}
|
|
|
|
|
|
2003-07-12 19:20:01 +00:00
|
|
|
ZERO( po.m_fAppearances );
|
2003-02-26 23:26:57 +00:00
|
|
|
if( m_iSelectedOption[p][PO_APPEAR] != 0 )
|
|
|
|
|
po.SetOneAppearance( (PlayerOptions::Appearance)(m_iSelectedOption[p][PO_APPEAR]-1) );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-02-26 23:26:57 +00:00
|
|
|
po.m_Turn = (PlayerOptions::Turn)m_iSelectedOption[p][PO_TURN];
|
2003-06-16 03:44:15 +00:00
|
|
|
po.m_Transform = (PlayerOptions::Transform)m_iSelectedOption[p][PO_TRANSFORM];
|
2003-08-17 00:15:54 +00:00
|
|
|
|
|
|
|
|
ZERO( po.m_fScrolls );
|
|
|
|
|
if( m_iSelectedOption[p][PO_SCROLL] != 0 )
|
|
|
|
|
po.SetOneScroll( (PlayerOptions::Scroll)(m_iSelectedOption[p][PO_SCROLL]-1) );
|
2003-02-17 12:19:42 +00:00
|
|
|
|
|
|
|
|
|
2003-06-16 03:44:15 +00:00
|
|
|
int iSelectedSkin = m_iSelectedOption[p][PO_NOTE_SKIN];
|
|
|
|
|
CString sNewSkin = m_OptionRow[PO_NOTE_SKIN].choices[iSelectedSkin];
|
|
|
|
|
po.m_sNoteSkin = sNewSkin;
|
|
|
|
|
|
|
|
|
|
|
2003-04-01 19:31:27 +00:00
|
|
|
po.m_bHoldNotes = (m_iSelectedOption[p][PO_HOLD_NOTES] == 1);
|
2003-08-24 17:20:58 +00:00
|
|
|
po.m_fDark = (m_iSelectedOption[p][PO_HIDE] == 1) ? 1.f : 0.f;
|
|
|
|
|
po.m_fBlind = (m_iSelectedOption[p][PO_HIDE] == 2) ? 1.f : 0.f;
|
2003-06-16 03:44:15 +00:00
|
|
|
|
|
|
|
|
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];
|
|
|
|
|
}
|
2003-06-15 17:05:51 +00:00
|
|
|
|
2003-06-18 00:07:56 +00:00
|
|
|
//
|
|
|
|
|
// apply difficulty selection
|
|
|
|
|
//
|
2003-08-11 06:09:57 +00:00
|
|
|
if( GAMESTATE->m_bEditing )
|
|
|
|
|
{
|
|
|
|
|
// do nothing
|
|
|
|
|
}
|
|
|
|
|
else if( GAMESTATE->m_pCurCourse ) // playing a course
|
2003-04-18 02:13:23 +00:00
|
|
|
{
|
2003-06-18 00:07:56 +00:00
|
|
|
if( m_iSelectedOption[p][PO_STEP] == 1 )
|
2003-08-10 00:39:28 +00:00
|
|
|
{
|
2003-06-18 00:07:56 +00:00
|
|
|
GAMESTATE->m_bDifficultCourses = true;
|
2003-08-10 00:39:28 +00:00
|
|
|
LOG->Trace("ScreenPlayerOptions: Using difficult course");
|
|
|
|
|
}
|
2003-06-15 17:05:51 +00:00
|
|
|
else
|
2003-08-10 00:39:28 +00:00
|
|
|
{
|
2003-06-18 00:07:56 +00:00
|
|
|
GAMESTATE->m_bDifficultCourses = false;
|
2003-08-10 00:39:28 +00:00
|
|
|
LOG->Trace("ScreenPlayerOptions: Using normal course");
|
|
|
|
|
}
|
2003-04-18 02:13:23 +00:00
|
|
|
}
|
2003-06-15 17:05:51 +00:00
|
|
|
else
|
2003-04-18 02:13:23 +00:00
|
|
|
{
|
2003-08-03 00:13:55 +00:00
|
|
|
vector<Steps*> vNotes;
|
2003-08-10 08:58:11 +00:00
|
|
|
GAMESTATE->m_pCurSong->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
2003-06-15 17:05:51 +00:00
|
|
|
SortNotesArrayByDifficulty( vNotes );
|
2003-06-18 00:07:56 +00:00
|
|
|
GAMESTATE->m_pCurNotes[p] = vNotes[ m_iSelectedOption[p][PO_STEP] ];
|
2003-06-16 03:44:15 +00:00
|
|
|
}
|
|
|
|
|
|
2003-06-27 08:06:22 +00:00
|
|
|
if( m_iSelectedOption[p][PO_CHARACTER] == 0 )
|
|
|
|
|
GAMESTATE->m_pCurCharacters[p] = NULL;
|
|
|
|
|
else
|
2003-06-16 03:44:15 +00:00
|
|
|
{
|
|
|
|
|
int choice = m_iSelectedOption[p][PO_CHARACTER] - 1;
|
|
|
|
|
GAMESTATE->m_pCurCharacters[p] = GAMESTATE->m_pCharacters[choice];
|
2003-04-18 02:13:23 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
2003-08-23 22:04:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
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];
|
2003-09-04 21:24:50 +00:00
|
|
|
so.m_bSaveScore = !!m_iSelectedOption[0][SO_SAVE];
|
2003-08-23 22:04:57 +00:00
|
|
|
|
|
|
|
|
int iSel = m_iSelectedOption[0][SO_RATE];
|
|
|
|
|
so.m_fMusicRate = (float) atof( g_PlayerOptionsLines[SO_RATE].choices[iSel] );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenPlayerOptions::GoToPrevState()
|
|
|
|
|
{
|
2003-02-19 05:46:09 +00:00
|
|
|
if( GAMESTATE->m_bEditing )
|
|
|
|
|
SCREENMAN->PopTopScreen();
|
2002-08-24 02:46:09 +00:00
|
|
|
else
|
2003-04-16 22:49:40 +00:00
|
|
|
SCREENMAN->SetNewScreen( PREV_SCREEN(GAMESTATE->m_PlayMode) );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenPlayerOptions::GoToNextState()
|
|
|
|
|
{
|
2003-02-19 05:46:09 +00:00
|
|
|
if( GAMESTATE->m_bEditing )
|
2003-08-11 06:09:57 +00:00
|
|
|
{
|
2003-02-19 05:46:09 +00:00
|
|
|
SCREENMAN->PopTopScreen();
|
2003-08-11 06:09:57 +00:00
|
|
|
}
|
2003-06-16 03:44:15 +00:00
|
|
|
else
|
2003-08-11 06:09:57 +00:00
|
|
|
{
|
|
|
|
|
GAMESTATE->AdjustFailType();
|
|
|
|
|
|
2003-08-29 05:10:53 +00:00
|
|
|
// if( m_bGoToOptions )
|
2003-08-11 06:09:57 +00:00
|
|
|
SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) );
|
2003-08-29 05:10:53 +00:00
|
|
|
// else
|
|
|
|
|
// SCREENMAN->SetNewScreen( ScreenSongOptions::GetNextScreen() );
|
2003-08-11 06:09:57 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-03-11 08:52:45 +00:00
|
|
|
void ScreenPlayerOptions::Update( float fDelta )
|
|
|
|
|
{
|
|
|
|
|
ScreenOptions::Update( fDelta );
|
2003-08-29 05:10:53 +00:00
|
|
|
// m_sprOptionsMessage.Update( fDelta );
|
2003-03-11 08:52:45 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-03-11 08:52:45 +00:00
|
|
|
void ScreenPlayerOptions::DrawPrimitives()
|
|
|
|
|
{
|
|
|
|
|
ScreenOptions::DrawPrimitives();
|
2003-08-29 05:10:53 +00:00
|
|
|
// m_sprOptionsMessage.Draw();
|
2003-03-11 08:52:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
|
|
|
|
{
|
2003-08-29 05:10:53 +00:00
|
|
|
/* if( !GAMESTATE->m_bEditing &&
|
2003-06-16 03:44:15 +00:00
|
|
|
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 );
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayOnce( THEME->GetPathToS("Common start") );
|
2003-06-16 03:44:15 +00:00
|
|
|
}
|
|
|
|
|
}
|
2003-08-29 05:10:53 +00:00
|
|
|
*/
|
2003-03-11 08:52:45 +00:00
|
|
|
ScreenOptions::Input( DeviceI, type, GameI, MenuI, StyleI );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenPlayerOptions::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
2003-08-29 05:10:53 +00:00
|
|
|
// 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;
|
|
|
|
|
// }
|
2003-03-11 08:52:45 +00:00
|
|
|
ScreenOptions::HandleScreenMessage( SM );
|
2003-07-03 18:13:13 +00:00
|
|
|
}
|
2003-08-08 10:01:55 +00:00
|
|
|
|
|
|
|
|
CString ScreenPlayerOptions::ConvertParamToThemeDifficulty(
|
|
|
|
|
const CString &in ) const
|
|
|
|
|
{
|
|
|
|
|
// inefficient, could optimize
|
|
|
|
|
#define BEGINNER_DESCRIPTION THEME->GetMetric("ScreenPlayerOptions","Beginner")
|
|
|
|
|
#define EASY_DESCRIPTION THEME->GetMetric("ScreenPlayerOptions","Easy")
|
|
|
|
|
#define MEDIUM_DESCRIPTION THEME->GetMetric("ScreenPlayerOptions","Medium")
|
|
|
|
|
#define HARD_DESCRIPTION THEME->GetMetric("ScreenPlayerOptions","Hard")
|
|
|
|
|
#define CHALLENGE_DESCRIPTION THEME->GetMetric("ScreenPlayerOptions","Challenge")
|
|
|
|
|
|
|
|
|
|
if (in == "BEGINNER") return BEGINNER_DESCRIPTION; // Extreme
|
|
|
|
|
|
|
|
|
|
if (in == "BASIC") return EASY_DESCRIPTION; // 3rd
|
|
|
|
|
if (in == "LIGHT") return EASY_DESCRIPTION; // MAX
|
|
|
|
|
|
|
|
|
|
if (in == "ANOTHER") return MEDIUM_DESCRIPTION; // 3rd
|
|
|
|
|
if (in == "STANDARD") return MEDIUM_DESCRIPTION; // MAX. Note DDRUSA uses this for standard, but its unlikely
|
|
|
|
|
if (in == "TRICK") return MEDIUM_DESCRIPTION; // 4th/5th
|
|
|
|
|
if (in == "DIFFICULT") return MEDIUM_DESCRIPTION; // DDRUSA, unlikely
|
|
|
|
|
|
|
|
|
|
if (in == "SSR") return HARD_DESCRIPTION; // 3rd
|
|
|
|
|
if (in == "MANIAC") return HARD_DESCRIPTION; // pre-MAX
|
|
|
|
|
if (in == "HEAVY") return HARD_DESCRIPTION; // MAX
|
|
|
|
|
if (in == "EXPERT") return HARD_DESCRIPTION; // Euromix
|
|
|
|
|
|
|
|
|
|
if (in == "SMANIAC") return CHALLENGE_DESCRIPTION; // 4th
|
|
|
|
|
if (in == "CHALLENGE") return CHALLENGE_DESCRIPTION; // MAX
|
|
|
|
|
if (in == "ONI") return CHALLENGE_DESCRIPTION; // Extreme
|
|
|
|
|
|
|
|
|
|
return in; // something else
|
2003-08-10 03:23:17 +00:00
|
|
|
}
|