seta _hud_panel_strafehud_demo "0" "HUD changes angle during configure"
seta hud_panel_strafehud_mode "0" "strafehud mode: \"0\" = movement centered, \"1\" = angle centered"
seta hud_panel_strafehud_bar_alpha ".2" "opacity of the strafe meter"
-seta hud_panel_strafehud_bar_alpha_default "1" "use default opacity for strafe bar"
seta hud_panel_strafehud_bar_color "1 1 1" "color of the strafe meter"
-seta hud_panel_strafehud_bar_color_default "1" "use default color for strafe bar""
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_color_default "1" "use default colors for angle indicators"
seta hud_panel_strafehud_angle "0" "the maximum angle displayed on the HUD, \"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_color_default "1" "use default colors for angle indicator"
seta hud_panel_strafehud_angle_alpha ".8" "indicator transparency of the actual strafe angle"
seta hud_panel_strafehud_direction_color ".5 .25 1" "direction indicator color"
-seta hud_panel_strafehud_direction_color_default "1" "use default color for direction markers"
-seta hud_panel_strafehud_timeout_air_default "0" "use default value for the air timeout"
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_default "0" "use default value for the ground timeout"
seta hud_panel_strafehud_timeout_ground ".03333333" "time after landing before changing HUD mode (prevents flickering on regular strafe turns)"
-seta hud_panel_strafehud_timeout_strafe_default "0" "use default value for the strafe turning timeout"
seta hud_panel_strafehud_timeout_strafe ".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"
bool autocvar__hud_panel_strafehud_demo;
int autocvar_hud_panel_strafehud_mode;
float autocvar_hud_panel_strafehud_bar_alpha;
-bool autocvar_hud_panel_strafehud_bar_alpha_default;
vector autocvar_hud_panel_strafehud_bar_color;
-bool autocvar_hud_panel_strafehud_bar_color_default;
vector autocvar_hud_panel_strafehud_indicator_color;
-bool autocvar_hud_panel_strafehud_indicator_color_default;
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;
-bool autocvar_hud_panel_strafehud_angle_color_default;
float autocvar_hud_panel_strafehud_angle_alpha;
vector autocvar_hud_panel_strafehud_direction_color;
-bool autocvar_hud_panel_strafehud_direction_color_default;
float autocvar_hud_panel_strafehud_timeout_air;
-bool autocvar_hud_panel_strafehud_timeout_air_default;
float autocvar_hud_panel_strafehud_timeout_ground;
-bool autocvar_hud_panel_strafehud_timeout_ground_default;
float autocvar_hud_panel_strafehud_timeout_strafe;
-bool autocvar_hud_panel_strafehud_timeout_strafe_default;
float autocvar_hud_panel_strafehud_indicator_minspeed;
bool autocvar_hud_panel_timer;
bool autocvar_hud_panel_timer_increment;
// Name: StrafeHUD
// Author: Juhu
-// FIXME: strafehud doesn't properly work in spectate due to lack of IS_ONGROUND()
+// FIXME: strafehud doesn't work properly in spectate due to lack of IS_ONGROUND()
#include "strafehud.qh"
HUD_Panel_LoadCvars();
- draw_beginBoldFont();
-
if (autocvar_hud_panel_strafehud_dynamichud)
HUD_Scale_Enable();
else
if(csqcplayer && strafeplayer)
{
// autocvars
- float strafehud_bar_alpha = autocvar_hud_panel_strafehud_bar_alpha_default
- ? .2
- : autocvar_hud_panel_strafehud_bar_alpha;
- vector strafehud_bar_color = autocvar_hud_panel_strafehud_bar_color_default
- ? '1 1 1'
- : autocvar_hud_panel_strafehud_bar_color;
- vector strafehud_bestangle_color = autocvar_hud_panel_strafehud_indicator_color_default
- ? '0 1 0'
- : autocvar_hud_panel_strafehud_indicator_color;
- vector strafehud_bestangle_opposite_color = autocvar_hud_panel_strafehud_indicator_color_default
- ? '1 1 0'
- : autocvar_hud_panel_strafehud_indicator_switch_color;
- vector strafehud_good_color = autocvar_hud_panel_strafehud_angle_color_default
- ? '0 1 1'
- : autocvar_hud_panel_strafehud_good_color;
- vector strafehud_warning_color = autocvar_hud_panel_strafehud_angle_color_default
- ? '1 1 0'
- : autocvar_hud_panel_strafehud_warning_color;
- vector strafehud_alert_color = autocvar_hud_panel_strafehud_angle_color_default
- ? '1 0 1'
- : autocvar_hud_panel_strafehud_alert_color;
- vector strafehud_direction_color = autocvar_hud_panel_strafehud_direction_color_default
- ? '.5 .25 1'
- : autocvar_hud_panel_strafehud_direction_color;
- float strafehud_timeout_air = autocvar_hud_panel_strafehud_timeout_air_default // timeout for slick ramps
- ? 0
- : autocvar_hud_panel_strafehud_timeout_air;
- float strafehud_timeout_ground = autocvar_hud_panel_strafehud_timeout_ground_default // timeout for strafe jumping in general
- ? .03333333
- : autocvar_hud_panel_strafehud_timeout_ground;
- float strafehud_timeout_strafe = autocvar_hud_panel_strafehud_timeout_strafe_default // timeout for jumping with strafe keys only
- ? .1
- : autocvar_hud_panel_strafehud_timeout_strafe;
+ float strafehud_bar_alpha = autocvar_hud_panel_strafehud_bar_alpha;
+ vector strafehud_bar_color = autocvar_hud_panel_strafehud_bar_color;
+ vector strafehud_bestangle_color = autocvar_hud_panel_strafehud_indicator_color;
+ vector strafehud_bestangle_opposite_color = autocvar_hud_panel_strafehud_indicator_switch_color;
+ vector strafehud_good_color = autocvar_hud_panel_strafehud_good_color;
+ vector strafehud_warning_color = autocvar_hud_panel_strafehud_warning_color;
+ vector strafehud_alert_color = autocvar_hud_panel_strafehud_alert_color;
+ vector strafehud_direction_color = autocvar_hud_panel_strafehud_direction_color;
+ float strafehud_timeout_air = autocvar_hud_panel_strafehud_timeout_air; // timeout for slick ramps
+ float strafehud_timeout_ground = autocvar_hud_panel_strafehud_timeout_ground; // timeout for strafe jumping in general
+ float strafehud_timeout_strafe = autocvar_hud_panel_strafehud_timeout_strafe; // timeout for jumping with strafe keys only
float strafehud_indicator_minspeed = autocvar_hud_panel_strafehud_indicator_minspeed;
// physics
// TODO: implement angle centered strafehud
}
}
- draw_endBoldFont();
}
#include "dialog_hudpanel_strafehud.qh"
-#include "textlabel.qh"
-#include "textslider.qh"
#include "checkbox_string.qh"
#include "colorpicker_string.qh"
+#include "button.qh"
#include "slider.qh"
+#include "textlabel.qh"
+#include "textslider.qh"
+
+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_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)
{
me.TR(me);
me.TDempty(me, 0.1);
me.TD(me, 2, 0.9, e = makeXonoticColorpickerString("hud_panel_strafehud_bar_color", "hud_panel_strafehud_bar_color"));
- setDependentStringNotEqual(e, "hud_panel_strafehud_bar_color_default", "1");
me.TDempty(me, 0.1);
me.TD(me, 1, 0.9, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_bar_alpha"));
- setDependentStringNotEqual(e, "hud_panel_strafehud_bar_alpha_default", "1");
me.TDempty(me, 0.1);
me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_good_color", "hud_panel_strafehud_good_color"));
- setDependentStringNotEqual(e, "hud_panel_strafehud_angle_color_default", "1");
me.TDempty(me, 0.1);
me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_warning_color", "hud_panel_strafehud_warning_color"));
- setDependentStringNotEqual(e, "hud_panel_strafehud_angle_color_default", "1");
me.TDempty(me, 0.1);
me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_alert_color", "hud_panel_strafehud_alert_color"));
- setDependentStringNotEqual(e, "hud_panel_strafehud_angle_color_default", "1");
me.TR(me);
- me.TR(me);
- me.TDempty(me, 0.1);
- me.TD(me, 1, 0.9, e = makeXonoticCheckBoxString("1", "0", "hud_panel_strafehud_bar_color_default", _("Use default")));
- me.TDempty(me, 0.1);
- me.TD(me, 1, 0.9, e = makeXonoticCheckBoxString("1", "0", "hud_panel_strafehud_bar_alpha_default", _("Use default")));
-
- me.TDempty(me, 0.1);
- me.TD(me, 1, 1.9, e = makeXonoticCheckBoxString("1", "0", "hud_panel_strafehud_angle_color_default", _("Use default")));
me.TR(me);
me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Ideal angle:")));
me.TDempty(me, 0.1);
me.TD(me, 2, 1.9, e = makeXonoticColorpickerString("hud_panel_strafehud_direction_color", "hud_panel_strafehud_direction_color"));
- setDependentStringNotEqual(e, "hud_panel_strafehud_direction_color_default", "1");
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"));
- setDependentStringNotEqual(e, "hud_panel_strafehud_indicator_color_default", "1");
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"));
- setDependentStringNotEqual(e, "hud_panel_strafehud_indicator_color_default", "1");
me.TR(me);
me.TDempty(me, 2.1);
- me.TD(me, 1, 1.9, e = makeXonoticCheckBoxString("1", "0", "hud_panel_strafehud_direction_color_default", _("Use default")));
- me.TR(me);
- me.TDempty(me, 0.1);
- me.TD(me, 1, 1.9, e = makeXonoticCheckBoxString("1", "0", "hud_panel_strafehud_indicator_color_default", _("Use default")));
+ me.TD(me, 1, 1.9, e = makeXonoticButton(_("Reset colors"), '0 0 0'));
+ e.onClick = StrafeHUD_ColorReset;
+ e.onClickEntity = me;
}
ATTRIB(XonoticHUDStrafeHUDDialog, title, string, _("StrafeHUD Panel"));
ATTRIB(XonoticHUDStrafeHUDDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDStrafeHUDDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDStrafeHUDDialog, rows, float, 21.5);
+ ATTRIB(XonoticHUDStrafeHUDDialog, rows, float, 19.5);
ATTRIB(XonoticHUDStrafeHUDDialog, columns, float, 4);
ATTRIB(XonoticHUDStrafeHUDDialog, name, string, "HUDstrafehud");
ATTRIB(XonoticHUDStrafeHUDDialog, requiresConnection, float, true);