Menus/Controls: draw tooltip at bottom of the screen

This commit is contained in:
James R 2024-02-17 20:39:23 -08:00
parent ea2fffb79d
commit 535bda8b88

View file

@ -4795,6 +4795,8 @@ void M_DrawProfileControls(void)
INT32 x = 8;
INT32 i, j, k;
const UINT8 pid = 0;
patch_t *hint = W_CachePatchName("MENUHINT", PU_CACHE);
INT32 hintofs = 3;
V_DrawScaledPatch(BASEVIDWIDTH*2/3 - optionsmenu.contx, BASEVIDHEIGHT/2 -optionsmenu.conty, 0, W_CachePatchName("PR_CONT", PU_CACHE));
@ -4826,16 +4828,16 @@ void M_DrawProfileControls(void)
return; // Don't draw the rest if we're trying the controller.
}
// Tooltip
// The text is slightly shifted hence why we don't just use M_DrawMenuTooltips()
V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("MENUHINT", PU_CACHE), NULL);
if (currentMenu->menuitems[itemOn].tooltip != NULL)
{
V_DrawCenteredThinString(229, 12, 0, currentMenu->menuitems[itemOn].tooltip);
}
V_DrawFill(0, 0, 138, 200, 31); // Black border
V_SetClipRect(
0,
0,
BASEVIDWIDTH * FRACUNIT,
(BASEVIDHEIGHT - SHORT(hint->height) + hintofs) * FRACUNIT,
0
);
// Draw the menu options...
for (i = 0; i < currentMenu->numitems; i++)
{
@ -5015,6 +5017,20 @@ void M_DrawProfileControls(void)
}
}
V_ClearClipRect();
// Tooltip
// Draw it at the bottom of the screen
{
static UINT8 blue[256];
blue[31] = 253;
V_DrawMappedPatch(0, BASEVIDHEIGHT + hintofs, V_VFLIP, hint, blue);
}
if (currentMenu->menuitems[itemOn].tooltip != NULL)
{
V_DrawCenteredThinString(BASEVIDWIDTH/2, BASEVIDHEIGHT + hintofs - 9 - 12, 0, currentMenu->menuitems[itemOn].tooltip);
}
// Overlay for control binding
if (optionsmenu.bindcontrol)
{