]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/physics.qc
Add a mutator hook to indicate whether the physics HUD panel should be shown when...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / physics.qc
index a6c65183d4541cc0cb23c1cdf133e594fc3c1e0c..d45aea2c1109248b171c8ae0b316d4dc88aa3e3f 100644 (file)
@@ -4,11 +4,32 @@
 #include <client/defs.qh>
 #include <client/miscfunctions.qh>
 #include <client/main.qh>
+#include <common/gamemodes/_mod.qh>
 #include <common/mapinfo.qh>
 #include <lib/csqcmodel/cl_player.qh>
 
 // Physics (#15)
 
+void HUD_Physics_Export(int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_physics_speed_unit_show");
+       HUD_Write_Cvar("hud_panel_physics_speed_max");
+       HUD_Write_Cvar("hud_panel_physics_speed_vertical");
+       HUD_Write_Cvar("hud_panel_physics_topspeed");
+       HUD_Write_Cvar("hud_panel_physics_topspeed_time");
+       HUD_Write_Cvar("hud_panel_physics_acceleration_max");
+       HUD_Write_Cvar("hud_panel_physics_acceleration_vertical");
+       HUD_Write_Cvar("hud_panel_physics_flip");
+       HUD_Write_Cvar("hud_panel_physics_baralign");
+       HUD_Write_Cvar("hud_panel_physics_progressbar");
+       HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_mode");
+       HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_scale");
+       HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_nonlinear");
+       HUD_Write_Cvar("hud_panel_physics_text");
+       HUD_Write_Cvar("hud_panel_physics_text_scale");
+}
+
 vector acc_prevspeed;
 float acc_prevtime, acc_avg, top_speed, top_speed_time;
 float physics_update_time, discrete_speed, discrete_acceleration;
@@ -18,7 +39,7 @@ void HUD_Physics()
        {
                if(!autocvar_hud_panel_physics) return;
                if(spectatee_status == -1 && (autocvar_hud_panel_physics == 1 || autocvar_hud_panel_physics == 3)) return;
-               if(autocvar_hud_panel_physics == 3 && !(gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS)) return;
+               if(autocvar_hud_panel_physics == 3 && !MUTATOR_CALLHOOK(HUD_Physics_showoptional)) return;
        }
 
        HUD_Panel_LoadCvars();