OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WarningMessage.h
1 /*
2  * Copyright 2010-2014 OpenXcom Developers.
3  *
4  * This file is part of OpenXcom.
5  *
6  * OpenXcom is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * OpenXcom is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPENXCOM_WARNINGMESSAGE_H
20 #define OPENXCOM_WARNINGMESSAGE_H
21 
22 #include "../Engine/Surface.h"
23 
24 namespace OpenXcom
25 {
26 
27 class Text;
28 class Timer;
29 class Font;
30 
35 class WarningMessage : public Surface
36 {
37 private:
38  Text *_text;
39  Timer *_timer;
40  Uint8 _color, _fade;
41 public:
43  WarningMessage(int width, int height, int x = 0, int y = 0);
47  void setColor(Uint8 color);
49  void setTextColor(Uint8 color);
51  void initText(Font *big, Font *small, Language *lang);
53  void setPalette(SDL_Color *colors, int firstcolor = 0, int ncolors = 256);
55  void showMessage(const std::wstring &msg);
57  void think();
59  void fade();
61  void draw();
62 };
63 
64 }
65 
66 #endif
void fade()
Fades the message.
Definition: WarningMessage.cpp:126
void setPalette(SDL_Color *colors, int firstcolor=0, int ncolors=256)
Sets the warning message's palette.
Definition: WarningMessage.cpp:96
WarningMessage(int width, int height, int x=0, int y=0)
Creates a new warning message with the specified size and position.
Definition: WarningMessage.cpp:35
Timer used to run code in fixed intervals.
Definition: Timer.h:37
Text string displayed on screen.
Definition: Text.h:41
~WarningMessage()
Cleans up the warning message.
Definition: WarningMessage.cpp:52
void showMessage(const std::wstring &msg)
Shows the warning message.
Definition: WarningMessage.cpp:106
Contains strings used throughout the game for localization.
Definition: Language.h:42
Takes care of loading and storing each character in a sprite font.
Definition: Font.h:40
void think()
Handles the timers.
Definition: WarningMessage.cpp:118
void setTextColor(Uint8 color)
Sets the text color for the warning message.
Definition: WarningMessage.cpp:71
Coloured box with text inside that fades out after it is displayed.
Definition: WarningMessage.h:35
void initText(Font *big, Font *small, Language *lang)
Initializes the warning message's resources.
Definition: WarningMessage.cpp:85
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39
void draw()
Draws the message.
Definition: WarningMessage.cpp:140
void setColor(Uint8 color)
Sets the color for the warning message.
Definition: WarningMessage.cpp:62