X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fphysics.qc;h=977dc797e2247fba66d4f7784ec6cefe5eca1f94;hb=126111bb9ef1d8979a6b76bcf464f6e19ea1168d;hp=f34bff3b8342e9e25a4b50183664d46d9849eb22;hpb=e1ffca1bb185fb2dc57c8e1ed043ef09e578863c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/physics.qc b/qcsrc/client/hud/panel/physics.qc index f34bff3b8..977dc797e 100644 --- a/qcsrc/client/hud/panel/physics.qc +++ b/qcsrc/client/hud/panel/physics.qc @@ -1,11 +1,30 @@ #include "physics.qh" -#include -#include +#include #include // 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; @@ -15,7 +34,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(); @@ -85,10 +104,10 @@ void HUD_Physics() const int acc_decimals = 2; if(time > physics_update_time) { + discrete_acceleration = acceleration; // workaround for ftos_decimals returning a negative 0 if(discrete_acceleration > -1 / (10 ** acc_decimals) && discrete_acceleration < 0) discrete_acceleration = 0; - discrete_acceleration = acceleration; discrete_speed = speed; physics_update_time += autocvar_hud_panel_physics_update_interval; if(physics_update_time < time)