Stop HUD messages from ticking when game is paused

These are often synchronized to the world so should be treated as such.
This commit is contained in:
Boondorl 2025-06-07 14:10:11 -04:00 committed by Ricardo Luís Vaz Silva
commit bfefd2363e
3 changed files with 44 additions and 17 deletions

View file

@ -61,6 +61,9 @@
#include "texturemanager.h"
#include "v_draw.h"
extern int paused;
extern bool pauseext;
DVector2 AM_GetPosition();
int Net_GetLatency(int *ld, int *ad);
void PrintPickupMessage(bool localview, const FString &str);
@ -499,6 +502,23 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, RemoveForceField, RemoveForceField)
return 0;
}
int WorldPaused()
{
if (paused)
return true;
if (netgame || gamestate != GS_LEVEL)
return false;
return pauseext || menuactive == MENU_On || ConsoleState != c_up;
}
DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, WorldPaused, WorldPaused)
{
PARAM_PROLOGUE;
ACTION_RETURN_BOOL(WorldPaused());
}
static sector_t *PointInSectorXY(FLevelLocals *self, double x, double y)
{
return self->PointInSector(x ,y);