2007-06-26 15:38:58 +03:00
# ifndef CMESSAGE_H
# define CMESSAGE_H
2007-08-12 20:48:05 +03:00
# include "global.h"
2007-06-12 12:33:20 +03:00
# include "SDL_TTF.h"
2007-07-29 02:01:25 +03:00
# include "SDL.h"
2007-06-12 12:33:20 +03:00
enum EWindowType { infoOnly , infoOK , yesOrNO } ;
2007-06-19 18:25:42 +03:00
class CPreGame ;
2007-06-28 13:47:28 +03:00
class MapSel ;
2007-10-13 23:31:50 +03:00
class CSimpleWindow ;
2007-11-19 00:58:28 +02:00
class CInfoWindow ;
2007-10-13 23:31:50 +03:00
class CDefHandler ;
2007-11-19 00:58:28 +02:00
struct SComponent ;
2007-07-29 02:01:25 +03:00
namespace NMessage
{
extern std : : vector < std : : vector < SDL_Surface * > > piecesOfBox ; //in colors of all players
extern SDL_Surface * background ;
}
2007-06-12 12:33:20 +03:00
class CMessage
{
public :
2007-11-19 00:58:28 +02:00
static std : : pair < int , int > getMaxSizes ( std : : vector < std : : vector < SDL_Surface * > > * txtg ) ;
static std : : vector < std : : vector < SDL_Surface * > > * drawText ( std : : vector < std : : string > * brtext ) ;
static CInfoWindow * genIWindow ( std : : string text , int player , int charperline , std : : vector < SComponent * > & comps ) ;
2007-10-13 23:31:50 +03: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-29 02:01:25 +03:00
static SDL_Surface * genMessage ( std : : string title , std : : string text , EWindowType type = infoOnly ,
2007-07-11 15:08:42 +03:00
std : : vector < CDefHandler * > * addPics = NULL , void * cb = NULL ) ;
2007-07-29 02:01:25 +03:00
static SDL_Surface * drawBox1 ( int w , int h , int playerColor = 1 ) ;
2007-10-13 23:31:50 +03: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 12:33:20 +03:00
CMessage ( ) ;
2007-08-04 00:47:34 +03:00
static void init ( ) ;
static void dispose ( ) ;
2007-06-19 18:25:42 +03:00
} ;
//
2007-06-26 15:38:58 +03:00
# endif //CMESSAGE_H