seta hud_panel_scoreboard_accuracy_showdelay_minpos 0.75 "delay displaying the accuracy panel only if its position is lower than this percentage of the screen height from the top"
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" "HUD changes angle during configure"
+seta _hud_panel_strafehud_demo "0" "strafehud changes angle during configure"
seta _hud_panel_strafehud_center "0" "puts the angle indicator in the center during HUD configure"
-seta hud_panel_strafehud_mode "0" "strafehud mode: \"0\" = movement centered, \"1\" = angle centered"
+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_alpha "0.3" "opacity of the strafe meter"
seta hud_panel_strafehud_bar_color "1 1 1" "color of the strafe meter"
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_angle "0" "the maximum angle displayed on the HUD, \"0\" = dynamic"
+seta hud_panel_strafehud_angle "0" "the maximum angle displayed on the strafehud, \"0\" = dynamic"
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_angle_alpha "0.8" "indicator transparency of the actual strafe angle"
seta hud_panel_strafehud_direction_color "0 0.5 1" "direction indicator color"
-seta hud_panel_strafehud_timeout_air "0" "time after take off before changing HUD mode (prevents flickering on slick ramps)"
-seta hud_panel_strafehud_timeout_ground "0.03333333" "time after landing before changing HUD mode (prevents flickering on regular strafe turns)"
+seta hud_panel_strafehud_timeout_air "0" "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_indicator_minspeed "-1" "speed at which HUD indicators will be shown, uses maxspeed if negative"
+seta hud_panel_strafehud_indicator_minspeed "-1" "speed at which strafehud indicators will be shown, uses maxspeed if negative"
// hud panel aliases
alias quickmenu "cl_cmd hud quickmenu ${* ?}"
int autocvar_hud_panel_radar_maximized_zoommode;
bool autocvar_hud_panel_score;
bool autocvar_hud_panel_score_rankings;
-bool autocvar_hud_panel_strafehud;
-bool autocvar__hud_panel_strafehud_demo;
-bool autocvar__hud_panel_strafehud_center;
-bool autocvar_hud_panel_strafehud_mode;
-float autocvar_hud_panel_strafehud_bar_alpha;
-vector autocvar_hud_panel_strafehud_bar_color;
-vector autocvar_hud_panel_strafehud_indicator_color;
-vector autocvar_hud_panel_strafehud_indicator_switch_color;
-float autocvar_hud_panel_strafehud_angle;
-vector autocvar_hud_panel_strafehud_good_color;
-vector autocvar_hud_panel_strafehud_warning_color;
-vector autocvar_hud_panel_strafehud_alert_color;
-float autocvar_hud_panel_strafehud_angle_alpha;
-vector autocvar_hud_panel_strafehud_direction_color;
-float autocvar_hud_panel_strafehud_timeout_air;
-float autocvar_hud_panel_strafehud_timeout_ground;
-float autocvar_hud_panel_strafehud_timeout_strafe;
-float autocvar_hud_panel_strafehud_indicator_minspeed;
+int autocvar_hud_panel_strafehud = 3;
+bool autocvar__hud_panel_strafehud_demo = false;
+bool autocvar__hud_panel_strafehud_center = false;
+int autocvar_hud_panel_strafehud_mode = 0;
+float autocvar_hud_panel_strafehud_bar_alpha = 0.3;
+vector autocvar_hud_panel_strafehud_bar_color = '1 1 1';
+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_angle = 0;
+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';
+float autocvar_hud_panel_strafehud_angle_alpha = 0.8;
+vector autocvar_hud_panel_strafehud_direction_color = '0 0.5 1';
+float autocvar_hud_panel_strafehud_timeout_air = 0;
+float autocvar_hud_panel_strafehud_timeout_ground = 0.03333333;
+float autocvar_hud_panel_strafehud_timeout_strafe = 0.1;
+float autocvar_hud_panel_strafehud_indicator_minspeed = -1;
bool autocvar_hud_panel_timer;
bool autocvar_hud_panel_timer_increment;
float autocvar_hud_panel_update_interval;
bool strafehud_turn = false;
float strafehud_turnangle;
+// provide basic panel cvars to old clients
+// TODO remove them after a future release (0.8.2+)
+noref string autocvar_hud_panel_scoreboard_pos = "0.320000 0.570000";
+noref string autocvar_hud_panel_scoreboard_size = "0.360000 0.020000";
+noref string autocvar_hud_panel_scoreboard_bg = "0";
+noref string autocvar_hud_panel_scoreboard_bg_color = "";
+noref string autocvar_hud_panel_scoreboard_bg_color_team = "";
+noref string autocvar_hud_panel_scoreboard_bg_alpha = "0.7";
+noref string autocvar_hud_panel_scoreboard_bg_border = "";
+noref string autocvar_hud_panel_scoreboard_bg_padding = "";
+
void HUD_StrafeHUD()
{
entity strafeplayer;
float strafehud_moveangle;
// HUD
+ int strafehud_mode = autocvar_hud_panel_strafehud_mode >= 0 && autocvar_hud_panel_strafehud_mode <= 1 ? autocvar_hud_panel_strafehud_mode : 0;
float strafehud_hudangle;
float strafehud_bar_offset;
vector strafehud_bar_size = panel_size;
// current angle
strafehud_currentangle_size.x = panel_size.x * .005;
if(strafehud_currentangle_size.x < 1) strafehud_currentangle_size.x = 1;
- if(!autocvar_hud_panel_strafehud_mode)
+ if(strafehud_mode == 0)
{
- strafehud_currentangle_offset = bound(-strafehud_hudangle, strafehud_angle, strafehud_hudangle)/strafehud_hudangle * panel_size.x/2 + panel_size.x/2;
+ strafehud_currentangle_offset = strafehud_angle/strafehud_hudangle * panel_size.x/2;
}
- else
+ else if(strafehud_mode == 1)
{
- strafehud_currentangle_offset = strafehud_angle/strafehud_hudangle * panel_size.x/2;
+ strafehud_currentangle_offset = bound(-strafehud_hudangle, strafehud_angle, strafehud_hudangle)/strafehud_hudangle * panel_size.x/2 + panel_size.x/2;
}
strafehud_currentangle_size.y = panel_size.y * 1.5;
// best strafe acceleration angle
if(strafehud_bestangle_size.x < 1) strafehud_bestangle_size.x = 1;
strafehud_mirror_bestangle_size = strafehud_bestangle_size;
// shift offset of best strafe angle in angle centered mode
- if(autocvar_hud_panel_strafehud_mode)
+ if(strafehud_mode == 0)
{
strafehud_bestangle_offset -= strafehud_currentangle_offset;
strafehud_mirror_bestangle_offset -= strafehud_currentangle_offset;
}
// remove indicator width from offset
- if( strafehud_direction < 0)
+ if(strafehud_direction < 0)
{
strafehud_bestangle_offset -= strafehud_bestangle_size.x;
}
strafehud_accelzone_size.x -= strafehud_overturn_size.x;
// calculate the remainder of the overturn zone on the opposite side
strafehud_mirror_overturn_offset = panel_size.x - strafehud_mirror_overturn_size.x;
- if(autocvar_hud_panel_strafehud_mode)
+ if(strafehud_mode == 0)
{
// acceleration zone shifts in angle centered
strafehud_accelzone_size.x += strafehud_currentangle_offset; // make sure the size is correct even when the offset is shifted
strafehud_accelzone_size.x -= strafehud_overturn_size.x;
// calculate the remainder of the overturn zone on the opposite side
strafehud_mirror_overturn_offset = 0;
- if(autocvar_hud_panel_strafehud_mode == 1)
+ if(strafehud_mode == 0)
{
// acceleration zone shifts if angle centered
strafehud_accelzone_size.x -= strafehud_currentangle_offset; // make sure the size is correct even when the offset is shifted
strafehud_currentangle_color = strafehud_good_color;
}
- if(!autocvar_hud_panel_strafehud_mode)
+ if(strafehud_mode == 0)
{
- drawfill(panel_pos - eY * ((strafehud_currentangle_size.y - panel_size.y) / 2) + eX * (strafehud_currentangle_offset - strafehud_currentangle_size.x/2), strafehud_currentangle_size, strafehud_currentangle_color, autocvar_hud_panel_strafehud_angle_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawfill(panel_pos - eY * ((strafehud_currentangle_size.y - panel_size.y) / 2) + eX * (panel_size.x/2 - strafehud_currentangle_size.x/2), strafehud_currentangle_size, strafehud_currentangle_color, autocvar_hud_panel_strafehud_angle_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- else
+ else if(strafehud_mode == 1)
{
- drawfill(panel_pos - eY * ((strafehud_currentangle_size.y - panel_size.y) / 2) + eX * (panel_size.x/2 - strafehud_currentangle_size.x/2), strafehud_currentangle_size, strafehud_currentangle_color, autocvar_hud_panel_strafehud_angle_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawfill(panel_pos - eY * ((strafehud_currentangle_size.y - panel_size.y) / 2) + eX * (strafehud_currentangle_offset - strafehud_currentangle_size.x/2), strafehud_currentangle_size, strafehud_currentangle_color, autocvar_hud_panel_strafehud_angle_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
}
}
me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("StrafeHUD mode:")));
me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_strafehud_mode"));
- e.addValue(e, _("View centered"), "0");
- e.addValue(e, _("Angle centered"), "1");
+ e.addValue(e, _("View angle centered"), "0");
+ e.addValue(e, _("Velocity direction centered"), "1");
e.configureXonoticTextSliderValues(e);
me.TR(me);
me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("1", "0", "_hud_panel_strafehud_demo", _("Demo mode")));