From 774b2bef632fc2de15350c9f906751517a3b1fc7 Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Wed, 1 Jul 2020 04:28:28 +0200 Subject: [PATCH] strafehud: mass renaming of cvars + some new cvars and adjusted hud dialog --- _hud_common.cfg | 58 ++++++------- qcsrc/client/autocvars.qh | 34 ++++---- qcsrc/client/hud/panel/strafehud.qc | 50 ++++++------ .../menu/xonotic/dialog_hudpanel_strafehud.qc | 81 ++++++++++++------- .../menu/xonotic/dialog_hudpanel_strafehud.qh | 2 +- 5 files changed, 126 insertions(+), 99 deletions(-) diff --git a/_hud_common.cfg b/_hud_common.cfg index 0309a282d..2d0d2bade 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -125,34 +125,36 @@ seta hud_panel_scoreboard_accuracy_showdelay_minpos 0.75 "delay displaying the a seta hud_panel_scoreboard_team_size_position 0 "where to show the team size (0 = do not show, 1 = left of scoreboard, 2 = right of scoreboard), will move team scores to the other side if necessary" seta _hud_panel_strafehud_demo "0" "strafehud changes angle during configure" -seta hud_panel_strafehud_mode "0" "strafehud mode which controls whether the strafehud is centered at: \"0\" = view angle, \"1\" = velocity direction" -seta hud_panel_strafehud_bar_color "1 1 1" "color of the strafe meter" -seta hud_panel_strafehud_bar_alpha "0.3" "opacity of the strafe meter background" -seta hud_panel_strafehud_acceleration_alpha "0.3" "opacity of the strafe meter acceleration zone" -seta hud_panel_strafehud_overturn_alpha "0.3" "opacity of the strafe meter overturn area" -seta hud_panel_strafehud_indicators "1" "show the strafe indicators" -seta hud_panel_strafehud_indicator_color "0 1 0" "color of the strafe angle indicator" -seta hud_panel_strafehud_indicator_switch_color "1 1 0" "color of the strafe angle indicator on the opposite side" -seta hud_panel_strafehud_indicator_minspeed "-1" "minimum speed in qu/s at which strafe angle indicators will be shown, uses physics maxspeed + antiflicker if negative" -seta hud_panel_strafehud_indicator_width "0.0075" "width of the strafe angle indicators relative to the strafe bar width" -seta hud_panel_strafehud_angle "0" "the maximum angle displayed on the strafehud, \"0\" = dynamic" -seta hud_panel_strafehud_angle_alpha "0.8" "indicator transparency of the actual strafe angle" -seta hud_panel_strafehud_angle_height "1.5" "indicator height of the actual strafe angle relative to the strafe bar height" -seta hud_panel_strafehud_angle_width "0.005" "indicator width of the actual strafe angle relative to the strafe bar width" -seta hud_panel_strafehud_good_color "0 1 1" "indicator color of the actual strafe angle if the angle matches the ideal angle" -seta hud_panel_strafehud_warning_color "1 1 0" "indicator color of the actual strafe angle if the angle doesn't match the ideal angle" -seta hud_panel_strafehud_alert_color "1 0 1" "indicator color of the actual strafe angle if the angle has a critical value" -seta hud_panel_strafehud_direction_show "1" "show the direction indicator caps" -seta hud_panel_strafehud_direction_color "0 0.5 1" "direction indicator color" -seta hud_panel_strafehud_direction_width "0.25" "direction indicator width relative to the panel height" -seta hud_panel_strafehud_direction_length "0.02" "direction indicator length relative to the panel width" -seta hud_panel_strafehud_style "1" "\"0\" = no styling, \"1\" = progress bar style for the strafe bar" -seta hud_panel_strafehud_timeout_air "0.1" "time after take off before changing strafehud mode (prevents flickering on slick ramps)" -seta hud_panel_strafehud_timeout_ground "0.03333333" "time after landing before changing strafehud mode (prevents flickering on regular strafe turns)" -seta hud_panel_strafehud_timeout_strafe "0.1" "time after releasing the strafe keys before changing mode (prevents flickering when switching between left/right strafe turning)" -seta hud_panel_strafehud_timeout_direction "0.5" "time it takes until direction changes (forward or backward movement) are detected" -seta hud_panel_strafehud_antiflicker_angle "0.01" "how many degrees from 0° to 180° the hud ignores if it could cause visual disturbances otherwise" -seta hud_panel_strafehud_antiflicker_speed "0.0001" "how many qu/s the hud ignores if it could cause visual disturbances otherwise" +seta hud_panel_strafehud_mode "0" "strafehud mode which controls whether the strafehud is centered at \"0\" = view angle, \"1\" = velocity angle" +seta hud_panel_strafehud_range "0" "the angle range up to 360 degrees displayed on the strafehud, \"0\" = dynamic (chooses the minimum range required to still see the whole area needed for accelerating at once)" +seta hud_panel_strafehud_style "1" "\"0\" = no styling, \"1\" = progress bar style for the strafe zones on the strafe bar" +seta hud_panel_strafehud_bar_neutral_color "1 1 1" "color of the strafe meter neutral zone" +seta hud_panel_strafehud_bar_neutral_alpha "0.3" "opacity of the strafe meter neutral zone" +seta hud_panel_strafehud_bar_accel_color "0 1 0" "color of the strafe meter acceleration zone" +seta hud_panel_strafehud_bar_accel_alpha "0.3" "opacity of the strafe meter acceleration zone" +seta hud_panel_strafehud_bar_overturn_color "1 0 1" "color of the strafe meter overturn zone" +seta hud_panel_strafehud_bar_overturn_alpha "0.3" "opacity of the strafe meter overturn zone" +seta hud_panel_strafehud_angle_alpha "0.8" "opacity of the indicator showing the player's current angle" +seta hud_panel_strafehud_angle_height "1.5" "height of the indicator showing the player's current angle (relative to the panel height)" +seta hud_panel_strafehud_angle_width "0.005" "width of the indicator showing the player's current angle (relative to the panel width)" +seta hud_panel_strafehud_angle_neutral_color "1 1 0" "color of the indicator showing the player's current angle if the player's angle is within the neutral zone" +seta hud_panel_strafehud_angle_accel_color "0 1 1" "color of the indicator showing the player's current angle if the player's angle is within the acceleration zone" +seta hud_panel_strafehud_angle_overturn_color "1 0 1" "color of the indicator showing the player's current angle if the player's angle is within the overturn zone" +seta hud_panel_strafehud_switch_minspeed "-1" "minimum speed in qu/s at which switch indicators which are used to aid changing strafe direction will be shown (uses physics maxspeed + antiflicker speed if negative)" +seta hud_panel_strafehud_switch_active_color "0 1 0" "color of the switch indicator on the current side" +seta hud_panel_strafehud_switch_inactive_color "1 1 0" "color of the switch indicator on the opposite side" +seta hud_panel_strafehud_switch_alpha "1" "opacity of the switch indicators" +seta hud_panel_strafehud_switch_width "0.0075" "width of the strafe angle indicators (relative to the strafe bar width)" +seta hud_panel_strafehud_direction_color "0 0.5 1" "color of the direction caps which indicate the direction the player is currently strafing towards" +seta hud_panel_strafehud_direction_alpha "1" "opacity of the direction caps which indicate the direction the player is currently strafing towards" +seta hud_panel_strafehud_direction_width "0.25" "stroke width of the direction caps which indicate the direction the player is currently strafing towards (relative to the panel height)" +seta hud_panel_strafehud_direction_length "0.02" "length of the horizontal component of the direction caps which indicate the direction the player is currently strafing towards (relative to the panel width)" +seta hud_panel_strafehud_timeout_air "0.1" "time after take off before changing to air strafe physics when not jumping (visually more consistent hud while on slick downwards ramps)" +seta hud_panel_strafehud_timeout_ground "0.03333333" "time after landing before changing to non-air strafe physics (visually more consistent hud while strafe turning when touching the floor after every hop)" +seta hud_panel_strafehud_timeout_turn "0.1" "time after releasing the strafe keys before changing mode (visually more consistent hud while switching between left/right strafe turning)" +seta hud_panel_strafehud_timeout_direction "0.5" "time it takes until direction changes (forward or backward movement) are applied" +seta hud_panel_strafehud_antiflicker_angle "0.01" "how many degrees from 0° to 180° the hud ignores if it could cause visual disturbances otherwise (and to counter rounding errors)" +seta hud_panel_strafehud_antiflicker_speed "0.0001" "how many qu/s the hud ignores if it could cause visual disturbances otherwise (and to counter rounding errors)" // hud panel aliases alias quickmenu "cl_cmd hud quickmenu ${* ?}" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index d83ed8c65..87c1aa210 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -324,30 +324,32 @@ bool autocvar_hud_panel_score_rankings; int autocvar_hud_panel_strafehud = 3; bool autocvar__hud_panel_strafehud_demo = false; int autocvar_hud_panel_strafehud_mode = 0; -vector autocvar_hud_panel_strafehud_bar_color = '1 1 1'; -float autocvar_hud_panel_strafehud_bar_alpha = 0.3; -float autocvar_hud_panel_strafehud_acceleration_alpha = 0.3; -float autocvar_hud_panel_strafehud_overturn_alpha = 0.3; -bool autocvar_hud_panel_strafehud_indicators = true; -vector autocvar_hud_panel_strafehud_indicator_color = '0 1 0'; -vector autocvar_hud_panel_strafehud_indicator_switch_color = '1 1 0'; -float autocvar_hud_panel_strafehud_indicator_minspeed = -1; -float autocvar_hud_panel_strafehud_indicator_width = 0.0075; -float autocvar_hud_panel_strafehud_angle = 0; +float autocvar_hud_panel_strafehud_range = 0; +int autocvar_hud_panel_strafehud_style = 1; +vector autocvar_hud_panel_strafehud_bar_neutral_color = '1 1 1'; +float autocvar_hud_panel_strafehud_bar_neutral_alpha = 0.3; +vector autocvar_hud_panel_strafehud_bar_accel_color = '0 1 1'; +float autocvar_hud_panel_strafehud_bar_accel_alpha = 0.3; +vector autocvar_hud_panel_strafehud_bar_overturn_color = '1 0 1'; +float autocvar_hud_panel_strafehud_bar_overturn_alpha = 0.3; float autocvar_hud_panel_strafehud_angle_alpha = 0.8; float autocvar_hud_panel_strafehud_angle_height = 1.5; float autocvar_hud_panel_strafehud_angle_width = 0.005; -vector autocvar_hud_panel_strafehud_good_color = '0 1 1'; -vector autocvar_hud_panel_strafehud_warning_color = '1 1 0'; -vector autocvar_hud_panel_strafehud_alert_color = '1 0 1'; -bool autocvar_hud_panel_strafehud_direction_show = true; +vector autocvar_hud_panel_strafehud_angle_neutral_color = '1 1 0'; +vector autocvar_hud_panel_strafehud_angle_accel_color = '0 1 1'; +vector autocvar_hud_panel_strafehud_angle_overturn_color = '1 0 1'; +float autocvar_hud_panel_strafehud_switch_minspeed = -1; +vector autocvar_hud_panel_strafehud_switch_active_color = '0 1 0'; +vector autocvar_hud_panel_strafehud_switch_inactive_color = '1 1 0'; +float autocvar_hud_panel_strafehud_switch_alpha = 1; +float autocvar_hud_panel_strafehud_switch_width = 0.0075; vector autocvar_hud_panel_strafehud_direction_color = '0 0.5 1'; +float autocvar_hud_panel_strafehud_direction_alpha = 1; float autocvar_hud_panel_strafehud_direction_width = 0.25; float autocvar_hud_panel_strafehud_direction_length = 0.02; -int autocvar_hud_panel_strafehud_style = 1; float autocvar_hud_panel_strafehud_timeout_air = 0.1; float autocvar_hud_panel_strafehud_timeout_ground = 0.03333333; -float autocvar_hud_panel_strafehud_timeout_strafe = 0.1; +float autocvar_hud_panel_strafehud_timeout_turn = 0.1; float autocvar_hud_panel_strafehud_timeout_direction = 0.5; float autocvar_hud_panel_strafehud_antiflicker_angle = 0.01; float autocvar_hud_panel_strafehud_antiflicker_speed = 0.0001; diff --git a/qcsrc/client/hud/panel/strafehud.qc b/qcsrc/client/hud/panel/strafehud.qc index f6e5026c8..cb9472061 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -111,7 +111,7 @@ void HUD_StrafeHUD() float hudangle; float bar_offset; float bar_width; - vector currentangle_color = autocvar_hud_panel_strafehud_warning_color; + vector currentangle_color = autocvar_hud_panel_strafehud_angle_neutral_color; float currentangle_offset; vector currentangle_size = '0 0 0'; bool show_indicators; @@ -235,7 +235,7 @@ void HUD_StrafeHUD() range_minangle = 90 - range_minangle; // calculate value which is never >90 or <45 range_minangle *= 2; // multiply to accommodate for both sides of the hud - if(autocvar_hud_panel_strafehud_angle == 0) + if(autocvar_hud_panel_strafehud_range == 0) { if(autocvar__hud_configure) { @@ -248,7 +248,7 @@ void HUD_StrafeHUD() } else { - hudangle = bound(0, fabs(autocvar_hud_panel_strafehud_angle), 360); // limit HUD range to 360 degrees, higher values don't make sense + hudangle = bound(0, fabs(autocvar_hud_panel_strafehud_range), 360); // limit HUD range to 360 degrees, higher values don't make sense } // detect air strafe turning @@ -283,7 +283,7 @@ void HUD_StrafeHUD() turnangle = wishangle; } } - else if((time - state_strafekeys_time) >= autocvar_hud_panel_strafehud_timeout_strafe) // timeout for jumping with strafe keys only + else if((time - state_strafekeys_time) >= autocvar_hud_panel_strafehud_timeout_turn) // timeout for jumping with strafe keys only { turn = false; } @@ -294,8 +294,8 @@ void HUD_StrafeHUD() wishangle = turnangle; } - minspeed = autocvar_hud_panel_strafehud_indicator_minspeed < 0 ? maxspeed + antiflicker_speed : autocvar_hud_panel_strafehud_indicator_minspeed; - show_indicators = (autocvar_hud_panel_strafehud_indicators && (speed >= minspeed)); + minspeed = autocvar_hud_panel_strafehud_switch_minspeed < 0 ? maxspeed + antiflicker_speed : autocvar_hud_panel_strafehud_switch_minspeed; + show_indicators = speed >= minspeed; // get current strafing angle ranging from -180° to +180° if(!autocvar__hud_configure) @@ -319,7 +319,7 @@ void HUD_StrafeHUD() { if(keys_fwd > 0) { - state_fwd = true; + state_fwd = true; } else if(keys_fwd < 0) { @@ -445,7 +445,7 @@ void HUD_StrafeHUD() if(show_indicators) { - bestangle_width = max(panel_size.x * autocvar_hud_panel_strafehud_indicator_width, 1); + bestangle_width = max(panel_size.x * autocvar_hud_panel_strafehud_switch_width, 1); } else { @@ -470,11 +470,11 @@ void HUD_StrafeHUD() { default: case 0: - drawfill(panel_pos, panel_size, autocvar_hud_panel_strafehud_bar_color, autocvar_hud_panel_strafehud_bar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); + drawfill(panel_pos, panel_size, autocvar_hud_panel_strafehud_bar_neutral_color, autocvar_hud_panel_strafehud_bar_neutral_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); break; case 1: - HUD_Panel_DrawProgressBar(panel_pos, panel_size, "progressbar", 1, 0, 0, autocvar_hud_panel_strafehud_bar_color, autocvar_hud_panel_strafehud_bar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); + HUD_Panel_DrawProgressBar(panel_pos, panel_size, "progressbar", 1, 0, 0, autocvar_hud_panel_strafehud_bar_neutral_color, autocvar_hud_panel_strafehud_bar_neutral_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } } } @@ -539,18 +539,18 @@ void HUD_StrafeHUD() } // draw acceleration zone - HUD_Panel_DrawStrafeHUD(accelzone_offset, accelzone_width, autocvar_hud_panel_strafehud_indicator_color, autocvar_hud_panel_strafehud_acceleration_alpha * panel_fg_alpha, autocvar_hud_panel_strafehud_style); + HUD_Panel_DrawStrafeHUD(accelzone_offset, accelzone_width, autocvar_hud_panel_strafehud_bar_accel_color, autocvar_hud_panel_strafehud_bar_accel_alpha * panel_fg_alpha, autocvar_hud_panel_strafehud_style); // draw odd acceleration zone - HUD_Panel_DrawStrafeHUD(odd_accelzone_offset, odd_accelzone_width, autocvar_hud_panel_strafehud_indicator_color, autocvar_hud_panel_strafehud_acceleration_alpha * panel_fg_alpha, autocvar_hud_panel_strafehud_style); + HUD_Panel_DrawStrafeHUD(odd_accelzone_offset, odd_accelzone_width, autocvar_hud_panel_strafehud_bar_accel_color, autocvar_hud_panel_strafehud_bar_accel_alpha * panel_fg_alpha, autocvar_hud_panel_strafehud_style); // draw overturn area - HUD_Panel_DrawStrafeHUD(overturn_offset, overturn_width, autocvar_hud_panel_strafehud_alert_color, autocvar_hud_panel_strafehud_overturn_alpha * panel_fg_alpha, autocvar_hud_panel_strafehud_style); + HUD_Panel_DrawStrafeHUD(overturn_offset, overturn_width, autocvar_hud_panel_strafehud_bar_overturn_color, autocvar_hud_panel_strafehud_bar_overturn_alpha * panel_fg_alpha, autocvar_hud_panel_strafehud_style); // draw the strafe bar background - HUD_Panel_DrawStrafeHUD(bar_offset, bar_width, autocvar_hud_panel_strafehud_bar_color, autocvar_hud_panel_strafehud_bar_alpha * panel_fg_alpha, autocvar_hud_panel_strafehud_style); + HUD_Panel_DrawStrafeHUD(bar_offset, bar_width, autocvar_hud_panel_strafehud_bar_neutral_color, autocvar_hud_panel_strafehud_bar_neutral_alpha * panel_fg_alpha, autocvar_hud_panel_strafehud_style); - if(autocvar_hud_panel_strafehud_direction_show && direction != 0) + if(direction != 0) { bool indicator_direction = direction < 0; // invert left/right when strafing backwards or when strafing towards the opposite side indicated by the direction variable @@ -561,23 +561,23 @@ void HUD_StrafeHUD() } // draw the direction indicator caps at the sides of the hud // vertical line - drawfill(panel_pos + eX * (indicator_direction ? -direction_size_vertical.x : panel_size.x), direction_size_vertical, autocvar_hud_panel_strafehud_direction_color, panel_fg_alpha, DRAWFLAG_NORMAL); + drawfill(panel_pos + eX * (indicator_direction ? -direction_size_vertical.x : panel_size.x), direction_size_vertical, autocvar_hud_panel_strafehud_direction_color, autocvar_hud_panel_strafehud_direction_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); // top horizontal line - drawfill(panel_pos + eX * (indicator_direction ? -direction_size_vertical.x : panel_size.x - direction_size_horizontal.x + direction_size_vertical.x) - eY * direction_size_horizontal.y, direction_size_horizontal, autocvar_hud_panel_strafehud_direction_color, panel_fg_alpha, DRAWFLAG_NORMAL); + drawfill(panel_pos + eX * (indicator_direction ? -direction_size_vertical.x : panel_size.x - direction_size_horizontal.x + direction_size_vertical.x) - eY * direction_size_horizontal.y, direction_size_horizontal, autocvar_hud_panel_strafehud_direction_color, autocvar_hud_panel_strafehud_direction_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); // bottom horizontal line - drawfill(panel_pos + eX * (indicator_direction ? -direction_size_vertical.x : panel_size.x - direction_size_horizontal.x + direction_size_vertical.x) + eY * panel_size.y, direction_size_horizontal, autocvar_hud_panel_strafehud_direction_color, panel_fg_alpha, DRAWFLAG_NORMAL); + drawfill(panel_pos + eX * (indicator_direction ? -direction_size_vertical.x : panel_size.x - direction_size_horizontal.x + direction_size_vertical.x) + eY * panel_size.y, direction_size_horizontal, autocvar_hud_panel_strafehud_direction_color, autocvar_hud_panel_strafehud_direction_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } if(show_indicators) // only draw indicators if enabled and minspeed is reached { // draw best angles for acceleration - vector indicator_color; + vector switch_color; float offset = !odd_angles ? bestangle_offset : odd_bestangle_offset; float switch_offset = !odd_angles ? switch_bestangle_offset : switch_odd_bestangle_offset; // both indicators are yellow if no direction can be determined - indicator_color = direction != 0 ? autocvar_hud_panel_strafehud_indicator_color : autocvar_hud_panel_strafehud_indicator_switch_color; - HUD_Panel_DrawStrafeHUD(switch_offset, bestangle_width, autocvar_hud_panel_strafehud_indicator_switch_color, panel_fg_alpha, 0); - HUD_Panel_DrawStrafeHUD(offset, bestangle_width, indicator_color, panel_fg_alpha, 0); + switch_color = direction != 0 ? autocvar_hud_panel_strafehud_switch_active_color : autocvar_hud_panel_strafehud_switch_inactive_color; + HUD_Panel_DrawStrafeHUD(switch_offset, bestangle_width, autocvar_hud_panel_strafehud_switch_inactive_color, autocvar_hud_panel_strafehud_switch_alpha * panel_fg_alpha, 0); + HUD_Panel_DrawStrafeHUD(offset, bestangle_width, switch_color, autocvar_hud_panel_strafehud_switch_alpha * panel_fg_alpha, 0); } } @@ -591,16 +591,16 @@ void HUD_StrafeHUD() { if((direction > 0 && (angle >= bestangle || angle <= -(bestangle + wishangle*2))) || (direction < 0 && (angle <= bestangle || angle >= -(bestangle + wishangle*2)))) - currentangle_color = autocvar_hud_panel_strafehud_good_color; + currentangle_color = autocvar_hud_panel_strafehud_angle_accel_color; } if(fabs(moveangle) > 90) // player is overturning { - currentangle_color = autocvar_hud_panel_strafehud_alert_color; + currentangle_color = autocvar_hud_panel_strafehud_angle_overturn_color; } else if(bestangle_anywhere) // player gains speed without strafing { - currentangle_color = autocvar_hud_panel_strafehud_good_color; + currentangle_color = autocvar_hud_panel_strafehud_angle_accel_color; } if(mode == 0 || straight_overturn) diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_strafehud.qc b/qcsrc/menu/xonotic/dialog_hudpanel_strafehud.qc index ad3b4cbe4..0b7d0e965 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_strafehud.qc +++ b/qcsrc/menu/xonotic/dialog_hudpanel_strafehud.qc @@ -17,13 +17,15 @@ void StrafeHUD_CenterPanel(entity btn, entity me) void StrafeHUD_ColorReset(entity btn, entity me) { - cvar_set("hud_panel_strafehud_bar_color", cvar_defstring("hud_panel_strafehud_bar_color")); - cvar_set("hud_panel_strafehud_good_color", cvar_defstring("hud_panel_strafehud_good_color")); - cvar_set("hud_panel_strafehud_warning_color", cvar_defstring("hud_panel_strafehud_warning_color")); - cvar_set("hud_panel_strafehud_alert_color", cvar_defstring("hud_panel_strafehud_alert_color")); + cvar_set("hud_panel_strafehud_bar_accel_color", cvar_defstring("hud_panel_strafehud_bar_accel_color")); + cvar_set("hud_panel_strafehud_bar_neutral_color", cvar_defstring("hud_panel_strafehud_bar_neutral_color")); + cvar_set("hud_panel_strafehud_bar_overturn_color", cvar_defstring("hud_panel_strafehud_bar_overturn_color")); + cvar_set("hud_panel_strafehud_angle_accel_color", cvar_defstring("hud_panel_strafehud_angle_accel_color")); + cvar_set("hud_panel_strafehud_angle_neutral_color", cvar_defstring("hud_panel_strafehud_angle_neutral_color")); + cvar_set("hud_panel_strafehud_angle_overturn_color", cvar_defstring("hud_panel_strafehud_angle_overturn_color")); + cvar_set("hud_panel_strafehud_switch_active_color", cvar_defstring("hud_panel_strafehud_switch_active_color")); + cvar_set("hud_panel_strafehud_switch_inactive_color", cvar_defstring("hud_panel_strafehud_switch_inactive_color")); cvar_set("hud_panel_strafehud_direction_color", cvar_defstring("hud_panel_strafehud_direction_color")); - cvar_set("hud_panel_strafehud_indicator_color", cvar_defstring("hud_panel_strafehud_indicator_color")); - cvar_set("hud_panel_strafehud_indicator_switch_color", cvar_defstring("hud_panel_strafehud_indicator_switch_color")); } void XonoticHUDStrafeHUDDialog_fill(entity me) @@ -52,61 +54,82 @@ void XonoticHUDStrafeHUDDialog_fill(entity me) me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("1", "0", "_hud_panel_strafehud_demo", _("Demo mode"))); me.TDempty(me, 0.4); + me.TD(me, 1, 0.6, e = makeXonoticTextLabel(0, _("Range:"))); - me.TD(me, 1, 1.8, e = makeXonoticSlider(0, 360, 5, "hud_panel_strafehud_angle")); + me.TD(me, 1, 1.8, e = makeXonoticSlider(0, 360, 5, "hud_panel_strafehud_range")); me.TR(me); - me.TD(me, 1, 1.9, e = makeXonoticButton(_("Center StrafeHUD"), '0 0 0')); + me.TD(me, 1, 1.9, e = makeXonoticButton(_("Center panel"), '0 0 0')); e.onClick = StrafeHUD_CenterPanel; e.onClickEntity = me; me.TDempty(me, 0.2); + me.TD(me, 1, 1.9, e = makeXonoticButton(_("Reset colors"), '0 0 0')); e.onClick = StrafeHUD_ColorReset; e.onClickEntity = me; me.TR(me); - me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Strafe bar:"))); + me.TD(me, 1, 1.9, e = makeXonoticTextLabel(0, _("Strafe bar:"))); - me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Current angle:"))); + me.TDempty(me, 0.2); + + me.TD(me, 1, 1.9, e = makeXonoticTextLabel(0, _("Angle indicator:"))); me.TR(me); + me.TD(me, 1, 0.56666666, e = makeXonoticTextLabel(0, _("Neutral:"))); me.TDempty(me, 0.1); - me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Color:"))); + me.TD(me, 1, 0.56666666, e = makeXonoticTextLabel(0, _("Good:"))); me.TDempty(me, 0.1); - me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Alpha:"))); + me.TD(me, 1, 0.56666666, e = makeXonoticTextLabel(0, _("Overturn:"))); + + me.TDempty(me, 0.2); + me.TD(me, 1, 0.56666666, e = makeXonoticTextLabel(0, _("Neutral:"))); me.TDempty(me, 0.1); me.TD(me, 1, 0.56666666, e = makeXonoticTextLabel(0, _("Good:"))); me.TDempty(me, 0.1); - me.TD(me, 1, 0.56666666, e = makeXonoticTextLabel(0, _("Neutral:"))); - me.TDempty(me, 0.1); me.TD(me, 1, 0.56666666, e = makeXonoticTextLabel(0, _("Overturn:"))); me.TR(me); + me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_bar_neutral_color", "hud_panel_strafehud_bar_neutral_color")); me.TDempty(me, 0.1); - me.TD(me, 2, 0.9, e = makeXonoticColorpickerString("hud_panel_strafehud_bar_color", "hud_panel_strafehud_bar_color")); + me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_bar_accel_color", "hud_panel_strafehud_bar_accel_color")); me.TDempty(me, 0.1); - me.TD(me, 1, 0.9, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_bar_alpha")); + me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_bar_overturn_color", "hud_panel_strafehud_bar_overturn_color")); + me.TDempty(me, 0.2); + + me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_angle_neutral_color", "hud_panel_strafehud_angle_neutral_color")); me.TDempty(me, 0.1); - me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_good_color", "hud_panel_strafehud_good_color")); - me.TDempty(me, 0.1); - me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_warning_color", "hud_panel_strafehud_warning_color")); + me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_angle_accel_color", "hud_panel_strafehud_angle_accel_color")); me.TDempty(me, 0.1); - me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_alert_color", "hud_panel_strafehud_alert_color")); + me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_angle_overturn_color", "hud_panel_strafehud_angle_overturn_color")); me.TR(me); me.TR(me); - me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Ideal angle:"))); + me.TD(me, 1, 0.56666666, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_bar_neutral_alpha")); + me.TDempty(me, 0.1); + me.TD(me, 1, 0.56666666, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_bar_accel_alpha")); + me.TDempty(me, 0.1); + me.TD(me, 1, 0.56666666, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_bar_overturn_alpha")); + + me.TDempty(me, 0.2); + + me.TD(me, 1, 1.9, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_angle_alpha")); + me.TR(me); + me.TD(me, 1, 1.9, e = makeXonoticTextLabel(0, _("Switch indicators:"))); - me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Direction marker:"))); + me.TDempty(me, 0.2); + + me.TD(me, 1, 1.9, e = makeXonoticTextLabel(0, _("Direction caps:"))); me.TR(me); - me.TDempty(me, 0.1); me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Active:"))); - me.TDempty(me, 0.1); + + me.TDempty(me, 0.2); + me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Inactive:"))); me.TR(me); - me.TDempty(me, 0.1); - me.TD(me, 2, 0.9, e = makeXonoticColorpickerString("hud_panel_strafehud_indicator_color", "hud_panel_strafehud_indicator_color")); - me.TDempty(me, 0.1); - me.TD(me, 2, 0.9, e = makeXonoticColorpickerString("hud_panel_strafehud_indicator_switch_color", "hud_panel_strafehud_indicator_switch_color")); + me.TD(me, 2, 0.85, e = makeXonoticColorpickerString("hud_panel_strafehud_switch_active_color", "hud_panel_strafehud_switch_active_color")); + me.TDempty(me, 0.2); + me.TD(me, 2, 0.85, e = makeXonoticColorpickerString("hud_panel_strafehud_switch_inactive_color", "hud_panel_strafehud_switch_inactive_color")); + + me.TDempty(me, 0.2); - me.TDempty(me, 0.1); me.TD(me, 2, 1.9, e = makeXonoticColorpickerString("hud_panel_strafehud_direction_color", "hud_panel_strafehud_direction_color")); } diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_strafehud.qh b/qcsrc/menu/xonotic/dialog_hudpanel_strafehud.qh index d82dbb8f6..40e37c599 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_strafehud.qh +++ b/qcsrc/menu/xonotic/dialog_hudpanel_strafehud.qh @@ -6,7 +6,7 @@ CLASS(XonoticHUDStrafeHUDDialog, XonoticRootDialog) ATTRIB(XonoticHUDStrafeHUDDialog, title, string, _("StrafeHUD Panel")); ATTRIB(XonoticHUDStrafeHUDDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT); ATTRIB(XonoticHUDStrafeHUDDialog, intendedWidth, float, 0.4); - ATTRIB(XonoticHUDStrafeHUDDialog, rows, float, 20.5); + ATTRIB(XonoticHUDStrafeHUDDialog, rows, float, 21.5); ATTRIB(XonoticHUDStrafeHUDDialog, columns, float, 4); ATTRIB(XonoticHUDStrafeHUDDialog, name, string, "HUDstrafehud"); ATTRIB(XonoticHUDStrafeHUDDialog, requiresConnection, float, true); -- 2.39.2