From 56b9c7d1cb60e7a6a077ab9bffb62f7e53f9e8ba Mon Sep 17 00:00:00 2001 From: otta8634 Date: Thu, 5 Dec 2024 09:46:06 +0800 Subject: [PATCH] Clean up some comments and cvar descriptions Some suggestions courtesy of @drjaska --- _hud_common.cfg | 2 +- _hud_descriptions.cfg | 8 ++++---- qcsrc/client/hud/panel/physics.qc | 24 ++++++++++++------------ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/_hud_common.cfg b/_hud_common.cfg index 344b4c0ff..865b7d9d8 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -111,7 +111,7 @@ seta hud_panel_physics_acceleration_movingaverage_strength "10" "weighting given seta hud_panel_physics_acceleration_max_slick "-1" "acceleration progressbar gets completely filled up by this value (in g) while on slick, -1 = same as the normal max" seta hud_panel_physics_update_interval "0.015625" "how often (in seconds) numeric values get updated on screen" seta hud_panel_physics_jumpspeed "0" "also show jump speed, replacing the speed unit text (NOTE: ignores vertical speed)" -seta hud_panel_physics_jumpspeed_time "1" "how many seconds the jump speed takes to fade out" +seta hud_panel_physics_jumpspeed_time "1" "how many seconds the jumpspeed text takes to fade out" seta hud_panel_physics_force_layout "0" "1 = force speed and acceleration to be side-by-side, 2 = force them to be above one another" seta hud_panel_itemstime_progressbar_maxtime "30" "when left time is at least this amount, the status bar is full" diff --git a/_hud_descriptions.cfg b/_hud_descriptions.cfg index 4d825891f..a9ab0c89b 100644 --- a/_hud_descriptions.cfg +++ b/_hud_descriptions.cfg @@ -252,15 +252,15 @@ seta hud_panel_physics_progressbar "" "enable progressbar in panel (2 = only for seta hud_panel_physics_acceleration_max "" "acceleration progressbar gets completely filled up by this value (in g)" seta hud_panel_physics_acceleration_progressbar_mode "" "0 = progressbar increases from the center to the right if the acceleration is positive, to the left if it's negative; 1 = progressbar increases from the border in the same direction for both positive and negative accelerations" seta hud_panel_physics_acceleration_progressbar_scale "" "multiply acceleration progressbar values by this factor (allow progressbar to go out of panel bounds)" -seta hud_panel_physics_acceleration_progressbar_nonlinear "" "use a non linear function to display acceleration progressbar values (amplify more smaller values)" +seta hud_panel_physics_acceleration_progressbar_nonlinear "" "use a nonlinear function to display acceleration progressbar values (amplifies smaller values)" seta hud_panel_physics_acceleration_vertical "" "include the acceleration on the Z-axis" seta hud_panel_physics_text "" "show text in panel (2 = only for speed; 3 = only for acceleration)" seta hud_panel_physics_text_scale "" "scale text height by this factor" -seta hud_panel_physics_speed_unit_show "" "also show speed unit (NOTE: overriden if both topspeed and jumpspeed are shown)" +seta hud_panel_physics_speed_unit_show "" "also show speed unit (NOTE: overridden if both topspeed and jumpspeed text are shown)" seta hud_panel_physics_speed_max "" "speed progressbar gets filled up completely by this value (in qu/s)" -seta hud_panel_physics_speed_vertical "" "include the speed on the Z-axis (NOTE: doesn't impact jumpspeed)" +seta hud_panel_physics_speed_vertical "" "include the speed on the Z-axis (NOTE: doesn't affect jumpspeed text)" seta hud_panel_physics_topspeed "" "also show top speed" -seta hud_panel_physics_topspeed_time "" "how many seconds the top speed takes to fade out" +seta hud_panel_physics_topspeed_time "" "how many seconds the topspeed text takes to fade out" seta hud_panel_centerprint_pos "" "position of this base of the panel" seta hud_panel_centerprint_size "" "size of this panel" diff --git a/qcsrc/client/hud/panel/physics.qc b/qcsrc/client/hud/panel/physics.qc index a82175809..7b2823662 100644 --- a/qcsrc/client/hud/panel/physics.qc +++ b/qcsrc/client/hud/panel/physics.qc @@ -32,7 +32,7 @@ void HUD_Physics_Export(int fh) vector acc_prev_vel; float acc_prev_time, acc_avg, top_speed, top_speed_time, jump_speed, jump_speed_time; float prev_vel_z = 0, prev_speed2d = 0; -float physics_update_time, discrete_speed, discrete_top_speed, discrete_accel; // not done for jump speed +float physics_update_time, discrete_speed, discrete_top_speed, discrete_accel; // not done for jumpspeed void HUD_Physics() { if (!autocvar__hud_configure) @@ -154,9 +154,9 @@ void HUD_Physics() vector tmp_offset = '0 0 0', tmp_size = '0 0 0'; float speed_size = 0.75; - int text_bits = BITS(0); // describes which texts may be drawn. BIT(0) = top speed, BIT(1) = jump speed, BIT(2) = speed unit + int text_bits = BITS(0); // describes which texts may be drawn. BIT(0) = topspeed, BIT(1) = jumpspeed, BIT(2) = speed unit // ordered by decreasing priority -- speed unit isn't drawn if the other two are, - // ... and top speed takes priority over jump speed in the lower spot + // ... and topspeed takes priority over jumpspeed in the lower spot // draw speed if (!immobile) @@ -164,7 +164,7 @@ void HUD_Physics() HUD_Panel_DrawProgressBar(panel_pos + speed_offset, panel_size, "progressbar", speed / max_speed, 0, speed_baralign, autocvar_hud_progressbar_speed_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); - // compute jump speed text + // compute jumpspeed text float jump_speed_f = 0; if (autocvar_hud_panel_physics_jumpspeed) if (autocvar_hud_panel_physics_text == PHYSICS_TEXT_BOTH || autocvar_hud_panel_physics_text == PHYSICS_TEXT_SPEED) @@ -190,7 +190,7 @@ void HUD_Physics() } } - // compute and draw top speed + // compute and draw topspeed float top_speed_f = 0; if (autocvar_hud_panel_physics_topspeed) if (autocvar_hud_panel_physics_text == PHYSICS_TEXT_BOTH || autocvar_hud_panel_physics_text == PHYSICS_TEXT_SPEED) @@ -208,7 +208,7 @@ void HUD_Physics() top_speed = speed; top_speed_time = time; } - if (top_speed == 0) // hide top speed 0 + if (top_speed == 0) // hide topspeed 0 top_speed_f = 0; else { @@ -216,7 +216,7 @@ void HUD_Physics() top_speed_f = time_frac > 1 ? 0 : cos(time_frac * PI / 2); } } - // top speed progressbar peak + // topspeed progressbar peak if (top_speed_f > 0) { if (speed < top_speed) @@ -353,14 +353,14 @@ void HUD_Physics() top_speed_y = panel_size.y * (1 - main_text_size) / 2; // offset halved to center text jump_speed_y = top_speed_y; } - else // both top speed and jump speed are drawn + else // both topspeed and jumpspeed are drawn { main_text_size = 0.5; // make them equal size - top_speed_y = panel_size.y * (1 - main_text_size); // put top speed in the lower slot - jump_speed_y = 0; // put jump speed in the upper slot + top_speed_y = panel_size.y * (1 - main_text_size); // put topspeed in the lower slot + jump_speed_y = 0; // put jumpspeed in the upper slot } - // draw jump speed text + // draw jumpspeed text tmp_size.y = panel_size.y * main_text_size * text_scale; if ((text_bits & BIT(1)) && jump_speed_f > 0) { @@ -368,7 +368,7 @@ void HUD_Physics() tmp_offset.y = jump_speed_y; drawstring_aspect(panel_pos + speed_offset + tmp_offset, ftos(jump_speed), tmp_size, '0 1 0', jump_speed_f * panel_fg_alpha, DRAWFLAG_NORMAL); } - // draw top speed text + // draw topspeed text if ((text_bits & BIT(0)) && top_speed_f > 0) { top_speed_y += (panel_size.y * main_text_size - tmp_size.y) / 2; -- 2.39.2