Files
itgmania212121/stepmania/src/ScreenRanking.h
T

181 lines
6.1 KiB
C++
Raw Normal View History

2004-06-08 05:22:33 +00:00
#ifndef SCREEN_RANKING_H
#define SCREEN_RANKING_H
#include "ScreenAttract.h"
2003-01-27 02:00:38 +00:00
#include "GameConstantsAndTypes.h" // for NUM_RANKING_LINES
2003-07-12 20:35:47 +00:00
#include "Sprite.h"
#include "BitmapText.h"
2003-10-20 01:06:26 +00:00
#include "Banner.h"
2005-04-10 23:42:47 +00:00
#include "ActorScroller.h"
2004-05-02 03:01:27 +00:00
#include "ActorUtil.h"
2005-01-22 19:36:39 +00:00
#include "Difficulty.h"
2005-02-28 17:18:01 +00:00
#include "ThemeMetric.h"
#include "CommonMetrics.h"
2003-01-26 07:33:03 +00:00
class Course;
class Song;
2004-06-03 20:47:37 +00:00
class Trail;
2003-01-26 07:33:03 +00:00
2004-05-02 03:01:27 +00:00
enum PageType
{
PAGE_TYPE_CATEGORY,
2004-06-03 20:47:37 +00:00
PAGE_TYPE_TRAIL,
2004-05-02 03:01:27 +00:00
PAGE_TYPE_ALL_STEPS,
PAGE_TYPE_NONSTOP_COURSES,
PAGE_TYPE_ONI_COURSES,
PAGE_TYPE_SURVIVAL_COURSES,
2004-05-02 03:01:27 +00:00
NUM_PAGE_TYPES
};
#define FOREACH_PageType( pt ) FOREACH_ENUM( PageType, NUM_PAGE_TYPES, pt )
const CString& PageTypeToString( PageType pt );
2003-01-26 07:33:03 +00:00
class ScreenRanking : public ScreenAttract
{
public:
2003-09-27 22:30:51 +00:00
ScreenRanking( CString sName );
virtual void Init();
2003-12-28 08:20:48 +00:00
~ScreenRanking();
2003-01-26 07:33:03 +00:00
2005-02-28 18:49:17 +00:00
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
virtual void MenuLeft( PlayerNumber pn, const InputEventType type ) { Scroll(-1); }
virtual void MenuRight( PlayerNumber pn, const InputEventType type ) { Scroll(+1); }
virtual void MenuUp( PlayerNumber pn, const InputEventType type ) { Scroll(-1); }
virtual void MenuDown( PlayerNumber pn, const InputEventType type ) { Scroll(+1); }
virtual void Scroll( int iDir );
virtual void MenuStart( PlayerNumber pn );
virtual void MenuBack( PlayerNumber pn );
2003-01-26 07:33:03 +00:00
void HandleScreenMessage( const ScreenMessage SM );
2003-01-20 05:08:35 +00:00
protected:
2003-01-26 20:49:05 +00:00
struct PageToShow
2003-01-26 07:33:03 +00:00
{
2004-05-02 03:01:27 +00:00
PageToShow()
{
pCourse = NULL;
2004-06-03 20:47:37 +00:00
pTrail = NULL;
2004-05-02 03:01:27 +00:00
}
PageType type;
int colorIndex;
2005-04-25 22:44:32 +00:00
StepsType st;
2003-01-26 07:33:03 +00:00
RankingCategory category;
Course* pCourse;
2004-06-03 20:47:37 +00:00
Trail* pTrail;
2003-01-26 07:33:03 +00:00
};
2003-12-28 08:20:48 +00:00
float SetPage( PageToShow pts );
2003-01-26 20:49:05 +00:00
void TweenPageOnScreen();
void TweenPageOffScreen();
2003-01-26 07:33:03 +00:00
2003-12-28 08:20:48 +00:00
Banner m_Banner; // for course
Sprite m_sprBannerFrame; // for course
BitmapText m_textCourseTitle; // for course
2003-12-28 08:20:48 +00:00
BitmapText m_textCategory; // for category
BitmapText m_textStepsType; // for category, course, all_steps
2004-05-02 03:01:27 +00:00
AutoActor m_sprPageType;
2003-12-28 08:20:48 +00:00
Sprite m_sprBullets[NUM_RANKING_LINES]; // for category and course
BitmapText m_textNames[NUM_RANKING_LINES]; // for category and course
BitmapText m_textScores[NUM_RANKING_LINES]; // for category and course
2003-02-12 22:52:28 +00:00
BitmapText m_textPoints[NUM_RANKING_LINES]; // for course
BitmapText m_textTime[NUM_RANKING_LINES]; // for course
2004-06-11 08:52:41 +00:00
AutoActor m_sprDifficulty[NUM_DIFFICULTIES]; // for all_steps
AutoActor m_sprCourseDifficulty[NUM_DIFFICULTIES]; // for all_courses
struct ScoreRowItem : public ActorFrame // for all_steps and all_courses
2004-01-29 09:24:56 +00:00
{
ScoreRowItem() { m_pSong = NULL; m_pCourse = NULL; }
Song *m_pSong;
2004-01-29 09:24:56 +00:00
Course *m_pCourse;
AutoActor m_sprFrame;
BitmapText m_textTitle;
BitmapText m_textScore[NUM_DIFFICULTIES];
2004-01-29 09:24:56 +00:00
};
vector<ScoreRowItem> m_vScoreRowItem; // for all_steps
2005-04-10 23:42:47 +00:00
ActorScroller m_ListScoreRowItems;
2003-01-26 07:33:03 +00:00
2003-01-26 20:49:05 +00:00
vector<PageToShow> m_vPagesToShow;
2005-02-28 17:18:01 +00:00
// Don't use the version in CommonMetrics because we may have multiple
// ranking screens that want to show different types and difficulties.
ThemeMetricStepsTypesToShow STEPS_TYPES_TO_SHOW;
ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW;
ThemeMetricCourseDifficultiesToShow COURSE_DIFFICULTIES_TO_SHOW;
2005-02-28 17:18:01 +00:00
ThemeMetric<bool> SHOW_CATEGORIES;
2005-04-25 22:44:32 +00:00
ThemeMetric<bool> SHOW_STEPS_SCORES;
ThemeMetric<bool> SHOW_NONSTOP_COURSE_SCORES;
ThemeMetric<bool> SHOW_ONI_COURSE_SCORES;
ThemeMetric<bool> SHOW_SURVIVAL_COURSE_SCORES;
2005-04-25 22:44:32 +00:00
ThemeMetric<bool> SHOW_ONLY_MOST_RECENT_SCORES;
ThemeMetric<int> NUM_MOST_RECENT_SCORES_TO_SHOW;
2005-02-28 17:18:01 +00:00
ThemeMetric<float> SECONDS_PER_PAGE;
ThemeMetric<float> PAGE_FADE_SECONDS;
ThemeMetric<CString> NO_SCORE_NAME;
ThemeMetric<float> ROW_SPACING_X;
ThemeMetric<float> ROW_SPACING_Y;
ThemeMetric<float> COL_SPACING_X;
ThemeMetric<float> COL_SPACING_Y;
ThemeMetric1D<RageColor> STEPS_TYPE_COLOR;
ThemeMetric<int> SONG_SCORE_ROWS_TO_SHOW;
ThemeMetric<float> SONG_SCORE_SECONDS_PER_ROW;
2005-02-28 18:49:17 +00:00
ThemeMetric<bool> MANUAL_SCROLLING;
ThemeMetric<bool> SHOW_SURVIVAL_TIME;
2005-02-28 17:18:01 +00:00
ThemeMetric<float> BULLET_START_X;
ThemeMetric<float> BULLET_START_Y;
ThemeMetric<float> NAME_START_X;
ThemeMetric<float> NAME_START_Y;
ThemeMetric<float> SCORE_START_X;
ThemeMetric<float> SCORE_START_Y;
ThemeMetric<float> POINTS_START_X;
ThemeMetric<float> POINTS_START_Y;
ThemeMetric<float> TIME_START_X;
ThemeMetric<float> TIME_START_Y;
ThemeMetric<float> DIFFICULTY_START_X;
ThemeMetric<float> DIFFICULTY_Y;
ThemeMetric<float> COURSE_DIFFICULTY_START_X;
ThemeMetric<float> COURSE_DIFFICULTY_Y;
ThemeMetric<float> SONG_TITLE_OFFSET_X;
ThemeMetric<float> SONG_TITLE_OFFSET_Y;
ThemeMetric<float> SONG_FRAME_OFFSET_X;
ThemeMetric<float> SONG_FRAME_OFFSET_Y;
ThemeMetric<float> STEPS_SCORE_OFFSET_START_X;
ThemeMetric<float> STEPS_SCORE_OFFSET_Y;
ThemeMetric<float> COURSE_SCORE_OFFSET_START_X;
ThemeMetric<float> COURSE_SCORE_OFFSET_Y;
};
2004-06-08 05:22:33 +00:00
#endif
2004-06-08 05:22:33 +00:00
/*
* (c) 2001-2004 Chris Danford, Ben Nordstrom
* 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.
*/