Files
itgmania212121/stepmania/src/ScreenMiniMenu.h
T

104 lines
2.4 KiB
C++
Raw Normal View History

2003-02-18 23:15:38 +00:00
/*
-----------------------------------------------------------------------------
Class: ScreenMiniMenu
Desc: Displays a prompt over the top of another screen. Must use by calling
SCREENMAN->AddScreenToTop( new ScreenMiniMenu(...) );
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "Screen.h"
#include "BitmapText.h"
2003-04-13 01:09:19 +00:00
#include "Transition.h"
2003-02-18 23:15:38 +00:00
#include "Quad.h"
#include "RandomSample.h"
#define MAX_MENU_ROWS 40
struct MenuRow
2003-02-18 23:15:38 +00:00
{
const char *name;
bool enabled;
int defaultChoice;
const char *choices[32];
};
struct MenuRowInternal
{
CString name;
bool enabled;
int defaultChoice;
vector<CString> choices;
MenuRowInternal()
2003-02-18 23:15:38 +00:00
{
enabled = true;
defaultChoice = 0;
}
MenuRowInternal( const MenuRow &r );
};
struct Menu
{
CString title;
vector<MenuRowInternal> rows;
Menu() {}
Menu( CString t, const MenuRow *rows );
2003-02-18 23:15:38 +00:00
};
class ScreenMiniMenu : public Screen
{
public:
2003-09-27 22:30:51 +00:00
ScreenMiniMenu( CString sName );
ScreenMiniMenu( Menu* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel );
2003-02-18 23:15:38 +00:00
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
virtual void HandleScreenMessage( const ScreenMessage SM );
protected:
2003-10-08 06:31:39 +00:00
void MenuUp( PlayerNumber pn, const InputEventType type );
void MenuDown( PlayerNumber pn, const InputEventType type );
void MenuLeft( PlayerNumber pn, const InputEventType type );
void MenuRight( PlayerNumber pn, const InputEventType type );
void MenuBack( PlayerNumber pn );
2003-10-08 06:31:39 +00:00
void MenuStart( PlayerNumber pn, const InputEventType type );
2003-02-18 23:15:38 +00:00
int GetGoUpSpot(); // return -1 if can't go up
int GetGoDownSpot(); // return -1 if can't go down
bool CanGoLeft();
bool CanGoRight();
void BeforeLineChanged();
void AfterLineChanged();
void AfterAnswerChanged();
BGAnimation m_Background;
Menu m_Def;
2003-02-18 23:15:38 +00:00
BitmapText m_textTitle;
BitmapText m_textLabel[MAX_MENU_ROWS];
BitmapText m_textAnswer[MAX_MENU_ROWS];
2003-02-18 23:15:38 +00:00
int m_iCurLine;
int m_iCurAnswers[MAX_MENU_ROWS];
2003-02-18 23:15:38 +00:00
ScreenMessage m_SMSendOnOK, m_SMSendOnCancel;
2003-04-13 01:09:19 +00:00
Transition m_In;
Transition m_Out;
2003-02-18 23:15:38 +00:00
public:
static int s_iLastLine;
static int s_iLastAnswers[MAX_MENU_ROWS];
2003-02-18 23:15:38 +00:00
};