diff --git a/stepmania/src/ScreenOptionsEditCourse.cpp b/stepmania/src/ScreenOptionsEditCourse.cpp deleted file mode 100644 index bd9005740c..0000000000 --- a/stepmania/src/ScreenOptionsEditCourse.cpp +++ /dev/null @@ -1,390 +0,0 @@ -#include "global.h" -#include "ScreenOptionsEditCourse.h" -#include "ScreenManager.h" -#include "RageLog.h" -#include "GameState.h" -#include "SongManager.h" -#include "CommonMetrics.h" -#include "GameManager.h" -#include "Song.h" -#include "ScreenMiniMenu.h" -#include "ScreenPrompt.h" -#include "CourseUtil.h" -#include "LocalizedString.h" -#include "OptionRowHandler.h" - -const int MAX_ENTRIES_PER_COURSE = 50; - - -enum EditCourseRow -{ - EditCourseRow_Type, - EditCourseRow_Meter, - NUM_EditCourseRow -}; - -AutoScreenMessage( SM_BackFromContextMenu ) - -enum CourseEntryAction -{ - CourseEntryAction_Edit, - CourseEntryAction_InsertEntry, - CourseEntryAction_Delete, - NUM_CourseEntryAction -}; -static const char *CourseEntryActionNames[] = { - "Edit", - "Insert Entry", - "Delete", -}; -XToString( CourseEntryAction ); -#define FOREACH_CourseEntryAction( i ) FOREACH_ENUM( CourseEntryAction, i ) - -static MenuDef g_TempMenu( - "ScreenMiniMenuContext" -); - -REGISTER_SCREEN_CLASS( ScreenOptionsEditCourse ); - -void ScreenOptionsEditCourse::Init() -{ - ScreenOptionsEditCourseSubMenu::Init(); - SubscribeToMessage( Message_EditCourseDifficultyChanged ); -} - -static LocalizedString ENTRY( "OptionTitles", "Entry %d" ); - -void ScreenOptionsEditCourse::BeginScreen() -{ - // save a backup that we'll use if we revert. - ASSERT( GAMESTATE->m_pCurCourse ); - Course *pCourse = GAMESTATE->m_pCurCourse; - m_Original = *pCourse; - m_vpDisplayedSongs = SONGMAN->GetAllSongs(); - - vector vHands; - - OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull(); - pHand->m_Def.m_sName = "Type"; - pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; - pHand->m_Def.m_bExportOnChange = true; - pHand->m_Def.m_bAllowThemeItems = false; - pHand->m_Def.m_bOneChoiceForAllPlayers = true; - FOREACH_CourseType( i ) - pHand->m_Def.m_vsChoices.push_back( CourseTypeToLocalizedString(i) ); - vHands.push_back( pHand ); - - pHand = OptionRowHandlerUtil::MakeNull(); - pHand->m_Def.m_sName = "Meter"; - pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; - pHand->m_Def.m_bExportOnChange = true; - pHand->m_Def.m_bOneChoiceForAllPlayers = true; - pHand->m_Def.m_vsChoices.push_back( "Auto" ); - for( int i=MIN_METER; i<=MAX_METER; i++ ) - pHand->m_Def.m_vsChoices.push_back( ssprintf("%d",i) ); - vHands.push_back( pHand ); - - FOREACH_CONST( CourseEntry, pCourse->m_vEntries, ce ) - { - pHand = OptionRowHandlerUtil::MakeNull(); - int iEntryIndex = ce - pCourse->m_vEntries.begin(); - pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; - pHand->m_Def.m_bExportOnChange = true; - pHand->m_Def.m_sName = ssprintf( ENTRY.GetValue(), iEntryIndex+1 ); - pHand->m_Def.m_bAllowThemeItems = false; - pHand->m_Def.m_bAllowThemeTitle = false; - pHand->m_Def.m_bOneChoiceForAllPlayers = true; - pHand->m_Def.m_vsChoices.push_back( "RANDOM" ); // XXX Localize? - FOREACH_CONST( Song*, m_vpDisplayedSongs, s ) - pHand->m_Def.m_vsChoices.push_back( (*s)->GetTranslitFullTitle() ); - vHands.push_back( pHand ); - } - - pHand = OptionRowHandlerUtil::MakeNull(); - pHand->m_Def.m_sName = ""; - pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; - pHand->m_Def.m_bExportOnChange = false; - pHand->m_Def.m_bOneChoiceForAllPlayers = true; - pHand->m_Def.m_vsChoices.push_back( "Insert Entry" ); - vHands.push_back( pHand ); - - ScreenOptions::InitMenu( vHands ); - - ScreenOptions::BeginScreen(); - - if( GAMESTATE->m_iEditCourseEntryIndex > -1 ) - this->MoveRowAbsolute( GAMESTATE->m_MasterPlayerNumber, NUM_EditCourseRow + GAMESTATE->m_iEditCourseEntryIndex ); - AfterChangeRow( GAMESTATE->m_MasterPlayerNumber ); -} - -static LocalizedString MAXIMUM_COURSE_ENTRIES ("ScreenOptionsEditCourse", "The maximum number of entries per course is %d. This course already has %d entries."); -static bool AreEntriesFull() -{ - Course *pCourse = GAMESTATE->m_pCurCourse; - - if( pCourse->m_vEntries.size() >= size_t(MAX_ENTRIES_PER_COURSE) ) - { - RString sError = ssprintf(MAXIMUM_COURSE_ENTRIES.GetValue(), MAX_ENTRIES_PER_COURSE, pCourse->m_vEntries.size() ); - ScreenPrompt::Prompt( SM_None, sError ); - return true; - } - return false; -} - -static LocalizedString CANNOT_DELETE_LAST_ENTRY ("ScreenOptionsEditCourse", "You cannot delete the last entry in a course."); -void ScreenOptionsEditCourse::HandleScreenMessage( const ScreenMessage SM ) -{ - Course *pCourse = GAMESTATE->m_pCurCourse; - - if( SM == SM_GoToNextScreen ) - { - int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; - if( iCurRow == (int)m_pRows.size() - 1 ) - { - m_Original = *pCourse; - WriteCourse(); - this->HandleScreenMessage( SM_GoToPrevScreen ); - return; // don't call base - } - } - else if( SM == SM_GoToPrevScreen ) - { - *pCourse = m_Original; - GAMESTATE->m_pCurCourse.Set( pCourse ); - GAMESTATE->m_iEditCourseEntryIndex.Set( -1 ); - } - else if( SM == SM_BackFromContextMenu ) - { - if( !ScreenMiniMenu::s_bCancelled ) - { - switch( ScreenMiniMenu::s_iLastRowCode ) - { - case CourseEntryAction_Edit: - ScreenOptions::BeginFadingOut(); - break; - case CourseEntryAction_InsertEntry: - { - if( AreEntriesFull() ) - return; - CourseEntry ce; - CourseUtil::MakeDefaultEditCourseEntry( ce ); - pCourse->m_vEntries.insert( pCourse->m_vEntries.begin() + GetCourseEntryIndexWithFocus(), ce ); - SCREENMAN->SetNewScreen( this->m_sName ); // reload - break; - } - case CourseEntryAction_Delete: - { - if( pCourse->m_vEntries.size() == 1 ) - { - ScreenPrompt::Prompt( SM_None, CANNOT_DELETE_LAST_ENTRY ); - return; - } - pCourse->m_vEntries.erase( pCourse->m_vEntries.begin() + GetCourseEntryIndexWithFocus() ); - GAMESTATE->m_iEditCourseEntryIndex.Set( GAMESTATE->m_iEditCourseEntryIndex ); - SCREENMAN->SetNewScreen( this->m_sName ); // reload - break; - } - } - } - } - - ScreenOptions::HandleScreenMessage( SM ); -} - -void ScreenOptionsEditCourse::AfterChangeRow( PlayerNumber pn ) -{ - ScreenOptions::AfterChangeRow( pn ); - - int iCourseEntry = GetCourseEntryIndexWithFocus(); - GAMESTATE->m_iEditCourseEntryIndex.Set( iCourseEntry ); -} - -void ScreenOptionsEditCourse::AfterChangeValueInRow( int iRow, PlayerNumber pn ) -{ - ScreenOptions::AfterChangeValueInRow( iRow, pn ); - - Course *pCourse = GAMESTATE->m_pCurCourse; - - // Regenerate Trails so that the new values propagate - GAMESTATE->m_pCurTrail[PLAYER_1].Set( NULL ); - Trail *pTrail = pCourse->GetTrailForceRegenCache( GAMESTATE->m_stEdit, GAMESTATE->m_cdEdit ); - - // cause overlay elements to refresh by changing the course - GAMESTATE->m_pCurCourse.Set( pCourse ); - GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail ); -} - -void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector &vpns ) -{ - OptionRow &row = *m_pRows[iRow]; - - if( row.GetRowType() == OptionRow::RowType_Exit ) - return; - Course *pCourse = GAMESTATE->m_pCurCourse; - - if( iRow == (int)pCourse->m_vEntries.size() + NUM_EditCourseRow ) - return; // "Insert Entry" - - switch( iRow ) - { - case EditCourseRow_Type: - row.SetOneSharedSelection( pCourse->GetCourseType() ); - return; - case EditCourseRow_Meter: - { - int iMeter = pCourse->m_iCustomMeter[GAMESTATE->m_cdEdit]; - if( iMeter == -1 ) - row.SetOneSharedSelection( 0 ); - else - row.SetOneSharedSelection( iMeter + 1 - MIN_METER ); - return; - } - } - - const CourseEntry& ce = pCourse->m_vEntries[iRow - NUM_EditCourseRow]; - - if( !ce.IsFixedSong() ) - { - row.SetOneSharedSelection( 0 ); - } - else - { - Song *pSong = ce.songID.ToSong(); - vector::const_iterator iter = find( m_vpDisplayedSongs.begin(), m_vpDisplayedSongs.end(), pSong ); - - if( iter == m_vpDisplayedSongs.end() ) // This song isn't being displayed, set to "RANDOM" - row.SetOneSharedSelection( 0 ); - else - row.SetOneSharedSelection( iter - m_vpDisplayedSongs.begin() + 1 ); - } -} - -void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector &vpns ) -{ - OptionRow &row = *m_pRows[iRow]; - - if( row.GetRowType() == OptionRow::RowType_Exit ) - return; - Course *pCourse = GAMESTATE->m_pCurCourse; - if( iRow == (int)pCourse->m_vEntries.size() + NUM_EditCourseRow ) - return; // "Insert Entry" - - int iSel = row.GetOneSharedSelection(); - - switch( iRow ) - { - case EditCourseRow_Type: - { - CourseType ct = (CourseType)iSel; - pCourse->SetCourseType( ct ); - return; - } - case EditCourseRow_Meter: - { - if( iSel == 0 ) // "auto" - pCourse->m_iCustomMeter[GAMESTATE->m_cdEdit] = -1; - else - pCourse->m_iCustomMeter[GAMESTATE->m_cdEdit] = iSel - 1 + MIN_METER; - return; - } - } - - CourseEntry& ce = pCourse->m_vEntries[iRow - NUM_EditCourseRow]; - - if( iSel == 0 ) - ce.songID.FromSong( NULL ); - else - ce.songID.FromSong( m_vpDisplayedSongs[iSel - 1] ); -} - -void ScreenOptionsEditCourse::ProcessMenuStart( const InputEventPlus &input ) -{ - if( IsTransitioning() ) - return; - - int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; - Course *pCourse = GAMESTATE->m_pCurCourse; - - if( iCurRow < NUM_EditCourseRow ) - return; - - if( iCurRow == (int)m_pRows.size()-2 ) // "create entry" - { - if( AreEntriesFull() ) - return; - CourseEntry ce; - CourseUtil::MakeDefaultEditCourseEntry( ce ); - pCourse->m_vEntries.push_back( ce ); - GAMESTATE->m_iEditCourseEntryIndex.Set( pCourse->m_vEntries.size()-1 ); - SCREENMAN->SetNewScreen( this->m_sName ); // reload - } - else if( iCurRow == (int)m_pRows.size()-1 ) // "done" - { - SCREENMAN->PlayStartSound(); - this->BeginFadingOut(); - } - else // a course entry - { - g_TempMenu.rows.clear(); - FOREACH_CourseEntryAction( i ) - { - MenuRowDef mrd( i, CourseEntryActionToString(i), true, EditMode_Home, true, true, 0, "" ); - g_TempMenu.rows.push_back( mrd ); - } - - int iWidth, iX, iY; - this->GetWidthXY( GAMESTATE->m_MasterPlayerNumber, iCurRow, 0, iWidth, iX, iY ); - ScreenMiniMenu::MiniMenu( &g_TempMenu, SM_BackFromContextMenu, SM_BackFromContextMenu, (float)iX, (float)iY ); - } - -} - -void ScreenOptionsEditCourse::HandleMessage( const Message &msg ) -{ - // We subscribe to messages before we initialize the options rows for the first time - if( msg == Message_EditCourseDifficultyChanged && m_pRows.size() > 0 ) - { - const vector vpns( 1, GAMESTATE->m_MasterPlayerNumber ); - OptionRow &row = *m_pRows[EditCourseRow_Meter]; - - ImportOptions( EditCourseRow_Meter, vpns ); - row.AfterImportOptions( GAMESTATE->m_MasterPlayerNumber ); - } - ScreenOptionsEditCourseSubMenu::HandleMessage( msg ); -} - -int ScreenOptionsEditCourse::GetCourseEntryIndexWithFocus() const -{ - int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; - if( iCurRow < NUM_EditCourseRow ) // not a CourseEntry - return -1; - else if( iCurRow == (int)m_pRows.size() - 1 ) // "done" - return -1; - else - return iCurRow - NUM_EditCourseRow; -} - -/* - * (c) 2002-2006 Chris Danford, Steve Checkoway - * 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/ScreenOptionsEditCourse.h b/stepmania/src/ScreenOptionsEditCourse.h deleted file mode 100644 index 771ac490ad..0000000000 --- a/stepmania/src/ScreenOptionsEditCourse.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef ScreenOptionsEditCourse_H -#define ScreenOptionsEditCourse_H - -#include "ScreenOptionsManageCourses.h" -#include "Course.h" - -class ScreenOptionsEditCourse : public ScreenOptionsEditCourseSubMenu -{ -public: - void Init(); - virtual void BeginScreen(); - - virtual void HandleScreenMessage( const ScreenMessage SM ); - -protected: - virtual void ImportOptions( int iRow, const vector &vpns ); - virtual void ExportOptions( int iRow, const vector &vpns ); - - virtual void AfterChangeRow( PlayerNumber pn ); - virtual void AfterChangeValueInRow( int iRow, PlayerNumber pn ); - virtual void ProcessMenuStart( const InputEventPlus &input ); - virtual void HandleMessage( const Message &msg ); - - int GetCourseEntryIndexWithFocus() const; - - Course m_Original; - - vector m_vpDisplayedSongs; // corresponds with the choices in the Entry row -}; - -#endif - -/* - * (c) 2003-2006 Chris Danford, Steve Checkoway - * 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/ScreenOptionsEditCourseEntry.cpp b/stepmania/src/ScreenOptionsEditCourseEntry.cpp deleted file mode 100644 index bb696f997a..0000000000 --- a/stepmania/src/ScreenOptionsEditCourseEntry.cpp +++ /dev/null @@ -1,569 +0,0 @@ -#include "global.h" -#include "ScreenOptionsEditCourseEntry.h" -#include "ScreenManager.h" -#include "RageLog.h" -#include "GameState.h" -#include "SongManager.h" -#include "CommonMetrics.h" -#include "GameManager.h" -#include "Song.h" -#include "Steps.h" -#include "OptionRowHandler.h" -#include "PlayerState.h" -#include "SongUtil.h" - -enum EditCourseEntryRow -{ - ROW_SONG_GROUP, - ROW_SONG, - ROW_BASE_DIFFICULTY, - ROW_LOW_METER, - ROW_HIGH_METER, - ROW_SORT, - ROW_CHOOSE_INDEX, - ROW_SECRET, - ROW_SET_MODS, - ROW_DONE, - NUM_EditCourseEntryRow -}; -#define FOREACH_EditCourseEntryRow( i ) FOREACH_ENUM( EditCourseEntryRow, i ) - -AutoScreenMessage( SM_BackFromCoursePlayerOptions ); - -static void FillSongsAndChoices( const RString &sSongGroup, vector &vpSongsOut, vector &vsChoicesOut ) -{ - vpSongsOut.clear(); - vsChoicesOut.clear(); - - vpSongsOut.push_back( NULL ); - const vector vSongs = SONGMAN->GetSongs( sSongGroup.empty()? GROUP_ALL:sSongGroup ); - vpSongsOut.insert( vpSongsOut.end(), vSongs.begin(), vSongs.end() ); - - FOREACH_CONST( Song*, vpSongsOut, s ) - { - if( *s == NULL ) - vsChoicesOut.push_back( "(any)" ); - else - vsChoicesOut.push_back( (*s)->GetTranslitFullTitle() ); - } -} - - -class OptionRowHandlerSongChoices: public OptionRowHandler -{ -public: - // corresponds with m_vsChoices: - vector m_vpDisplayedSongs; - RString m_sSongGroup; - - OptionRowHandlerSongChoices() { Init(); } - - virtual void LoadInternal( const Commands &cmds ) - { - FillSongsAndChoices( m_sSongGroup, m_vpDisplayedSongs, m_Def.m_vsChoices ); - } - - virtual ReloadChanged Reload() - { - FillSongsAndChoices( m_sSongGroup, m_vpDisplayedSongs, m_Def.m_vsChoices ); - return RELOAD_CHANGED_ALL; - } - - virtual void ImportOption( OptionRow *pRow, const vector &vpns, vector vbSelectedOut[NUM_PLAYERS] ) const - { - vector::const_iterator iter = find( m_vpDisplayedSongs.begin(), m_vpDisplayedSongs.end(), GAMESTATE->m_pCurSong.Get() ); - int iChoice = 0; - if( iter != m_vpDisplayedSongs.end() ) - iChoice = iter - m_vpDisplayedSongs.begin(); - FOREACH_PlayerNumber(pn) - OptionRowHandlerUtil::SelectExactlyOne( iChoice, vbSelectedOut[pn] ); - } - virtual int ExportOption( const vector &vpns, const vector vbSelected[NUM_PLAYERS] ) const - { - int iChoice = OptionRowHandlerUtil::GetOneSelection( vbSelected[GAMESTATE->m_MasterPlayerNumber] ); - GAMESTATE->m_pCurSong.Set( m_vpDisplayedSongs[iChoice] ); - return 0; - } -}; - -REGISTER_SCREEN_CLASS( ScreenOptionsEditCourseEntry ); - -void ScreenOptionsEditCourseEntry::Init() -{ - ScreenOptionsEditCourseSubMenu::Init(); - - vector vHands; - OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull(); - pHand->m_Def.m_sName = "Song Group"; - pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; - pHand->m_Def.m_bExportOnChange = true; - pHand->m_Def.m_bAllowThemeItems = false; - pHand->m_Def.m_bOneChoiceForAllPlayers = true; - vector vsSongGroups; - SONGMAN->GetSongGroupNames( vsSongGroups ); - pHand->m_Def.m_vsChoices.push_back( "(any)" ); - FOREACH_CONST( RString, vsSongGroups, group ) - pHand->m_Def.m_vsChoices.push_back( *group ); - vHands.push_back( pHand ); - - { - m_pSongHandler = new OptionRowHandlerSongChoices; - // m_pSongHandler->m_sSongGroup = ce.sSongGroup; - m_pSongHandler->Load( Commands() ); - m_pSongHandler->m_Def.m_sName = "Song"; - m_pSongHandler->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; - m_pSongHandler->m_Def.m_bExportOnChange = true; - m_pSongHandler->m_Def.m_bAllowThemeItems = false; - m_pSongHandler->m_Def.m_bOneChoiceForAllPlayers = true; - vHands.push_back( m_pSongHandler ); - } - - pHand = OptionRowHandlerUtil::MakeNull(); - pHand->m_Def.m_sName = "Base Difficulty"; - pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; - pHand->m_Def.m_bExportOnChange = true; - pHand->m_Def.m_bAllowThemeItems = false; - pHand->m_Def.m_bOneChoiceForAllPlayers = true; - pHand->m_Def.m_vsChoices.push_back( "(any)" ); - FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), dc ) - { - pHand->m_Def.m_vsChoices.push_back( GetLocalizedCustomDifficulty(GAMESTATE->m_stEdit, *dc) ); - } - vHands.push_back( pHand ); - - pHand = OptionRowHandlerUtil::MakeNull(); - pHand->m_Def.m_sName = "Low Meter"; - pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; - pHand->m_Def.m_bExportOnChange = true; - pHand->m_Def.m_bAllowThemeItems = false; - pHand->m_Def.m_bOneChoiceForAllPlayers = true; - pHand->m_Def.m_vsChoices.push_back( "(any)" ); - for( int i=MIN_METER; i<=MAX_METER; ++i ) - pHand->m_Def.m_vsChoices.push_back( ssprintf("%i",i) ); - vHands.push_back( pHand ); - - pHand = OptionRowHandlerUtil::MakeNull(); - pHand->m_Def.m_sName = "High Meter"; - pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; - pHand->m_Def.m_bExportOnChange = true; - pHand->m_Def.m_bAllowThemeItems = false; - pHand->m_Def.m_bOneChoiceForAllPlayers = true; - pHand->m_Def.m_vsChoices.push_back( "(any)" ); - for( int i=MIN_METER; i<=MAX_METER; i++ ) - pHand->m_Def.m_vsChoices.push_back( ssprintf("%i",i) ); - vHands.push_back( pHand ); - - pHand = OptionRowHandlerUtil::MakeNull(); - pHand->m_Def.m_sName = "Sort"; - pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; - pHand->m_Def.m_bExportOnChange = true; - pHand->m_Def.m_bAllowThemeItems = false; - pHand->m_Def.m_bOneChoiceForAllPlayers = true; - FOREACH_SongSort( i ) - pHand->m_Def.m_vsChoices.push_back( SongSortToLocalizedString(i) ); - vHands.push_back( pHand ); - - pHand = OptionRowHandlerUtil::MakeNull(); - pHand->m_Def.m_sName = "Choose"; - pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; - pHand->m_Def.m_bExportOnChange = true; - pHand->m_Def.m_bAllowThemeItems = false; - pHand->m_Def.m_bOneChoiceForAllPlayers = true; - for( int i=0; i<20; i++ ) - pHand->m_Def.m_vsChoices.push_back( FormatNumberAndSuffix(i+1) ); - vHands.push_back( pHand ); - - pHand = OptionRowHandlerUtil::MakeNull(); - pHand->m_Def.m_sName = "Secret"; - pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; - pHand->m_Def.m_bExportOnChange = true; - pHand->m_Def.m_bOneChoiceForAllPlayers = true; - pHand->m_Def.m_vsChoices.push_back( "No" ); - pHand->m_Def.m_vsChoices.push_back( "Yes" ); - vHands.push_back( pHand ); - - SHOW_MODS_ROW.Load( m_sName, "ShowModsRow" ); - - m_pModChangesHandler = NULL; - if( SHOW_MODS_ROW ) - { - m_pModChangesHandler = OptionRowHandlerUtil::MakeNull(); - m_pModChangesHandler->m_Def.m_sName = "Set Mods"; - m_pModChangesHandler->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; - m_pModChangesHandler->m_Def.m_bExportOnChange = true; - m_pModChangesHandler->m_Def.m_bAllowThemeItems = false; - m_pModChangesHandler->m_Def.m_bOneChoiceForAllPlayers = true; - m_pModChangesHandler->m_Def.m_vsChoices.push_back( "" ); - vHands.push_back( m_pModChangesHandler ); - } - - m_pLongSong = NULL; - - ScreenOptions::InitMenu( vHands ); -} - -void ScreenOptionsEditCourseEntry::BeginScreen() -{ - // save a backup that we'll use if we revert. - const Course *pCourse = GAMESTATE->m_pCurCourse; - const CourseEntry &ce = pCourse->m_vEntries[ GAMESTATE->m_iEditCourseEntryIndex ]; - m_Original = ce; - - m_pSongHandler->m_sSongGroup = ce.songCriteria.m_sGroupName; - - if( SHOW_MODS_ROW ) - m_pModChangesHandler->m_Def.m_vsChoices[0] = ssprintf( "%d mod changes", ce.GetNumModChanges() ); - - ScreenOptions::BeginScreen(); -} - -static LocalizedString NO_SONGS( "ScreenOptionsEditCourseEntry", "No songs loaded." ); -void ScreenOptionsEditCourseEntry::HandleScreenMessage( const ScreenMessage SM ) -{ - Course *pCourse = GAMESTATE->m_pCurCourse; - - if( SM == SM_GoToNextScreen ) - { - switch( m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber] ) - { - case ROW_SONG_GROUP: - case ROW_SONG: - case ROW_BASE_DIFFICULTY: - case ROW_LOW_METER: - case ROW_HIGH_METER: - case ROW_CHOOSE_INDEX: - return; - case ROW_SET_MODS: - if( SHOW_MODS_ROW ) - { - /* We can't rely on the trail here since it depends on what steps are available. - * Use the course entry directly instead. */ - CourseEntry& ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex]; - Song *pSong = ce.songID.ToSong(); - Steps *pSteps; - StepsType st = GAMESTATE->m_stEdit; - CourseDifficulty cd = ( ce.stepsCriteria.m_difficulty == Difficulty_Invalid ? - GAMESTATE->m_cdEdit : ce.stepsCriteria.m_difficulty ); - - if( pSong == NULL ) - pSong = m_pLongSong; - if( pSong == NULL ) - { - // Find the longest non-tutorial song. - const vector &vSongs = SONGMAN->GetAllSongs(); - float fLen = -1.f; - - FOREACH_CONST( Song*, vSongs, i ) - { - if( !(*i)->IsTutorial() && (*i)->m_fMusicLengthSeconds > fLen ) - { - pSong = *i; - fLen = pSong->m_fMusicLengthSeconds; - } - } - if( pSong == NULL ) - { - SCREENMAN->PlayInvalidSound(); - SCREENMAN->SystemMessage( NO_SONGS ); - return; - } - m_pLongSong = pSong; - } - - // Try to find steps first using st and cd, then st, then cd, then any. - pSteps = SongUtil::GetStepsByDifficulty( pSong, st, cd, false ); - if( !pSteps ) - pSteps = SongUtil::GetStepsByDifficulty( pSong, st, Difficulty_Invalid, false ); - if( !pSteps ) - pSteps = SongUtil::GetStepsByDifficulty( pSong, StepsType_Invalid, cd, false ); - if( !pSteps ) - pSteps = SongUtil::GetStepsByDifficulty( pSong, StepsType_Invalid, Difficulty_Invalid, false ); - ASSERT( pSteps ); - - // Set up for ScreenEdit - const Style *pStyle = GameManager::GetEditorStyleForStepsType(pSteps->m_StepsType); - GAMESTATE->SetCurrentStyle( pStyle ); - GAMESTATE->m_pCurSong.Set( pSong ); - GAMESTATE->m_pCurSteps[PLAYER_1].Set( pSteps ); - break; - } - // fall through - case ROW_DONE: - m_Original = pCourse->m_vEntries[ GAMESTATE->m_iEditCourseEntryIndex ]; - SCREENMAN->SetNewScreen( "ScreenOptionsEditCourse" ); - HandleScreenMessage( SM_GoToPrevScreen ); - return; - } - } - else if( SM == SM_GoToPrevScreen ) - { - // revert - pCourse->m_vEntries[ GAMESTATE->m_iEditCourseEntryIndex ] = m_Original; - - // cause overlay elements to refresh by changing the course - Trail *pTrail = pCourse->GetTrailForceRegenCache( GAMESTATE->m_stEdit, GAMESTATE->m_cdEdit ); - - GAMESTATE->m_pCurCourse.Set( pCourse ); - GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail ); - - } - else if( SM == SM_BackFromCoursePlayerOptions ) - { - const PlayerOptions &po = GAMESTATE->m_pPlayerState[GAMESTATE->m_MasterPlayerNumber]->m_PlayerOptions.GetPreferred(); - CourseEntry &ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex]; - - ce.sModifiers = po.GetString(); - } - - ScreenOptions::HandleScreenMessage( SM ); -} - -void ScreenOptionsEditCourseEntry::AfterChangeValueInRow( int iRow, PlayerNumber pn ) -{ - ScreenOptions::AfterChangeValueInRow( iRow, pn ); - Course *pCourse = GAMESTATE->m_pCurCourse; - - GAMESTATE->m_pCurTrail[PLAYER_1].Set( NULL ); - Trail *pTrail = pCourse->GetTrailForceRegenCache( GAMESTATE->m_stEdit, GAMESTATE->m_cdEdit ); - int iEntryIndex = GAMESTATE->m_iEditCourseEntryIndex; - ASSERT( iEntryIndex >= 0 && iEntryIndex < (int) pCourse->m_vEntries.size() ); - CourseEntry &ce = pCourse->m_vEntries[ iEntryIndex ]; - - switch( iRow ) - { - case ROW_SONG_GROUP: - // refresh songs - { - vector vpns; - vpns.push_back( pn ); - ExportOptions( ROW_SONG_GROUP, vpns ); - - m_pSongHandler->m_sSongGroup = ce.songCriteria.m_sGroupName; - - OptionRow &row = *m_pRows[ROW_SONG]; - row.Reload(); - ImportOptions( ROW_SONG, vpns ); - row.AfterImportOptions( pn ); - break; - } - } - - - // cause overlay elements to refresh by changing the course - GAMESTATE->m_pCurCourse.Set( pCourse ); - GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail ); - -} - -void ScreenOptionsEditCourseEntry::ImportOptions( int iRow, const vector &vpns ) -{ - Course *pCourse = GAMESTATE->m_pCurCourse; - int iEntryIndex = GAMESTATE->m_iEditCourseEntryIndex; - ASSERT( iEntryIndex >= 0 && iEntryIndex < (int) pCourse->m_vEntries.size() ); - CourseEntry &ce = pCourse->m_vEntries[ iEntryIndex ]; - - OptionRow &row = *m_pRows[iRow]; - - switch( iRow ) - { - case ROW_SONG_GROUP: - FOREACH_CONST( RString, row.GetRowDef().m_vsChoices, s ) - { - if( *s == ce.songCriteria.m_sGroupName ) - { - int iChoice = s - row.GetRowDef().m_vsChoices.begin(); - row.SetOneSharedSelection( iChoice ); - AfterChangeValueInRow( iRow, GAMESTATE->m_MasterPlayerNumber ); - break; - } - } - break; - case ROW_SONG: - { - GAMESTATE->m_pCurSong.Set( ce.songID.ToSong() ); - - // XXX: copy and pasted from ScreenOptionsMaster - FOREACH_CONST( PlayerNumber, vpns, pn ) - ASSERT( GAMESTATE->IsHumanPlayer(*pn) ); - OptionRow &row = *m_pRows[iRow]; - row.ImportOptions( vpns ); - break; - } - case ROW_BASE_DIFFICULTY: - { - vector::const_iterator iter = find( CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue().begin(), CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue().end(), ce.stepsCriteria.m_difficulty ); - int iChoice = 0; - if( iter != CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue().end() ) - iChoice = iter - CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue().begin() + 1; - OptionRow &row = *m_pRows[ROW_BASE_DIFFICULTY]; - row.SetOneSharedSelection( iChoice ); - break; - } - case ROW_LOW_METER: - { - int iChoice = 0; - if( ce.stepsCriteria.m_iLowMeter != -1 ) - iChoice = ce.stepsCriteria.m_iLowMeter; - OptionRow &row = *m_pRows[ROW_LOW_METER]; - row.SetOneSharedSelection( iChoice ); - break; - } - case ROW_HIGH_METER: - { - int iChoice = 0; - if( ce.stepsCriteria.m_iHighMeter != -1 ) - iChoice = ce.stepsCriteria.m_iHighMeter; - OptionRow &row = *m_pRows[ROW_HIGH_METER]; - row.SetOneSharedSelection( iChoice ); - break; - } - case ROW_SORT: - { - int iChoice = ce.songSort; - OptionRow &row = *m_pRows[ROW_SORT]; - row.SetOneSharedSelection( iChoice ); - break; - } - case ROW_CHOOSE_INDEX: - { - int iChoice = ce.iChooseIndex; - OptionRow &row = *m_pRows[ROW_CHOOSE_INDEX]; - row.SetOneSharedSelection( iChoice ); - break; - } - case ROW_SECRET: - row.SetOneSharedSelection( ce.bSecret ? 1 : 0 ); - break; - } -} - -void ScreenOptionsEditCourseEntry::ExportOptions( int iRow, const vector &vpns ) -{ - Course *pCourse = GAMESTATE->m_pCurCourse; - int iEntryIndex = GAMESTATE->m_iEditCourseEntryIndex; - ASSERT( iEntryIndex >= 0 && iEntryIndex < (int) pCourse->m_vEntries.size() ); - CourseEntry &ce = pCourse->m_vEntries[ iEntryIndex ]; - OptionRow &row = *m_pRows[iRow]; - int iChoice = row.GetOneSharedSelection( true ); - - switch( iRow ) - { - case ROW_SONG_GROUP: - { - if( iChoice == 0 ) - ce.songCriteria.m_sGroupName = ""; - else - ce.songCriteria.m_sGroupName = row.GetRowDef().m_vsChoices[ iChoice ]; - break; - } - case ROW_SONG: - { - // XXX: copy and pasted from ScreenOptionsMaster - bool bRowHasFocus[NUM_PLAYERS]; - ZERO( bRowHasFocus ); - FOREACH_CONST( PlayerNumber, vpns, p ) - { - int iCurRow = m_iCurrentRow[*p]; - bRowHasFocus[*p] = iCurRow == iRow; - } - row.ExportOptions( vpns, bRowHasFocus ); - - ce.songID.FromSong( GAMESTATE->m_pCurSong ); - break; - } - case ROW_BASE_DIFFICULTY: - { - if( iChoice == 0 ) - { - ce.stepsCriteria.m_difficulty = Difficulty_Invalid; - } - else - { - Difficulty d = CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue()[iChoice-1]; - ce.stepsCriteria.m_difficulty = d; - } - break; - } - case ROW_LOW_METER: - { - if( iChoice == 0 ) - ce.stepsCriteria.m_iLowMeter = -1; - else - ce.stepsCriteria.m_iLowMeter = iChoice; - break; - } - case ROW_HIGH_METER: - { - if( iChoice == 0 ) - ce.stepsCriteria.m_iHighMeter = -1; - else - ce.stepsCriteria.m_iHighMeter = iChoice; - break; - } - case ROW_SORT: - { - ce.songSort = (SongSort)iChoice; - break; - } - case ROW_CHOOSE_INDEX: - { - ce.iChooseIndex = iChoice; - break; - } - case ROW_SECRET: - ce.bSecret = !!iChoice; - break; - } - Trail *pTrail = pCourse->GetTrailForceRegenCache( GAMESTATE->m_stEdit, GAMESTATE->m_cdEdit ); - - GAMESTATE->m_pCurCourse.Set( pCourse ); - GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail ); -} - -void ScreenOptionsEditCourseEntry::ProcessMenuStart( const InputEventPlus &input ) -{ - PlayerNumber pn = GAMESTATE->m_MasterPlayerNumber; - - switch( m_iCurrentRow[pn] ) - { - case ROW_SONG_GROUP: - case ROW_SONG: - case ROW_BASE_DIFFICULTY: - case ROW_LOW_METER: - case ROW_HIGH_METER: - case ROW_SORT: - case ROW_CHOOSE_INDEX: - break; - case ROW_SET_MODS: - case ROW_DONE: - SCREENMAN->PlayStartSound(); - ScreenOptions::BeginFadingOut(); - break; - } -} - - -/* - * (c) 2002-2006 Chris Danford, Steve Checkoway - * 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/ScreenOptionsEditCourseEntry.h b/stepmania/src/ScreenOptionsEditCourseEntry.h deleted file mode 100644 index e83899edac..0000000000 --- a/stepmania/src/ScreenOptionsEditCourseEntry.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef ScreenOptionsEditCourseEntry_H -#define ScreenOptionsEditCourseEntry_H - -#include "ScreenOptionsManageCourses.h" -#include "Course.h" -class Song; - -class OptionRowHandler; -class OptionRowHandlerSongChoices; -class ScreenOptionsEditCourseEntry : public ScreenOptionsEditCourseSubMenu -{ -public: - void Init(); - void BeginScreen(); - - virtual void HandleScreenMessage( const ScreenMessage SM ); - -protected: - OptionRowHandler *m_pModChangesHandler; - OptionRowHandlerSongChoices *m_pSongHandler; - - virtual void ImportOptions( int iRow, const vector &vpns ); - virtual void ExportOptions( int iRow, const vector &vpns ); - - virtual void AfterChangeValueInRow( int iRow, PlayerNumber pn ); - virtual void ProcessMenuStart( const InputEventPlus &input ); - - CourseEntry m_Original; // use this to revert when cancelling - Song *m_pLongSong; - ThemeMetric SHOW_MODS_ROW; -}; - -#endif - -/* - * (c) 2003-2006 Chris Danford, Steve Checkoway - * 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/ScreenOptionsEditWorkout.cpp b/stepmania/src/ScreenOptionsEditWorkout.cpp deleted file mode 100644 index 09b8cd827f..0000000000 --- a/stepmania/src/ScreenOptionsEditWorkout.cpp +++ /dev/null @@ -1,198 +0,0 @@ -#include "global.h" - -#include "ScreenOptionsEditWorkout.h" -#include "ScreenManager.h" -#include "RageUtil.h" -#include "GameState.h" -#include "OptionRowHandler.h" -#include "ProfileManager.h" -#include "ScreenMiniMenu.h" -#include "Workout.h" -#include "LocalizedString.h" -#include "SongManager.h" -#include "SongUtil.h" -#include "WorkoutManager.h" - -enum WorkoutDetailsRow -{ - WorkoutDetailsRow_WorkoutProgram, - WorkoutDetailsRow_Minutes, - WorkoutDetailsRow_Meter, - NUM_WorkoutDetailsRow -}; - -const MenuRowDef g_MenuRows[] = -{ - MenuRowDef( -1, "Workout Program", true, EditMode_Practice, true, false, 0, NULL ), - MenuRowDef( -1, "Workout Minutes", true, EditMode_Practice, true, false, 0, NULL ), - MenuRowDef( -1, "Workout Difficulty", true, EditMode_Practice, true, false, 0, NULL ), -}; - -REGISTER_SCREEN_CLASS( ScreenOptionsEditWorkout ); - -void ScreenOptionsEditWorkout::Init() -{ - ScreenOptions::Init(); -} - -static RString MakeMinutesString( int iMeter ) -{ - return ssprintf( "%d", iMeter ); -} -static RString MakeMeterString( int iMeter ) -{ - return ssprintf( "%d", iMeter ); -} -void ScreenOptionsEditWorkout::BeginScreen() -{ - vector vHands; - FOREACH_ENUM( WorkoutDetailsRow, rowIndex ) - { - const MenuRowDef &mr = g_MenuRows[rowIndex]; - OptionRowHandler *pHand = OptionRowHandlerUtil::MakeSimple( mr ); - - pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; - pHand->m_Def.m_vsChoices.clear(); - - switch( rowIndex ) - { - DEFAULT_FAIL(rowIndex); - case WorkoutDetailsRow_WorkoutProgram: - FOREACH_ENUM( WorkoutProgram, i ) - pHand->m_Def.m_vsChoices.push_back( WorkoutProgramToLocalizedString(i) ); - break; - case WorkoutDetailsRow_Minutes: - for( int i=MIN_WORKOUT_MINUTES; i<=20; i+=2 ) - pHand->m_Def.m_vsChoices.push_back( MakeMinutesString(i) ); - for( int i=20; i<=MAX_WORKOUT_MINUTES; i+=5 ) - pHand->m_Def.m_vsChoices.push_back( MakeMinutesString(i) ); - break; - case WorkoutDetailsRow_Meter: - for( int i=MIN_METER; i<=MAX_METER; i++ ) - pHand->m_Def.m_vsChoices.push_back( MakeMeterString(i) ); - break; - } - - pHand->m_Def.m_bExportOnChange = true; - vHands.push_back( pHand ); - } - - ScreenOptions::InitMenu( vHands ); - - ScreenOptions::BeginScreen(); -} - -ScreenOptionsEditWorkout::~ScreenOptionsEditWorkout() -{ - -} - -void ScreenOptionsEditWorkout::ImportOptions( int iRow, const vector &vpns ) -{ - OptionRow &row = *m_pRows[iRow]; - - /* - FIXME - switch( iRow ) - { - case WorkoutDetailsRow_WorkoutProgram: - row.SetOneSharedSelectionIfPresent( WorkoutProgramToLocalizedString(WORKOUTMAN->GetCurrentWorkout()->m_WorkoutProgram) ); - break; - case WorkoutDetailsRow_Minutes: - row.SetOneSharedSelectionIfPresent( MakeMinutesString(WORKOUTMAN->GetCurrentWorkout()->m_iMinutes) ); - break; - case WorkoutDetailsRow_Meter: - row.SetOneSharedSelectionIfPresent( MakeMeterString(WORKOUTMAN->GetCurrentWorkout()->m_iAverageMeter) ); - break; - } - */ -} - -void ScreenOptionsEditWorkout::ExportOptions( int iRow, const vector &vpns ) -{ - /* - FIXME - FOREACH_ENUM( WorkoutDetailsRow, i ) - { - iRow = i; - OptionRow &row = *m_pRows[iRow]; - int iIndex = row.GetOneSharedSelection( true ); - RString sValue; - if( iIndex >= 0 ) - sValue = row.GetRowDef().m_vsChoices[ iIndex ]; - - switch( iRow ) - { - DEFAULT_FAIL(iRow); - case WorkoutDetailsRow_WorkoutProgram: - WORKOUTMAN->GetCurrentWorkout()->m_WorkoutProgram = (WorkoutProgram)iIndex; - break; - case WorkoutDetailsRow_Minutes: - sscanf( sValue, "%d", &WORKOUTMAN->GetCurrentWorkout()->m_iMinutes ); - break; - case WorkoutDetailsRow_Meter: - WORKOUTMAN->GetCurrentWorkout()->m_iAverageMeter = iIndex + MIN_METER; - break; - } - } - - MESSAGEMAN->Broadcast( "WorkoutChanged" ); - WORKOUTMAN->UpdateAndSetTrail(); - */ -} - -void ScreenOptionsEditWorkout::GoToNextScreen() -{ -} - -void ScreenOptionsEditWorkout::GoToPrevScreen() -{ -} - -void ScreenOptionsEditWorkout::HandleScreenMessage( const ScreenMessage SM ) -{ - if( SM == SM_GoToNextScreen ) - { - } - else if( SM == SM_GoToPrevScreen ) - { - } - - ScreenOptions::HandleScreenMessage( SM ); -} - -void ScreenOptionsEditWorkout::AfterChangeValueInRow( int iRow, PlayerNumber pn ) -{ - ScreenOptions::AfterChangeValueInRow( iRow, pn ); -} - -void ScreenOptionsEditWorkout::ProcessMenuStart( const InputEventPlus &input ) -{ - ScreenOptions::ProcessMenuStart( input ); -} - - -/* - * (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/ScreenOptionsEditWorkout.h b/stepmania/src/ScreenOptionsEditWorkout.h deleted file mode 100644 index 2206aebd37..0000000000 --- a/stepmania/src/ScreenOptionsEditWorkout.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef ScreenOptionsEditWorkout_H -#define ScreenOptionsEditWorkout_H - -#include "ScreenOptions.h" - -class ScreenOptionsEditWorkout : public ScreenOptions -{ -public: - virtual ~ScreenOptionsEditWorkout(); - - virtual void Init(); - virtual void BeginScreen(); - -protected: -private: - virtual void ImportOptions( int row, const vector &vpns ); - virtual void ExportOptions( int row, const vector &vpns ); - - virtual void GoToNextScreen(); - virtual void GoToPrevScreen(); - - virtual void HandleScreenMessage( const ScreenMessage SM ); - virtual void AfterChangeValueInRow( int iRow, PlayerNumber pn ); - virtual void ProcessMenuStart( const InputEventPlus &input ); -}; - -#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. - */