From: terencehill Date: Tue, 16 Aug 2016 09:54:46 +0000 (+0200) Subject: Display more panels (engineinfo, modicons and timer) while showing the scoreboard X-Git-Tag: xonotic-v0.8.2~674^2~16 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=efba688caaab0ef2c280daa8ec8032e6c0454eab;p=xonotic%2Fxonotic-data.pk3dir.git Display more panels (engineinfo, modicons and timer) while showing the scoreboard --- diff --git a/qcsrc/client/hud/hud.qc b/qcsrc/client/hud/hud.qc index c87e733e1..acd94ad86 100644 --- a/qcsrc/client/hud/hud.qc +++ b/qcsrc/client/hud/hud.qc @@ -492,11 +492,8 @@ void Hud_Dynamic_Frame() void HUD_Main() { int i; - // global hud alpha fade (scoreboard-related panels behave differently and override it temporarly) if(hud_configure_menu_open == 1) hud_fade_alpha = 1; - else if(!autocvar__hud_configure) - hud_fade_alpha = (1 - scoreboard_fade_alpha) * (1 - autocvar__menu_alpha); else hud_fade_alpha = 1 - autocvar__menu_alpha; @@ -504,27 +501,9 @@ void HUD_Main() Hud_Dynamic_Frame(); - // panels that we want to be active together with the scoreboard - // they must fade only when the menu does if(scoreboard_fade_alpha == 1) - { if(autocvar__menu_alpha == 1) return; - if(scoreboard_fade_alpha == 1) - { - HUD_Panel_Draw(HUD_PANEL(SCOREBOARD)); - HUD_Panel_Draw(HUD_PANEL(CENTERPRINT)); - return; - } - } - - if(!autocvar__hud_configure && !hud_fade_alpha) - { - hud_fade_alpha = 1; - HUD_Panel_Draw(HUD_PANEL(VOTE)); - hud_fade_alpha = 0; - return; - } // Drawing stuff if (hud_skin_prev != autocvar_hud_skin) diff --git a/qcsrc/client/hud/hud.qh b/qcsrc/client/hud/hud.qh index b269312d8..5171cb79e 100644 --- a/qcsrc/client/hud/hud.qh +++ b/qcsrc/client/hud/hud.qh @@ -22,14 +22,13 @@ REGISTER_REGISTRY(hud_panels) #define HUD_PANEL(NAME) HUD_PANEL_##NAME // draw the background/borders -#define HUD_Panel_DrawBg(theAlpha) MACRO_BEGIN { \ +#define HUD_Panel_DrawBg() MACRO_BEGIN { \ if(panel.current_panel_bg != "0" && panel.current_panel_bg != "") \ draw_BorderPicture( \ HUD_Shift(panel_pos - '1 1 0' * panel_bg_border), \ panel.current_panel_bg, \ HUD_Scale(panel_size + '1 1 0' * 2 * panel_bg_border), \ - panel_bg_color, \ - panel_bg_alpha * theAlpha, \ + panel_bg_color, panel_bg_alpha, \ HUD_Scale('1 1 0' * (panel_bg_border/BORDER_MULTIPLIER)) \ ); \ } MACRO_END @@ -366,7 +365,11 @@ REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, scoreboard, PANEL_CO } MACRO_END // NOTE: in hud_configure mode cvars must be reloaded every frame -#define HUD_Panel_UpdateCvars() MACRO_BEGIN { \ +float _panel_fade_alpha; +#define HUD_Panel_UpdateCvars(theAlpha) MACRO_BEGIN { \ + _panel_fade_alpha = theAlpha; \ + if(autocvar__hud_configure) \ + _panel_fade_alpha = 1; \ if (panel.update_time <= time) { \ if (autocvar__hud_configure) panel_enabled = cvar(strcat("hud_panel_", panel.panel_name)); \ panel_pos = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_pos"))); \ @@ -392,8 +395,8 @@ REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, scoreboard, PANEL_CO if (hud_configure_menu_open == 2 && panel == highlightedPanel) { \ HUD_Panel_UpdatePosSize_ForMenu(); \ } else { \ - panel_bg_alpha *= hud_fade_alpha; \ - panel_fg_alpha *= hud_fade_alpha; \ + panel_bg_alpha *= hud_fade_alpha * _panel_fade_alpha; \ + panel_fg_alpha *= hud_fade_alpha * _panel_fade_alpha; \ } \ panel.current_panel_pos = panel_pos; \ panel.current_panel_size = panel_size; \ @@ -405,12 +408,12 @@ REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, scoreboard, PANEL_CO } else { \ panel_pos = panel.current_panel_pos; \ panel_size = panel.current_panel_size; \ - panel_bg_alpha = panel.current_panel_bg_alpha * hud_fade_alpha; \ + panel_bg_alpha = panel.current_panel_bg_alpha * hud_fade_alpha * _panel_fade_alpha; \ panel_bg_border = panel.current_panel_bg_border; \ panel_bg_color = panel.current_panel_bg_color; \ panel_bg_color_team = panel.current_panel_bg_color_team; \ panel_bg_padding = panel.current_panel_bg_padding; \ - panel_fg_alpha = panel.current_panel_fg_alpha * hud_fade_alpha; \ + panel_fg_alpha = panel.current_panel_fg_alpha * hud_fade_alpha * _panel_fade_alpha; \ } \ } MACRO_END diff --git a/qcsrc/client/hud/panel/ammo.qc b/qcsrc/client/hud/panel/ammo.qc index bd3ccd068..27ba900f0 100644 --- a/qcsrc/client/hud/panel/ammo.qc +++ b/qcsrc/client/hud/panel/ammo.qc @@ -104,7 +104,9 @@ void HUD_Ammo() return; } - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); draw_beginBoldFont(); @@ -116,7 +118,7 @@ void HUD_Ammo() HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { pos += '1 1 0' * panel_bg_padding; diff --git a/qcsrc/client/hud/panel/centerprint.qc b/qcsrc/client/hud/panel/centerprint.qc index 9dd5f05ff..decbe8f2d 100644 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@ -154,14 +154,7 @@ void HUD_CenterPrint () } // this panel fades only when the menu does - float hud_fade_alpha_save = hud_fade_alpha; - if(hud_configure_menu_open == 1) - hud_fade_alpha = 1; - else - hud_fade_alpha = 1 - autocvar__menu_alpha; - - HUD_Panel_UpdateCvars(); - hud_fade_alpha = hud_fade_alpha_save; + HUD_Panel_UpdateCvars(1); // keep with the scoreboard if ( HUD_Radar_Clickable() ) { @@ -189,7 +182,7 @@ void HUD_CenterPrint () HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if (!centerprint_showing) return; diff --git a/qcsrc/client/hud/panel/chat.qc b/qcsrc/client/hud/panel/chat.qc index 5817142ae..270eeb87f 100644 --- a/qcsrc/client/hud/panel/chat.qc +++ b/qcsrc/client/hud/panel/chat.qc @@ -21,7 +21,7 @@ void HUD_Chat() } } - HUD_Panel_UpdateCvars(); + HUD_Panel_UpdateCvars(1); // can't be forced to fade with the scoreboard anyway if(intermission == 2) { @@ -56,7 +56,7 @@ void HUD_Chat() // chat messages don't scale properly since they are displayed directly by the engine HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { diff --git a/qcsrc/client/hud/panel/engineinfo.qc b/qcsrc/client/hud/panel/engineinfo.qc index 773c751d8..be5863a4c 100644 --- a/qcsrc/client/hud/panel/engineinfo.qc +++ b/qcsrc/client/hud/panel/engineinfo.qc @@ -18,7 +18,7 @@ void HUD_EngineInfo() if(!autocvar_hud_panel_engineinfo) return; } - HUD_Panel_UpdateCvars(); + HUD_Panel_UpdateCvars(1); vector pos, mySize; pos = panel_pos; mySize = panel_size; @@ -27,7 +27,7 @@ void HUD_EngineInfo() HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { pos += '1 1 0' * panel_bg_padding; diff --git a/qcsrc/client/hud/panel/healtharmor.qc b/qcsrc/client/hud/panel/healtharmor.qc index b56e390b3..54685aa14 100644 --- a/qcsrc/client/hud/panel/healtharmor.qc +++ b/qcsrc/client/hud/panel/healtharmor.qc @@ -56,7 +56,9 @@ void HUD_HealthArmor() fuel = 20; } - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); draw_beginBoldFont(); @@ -68,7 +70,7 @@ void HUD_HealthArmor() HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { pos += '1 1 0' * panel_bg_padding; diff --git a/qcsrc/client/hud/panel/infomessages.qc b/qcsrc/client/hud/panel/infomessages.qc index d341b6492..ebca95d17 100644 --- a/qcsrc/client/hud/panel/infomessages.qc +++ b/qcsrc/client/hud/panel/infomessages.qc @@ -60,7 +60,9 @@ void HUD_InfoMessages() if(!autocvar_hud_panel_infomessages) return; } - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); vector pos, mySize; pos = panel_pos; mySize = panel_size; @@ -69,7 +71,7 @@ void HUD_InfoMessages() HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { pos += '1 1 0' * panel_bg_padding; diff --git a/qcsrc/client/hud/panel/modicons.qc b/qcsrc/client/hud/panel/modicons.qc index 2c9948573..95009d2ed 100644 --- a/qcsrc/client/hud/panel/modicons.qc +++ b/qcsrc/client/hud/panel/modicons.qc @@ -758,9 +758,6 @@ void HUD_ModIcons() if(!HUD_ModIcons_GameType) return; } - HUD_Panel_UpdateCvars(); - - draw_beginBoldFont(); if(mod_active != mod_prev) { mod_change = time; @@ -772,12 +769,18 @@ void HUD_ModIcons() else mod_alpha = bound(0, 1 - (time - mod_change) * 2, 1); + //if(mod_alpha <= 0) + // return; + HUD_Panel_UpdateCvars(mod_alpha); + + draw_beginBoldFont(); + if (autocvar_hud_panel_modicons_dynamichud) HUD_Scale_Enable(); else HUD_Scale_Disable(); - if(mod_alpha) - HUD_Panel_DrawBg(mod_alpha); + + HUD_Panel_DrawBg(); if(panel_bg_padding) { diff --git a/qcsrc/client/hud/panel/notify.qc b/qcsrc/client/hud/panel/notify.qc index a5e923825..479800f90 100644 --- a/qcsrc/client/hud/panel/notify.qc +++ b/qcsrc/client/hud/panel/notify.qc @@ -47,12 +47,14 @@ void HUD_Notify() if (!autocvar_hud_panel_notify) return; - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); if (autocvar_hud_panel_notify_dynamichud) HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if (!autocvar__hud_configure) if (notify_count == 0) diff --git a/qcsrc/client/hud/panel/physics.qc b/qcsrc/client/hud/panel/physics.qc index 5fc8c1ca9..c28fd78a4 100644 --- a/qcsrc/client/hud/panel/physics.qc +++ b/qcsrc/client/hud/panel/physics.qc @@ -18,7 +18,9 @@ void HUD_Physics() if(autocvar_hud_panel_physics == 3 && !(gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS)) return; } - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); draw_beginBoldFont(); @@ -26,7 +28,7 @@ void HUD_Physics() HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { panel_pos += '1 1 0' * panel_bg_padding; diff --git a/qcsrc/client/hud/panel/powerups.qc b/qcsrc/client/hud/panel/powerups.qc index 7528c2ba2..dd4c0597e 100644 --- a/qcsrc/client/hud/panel/powerups.qc +++ b/qcsrc/client/hud/panel/powerups.qc @@ -109,12 +109,14 @@ void HUD_Powerups() return; // Draw panel background - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); if (autocvar_hud_panel_powerups_dynamichud) HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); // Set drawing area vector pos = panel_pos; diff --git a/qcsrc/client/hud/panel/pressedkeys.qc b/qcsrc/client/hud/panel/pressedkeys.qc index d0a4f39fd..e1fb8b474 100644 --- a/qcsrc/client/hud/panel/pressedkeys.qc +++ b/qcsrc/client/hud/panel/pressedkeys.qc @@ -8,7 +8,9 @@ void HUD_PressedKeys() if(spectatee_status <= 0 && autocvar_hud_panel_pressedkeys < 2) return; } - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); vector pos, mySize; pos = panel_pos; mySize = panel_size; @@ -17,7 +19,7 @@ void HUD_PressedKeys() HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { pos += '1 1 0' * panel_bg_padding; diff --git a/qcsrc/client/hud/panel/quickmenu.qc b/qcsrc/client/hud/panel/quickmenu.qc index b2d358884..ef08fdc60 100644 --- a/qcsrc/client/hud/panel/quickmenu.qc +++ b/qcsrc/client/hud/panel/quickmenu.qc @@ -503,7 +503,9 @@ void QuickMenu_Mouse() mousepos.y = bound(0, mousepos.y, vid_conheight); } - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); if(panel_bg_padding) { @@ -617,10 +619,12 @@ void HUD_QuickMenu() } } - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { diff --git a/qcsrc/client/hud/panel/racetimer.qc b/qcsrc/client/hud/panel/racetimer.qc index dd8bbdfec..f22f19846 100644 --- a/qcsrc/client/hud/panel/racetimer.qc +++ b/qcsrc/client/hud/panel/racetimer.qc @@ -83,7 +83,9 @@ void HUD_RaceTimer () if(spectatee_status == -1) return; } - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); vector pos, mySize; pos = panel_pos; @@ -93,7 +95,7 @@ void HUD_RaceTimer () HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { pos += '1 1 0' * panel_bg_padding; diff --git a/qcsrc/client/hud/panel/radar.qc b/qcsrc/client/hud/panel/radar.qc index e935d0cb2..9704f81c6 100644 --- a/qcsrc/client/hud/panel/radar.qc +++ b/qcsrc/client/hud/panel/radar.qc @@ -145,7 +145,9 @@ void HUD_Radar_Mouse() mousepos_y = bound(0, mousepos_y, vid_conheight); } - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); panel_size = autocvar_hud_panel_radar_maximized_size; @@ -197,7 +199,9 @@ void HUD_Radar() if ( hud_panel_radar_temp_hidden ) return; - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); float f = 0; @@ -284,7 +288,7 @@ void HUD_Radar() HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { pos += '1 1 0' * panel_bg_padding; diff --git a/qcsrc/client/hud/panel/score.qc b/qcsrc/client/hud/panel/score.qc index cd0d6fa32..2843b86f3 100644 --- a/qcsrc/client/hud/panel/score.qc +++ b/qcsrc/client/hud/panel/score.qc @@ -140,7 +140,9 @@ void HUD_Score() if(spectatee_status == -1 && (gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS)) return; } - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); vector pos, mySize; pos = panel_pos; mySize = panel_size; @@ -149,7 +151,7 @@ void HUD_Score() HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { pos += '1 1 0' * panel_bg_padding; diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 9e2acb09c..1357dfee5 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -935,7 +935,7 @@ vector Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_size) panel_pos = pos; panel_size.y = 1.25 * hud_fontsize.y * (1 + max(1, tm.team_size)); panel_size.y += panel_bg_padding * 2; - HUD_Panel_DrawBg(scoreboard_fade_alpha); + HUD_Panel_DrawBg(); vector end_pos = panel_pos + eY * (panel_size.y + hud_fontsize.y); if(panel.current_panel_bg != "0") @@ -1040,7 +1040,7 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size) panel_pos = pos; panel_size.y = height * rows; panel_size.y += panel_bg_padding * 2; - HUD_Panel_DrawBg(scoreboard_fade_alpha); + HUD_Panel_DrawBg(); vector end_pos = panel_pos + eY * (panel_size.y + hud_fontsize.y); if(panel.current_panel_bg != "0") @@ -1181,7 +1181,7 @@ vector Scoreboard_MapStats_Draw(vector pos, vector rgb, vector bg_size) { panel_pos = pos; panel_size.y = hud_fontsize.y * rows; panel_size.y += panel_bg_padding * 2; - HUD_Panel_DrawBg(scoreboard_fade_alpha); + HUD_Panel_DrawBg(); vector end_pos = panel_pos + eY * (panel_size.y + hud_fontsize.y); if(panel.current_panel_bg != "0") @@ -1240,7 +1240,7 @@ vector Scoreboard_Rankings_Draw(vector pos, entity pl, vector rgb, vector bg_siz panel_pos = pos; panel_size.y = 1.25 * hud_fontsize.y * RANKINGS_RECEIVED_CNT; panel_size.y += panel_bg_padding * 2; - HUD_Panel_DrawBg(scoreboard_fade_alpha); + HUD_Panel_DrawBg(); vector end_pos = panel_pos + eY * (panel_size.y + hud_fontsize.y); if(panel.current_panel_bg != "0") @@ -1315,12 +1315,9 @@ void Scoreboard_Draw() else HUD_Scale_Disable(); - float hud_fade_alpha_save = hud_fade_alpha; - if(hud_configure_menu_open == 1) - hud_fade_alpha = 1; - else - hud_fade_alpha = scoreboard_fade_alpha * (1 - autocvar__menu_alpha); - HUD_Panel_UpdateCvars(); + if(scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(scoreboard_fade_alpha); sbt_bg_alpha = autocvar_hud_panel_scoreboard_table_bg_alpha * panel_fg_alpha; sbt_highlight = autocvar_hud_panel_scoreboard_table_highlight; @@ -1329,8 +1326,6 @@ void Scoreboard_Draw() sbt_fg_alpha = autocvar_hud_panel_scoreboard_table_fg_alpha * panel_fg_alpha; sbt_fg_alpha_self = autocvar_hud_panel_scoreboard_table_fg_alpha_self * panel_fg_alpha; - hud_fade_alpha = hud_fade_alpha_save; - // don't overlap with con_notify if(!autocvar__hud_configure) panel_pos.y = max((autocvar_con_notify * autocvar_con_notifysize), panel_pos.y); diff --git a/qcsrc/client/hud/panel/timer.qc b/qcsrc/client/hud/panel/timer.qc index 5a7194a45..436a947e8 100644 --- a/qcsrc/client/hud/panel/timer.qc +++ b/qcsrc/client/hud/panel/timer.qc @@ -6,7 +6,7 @@ void HUD_Timer() if(!autocvar_hud_panel_timer) return; } - HUD_Panel_UpdateCvars(); + HUD_Panel_UpdateCvars(1); draw_beginBoldFont(); @@ -18,7 +18,7 @@ void HUD_Timer() HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { pos += '1 1 0' * panel_bg_padding; diff --git a/qcsrc/client/hud/panel/vote.qc b/qcsrc/client/hud/panel/vote.qc index a732b0c5e..e78cd2806 100644 --- a/qcsrc/client/hud/panel/vote.qc +++ b/qcsrc/client/hud/panel/vote.qc @@ -61,10 +61,10 @@ void HUD_Vote() else vote_alpha = bound(0, 1 - (time - vote_change) * 2, 1); - if(!vote_alpha) + a = vote_alpha * (vote_highlighted ? autocvar_hud_panel_vote_alreadyvoted_alpha : 1); + if(a <= 0) return; - - HUD_Panel_UpdateCvars(); + HUD_Panel_UpdateCvars(a); if(uid2name_dialog) { @@ -76,13 +76,11 @@ void HUD_Vote() pos = panel_pos; mySize = panel_size; - a = vote_alpha * (vote_highlighted ? autocvar_hud_panel_vote_alreadyvoted_alpha : 1); if (autocvar_hud_panel_vote_dynamichud) HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(a); - a = panel_fg_alpha * a; + HUD_Panel_DrawBg(); if(panel_bg_padding) { diff --git a/qcsrc/client/hud/panel/weapons.qc b/qcsrc/client/hud/panel/weapons.qc index fe2aefc60..c4481ad0c 100644 --- a/qcsrc/client/hud/panel/weapons.qc +++ b/qcsrc/client/hud/panel/weapons.qc @@ -81,7 +81,9 @@ void HUD_Weapons() } // update generic hud functions - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); // figure out weapon order (how the weapons are sorted) // TODO make this configurable if(weaponorder_bypriority != autocvar_cl_weaponpriority || !weaponorder[0]) @@ -152,7 +154,7 @@ void HUD_Weapons() if(autocvar__hud_configure) { if(hud_configure_menu_open != 2) - HUD_Panel_DrawBg(1); // also draw the bg of the entire panel + HUD_Panel_DrawBg(); // also draw the bg of the entire panel } // do we own this weapon? @@ -314,7 +316,7 @@ void HUD_Weapons() HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(center.x == -1) return; // panel has gone off screen diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 19c128a7d..141cb7ced 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -385,7 +385,9 @@ void MapVote_Draw() pos.y += hud_fontsize.y * 1.5; pos.y += hud_fontsize.y * 0.5; - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); // base for multi-column stuff... pos.y += hud_fontsize.y; @@ -440,7 +442,7 @@ void MapVote_Draw() panel_pos.y = pos.y; panel_size.x = xmax - xmin; panel_size.y = ymax - ymin; - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { diff --git a/qcsrc/common/minigames/cl_minigames_hud.qc b/qcsrc/common/minigames/cl_minigames_hud.qc index 90f1b2252..f0d51d8d0 100644 --- a/qcsrc/common/minigames/cl_minigames_hud.qc +++ b/qcsrc/common/minigames/cl_minigames_hud.qc @@ -35,7 +35,7 @@ void HUD_MinigameBoard () if ( !hud_minigame ) return; - HUD_Panel_UpdateCvars(); + HUD_Panel_UpdateCvars(1); vector pos, mySize; @@ -61,7 +61,7 @@ void HUD_MinigameStatus () if ( !hud_minigame ) return; - HUD_Panel_UpdateCvars(); + HUD_Panel_UpdateCvars(1); vector pos, mySize; @@ -429,7 +429,7 @@ void HUD_MinigameMenu_MouseInput() { panel = HUD_PANEL(MINIGAME_MENU); - HUD_Panel_UpdateCvars(); + HUD_Panel_UpdateCvars(1); if(panel_bg_padding) { @@ -475,10 +475,10 @@ void HUD_MinigameMenu () if ( !HUD_MinigameMenu_IsOpened() ) return; - HUD_Panel_UpdateCvars(); + HUD_Panel_UpdateCvars(1); HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { @@ -545,7 +545,7 @@ void HUD_MinigameHelp() if ( !help_message ) return; - HUD_Panel_UpdateCvars(); + HUD_Panel_UpdateCvars(1); vector pos, mySize; diff --git a/qcsrc/common/minigames/minigame/bd.qc b/qcsrc/common/minigames/minigame/bd.qc index 041e56339..e674a3705 100644 --- a/qcsrc/common/minigames/minigame/bd.qc +++ b/qcsrc/common/minigames/minigame/bd.qc @@ -854,7 +854,7 @@ void bd_hud_board(vector pos, vector mySize) // Required function, draw the game status panel void bd_hud_status(vector pos, vector mySize) { - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); vector ts; ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message, hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5); diff --git a/qcsrc/common/minigames/minigame/c4.qc b/qcsrc/common/minigames/minigame/c4.qc index 497ef2afc..e2ee86b13 100644 --- a/qcsrc/common/minigames/minigame/c4.qc +++ b/qcsrc/common/minigames/minigame/c4.qc @@ -322,7 +322,7 @@ void c4_hud_board(vector pos, vector mySize) // Required function, draw the game status panel void c4_hud_status(vector pos, vector mySize) { - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); vector ts; ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message, hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5); diff --git a/qcsrc/common/minigames/minigame/nmm.qc b/qcsrc/common/minigames/minigame/nmm.qc index 78fb30f1d..7ed5fe22f 100644 --- a/qcsrc/common/minigames/minigame/nmm.qc +++ b/qcsrc/common/minigames/minigame/nmm.qc @@ -496,9 +496,8 @@ void nmm_hud_board(vector pos, vector mySize) // Required function, draw the game status panel void nmm_hud_status(vector pos, vector mySize) { - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); vector ts; - ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message, hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5); pos_y += ts_y; diff --git a/qcsrc/common/minigames/minigame/pong.qc b/qcsrc/common/minigames/minigame/pong.qc index d535b8c85..fd12439d3 100644 --- a/qcsrc/common/minigames/minigame/pong.qc +++ b/qcsrc/common/minigames/minigame/pong.qc @@ -542,7 +542,7 @@ void pong_hud_board(vector pos, vector mySize) // Required function, draw the game status panel void pong_hud_status(vector pos, vector mySize) { - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); vector ts; ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message, hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5); diff --git a/qcsrc/common/minigames/minigame/pp.qc b/qcsrc/common/minigames/minigame/pp.qc index f9e0f79b9..d1cf447e4 100644 --- a/qcsrc/common/minigames/minigame/pp.qc +++ b/qcsrc/common/minigames/minigame/pp.qc @@ -374,7 +374,7 @@ void pp_hud_board(vector pos, vector mySize) // Required function, draw the game status panel void pp_hud_status(vector pos, vector mySize) { - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); vector ts; ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message, hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5); diff --git a/qcsrc/common/minigames/minigame/ps.qc b/qcsrc/common/minigames/minigame/ps.qc index c9ef8bd67..1912aabd6 100644 --- a/qcsrc/common/minigames/minigame/ps.qc +++ b/qcsrc/common/minigames/minigame/ps.qc @@ -429,7 +429,7 @@ void ps_hud_board(vector pos, vector mySize) // Required function, draw the game status panel void ps_hud_status(vector pos, vector mySize) { - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); vector ts; ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message, hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5); diff --git a/qcsrc/common/minigames/minigame/snake.qc b/qcsrc/common/minigames/minigame/snake.qc index 4248d589a..2c4cb74f5 100644 --- a/qcsrc/common/minigames/minigame/snake.qc +++ b/qcsrc/common/minigames/minigame/snake.qc @@ -673,7 +673,7 @@ void snake_hud_board(vector pos, vector mySize) // Required function, draw the game status panel void snake_hud_status(vector pos, vector mySize) { - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); vector ts; ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message, hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5); diff --git a/qcsrc/common/minigames/minigame/ttt.qc b/qcsrc/common/minigames/minigame/ttt.qc index 9c0ece163..cac117440 100644 --- a/qcsrc/common/minigames/minigame/ttt.qc +++ b/qcsrc/common/minigames/minigame/ttt.qc @@ -272,7 +272,7 @@ void ttt_hud_board(vector pos, vector mySize) // Required function, draw the game status panel void ttt_hud_status(vector pos, vector mySize) { - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); vector ts; ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message, hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5); diff --git a/qcsrc/common/mutators/mutator/itemstime.qc b/qcsrc/common/mutators/mutator/itemstime.qc index f47923d4e..1ec116f03 100644 --- a/qcsrc/common/mutators/mutator/itemstime.qc +++ b/qcsrc/common/mutators/mutator/itemstime.qc @@ -306,7 +306,9 @@ void HUD_ItemsTime() if (count == 0) return; - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); vector pos, mySize; pos = panel_pos; @@ -331,7 +333,7 @@ void HUD_ItemsTime() { if (autocvar__hud_configure) if (hud_configure_menu_open != 2) - HUD_Panel_DrawBg(1); // also draw the bg of the entire panel + HUD_Panel_DrawBg(); // also draw the bg of the entire panel // reduce panel to avoid spacing items if (itemstime_size.x / itemstime_size.y < ar) @@ -370,7 +372,7 @@ void HUD_ItemsTime() } HUD_Scale_Enable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); float row = 0, column = 0; bool item_available;