]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
strafehud: make both switch indicator alphas configurable
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Wed, 1 Jul 2020 13:28:21 +0000 (15:28 +0200)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Wed, 1 Jul 2020 13:28:21 +0000 (15:28 +0200)
_hud_common.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud/panel/strafehud.qc
qcsrc/menu/xonotic/dialog_hudpanel_strafehud.qc

index 2d0d2bade377ed945d5aca433bafa51a2f273ced..b174a29242f0161e37f5b5f93b4864beca4fdafa 100644 (file)
@@ -142,8 +142,9 @@ seta hud_panel_strafehud_angle_accel_color "0 1 1" "color of the indicator showi
 seta hud_panel_strafehud_angle_overturn_color "1 0 1" "color of the indicator showing the player's current angle if the player's angle is within the overturn zone"
 seta hud_panel_strafehud_switch_minspeed "-1" "minimum speed in qu/s at which switch indicators which are used to aid changing strafe direction will be shown (uses physics maxspeed + antiflicker speed if negative)"
 seta hud_panel_strafehud_switch_active_color "0 1 0" "color of the switch indicator on the current side"
+seta hud_panel_strafehud_switch_active_alpha "1" "opacity of the switch indicator on the current side"
 seta hud_panel_strafehud_switch_inactive_color "1 1 0" "color of the switch indicator on the opposite side"
-seta hud_panel_strafehud_switch_alpha "1" "opacity of the switch indicators"
+seta hud_panel_strafehud_switch_inactive_alpha "1" "opacity of the switch indicator on the opposite side"
 seta hud_panel_strafehud_switch_width "0.0075" "width of the strafe angle indicators (relative to the strafe bar width)"
 seta hud_panel_strafehud_direction_color "0 0.5 1" "color of the direction caps which indicate the direction the player is currently strafing towards"
 seta hud_panel_strafehud_direction_alpha "1" "opacity of the direction caps which indicate the direction the player is currently strafing towards"
index 87c1aa21052ae0435d10b784d5da28ff1976bf02..63c2240458ed3816bbaf66ceb8c0bb27204d2728 100644 (file)
@@ -340,8 +340,9 @@ vector autocvar_hud_panel_strafehud_angle_accel_color = '0 1 1';
 vector autocvar_hud_panel_strafehud_angle_overturn_color = '1 0 1';
 float autocvar_hud_panel_strafehud_switch_minspeed = -1;
 vector autocvar_hud_panel_strafehud_switch_active_color = '0 1 0';
+float autocvar_hud_panel_strafehud_switch_active_alpha = 1;
 vector autocvar_hud_panel_strafehud_switch_inactive_color = '1 1 0';
-float autocvar_hud_panel_strafehud_switch_alpha = 1;
+float autocvar_hud_panel_strafehud_switch_inactive_alpha = 1;
 float autocvar_hud_panel_strafehud_switch_width = 0.0075;
 vector autocvar_hud_panel_strafehud_direction_color = '0 0.5 1';
 float autocvar_hud_panel_strafehud_direction_alpha = 1;
index 08831681c16aa6e56b4b8d1ab1ac607e57964b6c..63e2bb959256538b8ab34f7015b13df2b9e5e145 100644 (file)
@@ -567,14 +567,14 @@ void HUD_StrafeHUD()
             if(speed >= minspeed) // only draw indicators if minspeed is reached
             {
                 // draw best angles for acceleration
-                vector switch_color;
                 float offset = !odd_angles ? bestangle_offset : odd_bestangle_offset;
                 float switch_offset = !odd_angles ? switch_bestangle_offset : switch_odd_bestangle_offset;
-
                 // both indicators are inactive if no direction can be determined
-                switch_color = direction != 0 ? autocvar_hud_panel_strafehud_switch_active_color : autocvar_hud_panel_strafehud_switch_inactive_color;
-                HUD_Panel_DrawStrafeHUD(switch_offset, bestangle_width, autocvar_hud_panel_strafehud_switch_inactive_color, autocvar_hud_panel_strafehud_switch_alpha * panel_fg_alpha, 0);
-                HUD_Panel_DrawStrafeHUD(offset, bestangle_width, switch_color, autocvar_hud_panel_strafehud_switch_alpha * panel_fg_alpha, 0);
+                vector switch_color = direction != 0 ? autocvar_hud_panel_strafehud_switch_active_color : autocvar_hud_panel_strafehud_switch_inactive_color;
+                float switch_alpha = direction != 0 ? autocvar_hud_panel_strafehud_switch_active_alpha : autocvar_hud_panel_strafehud_switch_inactive_alpha;
+                // draw the switch indicators
+                HUD_Panel_DrawStrafeHUD(switch_offset, bestangle_width, autocvar_hud_panel_strafehud_switch_inactive_color, autocvar_hud_panel_strafehud_switch_inactive_alpha * panel_fg_alpha, 0);
+                HUD_Panel_DrawStrafeHUD(offset, bestangle_width, switch_color, switch_alpha * panel_fg_alpha, 0);
             }
         }
 
index d77e68246bc6e3b087a2f281f9cd18ba5d226a1c..3405a6c1fcc97e050a74e77c53fe8511f8817b83 100644 (file)
@@ -134,7 +134,9 @@ void XonoticHUDStrafeHUDDialog_fill(entity me)
         me.TD(me, 2, 1.9, e = makeXonoticColorpickerString("hud_panel_strafehud_direction_color", "hud_panel_strafehud_direction_color"));
     me.TR(me);
     me.TR(me);
-        me.TD(me, 1, 1.9, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_switch_alpha"));
+        me.TD(me, 1, 0.9, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_switch_active_alpha"));
+        me.TDempty(me, 0.1);
+        me.TD(me, 1, 0.9, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_switch_inactive_alpha"));
 
         me.TDempty(me, 0.2);