From 7ac641450f07d25bd9fa8660562cdadcfe9bc346 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Fri, 9 Nov 2018 23:26:41 -0500 Subject: [PATCH] Text prompt Hide HUD dehacked --- src/dehacked.c | 10 ++++++++++ src/doomstat.h | 1 + src/f_finale.c | 9 +++++++++ src/f_finale.h | 1 + 4 files changed, 21 insertions(+) diff --git a/src/dehacked.c b/src/dehacked.c index 9130c3e40..0fc3f905a 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1701,6 +1701,14 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum) textprompts[num]->page[pagenum].textspeed = get_number(word2); else if (fastcmp(word, "TEXTSFX")) textprompts[num]->page[pagenum].textsfx = get_number(word2); + else if (fastcmp(word, "HIDEHUD")) + { + UINT8 hidehud = 0; + if (usi == 0 || (word2[0] == 'F' && (word2[1] == 'A' || !word2[1])) || word2[0] == 'N') hidehud = 1; // false + else if (usi == 1 || word2[0] == 'T' || word2[0] == 'Y') hidehud = 1; // true (hide appropriate HUD elements) + else if (usi == 2 || word2[0] == 'A' || (word2[0] == 'F' && word2[1] == 'O')) hidehud = 2; // force (hide all HUD elements) + textprompts[num]->page[pagenum].hidehud = hidehud; + } else if (fastcmp(word, "METAPAGE")) { if (usi && usi <= textprompts[num]->numpages) @@ -1716,6 +1724,7 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum) textprompts[num]->page[pagenum].verticalalign = textprompts[num]->page[metapagenum].verticalalign; textprompts[num]->page[pagenum].textspeed = textprompts[num]->page[metapagenum].textspeed; textprompts[num]->page[pagenum].textsfx = textprompts[num]->page[metapagenum].textsfx; + textprompts[num]->page[pagenum].hidehud = textprompts[num]->page[metapagenum].hidehud; } } else if (fastcmp(word, "NEXTPROMPT")) @@ -1781,6 +1790,7 @@ static void readtextprompt(MYFILE *f, INT32 num) if (1 <= value && value <= MAX_PAGES) { textprompts[num]->page[value - 1].backcolor = 1; // default to gray + textprompts[num]->page[value - 1].hidehud = 1; // hide appropriate HUD elements readtextpromptpage(f, num, value - 1); } else diff --git a/src/doomstat.h b/src/doomstat.h index 6ff32e95d..a46711cc4 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -175,6 +175,7 @@ typedef struct char iconname[8]; // narrator icon lump boolean rightside; // narrator side, false = left, true = right boolean iconflip; // narrator flip icon horizontally + UINT8 hidehud; // hide hud, 0 = show all, 1 = hide depending on prompt position (top/bottom), 2 = hide all UINT8 lines; // # of lines to show. If name is specified, name takes one of the lines. If 0, defaults to 4. INT32 backcolor; // see CON_SetupBackColormap: 0-11, INT32_MAX for user-defined (CONS_BACKCOLOR) UINT8 align; // text alignment, 0 = left, 1 = right, 2 = center diff --git a/src/f_finale.c b/src/f_finale.c index ad9fd26ce..aec567123 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -33,6 +33,7 @@ #include "m_cond.h" #include "p_local.h" #include "p_setup.h" +#include "st_stuff.h" // hud hiding #ifdef HAVE_BLUA #include "lua_hud.h" @@ -2030,6 +2031,14 @@ boolean F_CutsceneResponder(event_t *event) // TEXT PROMPTS // ================== +INT32 F_GetPromptHideHud() +{ + if (cutnum == INT32_MAX || scenenum == INT32_MAX || !textprompts[cutnum] || scenenum >= textprompts[cutnum]->numpages) + return 0; + else + return textprompts[cutnum]->page[scenenum]->hidehud; +} + static void F_GetPageTextGeometry(UINT8 *pagelines, boolean *rightside, INT32 *boxh, INT32 *texth, INT32 *texty, INT32 *namey, INT32 *chevrony, INT32 *textx, INT32 *textr) { // reuse: diff --git a/src/f_finale.h b/src/f_finale.h index 8ce7ac22e..a6c962dea 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -55,6 +55,7 @@ void F_EndCutScene(void); void F_StartTextPrompt(INT32 promptnum, INT32 pagenum, mobj_t *mo, UINT16 postexectag, boolean blockcontrols, boolean freezerealtime); void F_TextPromptDrawer(void); void F_EndTextPrompt(boolean forceexec, boolean noexec); +INT32 F_GetPromptHideHud(void); void F_StartGameEnd(void); void F_StartIntro(void);