Files
itgmania212121/stepmania/src/ScreenSelectMaster.h
T

117 lines
3.6 KiB
C++
Raw Normal View History

2003-06-20 23:07:45 +00:00
#ifndef ScreenSelectMaster_H
#define ScreenSelectMaster_H
#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
2004-06-08 05:22:33 +00:00
/*
* (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.
*/