00001
00002
00003
#ifndef SCREEN_MINI_MENU_H
00004
#define SCREEN_MINI_MENU_H
00005
00006
#include "Screen.h"
00007
#include "BitmapText.h"
00008
#include "Transition.h"
00009
#include "Quad.h"
00010
#include "RandomSample.h"
00011
#include "BGAnimation.h"
00012
00013 #define MAX_MENU_ROWS 40
00014
00015
00016 struct MenuRow
00017 {
00018 const char *
name;
00019 bool enabled;
00020 int defaultChoice;
00021 const char *
choices[32];
00022 };
00023
00024
00025 struct MenuRowInternal
00026 {
00027 CString name;
00028 bool enabled;
00029 int defaultChoice;
00030 vector<CString>
choices;
00031
00032 MenuRowInternal()
00033 {
00034
enabled =
true;
00035
defaultChoice = 0;
00036 }
00037
00038
MenuRowInternal(
const MenuRow &r );
00039
00040
void SetDefaultChoiceIfPresent(
const CString &s );
00041 };
00042
00043
00044 struct Menu
00045 {
00046 CString title;
00047 vector<MenuRowInternal>
rows;
00048
00049 Menu() {}
00050
Menu( CString t,
const MenuRow *rows );
00051 };
00052
00053
00054 class ScreenMiniMenu :
public Screen
00055 {
00056
public:
00057
ScreenMiniMenu(
CString sName );
00058
ScreenMiniMenu(
Menu* pDef,
ScreenMessage SM_SendOnOK,
ScreenMessage SM_SendOnCancel );
00059
00060
virtual void Update(
float fDeltaTime );
00061
virtual void DrawPrimitives();
00062
virtual void Input(
const DeviceInput& DeviceI,
const InputEventType type,
const GameInput &GameI,
const MenuInput &MenuI,
const StyleInput &StyleI );
00063
virtual void HandleScreenMessage(
const ScreenMessage SM );
00064
00065
protected:
00066
void MenuUp(
PlayerNumber pn,
const InputEventType type );
00067
void MenuDown(
PlayerNumber pn,
const InputEventType type );
00068
void MenuLeft(
PlayerNumber pn,
const InputEventType type );
00069
void MenuRight(
PlayerNumber pn,
const InputEventType type );
00070
void MenuBack(
PlayerNumber pn );
00071
void MenuStart(
PlayerNumber pn,
const InputEventType type );
00072
00073
int GetGoUpSpot();
00074
int GetGoDownSpot();
00075
bool CanGoLeft();
00076
bool CanGoRight();
00077
00078
00079
void BeforeLineChanged();
00080
void AfterLineChanged();
00081
void AfterAnswerChanged();
00082
00083 BGAnimation m_Background;
00084 Menu m_Def;
00085 BitmapText m_textTitle;
00086 BitmapText m_textLabel[
MAX_MENU_ROWS];
00087 BitmapText m_textAnswer[
MAX_MENU_ROWS];
00088 int m_iCurLine;
00089 int m_iCurAnswers[
MAX_MENU_ROWS];
00090 ScreenMessage m_SMSendOnOK,
m_SMSendOnCancel;
00091 Transition m_In;
00092 Transition m_Out;
00093
00094
public:
00095
static int s_iLastLine;
00096
static int s_iLastAnswers[
MAX_MENU_ROWS];
00097
00098 };
00099
00100
#endif
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125