#ifndef _CONVERSATION_H_ #define _CONVERSATION_H_ #include "texturemap.h" #include #include //the number of chars in a row, and the height of a row of text. //these are fixed so we can preformat the text without putting lots of parsing in the display funcion. there are 4 rows. #define rowlength 50 #define colheight 32 #define MAXCHATS 25 class conversation { public: conversation(); virtual ~conversation(); bool Init(char *backgroundfile, char *borderfile);//loads the textures void SetBox(int newtextcols, int newtextrows, int newboxx, int newboxy, int newboxwidth, int newboxheight, int newborderthickness);//sets up the size and arrangement of the boxes, if you don't like the default bool StartConversation(int which, char *newmessage);//returns true if the conversation is working, false if it failed. Starts a new conversation for player which, using the newmessage. The box will show up after this is called. bool ContinueMessage(int which );//displays the next section of the message if there's more, in the conversation for player which. returns true if there's still more, false if the message is over (and the window has been closed) void EndConversation(int which );//kills the current conversation for player which void DrawConversation(int which, int numplayers, int windowwidth, int windowheight);//renders the box bool CheckTalking(int which );//true if a conversation is open for player which, false if none private: TextureMap BackgroundTexture; TextureMap BorderTexture; char **message; unsigned int progress[MAXCHATS];//which char of the message is the next to be drawn. if progress=strlen, or message=NULL, there is no conversation going on. int textcols;// 40 //how many columns of text display in one box int textrows;// 4 //how many rows of text display in one box int boxx;// 0 //x coordinate of lower left corner int boxy;// 0 //y coordinate of the lower left corner int boxwidth;// 400//width of the box int boxheight;// 100//height of the box int borderthickness; }; #endif