]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_hudpanel_notification.c
Merge branch 'master' into fruitiex/gamemode_freezetag
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_hudpanel_notification.c
1 #ifdef INTERFACE
2 CLASS(XonoticHUDNotificationDialog) EXTENDS(XonoticRootDialog)
3         METHOD(XonoticHUDNotificationDialog, fill, void(entity))
4         ATTRIB(XonoticHUDNotificationDialog, title, string, "Notification Panel")
5         ATTRIB(XonoticHUDNotificationDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
6         ATTRIB(XonoticHUDNotificationDialog, intendedWidth, float, 0.4)
7         ATTRIB(XonoticHUDNotificationDialog, rows, float, 15)
8         ATTRIB(XonoticHUDNotificationDialog, columns, float, 4)
9         ATTRIB(XonoticHUDNotificationDialog, name, string, "HUDnotify")
10 ENDCLASS(XonoticHUDNotificationDialog)
11 #endif
12
13 #ifdef IMPLEMENTATION
14 void XonoticHUDNotificationDialog_fill(entity me)
15 {
16         entity e;
17         string panelname = "notify";
18         float i;
19
20         me.TR(me);
21                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor", "Enable panel"));
22         me.TR(me);
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);
29         me.TR(me);
30                 me.TDempty(me, 0.2);
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")), "");
34         me.TR(me);
35                 me.TDempty(me, 0.2);
36                 me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
37         me.TR(me);
38                 me.TDempty(me, 0.2);
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);
46         me.TR(me);
47                 me.TDempty(me, 0.2);
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);
54         me.TR(me);
55                 me.TDempty(me, 0.2);
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);
63         me.TR(me);
64                 me.TDempty(me, 0.4);
65                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
66         me.TR(me);
67                 me.TDempty(me, 0.2);
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);
74         me.TR(me);
75                 me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Notifications:"));
76         me.TR(me);
77                 me.TDempty(me, 0.2);
78                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_notify_print", "Also print notifications to the console"));
79         me.TR(me);
80                 me.TDempty(me, 0.2);
81                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_notify_flip", "Flip notify order"));
82         me.TR(me);
83                 me.TDempty(me, 0.2);
84                 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Entry lifetime:"));
85                         me.TD(me, 1, 2.6, e = makeXonoticSlider(3, 15, 1, "hud_panel_notify_time"));
86         me.TR(me);
87                 me.TDempty(me, 0.2);
88                 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Entry fadetime:"));
89                         me.TD(me, 1, 2.6, e = makeXonoticSlider(0.5, 5, 0.5, "hud_panel_notify_fadetime"));
90 }
91 #endif