ScummVM API documentation
QuestText.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 /*
23  * This code is based on the CRAB engine
24  *
25  * Copyright (c) Arvind Raja Yadav
26  *
27  * Licensed under MIT
28  *
29  */
30 
31 #ifndef CRAB_QUESTTEXT_H
32 #define CRAB_QUESTTEXT_H
33 
34 #include "crab/event/quest.h"
35 #include "crab/ui/button.h"
36 #include "crab/ui/ImageData.h"
37 #include "crab/ui/ParagraphData.h"
38 
39 namespace Crab {
40 
41 namespace pyrodactyl {
42 namespace ui {
43 class QuestText : public ParagraphData {
44 protected:
45  // How much the text and bullet positions change per line
46  Vector2i _inc;
47 
48  // Color of the highlighted quest
49  int _colS;
50 
51  // The coordinates for drawing image, which is like bullet points in the form of <Bullet> <Text>
52  ImageData _img;
53 
54  // The lines per page, we split the quest text into multiple pages if we have to draw more than that
55  uint _linesPerPage;
56 
57  // Keep track of which page we are at, and total pages
58  uint _currentPage, _totalPage;
59 
60  // The quest entries we start and stop the drawing at
61  int _start, _stop;
62 
63  // The buttons for cycling between pages of the menu
64  Button _prev, _next;
65 
66  // Display "Page 1 of 3" style information for the menu
67  HoverInfo _status;
68 
69 public:
70  QuestText() {
71  _colS = 0;
72  _currentPage = 0;
73  _start = 0;
74  _stop = 0;
75  _totalPage = 1;
76  _linesPerPage = 10;
77  }
78 
79  void load(rapidxml::xml_node<char> *node);
80 
81  // Reset the value of current page
82  void reset() {
83  _currentPage = 0;
84  }
85 
86  void handleEvents(pyrodactyl::event::Quest &q, const Common::Event &event);
87 
88  void draw(pyrodactyl::event::Quest &q);
89 
90  void setUI();
91 };
92 } // End of namespace ui
93 } // End of namespace pyrodactyl
94 
95 } // End of namespace Crab
96 
97 #endif // CRAB_QUESTTEXT_H
Definition: ParagraphData.h:40
Definition: ImageData.h:40
Definition: events.h:199
Definition: quest.h:41
Definition: moveeffect.h:37
Definition: button.h:86
Definition: QuestText.h:43
Definition: HoverInfo.h:41