]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
strafehud: direction caps can now be customized even more
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Tue, 23 Jun 2020 03:41:01 +0000 (05:41 +0200)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Tue, 23 Jun 2020 03:41:01 +0000 (05:41 +0200)
_hud_common.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud/panel/strafehud.qc

index 91d2d3030c5bf9e965c9f62c859c1d6f35f2cc39..37be5ca364f39df28a6c658f1cf022b11e730721 100644 (file)
@@ -132,16 +132,17 @@ 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"
 seta hud_panel_strafehud_indicator_minspeed "-1" "minimum speed in qu/s at which strafe angle indicators will be shown, uses physics maxspeed + antiflicker if negative"
-seta hud_panel_strafehud_indicator_width "0.01" "width of the strafe angle indicators"
+seta hud_panel_strafehud_indicator_width "0.01" "width of the strafe angle indicators relative to the strafe bar width"
 seta hud_panel_strafehud_angle "0" "the maximum angle displayed on the strafehud, \"0\" = dynamic"
 seta hud_panel_strafehud_good_color "0 1 1" "indicator color of the actual strafe angle if the angle matches the ideal angle"
 seta hud_panel_strafehud_warning_color "1 1 0" "indicator color of the actual strafe angle if the angle doesn't match the ideal angle"
 seta hud_panel_strafehud_alert_color "1 0 1" "indicator color of the actual strafe angle if the angle has a critical value"
 seta hud_panel_strafehud_angle_alpha "0.8" "indicator transparency of the actual strafe angle"
-seta hud_panel_strafehud_angle_height "1.5" "indicator height of the actual strafe angle"
-seta hud_panel_strafehud_angle_width "0.005" "indicator width of the actual strafe angle"
+seta hud_panel_strafehud_angle_height "1.5" "indicator height of the actual strafe angle relative to the strafe bar height"
+seta hud_panel_strafehud_angle_width "0.005" "indicator width of the actual strafe angle relative to the strafe bar width"
 seta hud_panel_strafehud_direction_color "0 0.5 1" "direction indicator color"
-seta hud_panel_strafehud_direction_width "0.0075" "direction indicator width"
+seta hud_panel_strafehud_direction_width "0.27" "direction indicator width relative to the panel height"
+seta hud_panel_strafehud_direction_length "0.0225" "direction indicator length relative to the panel width"
 seta hud_panel_strafehud_timeout_air "0" "time after take off before changing strafehud mode (prevents flickering on slick ramps)"
 seta hud_panel_strafehud_timeout_ground "0.03333333" "time after landing before changing strafehud mode (prevents flickering on regular strafe turns)"
 seta hud_panel_strafehud_timeout_strafe "0.1" "time after releasing the strafe keys before changing mode (prevents flickering when switching between left/right strafe turning)"
index a8d46ff5454c4f94f7b02a77e46a215b7e02e93d..cf97f8b42eac0006c9f452b75cc340d3da30f52f 100644 (file)
@@ -339,7 +339,8 @@ float autocvar_hud_panel_strafehud_angle_alpha = 0.8;
 float autocvar_hud_panel_strafehud_angle_height = 1.5;
 float autocvar_hud_panel_strafehud_angle_width = 0.005;
 vector autocvar_hud_panel_strafehud_direction_color = '0 0.5 1';
-float autocvar_hud_panel_strafehud_direction_width = 0.0075;
+float autocvar_hud_panel_strafehud_direction_width = 0.27;
+float autocvar_hud_panel_strafehud_direction_length = 0.0225;
 float autocvar_hud_panel_strafehud_timeout_air = 0;
 float autocvar_hud_panel_strafehud_timeout_ground = 0.03333333;
 float autocvar_hud_panel_strafehud_timeout_strafe = 0.1;
index b394bab82b1c9c1e0c6c3a178018668d25c59b87..890cc265135593cb09fdfce6d6db8d8a1ce76c9c 100644 (file)
@@ -436,8 +436,7 @@ void HUD_StrafeHUD()
         // how much is hidden by the current hud angle
         hidden_width = (360 - hudangle) / hudangle * panel_size.x;
         // current angle
-        currentangle_size.x = panel_size.x * autocvar_hud_panel_strafehud_angle_width;
-        if(currentangle_size.x < 1) currentangle_size.x = 1;
+        currentangle_size.x = max(panel_size.x * autocvar_hud_panel_strafehud_angle_width, 1);
         if(mode == 0)
         {
             currentangle_offset = angle/hudangle * panel_size.x;
@@ -446,15 +445,13 @@ void HUD_StrafeHUD()
         {
             currentangle_offset = bound(-hudangle/2, angle, hudangle/2)/hudangle * panel_size.x + panel_size.x/2;
         }
-        currentangle_size.y = panel_size.y * autocvar_hud_panel_strafehud_angle_height;
-        if(currentangle_size.y < 1) currentangle_size.y = 1;
+        currentangle_size.y = max(panel_size.y * autocvar_hud_panel_strafehud_angle_height, 1);
         // best strafe acceleration angle
         bestangle_offset        =  bestangle/hudangle * panel_size.x + panel_size.x/2;
         switch_bestangle_offset = -bestangle/hudangle * panel_size.x + panel_size.x/2;
         if(show_indicators)
         {
-            bestangle_width = panel_size.x * autocvar_hud_panel_strafehud_indicator_width;
-            if(bestangle_width < 1) bestangle_width = 1;
+            bestangle_width = max(panel_size.x * autocvar_hud_panel_strafehud_indicator_width, 1);
         }
         else
         {
@@ -470,10 +467,9 @@ void HUD_StrafeHUD()
             switch_bestangle_offset -= bestangle_width;
         }
         // direction indicator
-        direction_size_vertical.x = panel_size.x * autocvar_hud_panel_strafehud_direction_width;
-        if(direction_size_vertical.x < 1) direction_size_vertical.x = 1;
+        direction_size_vertical.x = max(panel_size.y * min(autocvar_hud_panel_strafehud_direction_width, .5), 1);
         direction_size_vertical.y = panel_size.y;
-        direction_size_horizontal.x = direction_size_vertical.x * 3;
+        direction_size_horizontal.x = max(panel_size.x * min(autocvar_hud_panel_strafehud_direction_length, .5), direction_size_vertical.x);
         direction_size_horizontal.y = direction_size_vertical.x;
         // overturn
         overturn_width = 180/hudangle * panel_size.x;