2 CLASS(XonoticHUDWeaponsDialog) EXTENDS(XonoticRootDialog)
3 METHOD(XonoticHUDWeaponsDialog, fill, void(entity))
4 ATTRIB(XonoticHUDWeaponsDialog, title, string, "Weapons Panel")
5 ATTRIB(XonoticHUDWeaponsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
6 ATTRIB(XonoticHUDWeaponsDialog, intendedWidth, float, 0.4)
7 ATTRIB(XonoticHUDWeaponsDialog, rows, float, 17)
8 ATTRIB(XonoticHUDWeaponsDialog, columns, float, 4)
9 ATTRIB(XonoticHUDWeaponsDialog, name, string, "HUDweapons")
10 ENDCLASS(XonoticHUDWeaponsDialog)
14 void XonoticHUDWeaponsDialog_fill(entity me)
17 string panelname = "weapons";
21 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_weapons", "Enable panel"));
23 me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
24 me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
25 e.addValue(e, "Default", "");
26 e.addValue(e, "Disable", "0");
27 e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
28 e.configureXonoticTextSliderValues(e);
31 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
32 me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
33 setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
36 me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", cvar_string("hud_panel_bg_color"), strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
39 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
40 me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
41 e.addValue(e, "Default", "");
42 e.addValue(e, "Disable", "0");
43 for(i = 1; i <= 10; ++i)
44 e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
45 e.configureXonoticTextSliderValues(e);
48 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
49 me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
50 e.addValue(e, "Default", "");
51 for(i = 1; i <= 10; ++i)
52 e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
53 e.configureXonoticTextSliderValues(e);
56 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
57 me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
58 e.addValue(e, "Default", "");
59 e.addValue(e, "Disable", "0");
60 for(i = 1; i <= 10; ++i)
61 e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
62 e.configureXonoticTextSliderValues(e);
65 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
68 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
69 me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
70 e.addValue(e, "Default", "");
71 for(i = 0; i <= 10; ++i)
72 e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
73 e.configureXonoticTextSliderValues(e);
76 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Fade out after:"));
77 me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_timeout"))));
78 e.addValue(e, "Never", "0");
79 for(i = 1; i <= 10; ++i)
80 e.addValue(e, strzone(strcat(ftos_decimals(i, 0), "s")), strzone(ftos(i)));
81 e.configureXonoticTextSliderValues(e);
84 me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Fade effect:"));
85 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "0", "None"));
86 setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
87 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "1", "Slide"));
88 setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
89 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "2", "Alpha"));
90 setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
92 me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Weapon icons:"));
95 me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Show weapon ID as:"));
96 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "0", "None"));
97 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "1", "Number"));
98 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "2", "Bind"));
101 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_weapons_accuracy", "Show Accuracy"));
102 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_weapons_ammo", "Show Ammo"));
105 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Ammo bar color:"));
106 me.TD(me, 2, 2.4, e = makeXonoticColorpickerString("hud_panel_weapons_ammo_color", "hud_panel_weapons_ammo_color"));
107 setDependent(e, "hud_panel_weapons_ammo", 1, 1);
111 me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Ammo bar alpha:"));
112 me.TD(me, 1, 2.6, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_weapons_ammo_alpha"));
113 setDependent(e, "hud_panel_weapons_ammo", 1, 1);