]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_hudpanel_timer.c
Merge branch 'master' into fruitiex/fruitbalance
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_hudpanel_timer.c
1 #ifdef INTERFACE
2 CLASS(XonoticHUDTimerDialog) EXTENDS(XonoticRootDialog)
3         METHOD(XonoticHUDTimerDialog, fill, void(entity))
4         ATTRIB(XonoticHUDTimerDialog, title, string, "Timer Panel")
5         ATTRIB(XonoticHUDTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
6         ATTRIB(XonoticHUDTimerDialog, intendedWidth, float, 0.4)
7         ATTRIB(XonoticHUDTimerDialog, rows, float, 15)
8         ATTRIB(XonoticHUDTimerDialog, columns, float, 4)
9         ATTRIB(XonoticHUDTimerDialog, name, string, "HUDtimer")
10 ENDCLASS(XonoticHUDTimerDialog)
11 #endif
12
13 #ifdef IMPLEMENTATION
14 void XonoticHUDTimerDialog_fill(entity me)
15 {
16         entity e;
17         string panelname = "timer";
18         float i;
19
20         me.TR(me);
21                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_timer", "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, "Timer:"));
71         me.TR(me);
72                 me.TDempty(me, 0.2);
73                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_timer_increment", "Show elapsed time"));
74 }
75 #endif