From 86bb7b9f9648709dadf86c7cdb25ee1e7f83e8a5 Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Wed, 18 Jan 2023 16:13:37 +0100 Subject: [PATCH] Add patch from Juhu/strafehud-features branch: "strafehud: add vertical angle indicator" --- _hud_common.cfg | 3 +++ qcsrc/client/hud/panel/strafehud.qc | 13 +++++++++++++ qcsrc/client/hud/panel/strafehud.qh | 3 +++ 3 files changed, 19 insertions(+) diff --git a/_hud_common.cfg b/_hud_common.cfg index c914ef4c3..b85631d80 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -213,6 +213,9 @@ seta hud_panel_strafehud_sonar_volume_start "0.333333" "sound volume of the stra seta hud_panel_strafehud_sonar_volume_range "0.666666" "dynamic volume range of the strafe sonar as you approach the optimal angle" seta hud_panel_strafehud_sonar_pitch_start "0.9" "playback speed of the strafe sonar" seta hud_panel_strafehud_sonar_pitch_range "0.1" "dynamic playback speed range of the strafe sonar as you approach the optimal angle" +seta hud_panel_strafehud_vangle "0" "set to \"1\" to enable the vertical angle indicator" +seta hud_panel_strafehud_vangle_color "0.75 0.75 0.75" "color of the vertical angle text" +seta hud_panel_strafehud_vangle_size "1" "size of the vertical angle text (relative to the panel height)" // hud panel aliases alias quickmenu "cl_cmd hud quickmenu ${* ?}" diff --git a/qcsrc/client/hud/panel/strafehud.qc b/qcsrc/client/hud/panel/strafehud.qc index 544632413..cf2e36cb3 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -969,6 +969,19 @@ void HUD_StrafeHUD() text_offset_top = max(angle_offset_top, text_offset_top); text_offset_bottom = max(angle_offset_bottom, text_offset_bottom); + // vertical angle for weapon jumps + { + if(autocvar_hud_panel_strafehud_vangle) + { + float vangle = -PHYS_INPUT_ANGLES(strafeplayer).x; + float vangle_height = autocvar_hud_panel_strafehud_vangle_size * panel_size.y; + string vangle_text = strcat(ftos_decimals(vangle, 2), "°"); + + if(StrafeHUD_drawTextIndicator(vangle_text, vangle_height, autocvar_hud_panel_strafehud_vangle_color, 1, time, text_offset_bottom, STRAFEHUD_TEXT_BOTTOM)) + text_offset_bottom += vangle_height; + } + } + draw_beginBoldFont(); // show speed when crossing the start trigger diff --git a/qcsrc/client/hud/panel/strafehud.qh b/qcsrc/client/hud/panel/strafehud.qh index 303d97d93..295fa83a8 100644 --- a/qcsrc/client/hud/panel/strafehud.qh +++ b/qcsrc/client/hud/panel/strafehud.qh @@ -68,6 +68,9 @@ AUTOCVAR_SAVE(hud_panel_strafehud_sonar_volume_start, float, 0.333333, "sound vo AUTOCVAR_SAVE(hud_panel_strafehud_sonar_volume_range, float, 0.666666, "dynamic volume range of the strafe sonar as you approach the optimal angle"); AUTOCVAR_SAVE(hud_panel_strafehud_sonar_pitch_start, float, 0.9, "playback speed of the strafe sonar"); AUTOCVAR_SAVE(hud_panel_strafehud_sonar_pitch_range, float, 0.1, "dynamic playback speed range of the strafe sonar as you approach the optimal angle"); +AUTOCVAR_SAVE(hud_panel_strafehud_vangle, bool, false, "set to \"1\" to enable the vertical angle indicator"); +AUTOCVAR_SAVE(hud_panel_strafehud_vangle_color, vector, '0.75 0.75 0.75', "color of the vertical angle text"); +AUTOCVAR_SAVE(hud_panel_strafehud_vangle_size, float, 1, "size of the vertical angle text (relative to the panel height)"); void HUD_Panel_DrawStrafeHUD(float, float, float, vector, float, int, int); vector StrafeHUD_mixColors(vector, vector, float); -- 2.39.2