#ifndef ScreenHighScores_H #define ScreenHighScores_H #include "ScreenAttract.h" #include "Course.h" #include "DynamicActorScroller.h" typedef pair DifficultyAndStepsType; enum HighScoresType { HighScoresType_AllSteps, // Top 1 HighScore for N Steps in each Song HighScoresType_NonstopCourses, // Top 1 HighScore for N Trails in each Course HighScoresType_OniCourses, HighScoresType_SurvivalCourses, HighScoresType_AllCourses, NUM_HighScoresType, HighScoresType_Invalid }; LuaDeclareType( HighScoresType ); class ScoreScroller: public DynamicActorScroller { public: ScoreScroller(); void LoadSongs( int iNumRecentScores ); void LoadCourses( CourseType ct, int iNumRecentScores ); void Load( RString sClassName ); void SetDisplay( const vector &DifficultiesToShow ); bool Scroll( int iDir ); void ScrollTop(); protected: virtual void ConfigureActor( Actor *pActor, int iItem ); vector m_DifficultiesToShow; struct ScoreRowItemData // for all_steps and all_courses { ScoreRowItemData() { m_pSong = NULL; m_pCourse = NULL; } Song *m_pSong; Course *m_pCourse; }; vector m_vScoreRowItemData; ThemeMetric SCROLLER_ITEMS_TO_DRAW; ThemeMetric SCROLLER_SECONDS_PER_ITEM; }; class ScreenHighScores: public ScreenAttract { public: virtual void Init(); virtual void BeginScreen(); void HandleScreenMessage( const ScreenMessage SM ); virtual void Input( const InputEventPlus &input ); virtual void MenuStart( const InputEventPlus &input ); virtual void MenuBack( const InputEventPlus &input ); virtual void MenuLeft( const InputEventPlus &input ) { DoScroll(-1); } virtual void MenuRight( const InputEventPlus &input ) { DoScroll(+1); } virtual void MenuUp( const InputEventPlus &input ) { DoScroll(-1); } virtual void MenuDown( const InputEventPlus &input ) { DoScroll(+1); } private: void DoScroll( int iDir ); ThemeMetric MANUAL_SCROLLING; ThemeMetric HIGH_SCORES_TYPE; ThemeMetric NUM_COLUMNS; ThemeMetric1D COLUMN_DIFFICULTY; ThemeMetric1D COLUMN_STEPS_TYPE; ThemeMetric MAX_ITEMS_TO_SHOW; ScoreScroller m_Scroller; }; #endif /* * (c) 2001-2007 Chris Danford, Ben Nordstrom, Glenn Maynard * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, and/or sell copies of the Software, and to permit persons to * whom the Software is furnished to do so, provided that the above * copyright notice(s) and this permission notice appear in all copies of * the Software and that both the above copyright notice(s) and this * permission notice appear in supporting documentation. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */