1 /* 2 * This file is part of EasyRPG Player. 3 * 4 * EasyRPG Player is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * EasyRPG Player is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with EasyRPG Player. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef EP_WINDOW_HELP_H 19 #define EP_WINDOW_HELP_H 20 21 // Headers 22 #include "window_base.h" 23 #include "text.h" 24 #include "font.h" 25 26 /** 27 * Window_Help class. 28 * Shows skill and item explanations. 29 */ 30 class Window_Help : public Window_Base { 31 32 public: 33 /** 34 * Constructor. 35 */ 36 Window_Help(int ix, int iy, int iwidth, int iheight, Drawable::Flags flags = Drawable::Flags::Default); 37 38 /** 39 * Sets the text that will be shown. 40 * 41 * @param text text to show. 42 * @param align text alignment. 43 * @param halfwidthspace if half width spaces should be used. 44 */ 45 void SetText(std::string text, int color = Font::ColorDefault, Text::Alignment align = Text::AlignLeft, bool halfwidthspace = true); 46 47 /** 48 * Clears the window 49 */ 50 void Clear(); 51 52 /** 53 * Adds text to the help window. This does not overwrite the old content. 54 * 55 * @param text text to add. 56 * @param color text color. 57 * @param align text alignment. 58 * @param halfwidthspace if half width spaces should be used. 59 */ 60 void AddText(std::string text, int color = Font::ColorDefault, Text::Alignment align = Text::AlignLeft, bool halfwidthspace = true); 61 62 private: 63 /** Text to draw. */ 64 std::string text; 65 /** Color of Text to draw. */ 66 int color = Font::ColorDefault; 67 /** Alignment of text. */ 68 Text::Alignment align; 69 /** Current text position */ 70 int text_x_offset = 0; 71 }; 72 73 #endif 74