Fix sbardef strict mode regressions (#2023)

* Fix coords strict mode regression

* Fix command history strict mode regression
This commit is contained in:
ceski 2024-11-13 19:50:28 -08:00 committed by GitHub
parent fbb026b3b1
commit 66f66ee40f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 5 deletions

View File

@ -272,7 +272,6 @@ void HU_BuildCommandHistory(sbe_widget_t *widget)
{
hud_cmd_item_t *hud_cmd = current;
ST_ClearLines(widget);
for (int i = 0; i < hud_command_history_size; i++)
{
ST_AddLine(widget, hud_cmd->buf);

View File

@ -184,8 +184,6 @@ void HU_BuildCoordinatesEx(sbe_widget_t *widget, const mobj_t *mo)
double magnitude;
crange_idx_e color;
ST_ClearLines(widget);
widget->font = widget->default_font;
#define LINE_SIZE 60

View File

@ -662,14 +662,19 @@ static void ForceDoomFont(sbe_widget_t *widget)
static void UpdateCoord(sbe_widget_t *widget, player_t *player)
{
ST_ClearLines(widget);
if (strictmode)
{
return;
}
if (hud_player_coords == HUD_WIDGET_ADVANCED)
{
HU_BuildCoordinatesEx(widget, player->mo);
return;
}
ST_ClearLines(widget);
if (!WidgetEnabled(hud_player_coords))
{
return;
@ -981,6 +986,13 @@ static void UpdateSpeed(sbe_widget_t *widget, player_t *player)
static void UpdateCmd(sbe_widget_t *widget)
{
ST_ClearLines(widget);
if (!STRICTMODE(hud_command_history))
{
return;
}
HU_BuildCommandHistory(widget);
}