]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_hudpanel_inventory.c
rename all the panel cvars to hud_panel_* (sorry for any inconvenience caused :(...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_hudpanel_inventory.c
1 #ifdef INTERFACE
2 CLASS(XonoticHUDInventoryDialog) EXTENDS(XonoticRootDialog)
3         METHOD(XonoticHUDInventoryDialog, fill, void(entity))
4         ATTRIB(XonoticHUDInventoryDialog, title, string, "Inventory Panel")
5         ATTRIB(XonoticHUDInventoryDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
6         ATTRIB(XonoticHUDInventoryDialog, intendedWidth, float, 0.4)
7         ATTRIB(XonoticHUDInventoryDialog, rows, float, 15)
8         ATTRIB(XonoticHUDInventoryDialog, columns, float, 4)
9         ATTRIB(XonoticHUDInventoryDialog, name, string, "HUDinventory")
10 ENDCLASS(XonoticHUDInventoryDialog)
11 #endif
12
13 #ifdef IMPLEMENTATION
14 void XonoticHUDInventoryDialog_fill(entity me)
15 {
16         entity e;
17         string panelname = "inventory";
18         float i;
19
20         me.TR(me);
21                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_inventory", "Enable panel"));
22         me.TR(me);
23                 me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background:"));
24         me.TR(me);
25                 me.TDempty(me, 0.2);
26                 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
27                 me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_", panelname, "_bg_color"))));
28                         setDependentStringNotEqual(e, strzone(strcat("hud_", panelname, "_bg_color")), "");
29         me.TR(me);
30                 me.TDempty(me, 0.2);
31                 me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_", panelname, "_bg_color")), "Use default"));
32         me.TR(me);
33                 me.TDempty(me, 0.2);
34                 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
35                         me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_", panelname, "_bg_border"))));
36                                 e.addValue(e, "Default", "");
37                                 e.addValue(e, "Disable", "0");
38                                 for(i = 1; i <= 10; ++i)
39                                         e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
40                                 e.configureXonoticTextSliderValues(e);
41         me.TR(me);
42                 me.TDempty(me, 0.2);
43                 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
44                         me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_", panelname, "_bg_alpha"))));
45                                 e.addValue(e, "Default", "");
46                                 for(i = 1; i <= 10; ++i)
47                                         e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
48                                 e.configureXonoticTextSliderValues(e);
49         me.TR(me);
50                 me.TDempty(me, 0.2);
51                 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
52                         me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_", panelname, "_bg_color_team"))));
53                                 e.addValue(e, "Default", "");
54                                 e.addValue(e, "Disable", "0");
55                                 for(i = 1; i <= 10; ++i)
56                                         e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
57                                 e.configureXonoticTextSliderValues(e);
58         me.TR(me);
59                 me.TDempty(me, 0.4);
60                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
61         me.TR(me);
62                 me.TDempty(me, 0.2);
63                 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
64                         me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_", panelname, "_bg_padding"))));
65                                 e.addValue(e, "Default", "");
66                                 for(i = 0; i <= 10; ++i)
67                                         e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
68                                 e.configureXonoticTextSliderValues(e);
69         me.TR(me);
70                 me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Ammunition display:"));
71         me.TR(me);
72                 me.TDempty(me, 0.2);
73                 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_inventory_onlycurrent", "Show only current ammo type"));
74         me.TR(me);
75                 me.TDempty(me, 0.2);
76                 me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Align icon:"));
77                         me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_inventory_iconalign", "0", "Left"));
78                         me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_inventory_iconalign", "1", "Right"));
79 }
80 #endif