From 980d59c9be772e7addee3718329a2b4e67960e66 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 27 Feb 2025 19:37:29 +0100 Subject: [PATCH] color ping numbers for color hud --- src/hu_stuff.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 11e304ac5..b59f52070 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2356,21 +2356,38 @@ Ping_gfx_num (int lag) return 4; } +static int +Ping_gfx_color (int lag) +{ + if (lag < 2) + return SKINCOLOR_JAWZ; + else if (lag < 4) + return SKINCOLOR_MINT; + else if (lag < 7) + return SKINCOLOR_GOLD; + else if (lag < 10) + return SKINCOLOR_RED; + else + return SKINCOLOR_WHITE; // SKINCOLOR_MAGENTA +} + static const UINT8 * Ping_gfx_colormap (UINT32 lag, boolean gentleman) { const UINT8 *colormap = NULL; - if (gentleman) - { - colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PASTEL, GTC_CACHE); - } + if (K_UseColorHud()) + colormap = R_GetTranslationColormap(TC_RAINBOW, Ping_gfx_color(lag), GTC_CACHE); if (servermaxping && lag > servermaxping && hu_tick < 4) { // flash ping red if too high colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_RASPBERRY, GTC_CACHE); } + else if (gentleman) + { + colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PASTEL, GTC_CACHE); + } return colormap; }