Files
itgmania212121/stepmania/src/ScreenOptions.h
T

119 lines
3.3 KiB
C++
Raw Normal View History

#ifndef SCREENOPTIONS_H
#define SCREENOPTIONS_H
2002-05-20 08:59:37 +00:00
/*
-----------------------------------------------------------------------------
File: ScreenOptions.h
Desc: A grid of options, and the selected option is drawn with a highlight rectangle.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "Screen.h"
#include "Sprite.h"
#include "BitmapText.h"
#include "RandomSample.h"
#include "TransitionInvisible.h"
#include "Quad.h"
#include "MenuElements.h"
#include "OptionsCursor.h"
2002-09-03 06:33:08 +00:00
#include "OptionIcon.h"
2002-05-20 08:59:37 +00:00
2002-10-31 03:25:35 +00:00
const unsigned MAX_OPTION_LINES = 20;
const unsigned MAX_OPTIONS_PER_LINE = 20;
2002-05-20 08:59:37 +00:00
// used to pass menu info into this class
struct OptionRowData {
2002-05-20 08:59:37 +00:00
char szTitle[30];
2002-10-31 03:25:35 +00:00
unsigned iNumOptions;
char szOptionsText[MAX_OPTIONS_PER_LINE][60];
char szExplanation[2048];
2002-05-20 08:59:37 +00:00
};
enum InputMode
{
INPUTMODE_PLAYERS, // each player controls their own cursor
INPUTMODE_BOTH // both players control the same cursor
};
2002-05-20 08:59:37 +00:00
class ScreenOptions : public Screen
{
public:
ScreenOptions( CString sBackgroundPath, CString sPagePath, CString sTopEdgePath );
void Init( InputMode im, OptionRowData OptionRowData[], int iNumOptionLines, bool bUseIcons );
2002-05-20 08:59:37 +00:00
virtual ~ScreenOptions();
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:
virtual void ImportOptions() = 0;
virtual void ExportOptions() = 0;
void InitOptionsText();
void GetWidthXY( PlayerNumber pn, int iRow, int &iWidthOut, int &iXOut, int &iYOut );
2002-05-20 08:59:37 +00:00
void PositionUnderlines();
2002-09-03 06:33:08 +00:00
void PositionIcons();
void RefreshIcons();
void PositionCursors();
void TweenCursor( PlayerNumber player_no );
void UpdateEnabledDisabled();
2002-08-22 07:35:58 +00:00
virtual void OnChange();
2002-05-20 08:59:37 +00:00
void MenuBack( PlayerNumber pn );
void MenuStart( PlayerNumber pn );
2002-05-20 08:59:37 +00:00
virtual void GoToNextState() = 0;
virtual void GoToPrevState() = 0;
void MenuLeft( PlayerNumber pn );
void MenuRight( PlayerNumber pn );
void MenuUp( PlayerNumber pn );
void MenuDown( PlayerNumber pn );
2002-05-20 08:59:37 +00:00
InputMode m_InputMode;
bool m_bUseIcons;
2002-05-20 08:59:37 +00:00
OptionRowData* m_OptionRowData;
int m_iNumOptionRows;
2002-05-20 08:59:37 +00:00
MenuElements m_Menu;
2002-05-20 08:59:37 +00:00
ActorFrame m_framePage;
Sprite m_sprPage;
Sprite m_sprLineArrows[MAX_OPTION_LINES];
BitmapText m_textOptionLineTitles[MAX_OPTION_LINES];
BitmapText m_textOptions[MAX_OPTION_LINES][MAX_OPTIONS_PER_LINE]; // this array has to be big enough to hold all of the options
2002-08-22 07:35:58 +00:00
bool m_OptionDim[MAX_OPTION_LINES][MAX_OPTIONS_PER_LINE];
void DimOption(int line, int option, bool dim);
2002-08-22 08:08:16 +00:00
bool RowCompletelyDimmed(int line) const;
2002-05-20 08:59:37 +00:00
int m_iSelectedOption[NUM_PLAYERS][MAX_OPTION_LINES];
int m_iCurrentRow[NUM_PLAYERS];
// Quad m_OptionUnderline[NUM_PLAYERS][MAX_OPTION_LINES];
// Quad m_SelectionHighlight[NUM_PLAYERS];
2002-05-20 08:59:37 +00:00
OptionsCursor m_Underline[NUM_PLAYERS][MAX_OPTION_LINES];
2002-09-03 06:33:08 +00:00
OptionIcon m_OptionIcons[NUM_PLAYERS][MAX_OPTION_LINES];
OptionsCursor m_Highlight[NUM_PLAYERS];
BitmapText m_textExplanation;
RageSoundSample m_SoundChangeCol;
RageSoundSample m_SoundNextRow;
RageSoundSample m_SoundPrevRow;
RageSoundSample m_SoundStart;
2002-05-20 08:59:37 +00:00
TransitionInvisible m_Wipe;
};
#endif