1 /////////////////////////////////////////////////////////////////////////////// 2 // Copyright (C) 2004-2011 by The Allacrost Project 3 // Copyright (C) 2012-2016 by Bertram (Valyria Tear) 4 // All Rights Reserved 5 // 6 // This code is licensed under the GNU GPL version 2. It is free software 7 // and you may modify it and/or redistribute it under the terms of this license. 8 // See https://www.gnu.org/copyleft/gpl.html for details. 9 /////////////////////////////////////////////////////////////////////////////// 10 11 #ifndef __MENU_QUEST_WINDOW__ 12 #define __MENU_QUEST_WINDOW__ 13 14 #include "common/global/global.h" 15 #include "common/gui/textbox.h" 16 17 #include "common/gui/menu_window.h" 18 #include "common/gui/option.h" 19 20 namespace vt_menu 21 { 22 23 class MenuMode; 24 25 namespace private_menu 26 { 27 28 /** 29 *** \brief Represents the quest log main window 30 *** players can view their active quests as well as completed quests when this window is viewing 31 **/ 32 class QuestWindow : public vt_gui::MenuWindow { 33 34 friend class vt_menu::MenuMode; 35 friend class QuestState; 36 37 public: 38 QuestWindow(); ~QuestWindow()39 virtual ~QuestWindow() override {} 40 41 //! \brief Draws window 42 void Draw() override; 43 44 /*! 45 * \brief Draws the bottom window information 46 * \note this only draws the location name and banner. we assume the 47 * calling function draws the actual window and frame 48 */ 49 void DrawBottom(); 50 51 //! \brief clears the info out. ClearBottom()52 void ClearBottom() 53 { 54 _location_name.ClearText(); 55 _location_subname.ClearText(); 56 _location_image = nullptr; 57 _location_subimage = nullptr; 58 } 59 60 //! \brief Performs updates 61 void Update() override; 62 63 //! \brief sets the viewing quest id information for the quest. 64 //! We use this to query the text description SetViewingQuestId(const std::string & quest_id)65 void SetViewingQuestId(const std::string &quest_id) 66 { 67 _viewing_quest_id = quest_id; 68 } 69 70 private: 71 //! \brief the currently viewing quest id. this is set by the Quest List Window through the 72 //! SetViewingQuestId() function 73 std::string _viewing_quest_id; 74 75 //! \brief sets the display text to be rendered, based on their quest key that is set 76 vt_gui::TextBox _quest_description; 77 //! \brief sets the display text to be rendered when the quest is completed. this is additional info 78 vt_gui::TextBox _quest_completion_description; 79 80 //! \brief the display text to be rendered for the location name and subname that the quest key is set to 81 vt_gui::TextBox _location_name; 82 vt_gui::TextBox _location_subname; 83 84 //! \brief the currently viewing location image and location subimage 85 const vt_video::StillImage* _location_image; 86 const vt_video::StillImage* _location_subimage; 87 }; 88 89 } // namespace private_menu 90 91 } // namespace vt_menu 92 93 #endif 94