align secret revealed widget relative to view center

This commit is contained in:
Fabian Greffrath 2024-05-19 21:27:32 +02:00
parent fb488620b5
commit ea85a6993d
3 changed files with 6 additions and 1 deletions

View File

@ -261,6 +261,10 @@ static int vert_align_widget(const hu_widget_t *const w, const hu_multiline_t *c
{ {
return w->y; return w->y;
} }
else if (v_align == align_secret)
{
return MAX(SCREENHEIGHT - 32, scaledviewheight) / 2 - 32;
}
// [FG] centered and Vanilla widgets are always exclusive, // [FG] centered and Vanilla widgets are always exclusive,
// i.e. they don't allow any other widget on the same line // i.e. they don't allow any other widget on the same line
else if (h_align == align_center || m->exclusive) else if (h_align == align_center || m->exclusive)

View File

@ -68,6 +68,7 @@ typedef enum
// [FG] v_align // [FG] v_align
align_top, align_top,
align_bottom, align_bottom,
align_secret,
num_aligns, num_aligns,
} align_t; } align_t;

View File

@ -2060,7 +2060,7 @@ static void HU_ParseHUD (void)
HU_AddToWidgets(&w_title, hud, align_direct, align_bottom, 0, 0); HU_AddToWidgets(&w_title, hud, align_direct, align_bottom, 0, 0);
HU_AddToWidgets(&w_message, hud, align_direct, align_top, 0, 0); HU_AddToWidgets(&w_message, hud, align_direct, align_top, 0, 0);
HU_AddToWidgets(&w_chat, hud, align_direct, align_top, 0, 0); HU_AddToWidgets(&w_chat, hud, align_direct, align_top, 0, 0);
HU_AddToWidgets(&w_secret , hud, align_center, align_direct, 0, (SCREENHEIGHT - ST_HEIGHT) / 4); HU_AddToWidgets(&w_secret , hud, align_center, align_secret, 0, 0);
} }
if ((lumpnum = W_CheckNumForName("WOOFHUD")) == -1) if ((lumpnum = W_CheckNumForName("WOOFHUD")) == -1)