diff --git a/src/dehacked.c b/src/dehacked.c index 2b466fab7..725a30b4e 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1655,18 +1655,18 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum) else if (fastcmp(word, "BACKCOLOR")) { UINT8 backcolor; - if (usi == 0 || fastcmp(word2, "WHITE")) backcolor = 0; - else if (usi == 1 || fastcmp(word2, "GRAY") || fastcmp(word2, "GREY")) backcolor = 1; - else if (usi == 2 || fastcmp(word2, "BROWN")) backcolor = 2; - else if (usi == 3 || fastcmp(word2, "RED")) backcolor = 3; - else if (usi == 4 || fastcmp(word2, "ORANGE")) backcolor = 4; - else if (usi == 5 || fastcmp(word2, "YELLOW")) backcolor = 5; - else if (usi == 6 || fastcmp(word2, "GREEN")) backcolor = 6; - else if (usi == 7 || fastcmp(word2, "BLUE")) backcolor = 7; - else if (usi == 8 || fastcmp(word2, "PURPLE")) backcolor = 8; - else if (usi == 9 || fastcmp(word2, "MAGENTA")) backcolor = 9; - else if (usi == 10 || fastcmp(word2, "AQUA")) backcolor = 10; - else if (usi < 0) backcolor = UINT8_MAX; // CONS_BACKCOLOR user-configured + if (i == 0 || fastcmp(word2, "WHITE")) backcolor = 0; + else if (i == 1 || fastcmp(word2, "GRAY") || fastcmp(word2, "GREY")) backcolor = 1; + else if (i == 2 || fastcmp(word2, "BROWN")) backcolor = 2; + else if (i == 3 || fastcmp(word2, "RED")) backcolor = 3; + else if (i == 4 || fastcmp(word2, "ORANGE")) backcolor = 4; + else if (i == 5 || fastcmp(word2, "YELLOW")) backcolor = 5; + else if (i == 6 || fastcmp(word2, "GREEN")) backcolor = 6; + else if (i == 7 || fastcmp(word2, "BLUE")) backcolor = 7; + else if (i == 8 || fastcmp(word2, "PURPLE")) backcolor = 8; + else if (i == 9 || fastcmp(word2, "MAGENTA")) backcolor = 9; + else if (i == 10 || fastcmp(word2, "AQUA")) backcolor = 10; + else if (i < 0) backcolor = UINT8_MAX; // CONS_BACKCOLOR user-configured else backcolor = 11; // default green textprompts[num]->page[pagenum].backcolor = backcolor; } @@ -1685,7 +1685,7 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum) textprompts[num]->page[pagenum].verticalalign = align; } else if (fastcmp(word, "TEXTSPEED")) - textprompts[num]->page[pagenum].textspeed = min(max(0, usi), 15); + textprompts[num]->page[pagenum].textspeed = min(max(0, i), 15); else if (fastcmp(word, "TEXTSFX")) textprompts[num]->page[pagenum].textsfx = get_number(word2); else if (fastcmp(word, "METAPAGE")) diff --git a/src/f_finale.c b/src/f_finale.c index 8d578c61f..5f6d8ce42 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -2113,31 +2113,36 @@ void F_TextPromptDrawer(void) // reuse: // cutnum -> promptnum // scenenum -> pagenum - - if (!promptactive) - return; - - lumpnum_t iconlump = W_CheckNumForName(textprompts[cutnum]->page[scenenum].iconname); - UINT8 pagelines = textprompts[cutnum]->page[scenenum].lines ? textprompts[cutnum]->page[scenenum].lines : 4; - boolean rightside = (iconlump != LUMPERROR && textprompts[cutnum]->page[scenenum].rightside); - - // Vertical calculations - INT32 boxh = pagelines*2; - INT32 texth = textprompts[cutnum]->page[scenenum].name[0] ? (pagelines-1)*2 : pagelines*2; // name takes up first line if it exists - INT32 texty = BASEVIDHEIGHT - ((texth * 4) + (texth/2)*4); - INT32 namey = BASEVIDHEIGHT - ((boxh * 4) + (boxh/2)*4); - INT32 chevrony = BASEVIDHEIGHT - (((1*2) * 4) + ((1*2)/2)*4); // force on last line - - // Horizontal calculations - // Shift text to the right if we have a character icon on the left side - // Add 4 margin against icon - INT32 textx = (iconlump != LUMPERROR && !rightside) ? ((boxh * 4) + (boxh/2)*4) + 4 : 4; - INT32 textr = rightside ? BASEVIDWIDTH - (((boxh * 4) + (boxh/2)*4) + 4) : BASEVIDWIDTH-4; + lumpnum_t iconlump; + UINT8 pagelines; + boolean rightside; + INT32 boxh, texth, texty, namey, chevrony; + INT32 textx, textr; // Data patch_t *patch; char *text; + if (!promptactive) + return; + + iconlump = W_CheckNumForName(textprompts[cutnum]->page[scenenum].iconname); + pagelines = textprompts[cutnum]->page[scenenum].lines ? textprompts[cutnum]->page[scenenum].lines : 4; + rightside = (iconlump != LUMPERROR && textprompts[cutnum]->page[scenenum].rightside); + + // Vertical calculations + boxh = pagelines*2; + texth = textprompts[cutnum]->page[scenenum].name[0] ? (pagelines-1)*2 : pagelines*2; // name takes up first line if it exists + texty = BASEVIDHEIGHT - ((texth * 4) + (texth/2)*4); + namey = BASEVIDHEIGHT - ((boxh * 4) + (boxh/2)*4); + chevrony = BASEVIDHEIGHT - (((1*2) * 4) + ((1*2)/2)*4); // force on last line + + // Horizontal calculations + // Shift text to the right if we have a character icon on the left side + // Add 4 margin against icon + textx = (iconlump != LUMPERROR && !rightside) ? ((boxh * 4) + (boxh/2)*4) + 4 : 4; + textr = rightside ? BASEVIDWIDTH - (((boxh * 4) + (boxh/2)*4) + 4) : BASEVIDWIDTH-4; + // Draw background V_DrawTutorialBack(boxh); diff --git a/src/f_finale.h b/src/f_finale.h index 66b608e21..dfee247fb 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -17,6 +17,7 @@ #include "doomtype.h" #include "d_event.h" +#include "p_mobj.h" // // FINALE