diff --git a/stepmania/src/ActorFrame.cpp b/stepmania/src/ActorFrame.cpp index 05b7c62ac2..b79f46c326 100644 --- a/stepmania/src/ActorFrame.cpp +++ b/stepmania/src/ActorFrame.cpp @@ -14,6 +14,12 @@ void ActorFrame::AddChild( Actor* pActor ) { +#if _DEBUG + // check that this Actor isn't already added. + vector::iterator iter = find( m_SubActors.begin(), m_SubActors.end(), pActor ); + ASSERT( iter == m_SubActors.end() ); // didn't find +#endif + ASSERT( pActor ); ASSERT( (void*)pActor != (void*)0xC0000005 ); m_SubActors.push_back( pActor ); diff --git a/stepmania/src/ScreenAppearanceOptions.cpp b/stepmania/src/ScreenAppearanceOptions.cpp index 3ec5843e65..68337c4752 100644 --- a/stepmania/src/ScreenAppearanceOptions.cpp +++ b/stepmania/src/ScreenAppearanceOptions.cpp @@ -47,20 +47,20 @@ enum { OptionRow g_AppearanceOptionsLines[NUM_APPEARANCE_OPTIONS_LINES] = { - OptionRow( "Language" ), - OptionRow( "Announcer" ), - OptionRow( "Theme" ), - OptionRow( "Default\nNoteSkin" ), - OptionRow( "Instructions", "SKIP","SHOW"), - OptionRow( "Caution", "SKIP","SHOW"), - OptionRow( "Oni Score\nDisplay","PERCENT","DANCE POINTS"), - OptionRow( "Song\nGroup", "ALL MUSIC","CHOOSE"), - OptionRow( "Wheel\nSections", "NEVER","ALWAYS", "ABC ONLY"), - OptionRow( "10+ foot\nIn Red", "NO", "YES"), - OptionRow( "Course\nSort", "# SONGS", "AVG FEET", "TOTAL FEET", "RANKING"), - OptionRow( "Random\nAt End", "NO","YES"), - OptionRow( "Translations", "NATIVE","TRANSLITERATE"), - OptionRow( "Lyrics", "HIDE","SHOW"), + OptionRow( "Language", true ), + OptionRow( "Announcer", true ), + OptionRow( "Theme", true ), + OptionRow( "Default\nNoteSkin", true ), + OptionRow( "Instructions", true, "SKIP","SHOW"), + OptionRow( "Caution", true, "SKIP","SHOW"), + OptionRow( "Oni Score\nDisplay",true, "PERCENT","DANCE POINTS"), + OptionRow( "Song\nGroup", true, "ALL MUSIC","CHOOSE"), + OptionRow( "Wheel\nSections", true, "NEVER","ALWAYS", "ABC ONLY"), + OptionRow( "10+ foot\nIn Red", true, "NO", "YES"), + OptionRow( "Course\nSort", true, "# SONGS", "AVG FEET", "TOTAL FEET", "RANKING"), + OptionRow( "Random\nAt End", true, "NO","YES"), + OptionRow( "Translations", true, "NATIVE","TRANSLITERATE"), + OptionRow( "Lyrics", true, "HIDE","SHOW"), }; ScreenAppearanceOptions::ScreenAppearanceOptions() : @@ -69,10 +69,10 @@ ScreenAppearanceOptions::ScreenAppearanceOptions() : LOG->Trace( "ScreenAppearanceOptions::ScreenAppearanceOptions()" ); Init( - INPUTMODE_BOTH, + INPUTMODE_TOGETHER, g_AppearanceOptionsLines, NUM_APPEARANCE_OPTIONS_LINES, - false, true ); + true ); m_Menu.m_MenuTimer.Disable(); SOUND->PlayMusic( THEME->GetPathToS("ScreenAppearanceOptions music") ); @@ -89,7 +89,7 @@ void ScreenAppearanceOptions::ImportOptions() THEME->GetLanguages( arrayLanguages ); m_OptionRow[AO_LANGUAGE].choices.clear(); - for( i=0; iTrace( "ScreenAutogenOptions::ScreenAutogenOptions()" ); Init( - INPUTMODE_BOTH, + INPUTMODE_TOGETHER, g_AutogenOptionsLines, NUM_AUTOGEN_OPTIONS_LINES, - false, true ); + true ); m_Menu.m_MenuTimer.Disable(); SOUND->PlayMusic( THEME->GetPathToS("ScreenAutogenOptions music") ); diff --git a/stepmania/src/ScreenBackgroundOptions.cpp b/stepmania/src/ScreenBackgroundOptions.cpp index 55daa95e60..0e0bc5a785 100644 --- a/stepmania/src/ScreenBackgroundOptions.cpp +++ b/stepmania/src/ScreenBackgroundOptions.cpp @@ -34,12 +34,12 @@ enum { }; OptionRow g_BackgroundOptionsLines[NUM_BACKGROUND_OPTIONS_LINES] = { - OptionRow( "Mode", "OFF","ANIMATIONS","VISUALIZATIONS","RANDOM MOVIES" ), - OptionRow( "Brightness", "0%","10%","20%","30%","40%","50%","60%","70%","80%","90%","100%" ), - OptionRow( "Danger", "HIDE","SHOW" ), - OptionRow( "Dancing\nCharacters", "DEFAULT TO OFF","DEFAULT TO RANDOM" ), - OptionRow( "Show Beginner\nHelper", "OFF","ON" ), - OptionRow( "Random\nBackgrounds", "5","10","15","20" ), + OptionRow( "Mode", true, "OFF","ANIMATIONS","VISUALIZATIONS","RANDOM MOVIES" ), + OptionRow( "Brightness", true, "0%","10%","20%","30%","40%","50%","60%","70%","80%","90%","100%" ), + OptionRow( "Danger", true, "HIDE","SHOW" ), + OptionRow( "Dancing\nCharacters", true, "DEFAULT TO OFF","DEFAULT TO RANDOM" ), + OptionRow( "Show Beginner\nHelper", true, "OFF","ON" ), + OptionRow( "Random\nBackgrounds", true, "5","10","15","20" ), }; ScreenBackgroundOptions::ScreenBackgroundOptions() : @@ -48,10 +48,10 @@ ScreenBackgroundOptions::ScreenBackgroundOptions() : LOG->Trace( "ScreenBackgroundOptions::ScreenBackgroundOptions()" ); Init( - INPUTMODE_BOTH, + INPUTMODE_TOGETHER, g_BackgroundOptionsLines, NUM_BACKGROUND_OPTIONS_LINES, - false, true ); + true ); m_Menu.m_MenuTimer.Disable(); SOUND->PlayMusic( THEME->GetPathToS("ScreenMachineOptions music") ); diff --git a/stepmania/src/ScreenGameplayOptions.cpp b/stepmania/src/ScreenGameplayOptions.cpp index b657e759f8..5699d3c203 100644 --- a/stepmania/src/ScreenGameplayOptions.cpp +++ b/stepmania/src/ScreenGameplayOptions.cpp @@ -34,12 +34,12 @@ enum { }; OptionRow g_GameplayOptionsLines[NUM_GAMEPLAY_OPTIONS_LINES] = { - OptionRow( "Solo\nSingles", "OFF","ON" ), - OptionRow( "Hidden\nSongs", "OFF","ON" ), - OptionRow( "Easter\nEggs", "OFF","ON" ), - OptionRow( "Marvelous\nTiming", "NEVER","COURSES ONLY","ALWAYS" ), - OptionRow( "Pick Extra\nStage", "OFF","ON" ), - OptionRow( "Unlock\nSystem", "OFF","ON" ) + OptionRow( "Solo\nSingles", true, "OFF","ON" ), + OptionRow( "Hidden\nSongs", true, "OFF","ON" ), + OptionRow( "Easter\nEggs", true, "OFF","ON" ), + OptionRow( "Marvelous\nTiming", true, "NEVER","COURSES ONLY","ALWAYS" ), + OptionRow( "Pick Extra\nStage", true, "OFF","ON" ), + OptionRow( "Unlock\nSystem", true, "OFF","ON" ) }; ScreenGameplayOptions::ScreenGameplayOptions() : @@ -48,10 +48,10 @@ ScreenGameplayOptions::ScreenGameplayOptions() : LOG->Trace( "ScreenGameplayOptions::ScreenGameplayOptions()" ); Init( - INPUTMODE_BOTH, + INPUTMODE_TOGETHER, g_GameplayOptionsLines, NUM_GAMEPLAY_OPTIONS_LINES, - false, true ); + true ); m_Menu.m_MenuTimer.Disable(); SOUND->PlayMusic( THEME->GetPathToS("ScreenMachineOptions music") ); diff --git a/stepmania/src/ScreenGraphicOptions.cpp b/stepmania/src/ScreenGraphicOptions.cpp index f0618f4053..d57b420ed4 100644 --- a/stepmania/src/ScreenGraphicOptions.cpp +++ b/stepmania/src/ScreenGraphicOptions.cpp @@ -35,15 +35,15 @@ enum { NUM_GRAPHIC_OPTIONS_LINES }; OptionRow g_GraphicOptionsLines[NUM_GRAPHIC_OPTIONS_LINES] = { - OptionRow( "Display\nMode", "FULLSCREEN", "WINDOWED" ), - OptionRow( "Display\nResolution", "320","400","512","640","800","1024","1280" ), - OptionRow( "Display\nColor", "16BIT","32BIT" ), - OptionRow( "Max Texture\nResolution", "256","512","1024","2048" ), - OptionRow( "Texture\nColor", "16BIT","32BIT" ), - OptionRow( "Keep Textures\nIn Memory", "NO","YES" ), - OptionRow( "Refresh\nRate", "DEFAULT","60","70","72","75","80","85","90","100","120","150" ), - OptionRow( "Movie\nDecode", "1ms","2ms","3ms","4ms" ), - OptionRow( "Wait For\nVsync", "NO", "YES" ), + OptionRow( "Display\nMode", true, "FULLSCREEN", "WINDOWED" ), + OptionRow( "Display\nResolution", true, "320","400","512","640","800","1024","1280" ), + OptionRow( "Display\nColor", true, "16BIT","32BIT" ), + OptionRow( "Max Texture\nResolution", true, "256","512","1024","2048" ), + OptionRow( "Texture\nColor", true, "16BIT","32BIT" ), + OptionRow( "Keep Textures\nIn Memory", true, "NO","YES" ), + OptionRow( "Refresh\nRate", true, "DEFAULT","60","70","72","75","80","85","90","100","120","150" ), + OptionRow( "Movie\nDecode", true, "1ms","2ms","3ms","4ms" ), + OptionRow( "Wait For\nVsync", true, "NO", "YES" ), }; static const int HorizRes[] = { @@ -62,10 +62,10 @@ ScreenGraphicOptions::ScreenGraphicOptions() : LOG->Trace( "ScreenGraphicOptions::ScreenGraphicOptions()" ); Init( - INPUTMODE_BOTH, + INPUTMODE_TOGETHER, g_GraphicOptionsLines, NUM_GRAPHIC_OPTIONS_LINES, - false, true ); + true ); m_Menu.m_MenuTimer.Disable(); SOUND->PlayMusic( THEME->GetPathToS("ScreenGraphicOptions music") ); diff --git a/stepmania/src/ScreenInputOptions.cpp b/stepmania/src/ScreenInputOptions.cpp index ddf8164b98..706884a002 100644 --- a/stepmania/src/ScreenInputOptions.cpp +++ b/stepmania/src/ScreenInputOptions.cpp @@ -36,13 +36,13 @@ enum { /* Hmm. Ignore JoyAxes and Back Delayed probably belong in "key/joy config", * preferably alongside button configuration. */ OptionRow g_InputOptionsLines[NUM_INPUT_OPTIONS_LINES] = { - OptionRow( "Auto Map\nJoysticks", "OFF","ON (recommended)" ), - OptionRow( "Ignore\nJoy Axes", "OFF","ON (for NTPad or DirectPad)" ), - OptionRow( "Menu\nButtons", "USE GAMEPLAY BUTTONS","ONLY DEDICATED BUTTONS" ), - OptionRow( "AutoPlay", "OFF","ON" ), - OptionRow( "Back\nDelayed", "INSTANT","HOLD" ), - OptionRow( "Options\nNavigation", "SM STYLE","ARCADE STYLE" ), - OptionRow( "Wheel\nSpeed", "SLOW","NORMAL","FAST","REALLY FAST" ), + OptionRow( "Auto Map\nJoysticks", true, "OFF","ON (recommended)" ), + OptionRow( "Ignore\nJoy Axes", true, "OFF","ON (for NTPad or DirectPad)" ), + OptionRow( "Menu\nButtons", true, "USE GAMEPLAY BUTTONS","ONLY DEDICATED BUTTONS" ), + OptionRow( "AutoPlay", true, "OFF","ON" ), + OptionRow( "Back\nDelayed", true, "INSTANT","HOLD" ), + OptionRow( "Options\nNavigation", true, "SM STYLE","ARCADE STYLE" ), + OptionRow( "Wheel\nSpeed", true, "SLOW","NORMAL","FAST","REALLY FAST" ), }; ScreenInputOptions::ScreenInputOptions() : @@ -51,10 +51,10 @@ ScreenInputOptions::ScreenInputOptions() : LOG->Trace( "ScreenInputOptions::ScreenInputOptions()" ); Init( - INPUTMODE_BOTH, + INPUTMODE_TOGETHER, g_InputOptionsLines, NUM_INPUT_OPTIONS_LINES, - false, true ); + true ); m_Menu.m_MenuTimer.Disable(); SOUND->PlayMusic( THEME->GetPathToS("ScreenInputOptions music") ); diff --git a/stepmania/src/ScreenMachineOptions.cpp b/stepmania/src/ScreenMachineOptions.cpp index 71d91f9f76..0728d9f3d5 100644 --- a/stepmania/src/ScreenMachineOptions.cpp +++ b/stepmania/src/ScreenMachineOptions.cpp @@ -43,20 +43,20 @@ enum { }; OptionRow g_MachineOptionsLines[NUM_MACHINE_OPTIONS_LINES] = { - OptionRow( "Menu\nTimer", "OFF","ON" ), - OptionRow( "Coin\nMode", "HOME","PAY","FREE PLAY" ), - OptionRow( "Songs Per\nPlay", "1","2","3","4","5","6","7","EVENT MODE" ), - OptionRow( "Scoring\nType", "MAX2","5TH" ), - OptionRow( "Judge\nDifficulty", "1","2","3","4","5","6","7","8","JUSTICE" ), - OptionRow( "Life\nDifficulty", "1","2","3","4","5","6","7" ), - OptionRow( "Progressive\nLifebar", "OFF","1","2","3","4","5","6","7","8"), - OptionRow( "Progressive\nStage Lifebar", "OFF","1","2","3","4","5","6","7","8","INSANITY"), - OptionRow( "Progressive\nNonstop Lifebar", "OFF","1","2","3","4","5","6","7","8","INSANITY"), - OptionRow( "Default\nFail Type", "ARCADE","END OF SONG","OFF" ), - OptionRow( "Show\nStats", "OFF","ON" ), - OptionRow( "Coins Per\nCredit", "1","2","3","4","5","6","7","8" ), - OptionRow( "Joint\nPremium", "OFF","ON" ), - OptionRow( "Song\nOptions", "HIDE","SHOW","ASK" ), + OptionRow( "Menu\nTimer", true, "OFF","ON" ), + OptionRow( "Coin\nMode", true, "HOME","PAY","FREE PLAY" ), + OptionRow( "Songs Per\nPlay", true, "1","2","3","4","5","6","7","EVENT MODE" ), + OptionRow( "Scoring\nType", true, "MAX2","5TH" ), + OptionRow( "Judge\nDifficulty", true, "1","2","3","4","5","6","7","8","JUSTICE" ), + OptionRow( "Life\nDifficulty", true, "1","2","3","4","5","6","7" ), + OptionRow( "Progressive\nLifebar", true, "OFF","1","2","3","4","5","6","7","8"), + OptionRow( "Progressive\nStage Lifebar", true, "OFF","1","2","3","4","5","6","7","8","INSANITY"), + OptionRow( "Progressive\nNonstop Lifebar", true, "OFF","1","2","3","4","5","6","7","8","INSANITY"), + OptionRow( "Default\nFail Type", true, "ARCADE","END OF SONG","OFF" ), + 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" ), }; ScreenMachineOptions::ScreenMachineOptions() : @@ -65,10 +65,10 @@ ScreenMachineOptions::ScreenMachineOptions() : LOG->Trace( "ScreenMachineOptions::ScreenMachineOptions()" ); Init( - INPUTMODE_BOTH, + INPUTMODE_TOGETHER, g_MachineOptionsLines, NUM_MACHINE_OPTIONS_LINES, - false, true ); + true ); m_Menu.m_MenuTimer.Disable(); SOUND->PlayMusic( THEME->GetPathToS("ScreenMachineOptions music") ); diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index b896370df0..f8e97acde9 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -74,7 +74,7 @@ ScreenOptions::ScreenOptions( CString sClassName, bool bEnableTimer ) : Screen(" memset(&m_bRowIsLong, 0, sizeof(m_bRowIsLong)); } -void ScreenOptions::Init( InputMode im, OptionRow OptionRow[], int iNumOptionLines, bool bUseIcons, bool bLoadExplanations ) +void ScreenOptions::Init( InputMode im, OptionRow OptionRow[], int iNumOptionLines, bool bLoadExplanations ) { LOG->Trace( "ScreenOptions::Set()" ); @@ -82,51 +82,61 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRow[], int iNumOptionLin m_InputMode = im; m_OptionRow = OptionRow; m_iNumOptionRows = iNumOptionLines; - m_bUseIcons = bUseIcons; m_bLoadExplanations = bLoadExplanations; this->ImportOptions(); - if( m_InputMode == INPUTMODE_BOTH ) - { - for( unsigned l=0; lIsHumanPlayer(p) ) + continue; // skip + + m_Highlight[p].Load( (PlayerNumber)p, false ); + m_framePage.AddChild( &m_Highlight[p] ); } - // init highlights and underlines - for( int p=0; pIsHumanPlayer(p) ) continue; // skip for( int l=0; lGetPathToF("ScreenOptions explanation") ); @@ -148,17 +158,17 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRow[], int iNumOptionLin /* It's tweening into position, but on the initial tween-in we only want to * tween in the whole page at once. Since the tweens are nontrivial, it's * easiest to queue the tweens and then force them to finish. */ - for( i=0; iIsHumanPlayer(PLAYER_2)? m_iCurrentRow[PLAYER_2]: m_iCurrentRow[PLAYER_1]; const bool BothPlayersActivated = GAMESTATE->IsHumanPlayer(PLAYER_1) && GAMESTATE->IsHumanPlayer(PLAYER_2); - if( m_InputMode == INPUTMODE_BOTH || !BothPlayersActivated ) + if( m_InputMode == INPUTMODE_TOGETHER || !BothPlayersActivated ) { /* Simply center the cursor. */ first_start = max( P1Choice - halfsize, 0 ); @@ -717,11 +732,12 @@ void ScreenOptions::MenuStart( PlayerNumber pn ) } } -void ScreenOptions::MenuLeft( PlayerNumber pn ) + +void ScreenOptions::ChangeValue( PlayerNumber pn, int iDelta ) { for( int p=0; p choices; - OptionRow( CString n, CString c0="", CString c1="", CString c2="", CString c3="", CString c4="", CString c5="", CString c6="", CString c7="", CString c8="", CString c9="", CString c10="", CString c11="", CString c12="", CString c13="", CString c14="", CString c15="", CString c16="", CString c17="", CString c18="", CString c19="" ) + OptionRow( CString n, int b, CString c0="", CString c1="", CString c2="", CString c3="", CString c4="", CString c5="", CString c6="", CString c7="", CString c8="", CString c9="", CString c10="", CString c11="", CString c12="", CString c13="", CString c14="", CString c15="", CString c16="", CString c17="", CString c18="", CString c19="" ) { name = n; + bOneChoiceForAllPlayers = !!b; #define PUSH( c ) if(c!="") choices.push_back(c); PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19); #undef PUSH @@ -41,8 +43,8 @@ struct OptionRow enum InputMode { - INPUTMODE_PLAYERS, // each player controls their own cursor - INPUTMODE_BOTH // both players control the same cursor + INPUTMODE_INDIVIDUAL, // each player controls their own cursor + INPUTMODE_TOGETHER // both players control the same cursor }; @@ -50,7 +52,7 @@ class ScreenOptions : public Screen { public: ScreenOptions( CString sClassName, bool bEnableTimer ); - void Init( InputMode im, OptionRow OptionRow[], int iNumOptionLines, bool bUseIcons, bool bLoadExplanations ); + void Init( InputMode im, OptionRow OptionRow[], int iNumOptionLines, bool bLoadExplanations ); virtual ~ScreenOptions(); virtual void Update( float fDeltaTime ); virtual void DrawPrimitives(); @@ -80,8 +82,9 @@ protected: virtual void GoToNextState() = 0; virtual void GoToPrevState() = 0; - void MenuLeft( PlayerNumber pn ); - void MenuRight( PlayerNumber pn ); + void MenuLeft( PlayerNumber pn ) { ChangeValue(pn,-1); } + void MenuRight( PlayerNumber pn ) { ChangeValue(pn,+1); } + void ChangeValue( PlayerNumber pn, int iDelta ); void MenuUp( PlayerNumber pn ); void MenuDown( PlayerNumber pn ); @@ -95,7 +98,6 @@ protected: private: CString m_sName; InputMode m_InputMode; - bool m_bUseIcons; bool m_bLoadExplanations; int m_iNumOptionRows; @@ -104,7 +106,7 @@ private: Sprite m_sprPage; Sprite m_sprBullets[MAX_OPTION_LINES]; BitmapText m_textTitles[MAX_OPTION_LINES]; - BitmapText m_textItems[MAX_OPTION_LINES][MAX_OPTIONS_PER_LINE]; // this array has to be big enough to hold all of the options + BitmapText m_textItems[MAX_OPTION_LINES][MAX_VISIBLE_VALUES_PER_LINE]; // this array has to be big enough to hold all of the options bool m_bRowIsLong[MAX_OPTION_LINES]; // goes off edge of screen diff --git a/stepmania/src/ScreenOptionsMenu.cpp b/stepmania/src/ScreenOptionsMenu.cpp index 471a0dbfa9..836f97af7b 100644 --- a/stepmania/src/ScreenOptionsMenu.cpp +++ b/stepmania/src/ScreenOptionsMenu.cpp @@ -42,16 +42,16 @@ enum { }; OptionRow g_OptionsMenuLines[NUM_OPTIONS_MENU_LINES] = { - OptionRow( "", "Appearance Options" ), - OptionRow( "", "Autogen Options" ), - OptionRow( "", "Background Options" ), - OptionRow( "", "Config Key/Joy Mappings" ), - OptionRow( "", "Input Options" ), - OptionRow( "", "Gameplay Options" ), - OptionRow( "", "Graphic Options" ), - OptionRow( "", "Machine Options" ), -// OptionRow( "", "Sound Options" ), - OptionRow( "", "Reload Songs/Courses" ), + OptionRow( "", true, "Appearance Options" ), + OptionRow( "", true, "Autogen Options" ), + OptionRow( "", true, "Background Options" ), + OptionRow( "", true, "Config Key/Joy Mappings" ), + OptionRow( "", true, "Input Options" ), + OptionRow( "", true, "Gameplay Options" ), + OptionRow( "", true, "Graphic Options" ), + OptionRow( "", true, "Machine Options" ), +// OptionRow( "", true, "Sound Options" ), + OptionRow( "", true, "Reload Songs/Courses" ), }; ScreenOptionsMenu::ScreenOptionsMenu() : @@ -66,10 +66,10 @@ ScreenOptionsMenu::ScreenOptionsMenu() : GAMESTATE->m_MasterPlayerNumber = PlayerNumber(0); Init( - INPUTMODE_BOTH, + INPUTMODE_TOGETHER, g_OptionsMenuLines, NUM_OPTIONS_MENU_LINES, - false, true ); + true ); m_Menu.m_MenuTimer.Disable(); SOUND->PlayMusic( THEME->GetPathToS("ScreenOptionsMenu music") ); diff --git a/stepmania/src/ScreenPlayerOptions.cpp b/stepmania/src/ScreenPlayerOptions.cpp index 3175095f62..299af56027 100644 --- a/stepmania/src/ScreenPlayerOptions.cpp +++ b/stepmania/src/ScreenPlayerOptions.cpp @@ -42,22 +42,36 @@ enum { PO_PERSPECTIVE, PO_STEP, PO_CHARACTER, + SO_LIFE, + SO_DRAIN, + SO_BAT_LIVES, + SO_FAIL, + SO_ASSIST, + SO_RATE, + SO_AUTOSYNC, 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","TIPSY" ), - 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","MINES" ), - OptionRow( "Scroll", "STANDARD","REVERSE","SPLIT","ALTERNATE" ), - OptionRow( "Note\nSkin", "" ), - OptionRow( "Holds", "OFF","ON" ), - OptionRow( "Dark", "OFF","ON" ), - OptionRow( "Perspec\n-tive", "" ), - OptionRow( "Step", "" ), - OptionRow( "Character", "" ), + 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" ), + OptionRow( "Dark", false, "OFF","ON" ), + OptionRow( "Perspec\n-tive", false, "" ), + OptionRow( "Step", false, "" ), + OptionRow( "Character", 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" ), }; static const PlayerOptions::Effect ChoosableEffects[] = @@ -77,10 +91,10 @@ ScreenPlayerOptions::ScreenPlayerOptions() : LOG->Trace( "ScreenPlayerOptions::ScreenPlayerOptions()" ); Init( - INPUTMODE_PLAYERS, + INPUTMODE_INDIVIDUAL, g_PlayerOptionsLines, NUM_PLAYER_OPTIONS_LINES, - true, false ); + 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 */ @@ -270,6 +284,27 @@ 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_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_RATE] = 7; // in case we don't match below + for( i=0; im_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]; + + int iSel = m_iSelectedOption[0][SO_RATE]; + so.m_fMusicRate = (float) atof( g_PlayerOptionsLines[SO_RATE].choices[iSel] ); } void ScreenPlayerOptions::GoToPrevState() diff --git a/stepmania/src/ScreenRaveOptions.cpp b/stepmania/src/ScreenRaveOptions.cpp index 0ccd0b5fb3..0d8ac68bbd 100644 --- a/stepmania/src/ScreenRaveOptions.cpp +++ b/stepmania/src/ScreenRaveOptions.cpp @@ -33,9 +33,9 @@ enum { }; OptionRow g_RaveOptionsLines[NUM_RAVE_OPTIONS_LINES] = { - OptionRow( "P1 Super\nGrowth", "25%","50%","75%","100%","125%","150%","175%","200%" ), - OptionRow( "P2 Super\nGrowth", "25%","50%","75%","100%","125%","150%","175%","200%" ), - OptionRow( "CPU\nSkill", "-5","-4","-3","-2","-1","DEFAULT","+1","+2","+3","+4","+5" ) + OptionRow( "P1 Super\nGrowth", true, "25%","50%","75%","100%","125%","150%","175%","200%" ), + OptionRow( "P2 Super\nGrowth", true, "25%","50%","75%","100%","125%","150%","175%","200%" ), + OptionRow( "CPU\nSkill", true, "-5","-4","-3","-2","-1","DEFAULT","+1","+2","+3","+4","+5" ) }; PlayerNumber OPPOSITE_PLAYER[NUM_PLAYERS] = { PLAYER_2, PLAYER_1 }; @@ -47,10 +47,10 @@ ScreenRaveOptions::ScreenRaveOptions() : bool bComputerPlayersPresent = GAMESTATE->GetNumSidesJoined()==1; Init( - INPUTMODE_BOTH, + INPUTMODE_TOGETHER, g_RaveOptionsLines, bComputerPlayersPresent ? 3 : 1, - false, false ); + false ); } void ScreenRaveOptions::ImportOptions() diff --git a/stepmania/src/ScreenSelectGame.cpp b/stepmania/src/ScreenSelectGame.cpp index 6a460b3239..5ef82ebf55 100644 --- a/stepmania/src/ScreenSelectGame.cpp +++ b/stepmania/src/ScreenSelectGame.cpp @@ -29,7 +29,7 @@ enum { OptionRow g_SelectGameLines[NUM_SELECT_GAME_LINES] = { - OptionRow( "Game" ), + OptionRow( "Game", true ), }; @@ -52,10 +52,10 @@ ScreenSelectGame::ScreenSelectGame() : } Init( - INPUTMODE_BOTH, + INPUTMODE_TOGETHER, g_SelectGameLines, NUM_SELECT_GAME_LINES, - false, true ); + true ); m_Menu.m_MenuTimer.Disable(); SOUND->PlayMusic( THEME->GetPathToS("ScreenSelectGame music") ); diff --git a/stepmania/src/ScreenSongOptions.cpp b/stepmania/src/ScreenSongOptions.cpp index e7b1aed8b8..15c38be7ce 100644 --- a/stepmania/src/ScreenSongOptions.cpp +++ b/stepmania/src/ScreenSongOptions.cpp @@ -34,13 +34,13 @@ enum { }; OptionRow g_SongOptionsLines[NUM_SONG_OPTIONS_LINES] = { - OptionRow( "Life\nType", "BAR","BATTERY" ), - OptionRow( "Bar\nDrain", "NORMAL","NO RECOVER","SUDDEN DEATH" ), - OptionRow( "Bat\nLives", "1","2","3","4","5","6","7","8","9","10" ), - OptionRow( "Fail", "ARCADE","END OF SONG","OFF" ), - OptionRow( "Assist\nTick", "OFF", "ON" ), - OptionRow( "Rate", "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", "OFF", "ON" ), + 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" ), }; /* Get the next screen we'll go to when finished. */ @@ -55,10 +55,10 @@ ScreenSongOptions::ScreenSongOptions() : { LOG->Trace( "ScreenSongOptions::ScreenSongOptions()" ); - Init( INPUTMODE_BOTH, + Init( INPUTMODE_TOGETHER, g_SongOptionsLines, NUM_SONG_OPTIONS_LINES, - false, false ); + false ); /* If we're coming in from "press start for more options", we need a different * fade in. XXX: this is a hack */ diff --git a/stepmania/src/ScreenSoundOptions.cpp b/stepmania/src/ScreenSoundOptions.cpp index 67580381ec..c58d98c1a0 100644 --- a/stepmania/src/ScreenSoundOptions.cpp +++ b/stepmania/src/ScreenSoundOptions.cpp @@ -36,7 +36,7 @@ OptionRow g_SoundOptionsLines[NUM_SOUND_OPTIONS_LINES] = { * users, except to troubleshoot clipping; that's why I didn't put it in * the options to begin with. */ // OptionRow( "Master\nVolume", "MUTE","20%","40%","60%","80%","100%" ), - OptionRow( "Preload\nSounds", "NO","YES" ), + OptionRow( "Preload\nSounds", true, "NO","YES" ), }; ScreenSoundOptions::ScreenSoundOptions() : @@ -44,7 +44,7 @@ ScreenSoundOptions::ScreenSoundOptions() : { LOG->Trace( "ScreenSoundOptions::ScreenSoundOptions()" ); - Init( INPUTMODE_BOTH, g_SoundOptionsLines, NUM_SOUND_OPTIONS_LINES, false, true ); + Init( INPUTMODE_TOGETHER, g_SoundOptionsLines, NUM_SOUND_OPTIONS_LINES, true ); m_Menu.m_MenuTimer.Disable(); SOUND->PlayMusic( THEME->GetPathToS("ScreenSoundOptions music") );