diff --git a/src/battle/capitalShips.h b/src/battle/capitalShips.h index 2f232e6..8cfb9d9 100644 --- a/src/battle/capitalShips.h +++ b/src/battle/capitalShips.h @@ -48,7 +48,7 @@ extern char *getTranslatedString(char *string); extern void addLargeExplosion(void); extern char **toTypeArray(char *types, int *numTypes); extern void updateCondition(char *name, int type); -extern void addMessageBox(char *title, char *body, int important); +extern void addMessageBox(char *title, char *body, int type); extern Battle battle; extern Entity *player; diff --git a/src/battle/messageBox.c b/src/battle/messageBox.c index 7fbd4bf..564515d 100644 --- a/src/battle/messageBox.c +++ b/src/battle/messageBox.c @@ -35,7 +35,7 @@ void initMessageBox(void) lastWingmate = NULL; } -void addMessageBox(char *title, char *body, int important) +void addMessageBox(char *title, char *body, int type) { MessageBox *msg; int isFirst; @@ -54,7 +54,7 @@ void addMessageBox(char *title, char *body, int important) STRNCPY(msg->title, title, MAX_NAME_LENGTH); STRNCPY(msg->body, body, MAX_DESCRIPTION_LENGTH); msg->time = time * FPS; - msg->important = important; + msg->type = type; if (isFirst) { @@ -124,13 +124,13 @@ void drawMessageBox(void) SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_BLEND); - if (!msg->important) + if (msg->type == MB_IMPORTANT) { - SDL_SetRenderDrawColor(app.renderer, 0, 0, 0, 128); + SDL_SetRenderDrawColor(app.renderer, 255, 0, 0, 64); } else { - SDL_SetRenderDrawColor(app.renderer, 255, 0, 0, 64); + SDL_SetRenderDrawColor(app.renderer, 0, 0, 0, 128); } SDL_RenderFillRect(app.renderer, &r); @@ -142,7 +142,7 @@ void drawMessageBox(void) limitTextWidth(575); - drawText(r.x + 10, r.y + 30, 18, TA_LEFT, (!msg->important) ? colors.white : colors.red, msg->body); + drawText(r.x + 10, r.y + 30, (msg->type == MB_PANDORAN) ? 0 : 18, TA_LEFT, (msg->type != MB_IMPORTANT) ? colors.white : colors.red, msg->body); limitTextWidth(0); } diff --git a/src/battle/script.c b/src/battle/script.c index a3d57b8..c89d5bd 100644 --- a/src/battle/script.c +++ b/src/battle/script.c @@ -228,12 +228,17 @@ static void executeNextLine(ScriptRunner *runner) else if (strcmp(command, "MSG_BOX") == 0) { sscanf(line, "%*s %255[^;]%*c%255[^\n]", strParam[0], strParam[1]); - addMessageBox(strParam[0], _(strParam[1]), 0); + addMessageBox(strParam[0], _(strParam[1]), MB_NORMAL); } else if (strcmp(command, "IMPORTANT_MSG_BOX") == 0) { sscanf(line, "%*s %255[^;]%*c%255[^\n]", strParam[0], strParam[1]); - addMessageBox(strParam[0], _(strParam[1]), 1); + addMessageBox(strParam[0], _(strParam[1]), MB_IMPORTANT); + } + else if (strcmp(command, "PANDORAN_MSG_BOX") == 0) + { + sscanf(line, "%*s %255[^;]%*c%255[^\n]", strParam[0], strParam[1]); + addMessageBox(strParam[0], _(strParam[1]), MB_PANDORAN); } else if (strcmp(command, "WAIT") == 0) { diff --git a/src/battle/script.h b/src/battle/script.h index 01c5f0d..cc7e1ff 100644 --- a/src/battle/script.h +++ b/src/battle/script.h @@ -27,7 +27,7 @@ extern void failMission(void); extern void retreatEnemies(void); extern void retreatAllies(void); extern void addHudMessage(SDL_Color c, char *format, ...); -extern void addMessageBox(char *title, char *body, int important); +extern void addMessageBox(char *title, char *body, int type); extern void activateEntities(char *name); extern void activateEntityGroups(char *groupName); extern void activateLocations(char *locations); diff --git a/src/defs.h b/src/defs.h index 17b6908..5aab531 100644 --- a/src/defs.h +++ b/src/defs.h @@ -135,6 +135,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define BOOST_FINISHED_TIME (FPS * 0.75) #define ECM_RECHARGE_TIME (FPS * 7) +#define MB_NORMAL 0 +#define MB_IMPORTANT 1 +#define MB_PANDORAN 2 + enum { CONTROL_FIRE, diff --git a/src/structs.h b/src/structs.h index c3fa52d..eb75e2d 100644 --- a/src/structs.h +++ b/src/structs.h @@ -441,7 +441,7 @@ struct MessageBox { char body[MAX_DESCRIPTION_LENGTH]; int time; int height; - int important; + int type; MessageBox *next; };