Files
itgmania212121/stepmania/src/ScreenSelectMaster.h
T

103 lines
2.7 KiB
C++
Raw Normal View History

2003-06-20 23:07:45 +00:00
#ifndef ScreenSelectMaster_H
#define ScreenSelectMaster_H
/*
-----------------------------------------------------------------------------
Class: ScreenSelectMaster
Desc: Abstract class for a widget that selects a ModeChoice
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "ScreenSelect.h"
#include "Sprite.h"
#include "BitmapText.h"
#include "RageSound.h"
#include "RandomSample.h"
2003-11-05 04:09:10 +00:00
#include "ActorUtil.h"
2004-01-17 23:14:56 +00:00
#include "ActorScroller.h"
2003-06-20 23:07:45 +00:00
class ScreenSelectMaster : public ScreenSelect
{
public:
2003-09-27 22:30:51 +00:00
ScreenSelectMaster( CString sName );
2003-06-20 23:07:45 +00:00
virtual void Update( float fDelta );
virtual void MenuLeft( PlayerNumber pn );
virtual void MenuRight( PlayerNumber pn );
2003-11-12 02:53:28 +00:00
virtual void MenuUp( PlayerNumber pn );
virtual void MenuDown( PlayerNumber pn );
2003-06-20 23:07:45 +00:00
virtual void MenuStart( PlayerNumber pn );
2004-02-01 05:03:45 +00:00
void TweenOffScreen();
void TweenOnScreen();
2003-06-20 23:07:45 +00:00
virtual void HandleScreenMessage( const ScreenMessage SM );
protected:
enum Page { PAGE_1, PAGE_2, NUM_PAGES }; // on PAGE_2, cursors are locked together
Page GetPage( int iChoiceIndex ) const;
Page GetCurrentPage() const;
2003-06-20 23:07:45 +00:00
2003-11-12 02:53:28 +00:00
enum Dirs
{
DIR_UP,
DIR_DOWN,
DIR_LEFT,
DIR_RIGHT,
DIR_AUTO, // when players join and the selection becomes invalid
NUM_DIRS
};
static const char *dirs[NUM_DIRS];
int m_Next[NUM_DIRS][MAX_CHOICES];
2003-06-20 23:07:45 +00:00
virtual int GetSelectionIndex( PlayerNumber pn );
virtual void UpdateSelectableChoices();
2003-11-12 02:53:28 +00:00
bool Move( PlayerNumber pn, Dirs dir );
bool ChangePage( int iNewChoice );
bool ChangeSelection( PlayerNumber pn, int iNewChoice );
2004-02-01 05:03:45 +00:00
float DoMenuStart( PlayerNumber pn );
2003-06-20 23:07:45 +00:00
float GetCursorX( PlayerNumber pn, int iPartIndex );
float GetCursorY( PlayerNumber pn, int iPartIndex );
2003-11-05 19:35:57 +00:00
AutoActor m_sprExplanation[NUM_PAGES];
2003-06-20 23:07:45 +00:00
Sprite m_sprMore[NUM_PAGES];
#define MAX_ICON_PARTS 3
2004-01-17 23:14:56 +00:00
// icon is the piece shared, per-choice piece
2003-11-05 04:09:10 +00:00
AutoActor m_sprIcon[MAX_ICON_PARTS][MAX_CHOICES];
2003-06-20 23:07:45 +00:00
#define MAX_PREVIEW_PARTS 3
2004-01-17 23:14:56 +00:00
// preview is per-choice, per-player piece
2003-11-05 04:09:10 +00:00
AutoActor m_sprPreview[MAX_PREVIEW_PARTS][MAX_CHOICES][NUM_PLAYERS];
2003-06-20 23:07:45 +00:00
#define MAX_CURSOR_PARTS 3
2004-01-17 23:14:56 +00:00
// cursor is the per-player that's shared by all choices
2003-06-20 23:07:45 +00:00
Sprite m_sprCursor[MAX_CURSOR_PARTS][NUM_PLAYERS];
2004-01-17 23:14:56 +00:00
// scroll is the per-player, per-choice piece that's scrolled
AutoActor m_sprScroll[MAX_CHOICES][NUM_PLAYERS];
ActorScroller m_Scroller[NUM_PLAYERS];
2003-06-20 23:07:45 +00:00
RageSound m_soundChange;
RandomSample m_soundDifficult;
int m_iChoice[NUM_PLAYERS];
bool m_bChosen[NUM_PLAYERS];
float m_fLockInputSecs;
};
//
// Aliases
//
class ScreenSelectStyle5th : public ScreenSelectMaster
{
2003-09-27 22:30:51 +00:00
public:
ScreenSelectStyle5th( CString sName ): ScreenSelectMaster( sName ) { }
};
2003-06-20 23:07:45 +00:00
#endif