]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
strafehud: the opacity of various different parts of the hud are now all configurable
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 29 Jun 2020 09:54:39 +0000 (11:54 +0200)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 29 Jun 2020 09:54:39 +0000 (11:54 +0200)
_hud_common.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud/panel/strafehud.qc

index 2848250aaf5efc8351855bfc6496657f61fbb367..0309a282db654edf5f0f88cb66e53e3dc2751de7 100644 (file)
@@ -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"
index 42608b20b3ccd20474da7a6a61af2388e7fc0604..d83ed8c6536b85887fe18a5fd4c02e7800a47c9b 100644 (file)
@@ -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';
index 346c2919fcd76e093e0392e9c59e41cc22191670..f6e5026c83a59bd1d4f16cbe2f42da7b3e658187 100644 (file)
@@ -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);
     }
 }