00001 #ifndef _STATUSPANEL_
00002
00003 #define _STATUSPANEL_
00004
00005
00006
00007 #ifdef _MSC_VER // if the compiler is from Microsoft
00008
00009 #pragma warning(disable:4786)
00010
00011 #endif
00012
00013
00014
00015 #include <SDL.h>
00016
00017 #include <SDL_ttf.h>
00018
00019
00020
00021 #include <deque>
00022
00023 #include <utility>
00024
00025 #include <string>
00026
00027
00028
00029 using namespace std;
00030
00031
00032
00033 #include "panel.h"
00034 #include "tile.h"
00035 #include "player.h"
00036
00037
00052 class StatusPanel : public Panel{
00053
00054 public:
00055
00062 static const string STATUS_BITMAP_FILE;
00063
00064
00065
00066 static const unsigned int INFO_BOX_WIDTH;
00067
00068 static const unsigned int INFO_BOX_HEIGHT;
00069
00070
00071
00082 StatusPanel();
00083
00084
00085
00112 StatusPanel(const unsigned int x, const unsigned int y,
00113
00114 const unsigned int w, const unsigned int h);
00115
00116
00117
00124 virtual ~StatusPanel();
00125
00126
00127
00134 StatusPanel& operator=(StatusPanel const& other);
00135
00136
00137
00152 bool draw(SDL_Surface* screen, Player * player);
00153
00154
00155
00168 void addMessage(string const &message, const Uint32 color);
00169
00170
00171
00184 void updateCurrentText(string const &text);
00185
00186
00187
00188 virtual void setFont(TTF_Font* font);
00189
00190
00191 void setNeedToDraw(bool value);
00192
00193 private:
00194
00207 deque<pair<string, Uint32> > messages;
00208
00209
00210
00219 string currentText;
00220
00221
00222
00235 void drawInfoBox(SDL_Surface* screen);
00236
00237
00238
00249 bool needToDraw;
00250
00251 unsigned int lines;
00252
00253 int resources[NUMRESOURCES];
00254 };
00255
00256
00257
00258 #endif