1 | /* |
---|
2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
3 | * > www.orxonox.net < |
---|
4 | * |
---|
5 | * |
---|
6 | * License notice: |
---|
7 | * |
---|
8 | * This program is free software; you can redistribute it and/or |
---|
9 | * modify it under the terms of the GNU General Public License |
---|
10 | * as published by the Free Software Foundation; either version 2 |
---|
11 | * of the License, or (at your option) any later version. |
---|
12 | * |
---|
13 | * This program is distributed in the hope that it will be useful, |
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | * GNU General Public License for more details. |
---|
17 | * |
---|
18 | * You should have received a copy of the GNU General Public License |
---|
19 | * along with this program; if not, write to the Free Software |
---|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
21 | * |
---|
22 | * Author: |
---|
23 | * Damian 'Mozork' Frick |
---|
24 | * Co-authors: |
---|
25 | * ... |
---|
26 | * |
---|
27 | */ |
---|
28 | |
---|
29 | #ifndef _QuestGUINode_H__ |
---|
30 | #define _QuestGUINode_H__ |
---|
31 | |
---|
32 | #include "questsystem/QuestsystemPrereqs.h" |
---|
33 | |
---|
34 | #include <list> |
---|
35 | #include <string> |
---|
36 | #include <CEGUIForwardRefs.h> |
---|
37 | #include "core/OrxonoxClass.h" |
---|
38 | |
---|
39 | |
---|
40 | namespace orxonox { |
---|
41 | |
---|
42 | class _QuestsystemExport QuestGUINode : public OrxonoxClass |
---|
43 | { |
---|
44 | |
---|
45 | public: |
---|
46 | |
---|
47 | QuestGUINode(void); |
---|
48 | QuestGUINode(QuestGUI* gui, QuestGUINode* parent, QuestItem* item, int depth, int index); |
---|
49 | virtual ~QuestGUINode(void); |
---|
50 | |
---|
51 | void toggleVisibility(void); |
---|
52 | |
---|
53 | void getName(std::string & buffer); //!< Sets the input buffer to the name of the node. |
---|
54 | /** |
---|
55 | @brief Retreive the window of this node. |
---|
56 | @return The CEGUI Window of this node. |
---|
57 | */ |
---|
58 | inline CEGUI::Window* getWindow(void) |
---|
59 | { return this->window_; } |
---|
60 | CEGUI::Window* getDetails(void); //!< Creates the details window. |
---|
61 | |
---|
62 | bool openDetails(const CEGUI::EventArgs& e); //!< Opens the details window for the Quest/QuestHint clicked on. |
---|
63 | bool closeDetails(const CEGUI::EventArgs& e); //!< Close the details window. |
---|
64 | |
---|
65 | private: |
---|
66 | static CEGUI::Rect getStaticTextArea(const CEGUI::Window* window); |
---|
67 | static int setHeight(CEGUI::Window* window); |
---|
68 | |
---|
69 | void initialize(void); //!< Initialize the object. |
---|
70 | void updatePosition(void); //!< Update the position list item. |
---|
71 | void createWindow(void); //!< Helper method to create the CEGUI Window the node. |
---|
72 | |
---|
73 | bool visible_; //!< Boolean determining the visibility of the node. |
---|
74 | |
---|
75 | QuestGUI* gui_; //!< The QuestGUI this node belongs to. |
---|
76 | QuestGUINode* parent_; //!< The parent node. |
---|
77 | std::list<QuestGUINode*> subNodes_; //!< a list of all subnodes. |
---|
78 | QuestItem* item_; //!< |
---|
79 | |
---|
80 | int depth_; //!< The depth (resp. indentation) of this node in the list of Quests. (Irrelevant for QuestHints) |
---|
81 | int index_; //!< The index of this node in the list of Quests, resp. in the list of QuestHints, if the node belongs to a QuestHint, rather than a Quest. |
---|
82 | |
---|
83 | CEGUI::Window* window_; //!< The list window of this node. |
---|
84 | CEGUI::Window* details_; //!< The details window of this node. |
---|
85 | |
---|
86 | }; |
---|
87 | |
---|
88 | } |
---|
89 | |
---|
90 | #endif /* _QuestGUINode_H__ */ |
---|
91 | |
---|