[5746] | 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> |
---|
[5748] | 36 | #include <CEGUIForwardRefs.h> |
---|
| 37 | #include "core/OrxonoxClass.h" |
---|
[5746] | 38 | |
---|
| 39 | |
---|
| 40 | namespace orxonox { |
---|
| 41 | |
---|
| 42 | class _QuestsystemExport QuestGUINode : public OrxonoxClass |
---|
| 43 | { |
---|
| 44 | |
---|
| 45 | public: |
---|
[6412] | 46 | |
---|
[5746] | 47 | QuestGUINode(void); |
---|
| 48 | QuestGUINode(QuestGUI* gui, QuestGUINode* parent, QuestItem* item, int depth, int index); |
---|
| 49 | virtual ~QuestGUINode(void); |
---|
[6412] | 50 | |
---|
[5748] | 51 | void toggleVisibility(void); |
---|
[5746] | 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. |
---|
[6412] | 56 | @return The CEGUI Window of this node. |
---|
[5746] | 57 | */ |
---|
| 58 | inline CEGUI::Window* getWindow(void) |
---|
| 59 | { return this->window_; } |
---|
| 60 | |
---|
| 61 | bool openDetails(const CEGUI::EventArgs& e); //!< Opens the details window for the Quest/QuestHint clicked on. |
---|
| 62 | bool closeDetails(const CEGUI::EventArgs& e); //!< Close the details window. |
---|
| 63 | |
---|
| 64 | private: |
---|
[5760] | 65 | CEGUI::Window* getDetails(void); //!< Creates the details window. |
---|
[5746] | 66 | |
---|
| 67 | void initialize(void); //!< Initialize the object. |
---|
| 68 | void updatePosition(void); //!< Update the position list item. |
---|
| 69 | void createWindow(void); //!< Helper method to create the CEGUI Window the node. |
---|
[5760] | 70 | static CEGUI::Rect getStaticTextArea(const CEGUI::Window* window); //Helper method for setHeight(). Gets the StaticTextArea for an input CEGUI Window. |
---|
| 71 | static int setHeight(CEGUI::Window* window); //Helper method to adjust the height of an input Window (of type StaticText) to the text it holds. |
---|
[5746] | 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. |
---|
[5760] | 77 | std::list<QuestGUINode*> subNodes_; //!< A list of all subnodes. |
---|
| 78 | QuestItem* item_; //!< QuestItem belonging to this node. |
---|
[5746] | 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 | |
---|
[5760] | 86 | //! Some magic numbers |
---|
| 87 | static const int TITLE_HEIGHT = 26; |
---|
| 88 | static const int BORDER_WIDTH = 5; |
---|
| 89 | static const int SCROLLBAR_WIDTH = 13; |
---|
| 90 | static const int BUTTON_HEIGHT = 30; |
---|
| 91 | static const int INDENT_WIDTH = 20; |
---|
| 92 | |
---|
[5746] | 93 | }; |
---|
| 94 | |
---|
| 95 | } |
---|
| 96 | |
---|
| 97 | #endif /* _QuestGUINode_H__ */ |
---|
| 98 | |
---|