ScummVM API documentation
zstats.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 ULTIMA2_VIEWS_ZTATS_H
23#define ULTIMA2_VIEWS_ZTATS_H
24
25#include "common/array.h"
26#include "common/str.h"
27#include "ultima/ultima1/views/dialog.h"
28
29namespace Ultima {
30namespace Ultima1 {
31namespace Views {
32
33using namespace Graphics::Views;
34
35class ZStats : public Dialog {
36private:
37 struct StatLine {
38 Common::String _text;
39 byte _color;
40 };
41
42 // All the lines to display, spanning however many pages are needed.
43 // Rebuilt fresh each time the dialog is focused
45
46 // Index into _lines where the currently displayed page starts
47 uint _pageStart = 0;
48
52 void buildLines();
53
58 void addLine(const char *name, int value, bool highlighted = false);
59
63 Common::String getLine(const char *name, int value);
64
69 Common::Point linePos(int lineNum) const;
70
71 void keyPressed();
72
73public:
74 ZStats() : Dialog("ZStats") {
75 }
76 ~ZStats() override {
77 }
78
79 void draw() override;
80 bool msgFocus(const FocusMessage &msg) override;
81 bool msgUnfocus(const UnfocusMessage &msg) override;
82 bool msgAction(const ActionMessage &msg) override;
83 bool msgKeypress(const KeypressMessage &msg) override;
84};
85
86} // namespace Views
87} // namespace Ultima1
88} // namespace Ultima
89
90#endif
Definition: str.h:59
Definition: dialog.h:34
Definition: zstats.h:35
Definition: rect.h:144
Definition: messages.h:118
Definition: messages.h:42
Definition: messages.h:54
Definition: messages.h:50