1
/* ScummVM - Graphic Adventure Engine
3
* ScummVM is the legal property of its developers, whose names
4
* are too numerous to list here. Please refer to the COPYRIGHT
5
* file distributed with this source distribution.
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24
* This code is based on the original source code of Lord Avalot d'Argent version 1.3.
25
* Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
28
/* Original name: DROPDOWN A customized version of Oopmenu (qv). */
30
#ifndef AVALANCHE_DROPDOWN_H
31
#define AVALANCHE_DROPDOWN_H
33
#include "common/str.h"
36
class AvalancheEngine;
40
typedef void (DropDownMenu::*MenuFunc)();
41
static const Color kMenuBackgroundColor = kColorLightgray;
42
static const Color kMenuBorderColor = kColorBlack;
46
Common::String _title;
47
char _trigger, _altTrigger;
50
MenuFunc _setupFunc, _chooseFunc;
52
void init(char trig, char alTtrig, Common::String title, byte pos, MenuFunc setupFunc, MenuFunc chooseFunc, DropDownMenu *menu);
55
bool parseAltTrigger(char key);
58
DropDownMenu *_dropdown;
62
Common::String _title;
64
Common::String _shortcut;
70
OptionType _options[12];
73
int16 _flx1, _flx2, _fly;
74
bool _activeNow; // Is there an active option now?
75
byte _activeNum; // And if so, which is it?
76
byte _choiceNum; // Your choice?
78
void init(DropDownMenu *menu);
80
void setupOption(Common::String title, char trigger, Common::String shortcut, bool valid);
83
void lightUp(Common::Point cursorPos);
84
void select(byte which);
87
byte _oldY; // used by lightUp
91
DropDownMenu *_dropdown;
93
void displayOption(byte y, bool highlit);
94
void moveHighlight(int8 inc);
96
// CHECKME: Useless function?
97
void parseKey(char c);
102
HeadType _menuItems[8];
106
void init(DropDownMenu *menu);
107
void createMenuItem(char trig, Common::String title, char altTrig, MenuFunc setupFunc, MenuFunc chooseFunc);
109
void chooseMenuItem(int16 x);
112
DropDownMenu *_dropdown;
114
void setupMenuItem(byte which);
115
// CHECKME: Useless function
116
void parseAltTrigger(char c);
121
friend class HeadType;
122
friend class MenuItem;
123
friend class MenuBar;
125
MenuItem _activeMenuItem;
128
DropDownMenu(AvalancheEngine *vm);
131
void setup(); // Standard menu bar.
134
void resetVariables();
137
static const byte kIndent = 5;
138
static const byte kSpacing = 10;
140
// Checkme: Useless constants?
141
// static const Color kMenuFontColor = kColorBlack;
142
// static const Color kHighlightBackgroundColor = kColorBlack;
143
// static const Color kHighlightFontColor = kColorWhite;
144
// static const Color kDisabledColor = kColorDarkgray;
146
Common::String people;
147
Common::String _verbStr; // what you can do with your object. :-)
148
bool _menuActive; // Kludge so we don't have to keep referring to the menu.
149
People _lastPerson; // Last person to have been selected using the People menu.
151
AvalancheEngine *_vm;
153
Common::String selectGender(byte x); // Returns "im" for boys, and "er" for girls.
154
void findWhatYouCanDoWithIt();
155
void drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted);
158
char getThingChar(byte which);
159
byte getNameChar(People whose);
160
Common::String getThing(byte which);
162
void setupMenuGame();
163
void setupMenuFile();
164
void setupMenuAction();
165
void setupMenuPeople();
166
void setupMenuObjects();
167
void setupMenuWith();
171
void runMenuAction();
172
void runMenuObjects();
173
void runMenuPeople();
176
// CHECKME: Useless function?
177
void parseKey(char r, char re);
180
} // End of namespace Avalanche.
182
#endif // AVALANCHE_DROPDOWN_H