Skip to content

Commit

Permalink
Doom: shift widgets one line down so chat typing line may appear (#949)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
JNechaevsky authored Oct 7, 2022
1 parent 7d7477f commit 35dc15e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/doom/hu_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 35dc15e

Please sign in to comment.