ScummVM API documentation
bubble_box.h
1/* ScummVM - Graphic Adventure Engine
2 *
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.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
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.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef ACCESS_BUBBLE_BOX_H
23#define ACCESS_BUBBLE_BOX_H
24
25#include "common/scummsys.h"
26#include "common/array.h"
27#include "common/rect.h"
28#include "common/str-array.h"
29#include "common/stream.h"
30#include "common/types.h"
31#include "graphics/surface.h"
32#include "access/data.h"
33
34namespace Access {
35
36class AccessEngine;
37
38// MM/Amazon uses an enum, Noctropolis uses flags.
39enum BoxType {
40 kBoxTypeNone = 0,
41 kBoxTypeList = 1,
42 kBoxTypeNormal = 2,
43 kBoxTypeFileList = 3,
44 kBoxTypeFileDialog = 4,
45
46 kTextBoxNoctPlain = 1,
47 kTextBoxNoctCaption = 2,
48 kTextBoxNoctCenter = 4,
49};
50
51class BubbleBox : public Manager {
52private:
53 int _startItem, _startBox;
54 int _rowOff;
55 Common::Point _fileStart;
56 Common::Point _fileOff;
57 int _boxStartX, _boxStartY;
58 int _boxEndX, _boxEndY;
59 int _bIconStartX, _bIconStartY;
60 int _boxPStartX, _boxPStartY;
61
62 int _btnId1;
63 int _btnX1;
64 int _btnId2;
65 int _btnX2;
66 int _btnId3;
67 int _btnX3;
68
69 Common::Rect _btnUpPos;
70 Common::Rect _btnDownPos;
71
72 void displayBoxData();
73 void drawSelectBox();
77 void printBubble_v1(const Common::String &msg);
78 void printBubble_v2(const Common::String &msg);
79 void printBubble_v3(const Common::String &msg);
80
81public:
82 BoxType _type;
83 Common::Rect _bounds;
84 Common::StringArray _nameIndex;
85 Common::String _bubbleTitle; // the active default "script" title
86 Common::String _bubbleDisplStr; // the title that will be drawn on the next bubble
87 Common::String _tempList[60];
88 int _tempListIdx[60];
90public:
91 BubbleBox(AccessEngine *vm, Access::BoxType type, int x, int y, int w, int h, int val1, int val2, int val3, int val4, const char *title);
92
93 void load(Common::SeekableReadStream *stream);
94
95 void clearBubbles();
96
97 void placeBubble(const Common::String &msg);
98 void placeBubble1(const Common::String &msg);
99
103 void calcBubble(const Common::String &msg);
104
108 void printBubble(const Common::String &msg);
109
110 /*
111 * Draws the background for a text bubble
112 * @param index Index of bounds in _bubbles array
113 */
114 void drawBubble(int index);
115
116 void doBox_v2(int item, int box);
117 void doBox_v3(int item, int box);
118
119 int doBox_v1(int item, int box, int &btnSelected);
120 void getList(const char *const data[], const byte *flags);
121 void setCursorPos(int posX, int posY);
122 void printString(Common::String msg);
123};
124
125} // End of namespace Access
126
127#endif /* ACCESS_BUBBLE_BOX_H */
Definition: access.h:141
Definition: bubble_box.h:51
void calcBubble(const Common::String &msg)
void printBubble(const Common::String &msg)
Definition: data.h:37
Definition: stream.h:745
Definition: str.h:59
Definition: access.h:62
Definition: rect.h:144
Definition: rect.h:536