Files
itgmania212121/stepmania/src/ScreenOptionsMasterPrefs.cpp
T

624 lines
21 KiB
C++
Raw Normal View History

#include "global.h"
#include "ScreenOptionsMasterPrefs.h"
#include "PrefsManager.h"
2003-09-28 07:14:07 +00:00
#include "ThemeManager.h"
#include "AnnouncerManager.h"
#include "NoteSkinManager.h"
#include "PlayerOptions.h"
#include "SongOptions.h"
2003-09-29 02:24:53 +00:00
#include "RageDisplay.h"
#include "RageUtil.h"
2003-09-29 03:22:51 +00:00
#include "GameManager.h"
#include "GameState.h"
#include "InputMapper.h"
2003-10-02 01:41:09 +00:00
#include "StepMania.h"
2004-07-25 17:07:32 +00:00
#include "Game.h"
#include "Foreach.h"
2003-09-29 06:28:17 +00:00
static void GetDefaultModifiers( PlayerOptions &po, SongOptions &so )
{
po.FromString( PREFSMAN->m_sDefaultModifiers );
so.FromString( PREFSMAN->m_sDefaultModifiers );
}
static void SetDefaultModifiers( const PlayerOptions &po, const SongOptions &so )
{
CStringArray as;
if( po.GetString() != "" )
as.push_back( po.GetString() );
if( so.GetString() != "" )
as.push_back( so.GetString() );
PREFSMAN->m_sDefaultModifiers = join(", ",as);
}
2003-09-30 05:33:33 +00:00
template<class T>
static void MoveMap( int &sel, T &opt, bool ToSel, const T *mapping, unsigned cnt )
{
if( ToSel )
{
/* opt -> sel. Find the closest entry in mapping. */
T best_dist = T();
2003-09-30 05:33:33 +00:00
bool have_best = false;
for( unsigned i = 0; i < cnt; ++i )
{
const T val = mapping[i];
T dist = opt < val? (T)(val-opt):(T)(opt-val);
if( have_best && best_dist < dist )
2003-09-30 05:33:33 +00:00
continue;
have_best = true;
best_dist = dist;
sel = i;
}
} else {
/* sel -> opt */
opt = mapping[sel];
}
}
/* "sel" is the selection in the menu. */
2003-09-28 07:14:07 +00:00
template<class T>
static void MoveData( int &sel, T &opt, bool ToSel )
{
2003-09-28 07:14:07 +00:00
if( ToSel ) (int&) sel = opt;
else opt = (T) sel;
}
2003-09-28 07:14:07 +00:00
template<>
static void MoveData( int &sel, bool &opt, bool ToSel )
{
if( ToSel ) sel = opt;
else opt = !!sel;
}
#define MOVE( name, opt ) \
static void name( int &sel, bool ToSel, const ConfOption *pConfOption ) \
{ \
MoveData( sel, opt, ToSel ); \
}
2003-09-28 07:14:07 +00:00
2003-09-29 03:22:51 +00:00
static void GameChoices( CStringArray &out )
{
2004-07-25 17:07:32 +00:00
vector<const Game*> aGames;
2003-09-29 03:22:51 +00:00
GAMEMAN->GetEnabledGames( aGames );
2004-07-25 17:07:32 +00:00
FOREACH( const Game*, aGames, g )
2003-09-29 03:22:51 +00:00
{
CString sGameName = (*g)->m_szName;
2003-09-29 03:22:51 +00:00
sGameName.MakeUpper();
out.push_back( sGameName );
}
}
static void GameSel( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-29 03:22:51 +00:00
{
CStringArray choices;
pConfOption->MakeOptionsList( choices );
2003-09-29 03:22:51 +00:00
if( ToSel )
{
const CString sCurGameName = GAMESTATE->m_pCurGame->m_szName;
2003-09-29 03:22:51 +00:00
sel = 0;
for(unsigned i = 0; i < choices.size(); ++i)
if( !stricmp(choices[i], sCurGameName) )
sel = i;
} else {
2004-07-25 17:07:32 +00:00
vector<const Game*> aGames;
2003-09-29 03:22:51 +00:00
GAMEMAN->GetEnabledGames( aGames );
ChangeCurrentGame( aGames[sel] );
2003-09-29 03:22:51 +00:00
}
}
2003-09-28 07:14:07 +00:00
static void LanguageChoices( CStringArray &out )
{
THEME->GetLanguages( out );
}
static void Language( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-28 07:14:07 +00:00
{
CStringArray choices;
pConfOption->MakeOptionsList( choices );
2003-09-28 07:14:07 +00:00
if( ToSel )
{
sel = 0;
for( unsigned i=1; i<choices.size(); i++ )
if( !stricmp(choices[i], THEME->GetCurLanguage()) )
sel = i;
} else {
const CString sNewLanguage = choices[sel];
if( THEME->GetCurLanguage() != sNewLanguage )
THEME->SwitchThemeAndLanguage( THEME->GetCurThemeName(), sNewLanguage );
}
}
static void ThemeChoices( CStringArray &out )
{
THEME->GetThemeNames( out );
}
static void Theme( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-28 07:14:07 +00:00
{
CStringArray choices;
pConfOption->MakeOptionsList( choices );
2003-09-28 07:14:07 +00:00
if( ToSel )
{
sel = 0;
for( unsigned i=1; i<choices.size(); i++ )
if( !stricmp(choices[i], THEME->GetCurThemeName()) )
sel = i;
} else {
const CString sNewTheme = choices[sel];
if( THEME->GetCurThemeName() != sNewTheme )
THEME->SwitchThemeAndLanguage( sNewTheme, THEME->GetCurLanguage() );
}
}
static void AnnouncerChoices( CStringArray &out )
{
ANNOUNCER->GetAnnouncerNames( out );
out.insert( out.begin(), "OFF" );
}
static void Announcer( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-28 07:14:07 +00:00
{
CStringArray choices;
pConfOption->MakeOptionsList( choices );
2003-09-28 07:14:07 +00:00
if( ToSel )
{
sel = 0;
for( unsigned i=1; i<choices.size(); i++ )
if( !stricmp(choices[i], ANNOUNCER->GetCurAnnouncerName()) )
sel = i;
} else {
2004-08-06 21:01:28 +00:00
const CString sNewAnnouncer = sel? choices[sel]:CString("");
2003-09-28 07:14:07 +00:00
ANNOUNCER->SwitchAnnouncer( sNewAnnouncer );
}
}
static void DefaultNoteSkinChoices( CStringArray &out )
{
NOTESKIN->GetNoteSkinNames( out );
for( unsigned i = 0; i < out.size(); ++i )
out[i].MakeUpper();
}
static void DefaultNoteSkin( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-28 07:14:07 +00:00
{
CStringArray choices;
pConfOption->MakeOptionsList( choices );
2003-09-28 07:14:07 +00:00
if( ToSel )
{
PlayerOptions po;
po.FromString( PREFSMAN->m_sDefaultModifiers );
sel = 0;
for( unsigned i=0; i < choices.size(); i++ )
if( !stricmp(choices[i], po.m_sNoteSkin) )
sel = i;
} else {
PlayerOptions po;
SongOptions so;
2003-09-29 06:28:17 +00:00
GetDefaultModifiers( po, so );
2003-09-28 07:14:07 +00:00
po.m_sNoteSkin = choices[sel];
2003-09-29 06:28:17 +00:00
SetDefaultModifiers( po, so );
2003-09-28 07:14:07 +00:00
}
}
2003-09-29 00:07:36 +00:00
/* Appearance options */
2004-12-07 09:22:38 +00:00
MOVE( Instructions, PREFSMAN->m_bShowInstructions );
MOVE( Caution, PREFSMAN->m_bShowCaution );
MOVE( OniScoreDisplay, PREFSMAN->m_bDancePointsForOni );
MOVE( SongGroup, PREFSMAN->m_bShowSelectGroup );
2003-09-29 00:46:25 +00:00
MOVE( WheelSections, PREFSMAN->m_MusicWheelUsesSections );
MOVE( CourseSort, PREFSMAN->m_iCourseSortOrder );
2004-12-07 09:22:38 +00:00
MOVE( RandomAtEnd, PREFSMAN->m_bMoveRandomToEnd );
MOVE( Translations, PREFSMAN->m_bShowNativeLanguage );
MOVE( Lyrics, PREFSMAN->m_bShowLyrics );
2003-09-28 07:14:07 +00:00
2003-12-30 09:34:05 +00:00
/* Misc. options */
2004-12-07 09:22:38 +00:00
MOVE( AutogenSteps, PREFSMAN->m_bAutogenSteps );
MOVE( AutogenGroupCourses, PREFSMAN->m_bAutogenGroupCourses );
MOVE( FastLoad, PREFSMAN->m_bFastLoad.Value() );
2003-09-29 00:07:36 +00:00
/* Background options */
2004-12-07 09:22:38 +00:00
MOVE( BackgroundMode, PREFSMAN->m_iBackgroundMode.Value() );
MOVE( ShowDanger, PREFSMAN->m_bShowDanger.Value() );
2003-09-29 00:07:36 +00:00
MOVE( DancingCharacters, PREFSMAN->m_ShowDancingCharacters );
2004-12-07 09:22:38 +00:00
MOVE( BeginnerHelper, PREFSMAN->m_bShowBeginnerHelper );
2003-09-29 00:07:36 +00:00
static void BGBrightness( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-29 00:07:36 +00:00
{
2003-09-30 05:33:33 +00:00
const float mapping[] = { 0.0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f };
2004-12-07 09:22:38 +00:00
MoveMap( sel, PREFSMAN->m_fBGBrightness.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
2003-09-29 00:07:36 +00:00
}
static void NumBackgrounds( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-29 00:07:36 +00:00
{
2003-09-30 05:33:33 +00:00
const int mapping[] = { 5,10,15,20 };
2004-12-07 09:22:38 +00:00
MoveMap( sel, PREFSMAN->m_iNumBackgrounds.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
2003-09-29 00:07:36 +00:00
}
2003-09-29 00:46:25 +00:00
/* Input options */
2004-12-07 09:22:38 +00:00
MOVE( AutoMapOnJoyChange, PREFSMAN->m_bAutoMapOnJoyChange );
MOVE( MenuButtons, PREFSMAN->m_bOnlyDedicatedMenuButtons.Value() );
MOVE( AutoPlay, PREFSMAN->m_bAutoPlay );
MOVE( BackDelayed, PREFSMAN->m_bDelayedBack );
MOVE( OptionsNavigation, PREFSMAN->m_bArcadeOptionsNavigation );
2003-09-29 00:46:25 +00:00
static void WheelSpeed( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-29 00:46:25 +00:00
{
2003-09-30 05:39:47 +00:00
const int mapping[] = { 5, 10, 15, 25 };
2004-12-07 09:22:38 +00:00
MoveMap( sel, PREFSMAN->m_iMusicWheelSwitchSpeed, ToSel, mapping, ARRAYSIZE(mapping) );
2003-09-29 00:46:25 +00:00
}
/* Gameplay options */
2004-12-07 09:22:38 +00:00
MOVE( SoloSingles, PREFSMAN->m_bSoloSingle );
MOVE( HiddenSongs, PREFSMAN->m_bHiddenSongs.Value() );
MOVE( EasterEggs, PREFSMAN->m_bEasterEggs );
2003-09-29 00:46:25 +00:00
MOVE( MarvelousTiming, PREFSMAN->m_iMarvelousTiming );
2004-12-07 09:22:38 +00:00
MOVE( AllowExtraStage, PREFSMAN->m_bAllowExtraStage );
MOVE( PickExtraStage, PREFSMAN->m_bPickExtraStage );
MOVE( UnlockSystem, PREFSMAN->m_bUseUnlockSystem );
2003-09-29 00:46:25 +00:00
2003-10-06 05:59:58 +00:00
/* Coin options */
MOVE( CoinMode, PREFSMAN->m_iCoinMode );
static void CoinModeNoHome( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-11-26 00:32:21 +00:00
{
const int mapping[] = { 1,2 };
2004-12-07 09:22:38 +00:00
MoveMap( sel, PREFSMAN->m_iCoinMode, ToSel, mapping, ARRAYSIZE(mapping) );
2003-11-26 00:32:21 +00:00
}
static void CoinsPerCredit( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-10-06 05:59:58 +00:00
{
const int mapping[] = { 1,2,3,4,5,6,7,8 };
2004-12-07 09:22:38 +00:00
MoveMap( sel, PREFSMAN->m_iCoinsPerCredit, ToSel, mapping, ARRAYSIZE(mapping) );
2003-10-06 05:59:58 +00:00
}
static void Premium( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-11-09 01:09:35 +00:00
{
2003-11-09 08:55:21 +00:00
const PrefsManager::Premium mapping[] = { PrefsManager::NO_PREMIUM,PrefsManager::DOUBLES_PREMIUM,PrefsManager::JOINT_PREMIUM };
2003-11-09 01:09:35 +00:00
MoveMap( sel, PREFSMAN->m_Premium, ToSel, mapping, ARRAYSIZE(mapping) );
}
2003-10-06 05:59:58 +00:00
static void SongsPerPlay( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-10-06 05:59:58 +00:00
{
2004-06-12 02:53:21 +00:00
const int mapping[] = { 1,2,3,4,5,6,7 };
2004-12-07 09:22:38 +00:00
MoveMap( sel, PREFSMAN->m_iNumArcadeStages, ToSel, mapping, ARRAYSIZE(mapping) );
2003-10-06 05:59:58 +00:00
}
2004-12-07 09:22:38 +00:00
MOVE( EventMode, PREFSMAN->m_bEventMode );
2003-10-06 05:59:58 +00:00
2003-09-29 03:02:54 +00:00
/* Machine options */
2004-12-07 09:22:38 +00:00
MOVE( MenuTimer, PREFSMAN->m_bMenuTimer.Value() );
2003-09-29 03:02:54 +00:00
MOVE( ScoringType, PREFSMAN->m_iScoringType );
static void JudgeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-29 03:02:54 +00:00
{
2003-09-29 04:46:37 +00:00
const float mapping[] = { 1.50f,1.33f,1.16f,1.00f,0.84f,0.66f,0.50f,0.33f,0.20f };
2004-12-07 09:22:38 +00:00
MoveMap( sel, PREFSMAN->m_fJudgeWindowScale.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
2003-09-29 03:02:54 +00:00
}
void LifeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-29 03:02:54 +00:00
{
2003-09-29 04:46:37 +00:00
const float mapping[] = { 1.60f,1.40f,1.20f,1.00f,0.80f,0.60f,0.40f };
2004-12-07 09:22:38 +00:00
MoveMap( sel, PREFSMAN->m_fLifeDifficultyScale.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
2003-09-29 03:02:54 +00:00
}
static void ShowSongOptions( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-29 03:02:54 +00:00
{
2003-09-30 05:23:12 +00:00
const PrefsManager::Maybe mapping[] = { PrefsManager::NO,PrefsManager::YES,PrefsManager::ASK };
2003-09-29 04:46:37 +00:00
MoveMap( sel, PREFSMAN->m_ShowSongOptions, ToSel, mapping, ARRAYSIZE(mapping) );
2003-09-29 03:02:54 +00:00
}
static void ShowNameEntry( int &sel, bool ToSel, const ConfOption *pConfOption )
{
const PrefsManager::GetRankingName mapping[] = { PrefsManager::RANKING_OFF, PrefsManager::RANKING_ON, PrefsManager::RANKING_LIST };
MoveMap( sel, PREFSMAN->m_iGetRankingName, ToSel, mapping, ARRAYSIZE(mapping) );
}
static void DefaultFailType( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-29 03:02:54 +00:00
{
if( ToSel )
{
SongOptions so;
so.FromString( PREFSMAN->m_sDefaultModifiers );
sel = so.m_FailType;
} else {
PlayerOptions po;
SongOptions so;
2003-09-29 06:28:17 +00:00
GetDefaultModifiers( po, so );
2003-09-29 03:02:54 +00:00
switch( sel )
{
2004-07-31 19:14:53 +00:00
case 0: so.m_FailType = SongOptions::FAIL_IMMEDIATE; break;
case 1: so.m_FailType = SongOptions::FAIL_COMBO_OF_30_MISSES; break;
case 2: so.m_FailType = SongOptions::FAIL_END_OF_SONG; break;
case 3: so.m_FailType = SongOptions::FAIL_OFF; break;
2003-09-29 03:02:54 +00:00
default:
ASSERT(0);
}
2003-09-29 06:28:17 +00:00
SetDefaultModifiers( po, so );
2003-09-29 03:02:54 +00:00
}
}
MOVE( ProgressiveLifebar, PREFSMAN->m_iProgressiveLifebar );
MOVE( ProgressiveStageLifebar, PREFSMAN->m_iProgressiveStageLifebar );
MOVE( ProgressiveNonstopLifebar, PREFSMAN->m_iProgressiveNonstopLifebar );
/* Graphic options */
2004-12-07 09:22:38 +00:00
MOVE( DisplayMode, PREFSMAN->m_bWindowed.Value() );
MOVE( WaitForVsync, PREFSMAN->m_bVsync.Value() );
MOVE( ShowBanners, PREFSMAN->m_bShowBanners.Value() );
MOVE( ShowStats, PREFSMAN->m_bShowStats.Value() );
MOVE( KeepTexturesInMemory, PREFSMAN->m_bDelayedTextureDelete.Value() );
MOVE( CelShadeModels, PREFSMAN->m_bCelShadeModels );
MOVE( SmoothLines, PREFSMAN->m_bSmoothLines );
2003-09-29 03:02:54 +00:00
struct res_t
{
int w, h;
res_t(): w(0), h(0) { }
res_t( int w_, int h_ ): w(w_), h(h_) { }
res_t operator-( const res_t &rhs ) const
{
return res_t( w-rhs.w, h-rhs.h );
}
bool operator<( const res_t &rhs ) const
{
if( w != rhs.w )
return w < rhs.w;
return h < rhs.h;
}
};
static void DisplayResolution( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-29 02:24:53 +00:00
{
const res_t mapping[] =
{
res_t(320, 240),
res_t(400, 300),
res_t(512, 384),
res_t(640, 480),
res_t(800, 600),
res_t(1024, 768),
res_t(1280, 960),
res_t(1280, 1024)
};
res_t sel_res( PREFSMAN->m_iDisplayWidth, PREFSMAN->m_iDisplayHeight );
MoveMap( sel, sel_res, ToSel, mapping, ARRAYSIZE(mapping) );
2003-09-29 02:24:53 +00:00
if( !ToSel )
{
PREFSMAN->m_iDisplayWidth = sel_res.w;
PREFSMAN->m_iDisplayHeight = sel_res.h;
}
2003-09-29 02:24:53 +00:00
}
static void DisplayColor( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-29 02:24:53 +00:00
{
2003-09-29 04:46:37 +00:00
const int mapping[] = { 16,32 };
2004-12-07 09:22:38 +00:00
MoveMap( sel, PREFSMAN->m_iDisplayColorDepth.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
2003-09-29 02:24:53 +00:00
}
static void TextureResolution( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-29 02:24:53 +00:00
{
2003-09-29 04:46:37 +00:00
const int mapping[] = { 256,512,1024,2048 };
2004-12-07 09:22:38 +00:00
MoveMap( sel, PREFSMAN->m_iMaxTextureResolution.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
2003-09-29 02:24:53 +00:00
}
static void TextureColor( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-29 02:24:53 +00:00
{
2003-09-29 04:46:37 +00:00
const int mapping[] = { 16,32 };
2004-12-07 09:22:38 +00:00
MoveMap( sel, PREFSMAN->m_iTextureColorDepth.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
2003-09-29 02:24:53 +00:00
}
static void MovieColor( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-29 02:24:53 +00:00
{
2003-10-07 08:18:28 +00:00
const int mapping[] = { 16,32 };
2004-12-07 09:22:38 +00:00
MoveMap( sel, PREFSMAN->m_iMovieColorDepth.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
2003-09-29 02:24:53 +00:00
}
static void RefreshRate( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-09-29 02:24:53 +00:00
{
2003-10-07 08:18:28 +00:00
const int mapping[] = { (int) REFRESH_DEFAULT,60,70,72,75,80,85,90,100,120,150 };
2004-12-07 09:22:38 +00:00
MoveMap( sel, PREFSMAN->m_iRefreshRate.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
2003-09-29 02:24:53 +00:00
}
2003-09-29 00:07:36 +00:00
/* Sound options */
2003-09-29 00:46:25 +00:00
MOVE( ResamplingQuality, PREFSMAN->m_iSoundResampleQuality );
2003-12-28 19:46:50 +00:00
MOVE( AttractSoundFrequency,PREFSMAN->m_iAttractSoundFrequency );
2003-09-28 07:14:07 +00:00
static void SoundVolume( int &sel, bool ToSel, const ConfOption *pConfOption )
2003-10-12 20:34:46 +00:00
{
const float mapping[] = { 0.0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f };
2004-12-07 09:22:38 +00:00
MoveMap( sel, PREFSMAN->m_fSoundVolume, ToSel, mapping, ARRAYSIZE(mapping) );
2003-10-12 20:34:46 +00:00
}
2004-12-07 09:49:03 +00:00
static vector<ConfOption> g_ConfOptions;
static void InitializeConfOptions()
{
2004-12-07 09:49:03 +00:00
if( !g_ConfOptions.empty() )
return;
#define ADD(x) g_ConfOptions.push_back( x )
2003-09-29 03:22:51 +00:00
/* Select game */
2004-12-07 09:49:03 +00:00
ADD( ConfOption( "Game", GameSel, GameChoices ) );
g_ConfOptions.back().m_iEffects = OPT_RESET_GAME;
2003-09-29 03:22:51 +00:00
2003-09-28 07:14:07 +00:00
/* Appearance options */
2004-12-07 09:49:03 +00:00
ADD( ConfOption( "Language", Language, LanguageChoices ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_THEME;
ADD( ConfOption( "Theme", Theme, ThemeChoices ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_THEME;
ADD( ConfOption( "Announcer", Announcer, AnnouncerChoices ) );
ADD( ConfOption( "Default\nNoteSkin", DefaultNoteSkin, DefaultNoteSkinChoices ) );
ADD( ConfOption( "Instructions", Instructions, "SKIP","SHOW") );
ADD( ConfOption( "Caution", Caution, "SKIP","SHOW") );
ADD( ConfOption( "Oni Score\nDisplay", OniScoreDisplay, "PERCENT","DANCE POINTS") );
ADD( ConfOption( "Song\nGroup", SongGroup, "ALL MUSIC","CHOOSE") );
ADD( ConfOption( "Wheel\nSections", WheelSections, "NEVER","ALWAYS", "ABC ONLY") );
ADD( ConfOption( "Course\nSort", CourseSort, "# SONGS","AVG FEET","TOTAL FEET","RANKING") );
ADD( ConfOption( "Random\nAt End", RandomAtEnd, "NO","YES") );
ADD( ConfOption( "Translations", Translations, "ROMANIZATION","NATIVE LANGUAGE") );
ADD( ConfOption( "Lyrics", Lyrics, "HIDE","SHOW") );
2003-09-28 07:14:07 +00:00
2003-12-30 09:34:05 +00:00
/* Misc options */
2004-12-07 09:49:03 +00:00
ADD( ConfOption( "Autogen\nSteps", AutogenSteps, "OFF","ON" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_SONG;
ADD( ConfOption( "Autogen\nGroup Courses", AutogenGroupCourses, "OFF","ON" ) );
ADD( ConfOption( "Fast\nLoad", FastLoad, "OFF","ON" ) );
2003-09-29 00:07:36 +00:00
/* Background options */
2004-12-07 09:49:03 +00:00
ADD( ConfOption( "Background\nMode", BackgroundMode, "OFF","ANIMATIONS","VISUALIZATIONS","RANDOM MOVIES" ) );
ADD( ConfOption( "Brightness", BGBrightness, "0%","10%","20%","30%","40%","50%","60%","70%","80%","90%","100%" ) );
ADD( ConfOption( "Danger", ShowDanger, "HIDE","SHOW" ) );
ADD( ConfOption( "Dancing\nCharacters", DancingCharacters, "DEFAULT TO OFF","DEFAULT TO RANDOM","SELECT" ) );
ADD( ConfOption( "Beginner\nHelper", BeginnerHelper, "OFF","ON" ) );
ADD( ConfOption( "Random\nBackgrounds", NumBackgrounds, "5","10","15","20" ) );
2003-09-29 00:07:36 +00:00
2003-09-29 00:46:25 +00:00
/* Input options */
2004-12-07 09:49:03 +00:00
ADD( ConfOption( "Auto Map\nOn Joy Change", AutoMapOnJoyChange, "OFF","ON (recommended)" ) );
ADD( ConfOption( "MenuButtons", MenuButtons, "USE GAMEPLAY BUTTONS","ONLY DEDICATED BUTTONS" ) );
ADD( ConfOption( "AutoPlay", AutoPlay, "OFF","ON" ) );
ADD( ConfOption( "Back\nDelayed", BackDelayed, "INSTANT","HOLD" ) );
ADD( ConfOption( "Options\nNavigation", OptionsNavigation, "SM STYLE","ARCADE STYLE" ) );
ADD( ConfOption( "Wheel\nSpeed", WheelSpeed, "SLOW","NORMAL","FAST","REALLY FAST" ) );
2003-09-29 00:46:25 +00:00
/* Gameplay options */
2004-12-07 09:49:03 +00:00
ADD( ConfOption( "Solo\nSingles", SoloSingles, "OFF","ON" ) );
ADD( ConfOption( "Hidden\nSongs", HiddenSongs, "OFF","ON" ) );
ADD( ConfOption( "Easter\nEggs", EasterEggs, "OFF","ON" ) );
ADD( ConfOption( "Marvelous\nTiming", MarvelousTiming, "NEVER","COURSES ONLY","ALWAYS" ) );
ADD( ConfOption( "Allow Extra\nStage", AllowExtraStage, "OFF","ON" ) );
ADD( ConfOption( "Pick Extra\nStage", PickExtraStage, "OFF","ON" ) );
ADD( ConfOption( "Unlock\nSystem", UnlockSystem, "OFF","ON" ) );
2003-09-29 00:46:25 +00:00
2003-09-29 03:02:54 +00:00
/* Machine options */
2004-12-07 09:49:03 +00:00
ADD( ConfOption( "Menu\nTimer", MenuTimer, "OFF","ON" ) );
ADD( ConfOption( "CoinMode", CoinMode, "HOME","PAY","FREE PLAY" ) );
ADD( ConfOption( "CoinModeNoHome", CoinModeNoHome, "PAY","FREE PLAY" ) );
ADD( ConfOption( "Songs Per\nPlay", SongsPerPlay, "1","2","3","4","5","6","7" ) );
ADD( ConfOption( "Event\nMode", EventMode, "OFF","ON" ) );
ADD( ConfOption( "Scoring\nType", ScoringType, "MAX2","5TH" ) );
ADD( ConfOption( "Judge\nDifficulty", JudgeDifficulty, "1","2","3","4","5","6","7","8","JUSTICE" ) );
ADD( ConfOption( "Life\nDifficulty", LifeDifficulty, "1","2","3","4","5","6","7" ) );
ADD( ConfOption( "Progressive\nLifebar", ProgressiveLifebar, "OFF","1","2","3","4","5","6","7","8") );
ADD( ConfOption( "Progressive\nStage Lifebar",ProgressiveStageLifebar, "OFF","1","2","3","4","5","6","7","8","INSANITY") );
ADD( ConfOption( "Progressive\nNonstop Lifebar",ProgressiveNonstopLifebar,"OFF","1","2","3","4","5","6","7","8","INSANITY") );
ADD( ConfOption( "Default\nFail Type", DefaultFailType, "IMMEDIATE","COMBO OF 30 MISSES","END OF SONG","OFF" ) );
ADD( ConfOption( "DefaultFailTypeNoOff", DefaultFailType, "IMMEDIATE","COMBO OF 30 MISSES","END OF SONG" ) );
ADD( ConfOption( "Coins Per\nCredit", CoinsPerCredit, "1","2","3","4","5","6","7","8" ) );
ADD( ConfOption( "Premium", Premium, "OFF","DOUBLE FOR 1 CREDIT","JOINT PREMIUM" ) );
ADD( ConfOption( "Show Song\nOptions", ShowSongOptions, "HIDE","SHOW","ASK" ) );
ADD( ConfOption( "Show Name\nEntry", ShowNameEntry, "OFF", "ON", "RANKING SONGS" ) );
2003-09-29 03:02:54 +00:00
2003-09-29 02:24:53 +00:00
/* Graphic options */
2004-12-07 09:49:03 +00:00
ADD( ConfOption( "Display\nMode", DisplayMode, "FULLSCREEN", "WINDOWED" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS;
ADD( ConfOption( "Display\nResolution", DisplayResolution, "320","400","512","640","800","1024","1280x960","1280x1024" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS;
ADD( ConfOption( "Display\nColor", DisplayColor, "16BIT","32BIT" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS;
ADD( ConfOption( "Texture\nResolution", TextureResolution, "256","512","1024","2048" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS;
ADD( ConfOption( "Texture\nColor", TextureColor, "16BIT","32BIT" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS;
ADD( ConfOption( "Movie\nColor", MovieColor, "16BIT","32BIT" ) );
ADD( ConfOption( "Keep Textures\nIn Memory", KeepTexturesInMemory, "OFF","ON" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS;
ADD( ConfOption( "CelShade\nModels", CelShadeModels, "OFF","ON" ) );
ADD( ConfOption( "SmoothLines", SmoothLines, "OFF","ON" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS;
ADD( ConfOption( "Refresh\nRate", RefreshRate, "DEFAULT","60","70","72","75","80","85","90","100","120","150" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS;
ADD( ConfOption( "Wait For\nVsync", WaitForVsync, "NO", "YES" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS;
ADD( ConfOption( "Show\nStats", ShowStats, "OFF","ON" ) );
ADD( ConfOption( "Show\nBanners", ShowBanners, "OFF","ON" ) );
2003-09-29 02:24:53 +00:00
2003-09-28 07:14:07 +00:00
/* Sound options */
2004-12-07 09:49:03 +00:00
ADD( ConfOption( "Resampling\nQuality", ResamplingQuality, "FAST","NORMAL","HIGH QUALITY" ) );
ADD( ConfOption( "Attract\nSound Frequency",AttractSoundFrequency, "NEVER","ALWAYS","2 TIMES","3 TIMES","4 TIMES","5 TIMES" ) );
ADD( ConfOption( "Sound\nVolume", SoundVolume, "SILENT","10%","20%","30%","40%","50%","60%","70%","80%","90%","100%" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_SOUND;
}
2003-09-29 02:24:53 +00:00
/* Get a mask of effects to apply if the given option changes. */
int ConfOption::GetEffects() const
{
2004-12-07 09:49:03 +00:00
return m_iEffects | OPT_SAVE_PREFERENCES;
2003-09-29 02:24:53 +00:00
}
ConfOption *ConfOption::Find( CString name )
{
2004-12-07 09:49:03 +00:00
InitializeConfOptions();
for( unsigned i = 0; i < g_ConfOptions.size(); ++i )
{
ConfOption *opt = &g_ConfOptions[i];
CString match(opt->name);
match.Replace("\n", "");
match.Replace("-", "");
2003-09-28 07:14:07 +00:00
match.Replace(" ", "");
2003-09-28 07:14:07 +00:00
if( match.CompareNoCase(name) )
continue;
return opt;
}
return NULL;
}
void ConfOption::UpdateAvailableOptions()
2003-09-28 05:15:27 +00:00
{
if( MakeOptionsListCB != NULL )
2003-09-28 05:15:27 +00:00
{
names.clear();
MakeOptionsListCB( names );
2003-09-28 05:15:27 +00:00
}
}
2003-09-28 05:15:27 +00:00
void ConfOption::MakeOptionsList( CStringArray &out ) const
{
out = names;
2003-09-28 05:15:27 +00:00
}
2004-06-08 05:22:33 +00:00
/*
* (c) 2003-2004 Glenn Maynard
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/