]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/strafehud.qc
added an option to put the hud angle in the middle during hud configure
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / strafehud.qc
index 0ad0c29a2911ec125204697a413b048b9ef11f5a..3f553c3515ac3a47bced92d8b7b1325b9b54e7bf 100644 (file)
@@ -300,17 +300,26 @@ void HUD_StrafeHUD()
         }
         else // simulate turning for HUD setup
         {
-            if(autocvar__hud_panel_strafehud_demo && ((time - strafehud_demo_time) >= .025))
+            if(autocvar__hud_panel_strafehud_center)
             {
-                strafehud_demo_time = time;
-                strafehud_demo_angle += 1 * strafehud_demo_direction;
-                if(fabs(strafehud_demo_angle) >= 55)
+                strafehud_angle = strafehud_demo_angle = 0;
+                strafehud_demo_time = 0;
+                strafehud_wishangle = 0;
+            }
+            else
+            {
+                if(autocvar__hud_panel_strafehud_demo && ((time - strafehud_demo_time) >= .025))
                 {
-                    strafehud_demo_direction = -strafehud_demo_direction;
+                    strafehud_demo_time = time;
+                    strafehud_demo_angle += strafehud_demo_direction;
+                    if(fabs(strafehud_demo_angle) >= 55)
+                    {
+                        strafehud_demo_direction = -strafehud_demo_direction;
+                    }
                 }
+                strafehud_angle = strafehud_demo_angle;
+                strafehud_wishangle = 45 * (strafehud_demo_angle > 0 ? 1 : -1);
             }
-            strafehud_angle = strafehud_demo_angle;
-            strafehud_wishangle = 45 * (strafehud_demo_angle > 0 ? 1 : -1);
         }
 
         if (autocvar_v_flipped)