ScummVM API documentation
questmenu.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_QUESTMENU_H
32 #define CRAB_QUESTMENU_H
33 
34 #include "crab/event/quest.h"
35 #include "crab/ui/PageMenu.h"
36 #include "crab/ui/QuestText.h"
37 
38 namespace Crab {
39 
40 namespace pyrodactyl {
41 namespace ui {
42 class QuestMenu {
43  // The collection of quest pages
44  PageButtonMenu _menu;
45 
46  // The currently selected quest for reading
47  int _selQuest;
48 
49  // The currently selected page
50  int _selPage;
51 
52  // The currently selected button in the page menu
53  int _selBu;
54 
55  // For drawing quest text
56  QuestText _text;
57 
58  // For drawing quest tabs
59  FontKey _font;
60  Align _align;
61  int _colN, _colS;
62  ButtonImage _imgN, _imgS;
63  Vector2i _offTitle, _offUnread;
64 
65 public:
66  // All the quests currently in this menu
68 
69  // Keep track of unread notifications for each category button
70  bool _unread;
71 
72  QuestMenu();
73  ~QuestMenu() {}
74 
75  void load(rapidxml::xml_node<char> *node);
76  void draw(Button &buMap);
77 
78  bool handleEvents(Button &buMap, Common::String &mapTitle, const Common::Event &event);
79 
80  void useKeyboard(const bool &val) {
81  _menu.useKeyboard(val);
82  }
83 
84  void assignPaths() {
85  _menu.assignPaths();
86  }
87 
88  void marker(const Common::String &title, const bool &val);
89 
90  void add(const Common::String &title, const Common::String &txt);
91  void add(const pyrodactyl::event::Quest &q);
92  void erase(const int &index);
93 
94  void select(const int &questIndex);
95 
96  void saveState(rapidxml::xml_document<char> &doc, rapidxml::xml_node<char> *root, const char *name);
97  void loadState(rapidxml::xml_node<char> *node);
98 
99  void setUI();
100 };
101 } // End of namespace ui
102 } // End of namespace pyrodactyl
103 
104 } // End of namespace Crab
105 
106 #endif // CRAB_QUESTMENU_H
Definition: str.h:59
Definition: array.h:52
Definition: button.h:58
Definition: events.h:199
Definition: quest.h:41
Definition: moveeffect.h:37
Definition: button.h:86
Definition: questmenu.h:42
Definition: QuestText.h:43