diff --git a/stepmania/Themes/default/Graphics/ScreenOptions page.png b/stepmania/Themes/default/Graphics/ScreenOptions page.png new file mode 100644 index 0000000000..6713a5de0b Binary files /dev/null and b/stepmania/Themes/default/Graphics/ScreenOptions page.png differ diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 6803353b37..9522ccf1cd 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -2231,15 +2231,20 @@ MemoryCardIcons=0 TimerSeconds=0 [ScreenJukeboxMenu] -Fallback=ScreenWithMenuElements +Class=ScreenOptionsMaster +Fallback=ScreenOptions NextScreen=ScreenJukebox PrevScreen=ScreenTitleBranch -ExplanationX=SCREEN_CENTER_X+0 -ExplanationY=SCREEN_CENTER_Y+170 -ExplanationOnCommand=wrapwidthpixels,900;zoom,0.7 StyleIcon=0 -MemoryCardIcons=0 +MemoryCardIcons=1 TimerSeconds=0 +CapitalizeAllOptionNames=1 +OptionMenuFlags= +LineNames=1,2,3,4 +Line1=Styles +Line2=Groups +Line3=Difficulties +Line4=list,RandomModifiers [ScreenEditCoursesMenu] Fallback=ScreenWithMenuElements @@ -3338,19 +3343,6 @@ Row5Y=SCREEN_CENTER_Y+20 Row6Y=SCREEN_CENTER_Y+60 Row7Y=SCREEN_CENTER_Y+100 -[JukeboxMenu] -Arrows1X=SCREEN_CENTER_X-130 -Arrows2X=SCREEN_CENTER_X+270 -RowLabelsX=SCREEN_CENTER_X-300 -RowValue1X=SCREEN_CENTER_X+60 -RowValue2X=SCREEN_CENTER_X+60 -RowValue3X=SCREEN_CENTER_X+60 -RowValue4X=SCREEN_CENTER_X+60 -Row1Y=SCREEN_CENTER_Y-160 -Row2Y=SCREEN_CENTER_Y-110 -Row3Y=SCREEN_CENTER_Y-60 -Row4Y=SCREEN_CENTER_Y-10 - [EditCoursesMenu] Arrows1X=SCREEN_CENTER_X-130 Arrows2X=SCREEN_CENTER_X+270 @@ -3512,8 +3504,8 @@ Line10=list,Mines Line11=list,Hide Line12=list,Persp Line13=list,ScoreDisplay -Line14=Steps -Line15=Characters +Line14=list,Steps +Line15=list,Characters CancelAllP1X= CancelAllP1Y= CancelAllP1OnCommand= @@ -3870,6 +3862,11 @@ Network Options=1,together,SelectNone Network OptionsDefault= Network Options,1=screen,ScreenNetworkOptions;name,NetworkOptions +#ScreenJukeboxMenu +RandomModifiers=2 +RandomModifiersDefault=mod,clear +RandomModifiers,1=name,Off +RandomModifiers,2=mod,random;name,Random [DancingCharacters] diff --git a/stepmania/src/Foreach.h b/stepmania/src/Foreach.h index fd6bdcc89e..cb9b45ec2d 100644 --- a/stepmania/src/Foreach.h +++ b/stepmania/src/Foreach.h @@ -11,6 +11,11 @@ for( deque::iterator var = (vect).begin(); var != (vect).end(); ++var #define FOREACHD_CONST( elemType, vect, var ) \ for( deque::const_iterator var = (vect).begin(); var != (vect).end(); ++var ) +#define FOREACHS( elemType, vect, var ) \ +for( set::iterator var = (vect).begin(); var != (vect).end(); ++var ) +#define FOREACHS_CONST( elemType, vect, var ) \ +for( set::const_iterator var = (vect).begin(); var != (vect).end(); ++var ) + #define FOREACHMM( keyType, valType, vect, var ) \ for( multimap::iterator var = (vect).begin(); var != (vect).end(); ++var ) diff --git a/stepmania/src/GameCommand.cpp b/stepmania/src/GameCommand.cpp index 38628b68f4..488708f96b 100644 --- a/stepmania/src/GameCommand.cpp +++ b/stepmania/src/GameCommand.cpp @@ -84,8 +84,8 @@ bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const if( m_pSteps == NULL && m_dc != DIFFICULTY_INVALID ) { // Why is this checking for all players? - FOREACH_PlayerNumber( pn ) - if( GAMESTATE->IsHumanPlayer(pn) && GAMESTATE->m_PreferredDifficulty[pn] != m_dc ) + FOREACH_HumanPlayer( pn ) + if( GAMESTATE->m_PreferredDifficulty[pn] != m_dc ) return false; } @@ -114,6 +114,8 @@ bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const return false; if( m_pTrail && GAMESTATE->m_pCurTrail[pn] != m_pTrail ) return false; + if( !m_sSongGroup.empty() && GAMESTATE->m_sPreferredSongGroup != m_sSongGroup ) + return false; if( m_SortOrder != SORT_INVALID && GAMESTATE->m_PreferredSortOrder != m_SortOrder ) return false; @@ -736,6 +738,7 @@ bool GameCommand::IsZero() const m_pTrail != NULL || m_pCharacter != NULL || m_CourseDifficulty != DIFFICULTY_INVALID || + !m_sSongGroup.empty() || m_SortOrder != SORT_INVALID ) return false; diff --git a/stepmania/src/JukeboxMenu.cpp b/stepmania/src/JukeboxMenu.cpp deleted file mode 100644 index 8ac1a9f7e4..0000000000 --- a/stepmania/src/JukeboxMenu.cpp +++ /dev/null @@ -1,206 +0,0 @@ -#include "global.h" -#include "JukeboxMenu.h" -#include "RageLog.h" -#include "SongManager.h" -#include "GameState.h" -#include "ThemeManager.h" -#include "GameManager.h" -#include "Style.h" - -// -// Defines specific to JukeboxMenu -// -#define ARROWS_X( i ) THEME->GetMetricF("JukeboxMenu",ssprintf("Arrows%dX",i+1)) -#define ROW_LABELS_X THEME->GetMetricF("JukeboxMenu","RowLabelsX") -#define ROW_VALUE_X( i ) THEME->GetMetricF("JukeboxMenu",ssprintf("RowValue%dX",i+1)) -#define ROW_Y( i ) THEME->GetMetricF("JukeboxMenu",ssprintf("Row%dY",i+1)) - - -JukeboxMenu::JukeboxMenu() -{ - LOG->Trace( "ScreenJukeboxMenu::ScreenJukeboxMenu()" ); - - for( int i=0; i<2; i++ ) - { - m_sprArrows[i].Load( THEME->GetPathToG(ssprintf("JukeboxMenu %s",(i==0?"left":"right"))) ); - m_sprArrows[i].SetX( ARROWS_X(i) ); - this->AddChild( &m_sprArrows[i] ); - } - - m_SelectedRow = (Row)0; - - ZERO( m_iSelection ); - - for( int i=0; iGetPathToF("Common title") ); - m_textLabel[i].SetXY( ROW_LABELS_X, ROW_Y(i) ); - m_textLabel[i].SetText( RowToString((Row)i) ); - m_textLabel[i].SetZoom( 0.8f ); - m_textLabel[i].SetHorizAlign( Actor::align_left ); - this->AddChild( &m_textLabel[i] ); - - m_textValue[i].LoadFromFont( THEME->GetPathToF("Common normal") ); - m_textValue[i].SetXY( ROW_VALUE_X(i), ROW_Y(i) ); - m_textValue[i].SetText( "blah" ); - m_textValue[i].SetZoom( 0.8f ); - this->AddChild( &m_textValue[i] ); - } - - m_soundChangeRow.Load( THEME->GetPathToS("JukeboxMenu row") ); - m_soundChangeValue.Load( THEME->GetPathToS("JukeboxMenu value") ); - - - // fill in data structures - GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, m_Styles ); - SONGMAN->GetGroupNames( m_sGroups ); - m_sGroups.insert( m_sGroups.begin(), "ALL MUSIC" ); - m_sDifficulties.push_back( "all difficulties" ); - for( int d=0; dm_szName ); - // fall through - case ROW_GROUP: - m_textValue[ROW_GROUP].SetText( SONGMAN->ShortenGroupName(GetSelectedGroup()) ); - // fall through - case ROW_DIFFICULTY: - m_textValue[ROW_DIFFICULTY].SetText( GetSelectedDifficultyString() ); - // fall through - case ROW_MODIFIERS: - m_textValue[ROW_MODIFIERS].SetText( m_sModifiers[GetSelectedModifiers()] ); - break; - default: - ASSERT(0); // invalid row - } -} - -/* - * (c) 2003 Chris Danford - * 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. - */ diff --git a/stepmania/src/JukeboxMenu.h b/stepmania/src/JukeboxMenu.h deleted file mode 100644 index 005ee71736..0000000000 --- a/stepmania/src/JukeboxMenu.h +++ /dev/null @@ -1,103 +0,0 @@ -/* JukeboxMenu - UI on ScreenJukeboxMenu. */ - -#ifndef JUKEBOX_MENU_H -#define JUKEBOX_MENU_H - -#include "ActorFrame.h" -#include "Banner.h" -#include "GameConstantsAndTypes.h" -#include "RandomSample.h" -#include "BitmapText.h" -#include "Difficulty.h" - -class Style; - -class JukeboxMenu: public ActorFrame -{ -public: - JukeboxMenu(); - ~JukeboxMenu(); - virtual void DrawPrimitives(); - - bool CanGoUp(); - bool CanGoDown(); - bool CanGoLeft(); - bool CanGoRight(); - - void Up(); - void Down(); - void Left(); - void Right(); - - enum Row - { - ROW_STYLE, - ROW_GROUP, - ROW_DIFFICULTY, - ROW_MODIFIERS, - NUM_ROWS - } m_SelectedRow; - CString RowToString( Row r ) - { - const CString s[NUM_ROWS] = - { - "Style", - "Group", - "Difficulty", - "Modifiers", - }; - return s[r]; - } - - - const Style* GetSelectedStyle() { return m_Styles[m_iSelection[ROW_STYLE]]; } - CString GetSelectedGroup() { return m_sGroups[m_iSelection[ROW_GROUP]]; } - CString GetSelectedDifficultyString() { return m_sDifficulties[m_iSelection[ROW_DIFFICULTY]]; } - Difficulty GetSelectedDifficulty() { return StringToDifficulty( GetSelectedDifficultyString() ); } - bool GetSelectedModifiers() { return m_iSelection[ROW_MODIFIERS] != 0; } - -private: - Sprite m_sprArrows[2]; - - int m_iSelection[NUM_ROWS]; - BitmapText m_textLabel[NUM_ROWS]; - BitmapText m_textValue[NUM_ROWS]; - - vector m_Styles; - CStringArray m_sGroups; - vector m_sDifficulties; - CStringArray m_sModifiers; - - void OnRowValueChanged( Row row ); - void ChangeToRow( Row newRow ); - - RandomSample m_soundChangeRow; - RandomSample m_soundChangeValue; -}; - -#endif - -/* - * (c) 2003 Chris Danford - * 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. - */ diff --git a/stepmania/src/Makefile.am b/stepmania/src/Makefile.am index c4272e33a4..9006798299 100644 --- a/stepmania/src/Makefile.am +++ b/stepmania/src/Makefile.am @@ -35,7 +35,7 @@ ScreenEz2SelectMusic.cpp ScreenEz2SelectMusic.h ScreenEz2SelectPlayer.cpp Screen ScreenGameplay.cpp ScreenGameplay.h ScreenHowToPlay.cpp ScreenHowToPlay.h \ ScreenInstructions.cpp ScreenInstructions.h \ ScreenJukebox.cpp ScreenJukebox.h \ -ScreenJukeboxMenu.cpp ScreenJukeboxMenu.h ScreenLogo.cpp ScreenLogo.h ScreenMapControllers.cpp ScreenMapControllers.h \ +ScreenLogo.cpp ScreenLogo.h ScreenMapControllers.cpp ScreenMapControllers.h \ ScreenMessage.h ScreenMiniMenu.cpp ScreenMiniMenu.h ScreenMusicScroll.cpp ScreenMusicScroll.h \ ScreenNameEntry.cpp ScreenNameEntry.h ScreenNameEntryTraditional.cpp ScreenNameEntryTraditional.h \ ScreenOptions.cpp ScreenOptions.h ScreenOptionsMaster.cpp ScreenOptionsMaster.h \ @@ -202,7 +202,7 @@ DifficultyDisplay.cpp DifficultyDisplay.h DifficultyList.cpp DifficultyList.h \ DifficultyMeter.cpp DifficultyMeter.h DifficultyRating.cpp DifficultyRating.h DualScrollBar.cpp DualScrollBar.h \ EditCoursesMenu.cpp EditCoursesMenu.h EditMenu.cpp EditMenu.h FadingBanner.cpp FadingBanner.h \ GradeDisplay.cpp GradeDisplay.h GraphDisplay.cpp GraphDisplay.h GrooveGraph.cpp GrooveGraph.h \ -GrooveRadar.cpp GrooveRadar.h GroupList.cpp GroupList.h HelpDisplay.cpp HelpDisplay.h JukeboxMenu.cpp JukeboxMenu.h \ +GrooveRadar.cpp GrooveRadar.h GroupList.cpp GroupList.h HelpDisplay.cpp HelpDisplay.h \ ListDisplay.cpp ListDisplay.h MemoryCardDisplay.cpp MemoryCardDisplay.h \ MenuTimer.cpp MenuTimer.h ModeSwitcher.cpp ModeSwitcher.h MusicBannerWheel.cpp MusicBannerWheel.h \ MusicList.cpp MusicList.h MusicSortDisplay.cpp MusicSortDisplay.h MusicWheel.cpp MusicWheel.h \ diff --git a/stepmania/src/PlayerOptions.cpp b/stepmania/src/PlayerOptions.cpp index f0592f9f4a..d9329acca1 100644 --- a/stepmania/src/PlayerOptions.cpp +++ b/stepmania/src/PlayerOptions.cpp @@ -297,18 +297,13 @@ void PlayerOptions::FromString( CString sOptions ) else if( sBit == "space" ) { m_fSkew = level; m_fPerspectiveTilt = +level; m_SpeedfSkew = m_SpeedfPerspectiveTilt = speed; } else if( sBit == "hallway" ) { m_fSkew = 0; m_fPerspectiveTilt = -level; m_SpeedfSkew = m_SpeedfPerspectiveTilt = speed; } else if( sBit == "distant" ) { m_fSkew = 0; m_fPerspectiveTilt = +level; m_SpeedfSkew = m_SpeedfPerspectiveTilt = speed; } - else if( NOTESKIN && NOTESKIN->DoesNoteSkinExist(sBit) ) - m_sNoteSkin = sBit; - else if( sBit == "noteskin" && !on ) /* "no noteskin" */ - m_sNoteSkin = "default"; - else if ( sBit == "randomspeed" ) - SET_FLOAT( fRandomSpeed ) - else if ( sBit == "addscore" ) - m_ScoreDisplay = SCORING_ADD; - else if ( sBit == "subtractscore" ) - m_ScoreDisplay = SCORING_SUBTRACT; - else if ( sBit == "averagescore" ) - m_ScoreDisplay = SCORING_AVERAGE; + else if( NOTESKIN && NOTESKIN->DoesNoteSkinExist(sBit) ) m_sNoteSkin = sBit; + else if( sBit == "noteskin" && !on ) /* "no noteskin" */ m_sNoteSkin = "default"; + else if( sBit == "randomspeed" ) SET_FLOAT( fRandomSpeed ) + else if( sBit == "addscore" ) m_ScoreDisplay = SCORING_ADD; + else if( sBit == "subtractscore" ) m_ScoreDisplay = SCORING_SUBTRACT; + else if( sBit == "averagescore" ) m_ScoreDisplay = SCORING_AVERAGE; + else if( sBit == "random" ) ChooseRandomMofifiers(); } } diff --git a/stepmania/src/ScreenJukeboxMenu.cpp b/stepmania/src/ScreenJukeboxMenu.cpp deleted file mode 100644 index 106ba329c1..0000000000 --- a/stepmania/src/ScreenJukeboxMenu.cpp +++ /dev/null @@ -1,144 +0,0 @@ -#include "global.h" -#include "ScreenJukeboxMenu.h" -#include "SongManager.h" -#include "ScreenManager.h" -#include "GameConstantsAndTypes.h" -#include "RageUtil.h" -#include "GameManager.h" -#include "RageLog.h" -#include "GameState.h" -#include "GameSoundManager.h" -#include "ThemeManager.h" -#include "ScreenJukebox.h" - - -// -// Defines specific to ScreenJukeboxMenu -// -#define EXPLANATION_TEXT THEME->GetMetric("ScreenJukeboxMenu","ExplanationText") - - -REGISTER_SCREEN_CLASS( ScreenJukeboxMenu ); -ScreenJukeboxMenu::ScreenJukeboxMenu( CString sClassName ) : ScreenWithMenuElements( sClassName ) -{ - LOG->Trace( "ScreenJukeboxMenu::ScreenJukeboxMenu()" ); - - GAMESTATE->m_pCurStyle = NULL; - - FOREACH_PlayerNumber( pn ) - GAMESTATE->m_bSideIsJoined[pn] = true; - - m_Selector.SetXY( 0, 0 ); -// m_Selector.AllowNewNotes(); - this->AddChild( &m_Selector ); - - - m_textExplanation.SetName( "Explanation" ); - m_textExplanation.LoadFromFont( THEME->GetPathToF("Common normal") ); - m_textExplanation.SetText( EXPLANATION_TEXT ); - SET_XY_AND_ON_COMMAND( m_textExplanation ); - this->AddChild( &m_textExplanation ); - - this->SortByDrawOrder(); - - SOUND->PlayMusic( THEME->GetPathToS("ScreenJukeboxMenu music") ); -} - - -ScreenJukeboxMenu::~ScreenJukeboxMenu() -{ - LOG->Trace( "ScreenJukeboxMenu::~ScreenJukeboxMenu()" ); -} - -void ScreenJukeboxMenu::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) -{ - LOG->Trace( "ScreenJukeboxMenu::Input()" ); - - if( IsTransitioning() ) - return; - - Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); -} - -void ScreenJukeboxMenu::MenuUp( PlayerNumber pn ) -{ - m_Selector.Up(); -} - -void ScreenJukeboxMenu::MenuDown( PlayerNumber pn ) -{ - m_Selector.Down(); -} - -void ScreenJukeboxMenu::MenuLeft( PlayerNumber pn, const InputEventType type ) -{ - m_Selector.Left(); -} - -void ScreenJukeboxMenu::MenuRight( PlayerNumber pn, const InputEventType type ) -{ - m_Selector.Right(); -} - -void ScreenJukeboxMenu::MenuStart( PlayerNumber pn ) -{ - if( IsTransitioning() ) - return; - - const Style *style = m_Selector.GetSelectedStyle(); - CString sGroup = m_Selector.GetSelectedGroup(); - Difficulty dc = m_Selector.GetSelectedDifficulty(); - bool bModifiers = m_Selector.GetSelectedModifiers(); - - GAMESTATE->m_pCurStyle = style; - GAMESTATE->m_sPreferredSongGroup = (sGroup=="ALL MUSIC") ? GROUP_ALL_MUSIC : sGroup; - FOREACH_PlayerNumber( p ) - GAMESTATE->m_PreferredDifficulty[p] = dc; - GAMESTATE->m_bJukeboxUsesModifiers = bModifiers; - - if( !ScreenJukebox::SetSong(false) ) - { - /* No songs are available for the selected style, group, and difficulty. */ - - SCREENMAN->PlayInvalidSound(); - SCREENMAN->SystemMessage( "No songs available with these settings" ); - return; - } - - - SOUND->StopMusic(); - SCREENMAN->PlayStartSound(); - StartTransitioning( SM_GoToNextScreen ); -} - -void ScreenJukeboxMenu::MenuBack( PlayerNumber pn ) -{ - StartTransitioning( SM_GoToPrevScreen ); - - SOUND->StopMusic(); -} - -/* - * (c) 2003-2004 Chris Danford - * 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. - */ diff --git a/stepmania/src/ScreenJukeboxMenu.h b/stepmania/src/ScreenJukeboxMenu.h deleted file mode 100644 index ef6281a1cb..0000000000 --- a/stepmania/src/ScreenJukeboxMenu.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef SCREEN_JUKEBOX_MENU_H -#define SCREEN_JUKEBOX_MENU_H - -#include "ScreenWithMenuElements.h" -#include "JukeboxMenu.h" -#include "BitmapText.h" -#include "RageSound.h" - -class ScreenJukeboxMenu : public ScreenWithMenuElements -{ -public: - ScreenJukeboxMenu( CString sName ); - virtual ~ScreenJukeboxMenu(); - - virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ); - -private: - - void MenuUp( PlayerNumber pn ); - void MenuDown( PlayerNumber pn ); - void MenuLeft( PlayerNumber pn, const InputEventType type ); - void MenuRight( PlayerNumber pn, const InputEventType type ); - void MenuBack( PlayerNumber pn ); - void MenuStart( PlayerNumber pn ); - - JukeboxMenu m_Selector; - - BitmapText m_textExplanation; -}; - -#endif - -/* - * (c) 2003-2004 Chris Danford - * 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. - */ diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index d5f58dfd49..71bc147215 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -22,6 +22,8 @@ #include "ProfileManager.h" #include "StepsUtil.h" #include "LuaManager.h" +#include "GameManager.h" +#include "Foreach.h" #define LINE_NAMES THEME->GetMetric (m_sName,"LineNames") #define OPTION_MENU_FLAGS THEME->GetMetric (m_sName,"OptionMenuFlags") @@ -98,9 +100,9 @@ void ScreenOptionsMaster::SetList( OptionRowData &row, OptionRowHandler &hand, C } /* Add a list of difficulties/edits to the given row/handler. */ -void ScreenOptionsMaster::SetStep( OptionRowData &row, OptionRowHandler &hand ) +void ScreenOptionsMaster::SetSteps( OptionRowData &row, OptionRowHandler &hand ) { - hand.type = ROW_STEP; + hand.type = ROW_LIST; row.name = "Steps"; row.bOneChoiceForAllPlayers = false; @@ -173,9 +175,9 @@ void ScreenOptionsMaster::SetConf( OptionRowData &row, OptionRowHandler &hand, C } /* Add a list of available characters to the given row/handler. */ -void ScreenOptionsMaster::SetCharacter( OptionRowData &row, OptionRowHandler &hand ) +void ScreenOptionsMaster::SetCharacters( OptionRowData &row, OptionRowHandler &hand ) { - hand.type = ROW_CHARACTER; + hand.type = ROW_LIST; row.bOneChoiceForAllPlayers = false; row.name = "Characters"; hand.Default.m_pCharacter = GAMESTATE->GetDefaultCharacter(); @@ -183,7 +185,7 @@ void ScreenOptionsMaster::SetCharacter( OptionRowData &row, OptionRowHandler &ha { row.choices.push_back( ENTRY_NAME("Off") ); GameCommand mc; - mc.m_pCharacter = GAMESTATE->GetDefaultCharacter(); + mc.m_pCharacter = NULL; hand.ListEntries.push_back( mc ); } @@ -202,6 +204,84 @@ void ScreenOptionsMaster::SetCharacter( OptionRowData &row, OptionRowHandler &ha } } +/* Add a list of available styles to the given row/handler. */ +void ScreenOptionsMaster::SetStyles( OptionRowData &row, OptionRowHandler &hand ) +{ + hand.type = ROW_LIST; + row.bOneChoiceForAllPlayers = true; + row.name = "Style"; + + vector vStyles; + GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vStyles ); + ASSERT( vStyles.size() ); + FOREACH_CONST( const Style*, vStyles, s ) + { + row.choices.push_back( GAMEMAN->StyleToThemedString(*s) ); + GameCommand mc; + mc.m_pStyle = *s; + hand.ListEntries.push_back( mc ); + } + + hand.Default.m_pStyle = vStyles[0]; +} + +/* Add a list of available song groups to the given row/handler. */ +void ScreenOptionsMaster::SetGroups( OptionRowData &row, OptionRowHandler &hand ) +{ + hand.type = ROW_LIST; + row.bOneChoiceForAllPlayers = true; + row.name = "Group"; + hand.Default.m_sSongGroup = GROUP_ALL_MUSIC; + + vector vGroups; + SONGMAN->GetGroupNames( vGroups ); + ASSERT( vGroups.size() ); + + { + row.choices.push_back( ENTRY_NAME("AllGroups") ); + GameCommand mc; + mc.m_sSongGroup = GROUP_ALL_MUSIC; + hand.ListEntries.push_back( mc ); + } + + FOREACH_CONST( CString, vGroups, g ) + { + row.choices.push_back( *g ); + GameCommand mc; + mc.m_sSongGroup = *g; + hand.ListEntries.push_back( mc ); + } +} + +/* Add a list of available difficulties to the given row/handler. */ +void ScreenOptionsMaster::SetDifficulties( OptionRowData &row, OptionRowHandler &hand ) +{ + set vDifficulties; + GAMESTATE->GetDifficultiesToShow( vDifficulties ); + + hand.type = ROW_LIST; + row.bOneChoiceForAllPlayers = true; + row.name = "Difficulty"; + hand.Default.m_dc = DIFFICULTY_INVALID; + + { + row.choices.push_back( ENTRY_NAME("AllDifficulties") ); + GameCommand mc; + mc.m_dc = DIFFICULTY_INVALID; + hand.ListEntries.push_back( mc ); + } + + FOREACHS_CONST( Difficulty, vDifficulties, d ) + { + CString s = DifficultyToThemedString( *d ); + + row.choices.push_back( s ); + GameCommand mc; + mc.m_dc = *d; + hand.ListEntries.push_back( mc ); + } +} + REGISTER_SCREEN_CLASS( ScreenOptionsMaster ); ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ): ScreenOptions( sClassName ) @@ -270,14 +350,13 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ): const CString &name = command.GetName(); - if( !name.CompareNoCase("list") ) - SetList( row, hand, sArg(1) ); - else if( !name.CompareNoCase("steps") ) - SetStep( row, hand ); - else if( !name.CompareNoCase("conf") ) - SetConf( row, hand, sArg(1) ); - else if( !name.CompareNoCase("characters") ) - SetCharacter( row, hand ); + if( !name.CompareNoCase("list") ) SetList( row, hand, sArg(1) ); + else if( !name.CompareNoCase("steps") ) SetSteps( row, hand ); + else if( !name.CompareNoCase("conf") ) SetConf( row, hand, sArg(1) ); + else if( !name.CompareNoCase("characters") ) SetCharacters( row, hand ); + else if( !name.CompareNoCase("styles") ) SetStyles( row, hand ); + else if( !name.CompareNoCase("groups") ) SetGroups( row, hand ); + else if( !name.CompareNoCase("difficulties") ) SetDifficulties( row, hand ); else RageException::Throw( "Unexpected type '%s' in %s::Line%i", name.c_str(), m_sName.c_str(), i ); @@ -316,8 +395,6 @@ void ScreenOptionsMaster::ImportOption( const OptionRowData &row, const OptionRo switch( hand.type ) { case ROW_LIST: - case ROW_STEP: - case ROW_CHARACTER: { int FallbackOption = -1; bool UseFallbackOption = true; @@ -453,8 +530,6 @@ int ScreenOptionsMaster::ExportOption( const OptionRowData &row, const OptionRow switch( hand.type ) { case ROW_LIST: - case ROW_CHARACTER: - case ROW_STEP: { hand.Default.Apply( pn ); for( unsigned i=0; i &vbSelected ); void ImportOption( const OptionRowData &row, const OptionRowHandler &hand, PlayerNumber pn, int rowno, vector &vbSelectedOut ); - void SetList( OptionRowData &row, OptionRowHandler &hand, CString param ); - void SetStep( OptionRowData &row, OptionRowHandler &hand ); - void SetConf( OptionRowData &row, OptionRowHandler &hand, CString param ); - void SetCharacter( OptionRowData &row, OptionRowHandler &hand ); + + static void SetList( OptionRowData &row, OptionRowHandler &hand, CString param ); + static void SetSteps( OptionRowData &row, OptionRowHandler &hand ); + static void SetConf( OptionRowData &row, OptionRowHandler &hand, CString param ); + static void SetCharacters( OptionRowData &row, OptionRowHandler &hand ); + static void SetStyles( OptionRowData &row, OptionRowHandler &hand ); + static void SetGroups( OptionRowData &row, OptionRowHandler &hand ); + static void SetDifficulties( OptionRowData &row, OptionRowHandler &hand ); protected: virtual void ImportOptions(); diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index bf91c49985..9012426bda 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -292,12 +292,6 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ - - - - @@ -1494,12 +1488,6 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ - - - -