Xonotic
dialog_hudpanel_strafehud.qc File Reference
#include "dialog_hudpanel_strafehud.qh"
#include "checkbox_string.qh"
#include "colorpicker_string.qh"
#include "button.qh"
#include "slider.qh"
#include "textlabel.qh"
#include "textslider.qh"
+ Include dependency graph for dialog_hudpanel_strafehud.qc:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void StrafeHUD_CenterPanel (entity btn, entity me)
 
void StrafeHUD_ColorReset (entity btn, entity me)
 
void XonoticHUDStrafeHUDDialog_fill (entity me)
 

Function Documentation

◆ StrafeHUD_CenterPanel()

void StrafeHUD_CenterPanel ( entity  btn,
entity  me 
)

Definition at line 10 of file dialog_hudpanel_strafehud.qc.

References cvar_set(), ftos(), size, stov(), str_cvar(), strcat(), and vector().

11 {
12  vector size = stov(str_cvar("hud_panel_strafehud_size"));
13  vector pos = stov(str_cvar("hud_panel_strafehud_pos"));
14  pos.x = 0.5 - size.x / 2;
15  cvar_set("hud_panel_strafehud_pos", strcat(ftos(pos.x), " ", ftos(pos.y)));
16 }
vector size
Definition: csprogsdefs.qc:114
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
vector(float skel, float bonenum) _skel_get_boneabs_hidden
+ Here is the call graph for this function:

◆ StrafeHUD_ColorReset()

void StrafeHUD_ColorReset ( entity  btn,
entity  me 
)

Definition at line 18 of file dialog_hudpanel_strafehud.qc.

References cvar_defstring(), and cvar_set().

19 {
20  cvar_set("hud_panel_strafehud_bar_accel_color", cvar_defstring("hud_panel_strafehud_bar_accel_color"));
21  cvar_set("hud_panel_strafehud_bar_neutral_color", cvar_defstring("hud_panel_strafehud_bar_neutral_color"));
22  cvar_set("hud_panel_strafehud_bar_overturn_color", cvar_defstring("hud_panel_strafehud_bar_overturn_color"));
23  cvar_set("hud_panel_strafehud_angle_accel_color", cvar_defstring("hud_panel_strafehud_angle_accel_color"));
24  cvar_set("hud_panel_strafehud_angle_neutral_color", cvar_defstring("hud_panel_strafehud_angle_neutral_color"));
25  cvar_set("hud_panel_strafehud_angle_overturn_color", cvar_defstring("hud_panel_strafehud_angle_overturn_color"));
26  cvar_set("hud_panel_strafehud_switch_active_color", cvar_defstring("hud_panel_strafehud_switch_active_color"));
27  cvar_set("hud_panel_strafehud_switch_inactive_color", cvar_defstring("hud_panel_strafehud_switch_inactive_color"));
28  cvar_set("hud_panel_strafehud_direction_color", cvar_defstring("hud_panel_strafehud_direction_color"));
29 }
+ Here is the call graph for this function:

◆ XonoticHUDStrafeHUDDialog_fill()

void XonoticHUDStrafeHUDDialog_fill ( entity  me)

Definition at line 31 of file dialog_hudpanel_strafehud.qc.

References entity(), and makeXonoticTextSlider().

32 {
33  entity e;
34  string panelname = "strafehud";
35 
36  me.TR(me);
37  me.TD(me, 1, 4, e = makeXonoticTextSlider("hud_panel_strafehud"));
38  e.addValue(e, _("Disable"), "0");
39  e.addValue(e, _("Enable"), "1");
40  e.addValue(e, _("Enable even observing"), "2");
41  e.addValue(e, _("Enable only in Race/CTS"), "3");
42  e.configureXonoticTextSliderValues(e);
43 
44  dialog_hudpanel_main_settings(me, panelname);
45 
46  me.TR(me);
47  me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("StrafeHUD mode:")));
48 
49  me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_strafehud_mode"));
50  e.addValue(e, _("View angle centered"), "0");
51  e.addValue(e, _("Velocity angle centered"), "1");
52  e.configureXonoticTextSliderValues(e);
53  me.TR(me);
54  me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("StrafeHUD style:")));
55 
56  me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_strafehud_style"));
57  e.addValue(e, _("no styling"), "0");
58  e.addValue(e, _("progress bar"), "1");
59  e.addValue(e, _("gradient"), "2");
60  e.configureXonoticTextSliderValues(e);
61  me.TR(me);
62  me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("1", "0", "_hud_panel_strafehud_demo", _("Demo mode")));
63 
64  me.TDempty(me, 0.4);
65 
66  me.TD(me, 1, 0.6, e = makeXonoticTextLabel(0, _("Range:")));
67  me.TD(me, 1, 1.8, e = makeXonoticSlider(0, 360, 5, "hud_panel_strafehud_range"));
68  me.TR(me);
69  me.TD(me, 1, 1.9, e = makeXonoticButton(_("Center panel"), '0 0 0'));
70  e.onClick = StrafeHUD_CenterPanel;
71  e.onClickEntity = me;
72 
73  me.TDempty(me, 0.2);
74 
75  me.TD(me, 1, 1.9, e = makeXonoticButton(_("Reset colors"), '0 0 0'));
76  e.onClick = StrafeHUD_ColorReset;
77  e.onClickEntity = me;
78  me.TR(me);
79  me.TD(me, 1, 1.9, e = makeXonoticTextLabel(0, _("Strafe bar:")));
80 
81  me.TDempty(me, 0.2);
82 
83  me.TD(me, 1, 1.9, e = makeXonoticTextLabel(0, _("Angle indicator:")));
84  me.TR(me);
85  me.TD(me, 1, 0.56666666, e = makeXonoticTextLabel(0, _("Neutral:")));
86  me.TDempty(me, 0.1);
87  me.TD(me, 1, 0.56666666, e = makeXonoticTextLabel(0, _("Good:")));
88  me.TDempty(me, 0.1);
89  me.TD(me, 1, 0.56666666, e = makeXonoticTextLabel(0, _("Overturn:")));
90 
91  me.TDempty(me, 0.2);
92 
93  me.TD(me, 1, 0.56666666, e = makeXonoticTextLabel(0, _("Neutral:")));
94  me.TDempty(me, 0.1);
95  me.TD(me, 1, 0.56666666, e = makeXonoticTextLabel(0, _("Good:")));
96  me.TDempty(me, 0.1);
97  me.TD(me, 1, 0.56666666, e = makeXonoticTextLabel(0, _("Overturn:")));
98  me.TR(me);
99  me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_bar_neutral_color", "hud_panel_strafehud_bar_neutral_color"));
100  me.TDempty(me, 0.1);
101  me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_bar_accel_color", "hud_panel_strafehud_bar_accel_color"));
102  me.TDempty(me, 0.1);
103  me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_bar_overturn_color", "hud_panel_strafehud_bar_overturn_color"));
104 
105  me.TDempty(me, 0.2);
106 
107  me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_angle_neutral_color", "hud_panel_strafehud_angle_neutral_color"));
108  me.TDempty(me, 0.1);
109  me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_angle_accel_color", "hud_panel_strafehud_angle_accel_color"));
110  me.TDempty(me, 0.1);
111  me.TD(me, 2, 0.56666666, e = makeXonoticColorpickerString("hud_panel_strafehud_angle_overturn_color", "hud_panel_strafehud_angle_overturn_color"));
112  me.TR(me);
113  me.TR(me);
114  me.TD(me, 1, 0.56666666, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_bar_neutral_alpha"));
115  me.TDempty(me, 0.1);
116  me.TD(me, 1, 0.56666666, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_bar_accel_alpha"));
117  me.TDempty(me, 0.1);
118  me.TD(me, 1, 0.56666666, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_bar_overturn_alpha"));
119 
120  me.TDempty(me, 0.2);
121 
122  me.TD(me, 1, 1.9, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_angle_alpha"));
123  me.TR(me);
124  me.TD(me, 1, 1.9, e = makeXonoticTextLabel(0, _("Switch indicators:")));
125 
126  me.TDempty(me, 0.2);
127 
128  me.TD(me, 1, 1.9, e = makeXonoticTextLabel(0, _("Direction caps:")));
129  me.TR(me);
130  me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Active:")));
131 
132  me.TDempty(me, 0.2);
133 
134  me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Inactive:")));
135  me.TR(me);
136  me.TD(me, 2, 0.85, e = makeXonoticColorpickerString("hud_panel_strafehud_switch_active_color", "hud_panel_strafehud_switch_active_color"));
137  me.TDempty(me, 0.2);
138  me.TD(me, 2, 0.85, e = makeXonoticColorpickerString("hud_panel_strafehud_switch_inactive_color", "hud_panel_strafehud_switch_inactive_color"));
139 
140  me.TDempty(me, 0.2);
141 
142  me.TD(me, 2, 1.9, e = makeXonoticColorpickerString("hud_panel_strafehud_direction_color", "hud_panel_strafehud_direction_color"));
143  me.TR(me);
144  me.TR(me);
145  me.TD(me, 1, 0.9, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_switch_active_alpha"));
146  me.TDempty(me, 0.1);
147  me.TD(me, 1, 0.9, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_switch_inactive_alpha"));
148 
149  me.TDempty(me, 0.2);
150 
151  me.TD(me, 1, 1.9, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_strafehud_direction_alpha"));
152 }
void StrafeHUD_ColorReset(entity btn, entity me)
entity() spawn
entity makeXonoticTextLabel(float theAlign, string theText)
Definition: textlabel.qc:3
entity makeXonoticSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
Definition: slider.qc:10
entity makeXonoticCheckBoxString(string theYesValue, string theNoValue, string theCvar, string theText)
entity makeXonoticColorpickerString(string theCvar, string theDefaultCvar)
entity makeXonoticTextSlider(string theCvar)
Definition: textslider.qc:10
void StrafeHUD_CenterPanel(entity btn, entity me)
+ Here is the call graph for this function: