CMessage.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #ifndef CMESSAGE_H
  2. #define CMESSAGE_H
  3. #include "global.h"
  4. #include "SDL_TTF.h"
  5. #include "SDL.h"
  6. enum EWindowType {infoOnly, infoOK, yesOrNO};
  7. class CPreGame;
  8. class MapSel;
  9. class CSimpleWindow;
  10. class CDefHandler;
  11. namespace NMessage
  12. {
  13. extern std::vector<std::vector<SDL_Surface*> > piecesOfBox; //in colors of all players
  14. extern SDL_Surface * background ;
  15. }
  16. class CMessage
  17. {
  18. public:
  19. 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
  20. static SDL_Surface * genMessage(std::string title, std::string text, EWindowType type=infoOnly,
  21. std::vector<CDefHandler*> *addPics=NULL, void * cb=NULL);
  22. static SDL_Surface * drawBox1(int w, int h, int playerColor=1);
  23. static std::vector<std::string> * breakText(std::string text, int line=30, bool userBreak=true, bool ifor=true); //line - chars per line
  24. CMessage();
  25. static void init();
  26. static void dispose();
  27. };
  28. //
  29. #endif //CMESSAGE_H