2007-06-26 12:38:58 +00:00
# ifndef CMESSAGE_H
# define CMESSAGE_H
2007-08-12 17:48:05 +00:00
# include "global.h"
2007-06-12 09:33:20 +00:00
# include "SDL_TTF.h"
2007-07-28 23:01:25 +00:00
# include "SDL.h"
2007-06-12 09:33:20 +00:00
enum EWindowType { infoOnly , infoOK , yesOrNO } ;
2007-06-19 15:25:42 +00:00
class CPreGame ;
2007-06-28 10:47:28 +00:00
class MapSel ;
2007-10-13 20:31:50 +00:00
class CSimpleWindow ;
class CDefHandler ;
2007-07-28 23:01:25 +00:00
namespace NMessage
{
extern std : : vector < std : : vector < SDL_Surface * > > piecesOfBox ; //in colors of all players
extern SDL_Surface * background ;
}
2007-06-12 09:33:20 +00:00
class CMessage
{
public :
2007-10-13 20:31:50 +00:00
static CSimpleWindow * genWindow ( std : : string text , int player , int Lmar = 35 , int Rmar = 35 , int Tmar = 35 , int Bmar = 35 ) ; //supports h3 text formatting; player sets color of window, Lmar/Rmar/Tmar/Bmar are Left/Right/Top/Bottom margins
2007-07-28 23:01:25 +00:00
static SDL_Surface * genMessage ( std : : string title , std : : string text , EWindowType type = infoOnly ,
2007-07-11 12:08:42 +00:00
std : : vector < CDefHandler * > * addPics = NULL , void * cb = NULL ) ;
2007-07-28 23:01:25 +00:00
static SDL_Surface * drawBox1 ( int w , int h , int playerColor = 1 ) ;
2007-10-13 20:31:50 +00:00
static std : : vector < std : : string > * breakText ( std : : string text , int line = 30 , bool userBreak = true , bool ifor = true ) ; //line - chars per line
2007-06-12 09:33:20 +00:00
CMessage ( ) ;
2007-08-03 21:47:34 +00:00
static void init ( ) ;
static void dispose ( ) ;
2007-06-19 15:25:42 +00:00
} ;
//
2007-06-26 12:38:58 +00:00
# endif //CMESSAGE_H