/* Add a list of difficulties/edits to the given row/handler. */ void ScreenOptionsMaster::SetStep( OptionRowData &row, OptionRowHandler &hand ) { hand.type = ROW_STEP; row.bOneChoiceForAllPlayers = false; // fill in difficulty names if( GAMESTATE->m_bEditing ) { row.choices.push_back( "" ); hand.ListEntries.push_back( ModeChoice() ); } else if( GAMESTATE->IsCourseMode() ) // playing a course { row.bOneChoiceForAllPlayers = PREFSMAN->m_bLockCourseDifficulties; vector<Trail*> vTrails; GAMESTATE->m_pCurCourse->GetTrails( vTrails, GAMESTATE->GetCurrentStyle()->m_StepsType ); ModeChoice mc; for( unsigned i=0; i<vTrails.size(); i++ ) { row.choices.push_back( CourseDifficultyToThemedString(vTrails[i]->m_CourseDifficulty) ); mc.m_pTrail = vTrails[i]; hand.ListEntries.push_back( mc ); } } else // !GAMESTATE->IsCourseMode(), playing a song { vector<Steps*> vSteps; GAMESTATE->m_pCurSong->GetSteps( vSteps, GAMESTATE->GetCurrentStyle()->m_StepsType ); StepsUtil::SortNotesArrayByDifficulty( vSteps ); ModeChoice mc; for( unsigned i=0; i<vSteps.size(); i++ ) { Steps* pSteps = vSteps[i]; CString s; if( pSteps->GetDifficulty() == DIFFICULTY_EDIT ) s = pSteps->GetDescription(); else s = DifficultyToThemedString( pSteps->GetDifficulty() ); s += ssprintf( " (%d)", pSteps->GetMeter() ); row.choices.push_back( s ); mc.m_pSteps = pSteps; mc.m_dc = pSteps->GetDifficulty(); hand.ListEntries.push_back( mc ); } } }
SongCreditDisplay::SongCreditDisplay() { if( GAMESTATE->IsCourseMode() ) return; this->LoadFromFont( THEME->GetPathF("SongCreditDisplay","text") ); Song* pSong = GAMESTATE->m_pCurSong; ASSERT( pSong ); CString s = pSong->GetFullDisplayTitle() + "\n" + pSong->GetDisplayArtist() + "\n"; if( !pSong->m_sCredit.empty() ) s += pSong->m_sCredit + "\n"; // use a vector and not a set so that ordering is maintained vector<Steps*> vpStepsToShow; FOREACH_PlayerNumber( p ) { if( !GAMESTATE->IsHumanPlayer(p) ) continue; // skip Steps* pSteps = GAMESTATE->m_pCurSteps[p]; bool bAlreadyAdded = find( vpStepsToShow.begin(), vpStepsToShow.end(), pSteps ) != vpStepsToShow.end(); if( !bAlreadyAdded ) vpStepsToShow.push_back( pSteps ); } for( unsigned i=0; i<vpStepsToShow.size(); i++ ) { Steps* pSteps = vpStepsToShow[i]; CString sDifficulty = DifficultyToThemedString( pSteps->GetDifficulty() ); // HACK: reset capitalization sDifficulty.MakeLower(); sDifficulty = Capitalize( sDifficulty ); s += sDifficulty + " steps: " + pSteps->GetDescription() + "\n"; } // erase the last newline s.erase( s.end()-1 ); this->SetText( s ); }
CString GetStatsLineTitle( PlayerNumber pn, EndingStatsLine line ) { switch( line ) { case CALORIES_TODAY: return "Calories Today"; case CURRENT_COMBO: return "Current Combo"; case PERCENT_COMPLETE: { StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType; CString sStepsType = GAMEMAN->StepsTypeToThemedString(st); const char *szType = GAMESTATE->IsCourseMode() ? "Courses" : "Songs"; return ssprintf( "%s %s %%", sStepsType.c_str(), szType ); } case PERCENT_COMPLETE_EASY: case PERCENT_COMPLETE_MEDIUM: case PERCENT_COMPLETE_HARD: case PERCENT_COMPLETE_CHALLENGE: { if( GAMESTATE->IsCourseMode() ) { CourseDifficulty cd = (CourseDifficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY); ASSERT( cd >= 0 && cd < NUM_COURSE_DIFFICULTIES ); if( !GAMESTATE->IsCourseDifficultyShown(cd) ) return ""; return CourseDifficultyToThemedString(cd); } else { Difficulty dc = (Difficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY); ASSERT( dc >= 0 && dc < NUM_DIFFICULTIES ); return DifficultyToThemedString(dc); } } default: ASSERT(0); return ""; } }
#include "LuaManager.h" #include "LuaFunctions.h" static const CString DifficultyNames[] = { "Beginner", "Easy", "Medium", "Hard", "Challenge", "Edit", }; XToString( Difficulty, NUM_DIFFICULTIES ); XToThemedString( Difficulty, NUM_DIFFICULTIES ); LuaFunction( DifficultyToThemedString, DifficultyToThemedString((Difficulty) IArg(1)) ); /* We prefer the above names; recognize a number of others, too. (They'l * get normalized when written to SMs, etc.) */ Difficulty StringToDifficulty( const CString& sDC ) { CString s2 = sDC; s2.MakeLower(); if( s2 == "beginner" ) return DIFFICULTY_BEGINNER; else if( s2 == "easy" ) return DIFFICULTY_EASY; else if( s2 == "basic" ) return DIFFICULTY_EASY; else if( s2 == "light" ) return DIFFICULTY_EASY; else if( s2 == "medium" ) return DIFFICULTY_MEDIUM; else if( s2 == "another" ) return DIFFICULTY_MEDIUM; else if( s2 == "trick" ) return DIFFICULTY_MEDIUM; else if( s2 == "standard" ) return DIFFICULTY_MEDIUM;