Text prompt Hide HUD dehacked

This commit is contained in:
mazmazz 2018-11-09 23:26:41 -05:00
parent 9ee894f777
commit 7ac641450f
4 changed files with 21 additions and 0 deletions

View file

@ -1701,6 +1701,14 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum)
textprompts[num]->page[pagenum].textspeed = get_number(word2); textprompts[num]->page[pagenum].textspeed = get_number(word2);
else if (fastcmp(word, "TEXTSFX")) else if (fastcmp(word, "TEXTSFX"))
textprompts[num]->page[pagenum].textsfx = get_number(word2); 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")) else if (fastcmp(word, "METAPAGE"))
{ {
if (usi && usi <= textprompts[num]->numpages) 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].verticalalign = textprompts[num]->page[metapagenum].verticalalign;
textprompts[num]->page[pagenum].textspeed = textprompts[num]->page[metapagenum].textspeed; textprompts[num]->page[pagenum].textspeed = textprompts[num]->page[metapagenum].textspeed;
textprompts[num]->page[pagenum].textsfx = textprompts[num]->page[metapagenum].textsfx; 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")) else if (fastcmp(word, "NEXTPROMPT"))
@ -1781,6 +1790,7 @@ static void readtextprompt(MYFILE *f, INT32 num)
if (1 <= value && value <= MAX_PAGES) if (1 <= value && value <= MAX_PAGES)
{ {
textprompts[num]->page[value - 1].backcolor = 1; // default to gray 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); readtextpromptpage(f, num, value - 1);
} }
else else

View file

@ -175,6 +175,7 @@ typedef struct
char iconname[8]; // narrator icon lump char iconname[8]; // narrator icon lump
boolean rightside; // narrator side, false = left, true = right boolean rightside; // narrator side, false = left, true = right
boolean iconflip; // narrator flip icon horizontally 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. 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) INT32 backcolor; // see CON_SetupBackColormap: 0-11, INT32_MAX for user-defined (CONS_BACKCOLOR)
UINT8 align; // text alignment, 0 = left, 1 = right, 2 = center UINT8 align; // text alignment, 0 = left, 1 = right, 2 = center

View file

@ -33,6 +33,7 @@
#include "m_cond.h" #include "m_cond.h"
#include "p_local.h" #include "p_local.h"
#include "p_setup.h" #include "p_setup.h"
#include "st_stuff.h" // hud hiding
#ifdef HAVE_BLUA #ifdef HAVE_BLUA
#include "lua_hud.h" #include "lua_hud.h"
@ -2030,6 +2031,14 @@ boolean F_CutsceneResponder(event_t *event)
// TEXT PROMPTS // 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) static void F_GetPageTextGeometry(UINT8 *pagelines, boolean *rightside, INT32 *boxh, INT32 *texth, INT32 *texty, INT32 *namey, INT32 *chevrony, INT32 *textx, INT32 *textr)
{ {
// reuse: // reuse:

View file

@ -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_StartTextPrompt(INT32 promptnum, INT32 pagenum, mobj_t *mo, UINT16 postexectag, boolean blockcontrols, boolean freezerealtime);
void F_TextPromptDrawer(void); void F_TextPromptDrawer(void);
void F_EndTextPrompt(boolean forceexec, boolean noexec); void F_EndTextPrompt(boolean forceexec, boolean noexec);
INT32 F_GetPromptHideHud(void);
void F_StartGameEnd(void); void F_StartGameEnd(void);
void F_StartIntro(void); void F_StartIntro(void);