From 0e5cbf515429d0f2c0ca3324d566edfb986094d7 Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 22 Jul 2011 16:46:49 +0200 Subject: [PATCH] Draw the highlight on top of the foremost panel after all the panels have been drawn rather than in the macro HUD_Panel_DrawBg to prevent weapons panel in onlyowned mode to display 2 highlights --- qcsrc/client/hud.qc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 0a7130cc1..38de30ed2 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -427,11 +427,7 @@ HUD panels // draw the background/borders #define HUD_Panel_DrawBg(alpha)\ if(panel_bg != "0")\ - draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * alpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER));\ -if(highlightedPanel == hud_configure_active_panel && autocvar__hud_configure)\ -{\ - HUD_Panel_HlBorder(panel_bg_border + 1.5 * hlBorderSize, '0 0.5 1', 0.25 * (1 - autocvar__menu_alpha) * alpha);\ -} ENDS_WITH_CURLY_BRACE + draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * alpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER)) //basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, float vertical, float baralign, vector theColor, float theAlpha, float drawflag) @@ -4746,10 +4742,18 @@ void HUD_Main (void) if (autocvar__hud_configure && spectatee_status && hud_configure_prev == -1) // try to join if we are in hud_configure mode, but still spectating, and in the first frame (in order to get rid of motd when launching a server via the menu "HUD Setup" button) localcmd("cmd selectteam auto; cmd join\n"); - if(autocvar__hud_configure && tab_panel != -1) + if(autocvar__hud_configure) { - HUD_Panel_UpdatePosSizeForId(tab_panel) - drawfill(panel_pos - '1 1 0' * panel_bg_border, panel_size + '2 2 0' * panel_bg_border, '1 1 1', .2, DRAWFLAG_NORMAL); + if(tab_panel != -1) + { + HUD_Panel_UpdatePosSizeForId(tab_panel) + drawfill(panel_pos - '1 1 0' * panel_bg_border, panel_size + '2 2 0' * panel_bg_border, '1 1 1', .2, DRAWFLAG_NORMAL); + } + if(highlightedPanel != -1) + { + HUD_Panel_UpdatePosSizeForId(highlightedPanel); + HUD_Panel_HlBorder(panel_bg_border + 1.5 * hlBorderSize, '0 0.5 1', 0.25 * (1 - autocvar__menu_alpha)); + } } hud_configure_prev = autocvar__hud_configure; -- 2.39.2