1 ///////////////////////////////////////////////////////////////////////////////
2 //            Copyright (C) 2004-2010 by The Allacrost Project
3 //                         All Rights Reserved
4 //
5 // This code is licensed under the GNU GPL version 2. It is free software
6 // and you may modify it and/or redistribute it under the terms of this license.
7 // See http://www.gnu.org/copyleft/gpl.html for details.
8 ///////////////////////////////////////////////////////////////////////////////
9 
10 /** ****************************************************************************
11 *** \file    boot_credits.h
12 *** \author  Viljami Korhonen, mindflayer@allacrost.org
13 *** \brief   Header file for the boot credits window
14 *** ***************************************************************************/
15 
16 #ifndef __BOOT_CREDITS__
17 #define __BOOT_CREDITS__
18 
19 #include "utils.h"
20 #include "video.h"
21 #include "gui.h"
22 
23 namespace hoa_boot {
24 
25 namespace private_boot {
26 
27 /** ****************************************************************************
28 *** \brief Displays the game credits in a vertical scrolling fashion
29 ***
30 *** This welcome window only pops up the first time that the player starts the game.
31 *** Its purpose is to ensure that the player understands the default key commands in
32 *** case they started up the game prior to reading the game manual. Under normal
33 *** circumstances, this screen is shown only once when the player first starts up
34 *** the game after installation. After that the Lua file holding the game settings
35 *** is marked so that this screen does not pop up a second time.
36 ***
37 *** The window itself consists of a large MenuWindow, header text explaining the
38 *** window's purpose of providing default key mappings to the player, a table of
39 *** the default keys and purposes, and footer text informing the player where
40 *** they can find more information.
41 *** *****************************************************************************/
42 class CreditsWindow {
43 public:
44 	CreditsWindow();
45 
46 	~CreditsWindow();
47 
48 	//! \brief Updates the state of the credits window and processes user input
49 	void Update();
50 
51 	//! \brief Draws the credits window and its contents to the screen
52 	void Draw();
53 
54 	//! \brief Activates and shows the credits window
55 	void Show();
56 
57 	//! \brief Deactivates and hides the welcome window
58 	void Hide();
59 
60 	//! \brief Returns true if the credits window is currently active and visible
IsActive()61 	bool IsActive() const
62 		{ return _active; }
63 
64 private:
65 	//! \brief Set to true when the window is active and should be visible on the screen
66 	bool _active;
67 
68 	//! \brief Set to true only after the credits text has been loaded and rendered
69 	bool _loaded;
70 
71 	//! \brief A vertical offset used for the scrolling credits text
72 	float _scroll_offset;
73 
74 	//! \brief The GUI menu window that all other content is drawn upon
75 	hoa_gui::MenuWindow _window;
76 
77 	//! \brief The rendered image of the credits text
78 	hoa_video::TextImage _credits_text;
79 }; // class CreditsWindow
80 
81 } // namespace private_boot
82 
83 } // namespace hoa_boot
84 
85 #endif // __BOOT_CREDITS__
86