From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Mon, 29 Jun 2020 09:54:39 +0000 (+0200) Subject: strafehud: the opacity of various different parts of the hud are now all configurable X-Git-Tag: xonotic-v0.8.5~738^2~28 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1b3413b76056704da7d9d79db06a56d211314e87;p=xonotic%2Fxonotic-data.pk3dir.git strafehud: the opacity of various different parts of the hud are now all configurable --- diff --git a/_hud_common.cfg b/_hud_common.cfg index 2848250aa..0309a282d 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -126,8 +126,10 @@ seta hud_panel_scoreboard_team_size_position 0 "where to show the team size (0 = seta _hud_panel_strafehud_demo "0" "strafehud changes angle during configure" seta hud_panel_strafehud_mode "0" "strafehud mode which controls whether the strafehud is centered at: \"0\" = view angle, \"1\" = velocity direction" -seta hud_panel_strafehud_bar_alpha "0.3" "opacity of the strafe meter" seta hud_panel_strafehud_bar_color "1 1 1" "color of the strafe meter" +seta hud_panel_strafehud_bar_alpha "0.3" "opacity of the strafe meter background" +seta hud_panel_strafehud_acceleration_alpha "0.3" "opacity of the strafe meter acceleration zone" +seta hud_panel_strafehud_overturn_alpha "0.3" "opacity of the strafe meter overturn area" seta hud_panel_strafehud_indicators "1" "show the strafe indicators" seta hud_panel_strafehud_indicator_color "0 1 0" "color of the strafe angle indicator" seta hud_panel_strafehud_indicator_switch_color "1 1 0" "color of the strafe angle indicator on the opposite side" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 42608b20b..d83ed8c65 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -324,8 +324,10 @@ bool autocvar_hud_panel_score_rankings; int autocvar_hud_panel_strafehud = 3; bool autocvar__hud_panel_strafehud_demo = false; int autocvar_hud_panel_strafehud_mode = 0; -float autocvar_hud_panel_strafehud_bar_alpha = 0.3; vector autocvar_hud_panel_strafehud_bar_color = '1 1 1'; +float autocvar_hud_panel_strafehud_bar_alpha = 0.3; +float autocvar_hud_panel_strafehud_acceleration_alpha = 0.3; +float autocvar_hud_panel_strafehud_overturn_alpha = 0.3; bool autocvar_hud_panel_strafehud_indicators = true; vector autocvar_hud_panel_strafehud_indicator_color = '0 1 0'; vector autocvar_hud_panel_strafehud_indicator_switch_color = '1 1 0'; diff --git a/qcsrc/client/hud/panel/strafehud.qc b/qcsrc/client/hud/panel/strafehud.qc index 346c2919f..f6e5026c8 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -539,16 +539,16 @@ void HUD_StrafeHUD() } // draw acceleration zone - HUD_Panel_DrawStrafeHUD(accelzone_offset, accelzone_width, autocvar_hud_panel_strafehud_indicator_color, autocvar_hud_panel_strafehud_bar_alpha, autocvar_hud_panel_strafehud_style); + HUD_Panel_DrawStrafeHUD(accelzone_offset, accelzone_width, autocvar_hud_panel_strafehud_indicator_color, autocvar_hud_panel_strafehud_acceleration_alpha * panel_fg_alpha, autocvar_hud_panel_strafehud_style); // draw odd acceleration zone - HUD_Panel_DrawStrafeHUD(odd_accelzone_offset, odd_accelzone_width, autocvar_hud_panel_strafehud_indicator_color, autocvar_hud_panel_strafehud_bar_alpha, autocvar_hud_panel_strafehud_style); + HUD_Panel_DrawStrafeHUD(odd_accelzone_offset, odd_accelzone_width, autocvar_hud_panel_strafehud_indicator_color, autocvar_hud_panel_strafehud_acceleration_alpha * panel_fg_alpha, autocvar_hud_panel_strafehud_style); // draw overturn area - HUD_Panel_DrawStrafeHUD(overturn_offset, overturn_width, autocvar_hud_panel_strafehud_alert_color, autocvar_hud_panel_strafehud_bar_alpha, autocvar_hud_panel_strafehud_style); + HUD_Panel_DrawStrafeHUD(overturn_offset, overturn_width, autocvar_hud_panel_strafehud_alert_color, autocvar_hud_panel_strafehud_overturn_alpha * panel_fg_alpha, autocvar_hud_panel_strafehud_style); // draw the strafe bar background - HUD_Panel_DrawStrafeHUD(bar_offset, bar_width, autocvar_hud_panel_strafehud_bar_color, autocvar_hud_panel_strafehud_bar_alpha, autocvar_hud_panel_strafehud_style); + HUD_Panel_DrawStrafeHUD(bar_offset, bar_width, autocvar_hud_panel_strafehud_bar_color, autocvar_hud_panel_strafehud_bar_alpha * panel_fg_alpha, autocvar_hud_panel_strafehud_style); if(autocvar_hud_panel_strafehud_direction_show && direction != 0) { @@ -576,8 +576,8 @@ void HUD_StrafeHUD() float switch_offset = !odd_angles ? switch_bestangle_offset : switch_odd_bestangle_offset; // both indicators are yellow if no direction can be determined indicator_color = direction != 0 ? autocvar_hud_panel_strafehud_indicator_color : autocvar_hud_panel_strafehud_indicator_switch_color; - HUD_Panel_DrawStrafeHUD(switch_offset, bestangle_width, autocvar_hud_panel_strafehud_indicator_switch_color, 1, 0); - HUD_Panel_DrawStrafeHUD(offset, bestangle_width, indicator_color, 1, 0); + HUD_Panel_DrawStrafeHUD(switch_offset, bestangle_width, autocvar_hud_panel_strafehud_indicator_switch_color, panel_fg_alpha, 0); + HUD_Panel_DrawStrafeHUD(offset, bestangle_width, indicator_color, panel_fg_alpha, 0); } } @@ -651,12 +651,12 @@ void HUD_Panel_DrawStrafeHUD(float offset, float width, vector color, float alph { default: case 0: - if(mirror_width > 0) drawfill(panel_pos + eX * mirror_offset, mirror_size, color, alpha * panel_fg_alpha, DRAWFLAG_NORMAL); - if(width > 0) drawfill(panel_pos + eX * offset, size, color, alpha * panel_fg_alpha, DRAWFLAG_NORMAL); + if(mirror_width > 0) drawfill(panel_pos + eX * mirror_offset, mirror_size, color, alpha, DRAWFLAG_NORMAL); + if(width > 0) drawfill(panel_pos + eX * offset, size, color, alpha, DRAWFLAG_NORMAL); break; case 1: - if(mirror_size.x > 0 && mirror_size.y > 0) HUD_Panel_DrawProgressBar(panel_pos + eX * mirror_offset, mirror_size, "progressbar", 1, 0, 0, color, alpha * panel_fg_alpha, DRAWFLAG_NORMAL); - if(size.x > 0 && size.y > 0) HUD_Panel_DrawProgressBar(panel_pos + eX * offset, size, "progressbar", 1, 0, 0, color, alpha * panel_fg_alpha, DRAWFLAG_NORMAL); + if(mirror_size.x > 0 && mirror_size.y > 0) HUD_Panel_DrawProgressBar(panel_pos + eX * mirror_offset, mirror_size, "progressbar", 1, 0, 0, color, alpha, DRAWFLAG_NORMAL); + if(size.x > 0 && size.y > 0) HUD_Panel_DrawProgressBar(panel_pos + eX * offset, size, "progressbar", 1, 0, 0, color, alpha, DRAWFLAG_NORMAL); } }