1 2 #ifndef _CHAT_H_ 3 #define _CHAT_H_ 4 5 #include "keybinput.h" 6 7 #define CHAT_MAX_LINES 255 8 #define CHAT_BG_SHADE_DARK -64 9 #define CHAT_BG_SHADE_BRIGHT 64 10 #define CHAT_TEXTCOLOR COLOR_gray 11 #define CHAR_NETCOLOR COLOR_blue 12 13 struct __chat { 14 SDL_Rect window; 15 signed char changed; // if the chat windows has to redarwn after chat_loop 16 SDL_Surface *oldscreen; // old screen 17 short int curline; // current line 18 short int active; // if the chat window is active 19 short int keepactive; // keep chat active after pressing enter 20 struct { 21 char text[KEYBI_LINE_LEN]; 22 int color; // color of the line 23 int end; // mark the end of one line 24 } lines[CHAT_MAX_LINES]; 25 _keybinput input; 26 } typedef _chat; 27 28 extern _chat chat; 29 30 extern void chat_show (int x, int y, int w, int h); 31 extern void chat_addline (char *text, int color); 32 extern void chat_loop (SDL_Event *event); 33 extern void chat_setactive (int active, int keepactive); 34 extern void chat_draw (); 35 36 #endif 37