From 35dc15ec4175d8d46997276953604e24e053a2fa Mon Sep 17 00:00:00 2001 From: Julia Nechaevskaya Date: Fri, 7 Oct 2022 22:17:38 +0300 Subject: [PATCH] Doom: shift widgets one line down so chat typing line may appear (#949) * Doom: shift widgets one line down so chat typing line may appear * Shift coords down as well Notes: chat string may be long at take full width of the screen. Also, better variable naming. * Dynamically move widgets down while active chat line * Roll back, shift coords only in HU_Ticker * Corrections - Add back removed line break. - No shifting of time widget is needed if no stats widget is used. - Remove redundant automapstats check. --- src/doom/hu_stuff.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/doom/hu_stuff.c b/src/doom/hu_stuff.c index 190f98d60a..0bf095e9f2 100644 --- a/src/doom/hu_stuff.c +++ b/src/doom/hu_stuff.c @@ -1058,6 +1058,20 @@ void HU_Ticker(void) players[i].cmd.chatchar = 0; } } + // [crispy] shift widgets one line down so chat typing line may appear + if (crispy->automapstats != WIDGETS_STBAR) + { + const int chat_line = chat_on ? 8 : 0; + + w_kills.y = HU_MSGY + 1 * 8 + chat_line; + w_items.y = HU_MSGY + 2 * 8 + chat_line; + w_scrts.y = HU_MSGY + 3 * 8 + chat_line; + // [crispy] do not shift level time widget if no stats widget is used + w_ltime.y = HU_MSGY + 4 * 8 + (crispy->automapstats ? chat_line : 0); + w_coordx.y = HU_MSGY + 1 * 8 + chat_line; + w_coordy.y = HU_MSGY + 2 * 8 + chat_line; + w_coorda.y = HU_MSGY + 3 * 8 + chat_line; + } } if (automapactive) @@ -1096,6 +1110,7 @@ void HU_Ticker(void) { crispy_statsline_func_t crispy_statsline = crispy_statslines[crispy->statsformat]; + if (crispy->automapstats == WIDGETS_STBAR) w_kills.y = HU_MSGY + 1 * 8; crispy_statsline(str, sizeof(str), kills, plr->killcount, totalkills, extrakills);