2 CLASS(XonoticHUDAmmoDialog) EXTENDS(XonoticRootDialog)
3 METHOD(XonoticHUDAmmoDialog, fill, void(entity))
4 ATTRIB(XonoticHUDAmmoDialog, title, string, "Ammo Panel")
5 ATTRIB(XonoticHUDAmmoDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
6 ATTRIB(XonoticHUDAmmoDialog, intendedWidth, float, 0.4)
7 ATTRIB(XonoticHUDAmmoDialog, rows, float, 15)
8 ATTRIB(XonoticHUDAmmoDialog, columns, float, 4)
9 ATTRIB(XonoticHUDAmmoDialog, name, string, "HUDammo")
10 ENDCLASS(XonoticHUDAmmoDialog)
14 void XonoticHUDAmmoDialog_fill(entity me)
17 string panelname = "ammo";
21 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_ammo", "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("", "1 1 1", 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);
75 me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Ammunition display:"));
78 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_ammo_onlycurrent", "Show only current ammo type"));
81 me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Align icon:"));
82 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_ammo_iconalign", "0", "Left"));
83 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_ammo_iconalign", "1", "Right"));