1 #include "dialog_hudsetup_exit.qh"
3 #include "textlabel.qh"
5 #include "textslider.qh"
7 #include "hudskinlist.qh"
8 #include "colorpicker_string.qh"
10 #include "commandbutton.qh"
12 void XonoticHUDExitDialog_fill(entity me)
16 hudskinlist = makeXonoticHUDSkinList();
19 me.TD(me, 1, 4, makeXonoticHeaderLabel(_("HUD skins")));
22 me.TD(me, 1, 0.7, e = makeXonoticTextLabel(0.5, _("Filter:")));
23 me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null));
24 e.onChange = HUDSkinList_Filter_Change;
25 e.onChangeEntity = hudskinlist;
27 me.TD(me, 12, 4, hudskinlist);
28 me.gotoRC(me, me.rows - 4, 0);
30 me.TD(me, 1, 1.4, e = makeXonoticButton(_("Refresh"), '0 0 0'));
31 e.onClick = HUDSkinList_Refresh_Click;
32 e.onClickEntity = hudskinlist;
33 me.TD(me, 1, 2.2, e = makeXonoticButton(_("Set skin"), '0 0 0'));
34 e.onClick = SetHUDSkin_Click;
35 e.onClickEntity = hudskinlist;
36 me.gotoRC(me, me.rows - 2.5, 0);
37 me.TD(me, 1, 2, e = makeXonoticButton_T(_("Save current skin"), '0 0 0',
38 "Note: HUD skins are saved in data/data/ directory and can be manually renamed/deleted from there"));
39 e.onClick = SaveHUDSkin_Click;
40 e.onClickEntity = hudskinlist;
41 me.TD(me, 1, 2, e = makeXonoticInputBox(0, string_null));
42 e.onChange = HUDSkinList_SavedName_Change;
43 e.onChangeEntity = hudskinlist;
45 me.gotoRC(me, 0, 4.2); me.setFirstColumn(me, me.currentColumn);
46 me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Panel background defaults:")));
48 me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Background:")));
49 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg"));
50 e.addValue(e, _("Disable"), "0");
51 e.addValue(e, "border_default", "border_default"); // this is a file name!
52 e.configureXonoticTextSliderValues(e);
55 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Color:")));
56 me.TD(me, 2, 2.6, e = makeXonoticColorpickerString("hud_panel_bg_color", "hud_panel_bg_color"));
60 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Border size:")));
61 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_border"));
62 e.addValue(e, _("Disable"), "0");
63 for(i = 1; i <= 10; ++i)
64 e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
65 e.configureXonoticTextSliderValues(e);
68 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
69 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_alpha"));
70 for(i = 1; i <= 10; ++i)
71 e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
72 e.configureXonoticTextSliderValues(e);
75 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Team color:")));
76 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_color_team"));
77 e.addValue(e, _("Disable"), "0");
78 for(i = 1; i <= 10; ++i)
79 e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
80 e.configureXonoticTextSliderValues(e);
83 me.TD(me, 1, 3.6, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", _("Test team color in configure mode")));
86 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Padding:")));
87 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_padding"));
88 for(i = 0; i <= 10; ++i)
89 e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
90 e.configureXonoticTextSliderValues(e);
93 me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("HUD Dock:")));
94 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_dock"));
95 e.addValue(e, ZCTX(_("DOCK^Disabled")), "0");
96 e.addValue(e, ZCTX(_("DOCK^Small")), "dock_small");
97 e.addValue(e, ZCTX(_("DOCK^Medium")), "dock_medium");
98 e.addValue(e, ZCTX(_("DOCK^Large")), "dock_large");
99 e.configureXonoticTextSliderValues(e);
102 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Color:")));
103 me.TD(me, 2, 2.6, e = makeXonoticColorpickerString("hud_dock_color", "hud_dock_color"));
107 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
108 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_dock_alpha"));
109 for(i = 1; i <= 10; ++i)
110 e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
111 e.configureXonoticTextSliderValues(e);
114 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Team color:")));
115 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_dock_color_team"));
116 e.addValue(e, _("Disable"), "0");
117 for(i = 1; i <= 10; ++i)
118 e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
119 e.configureXonoticTextSliderValues(e);
121 me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Grid settings:")));
124 me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_configure_grid", _("Snap panels to grid")));
127 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Grid size:")));
128 setDependent(e, "hud_configure_grid", 1, 1);
129 me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, _("X:")));
130 setDependent(e, "hud_configure_grid", 1, 1);
131 me.TD(me, 1, 1.1, e = makeXonoticTextSlider("hud_configure_grid_xsize"));
132 for(i = 1; i <= 14; ++i)
133 e.addValue(e, strzone(sprintf("%.1f%%", i/2)), strzone(ftos(i/200)));
134 e.configureXonoticTextSliderValues(e);
135 setDependent(e, "hud_configure_grid", 1, 1);
136 me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, _("Y:")));
137 setDependent(e, "hud_configure_grid", 1, 1);
138 me.TD(me, 1, 1.1, e = makeXonoticTextSlider("hud_configure_grid_ysize"));
139 for(i = 1; i <= 14; ++i)
140 e.addValue(e, strzone(sprintf("%.1f%%", i/2)), strzone(ftos(i/200)));
141 e.configureXonoticTextSliderValues(e);
142 setDependent(e, "hud_configure_grid", 1, 1);
144 me.gotoRC(me, me.rows - 1, 0);
145 me.TD(me, 1, me.columns, e = makeXonoticCommandButton(_("Exit setup"), '0 0 0', "_hud_configure 0", COMMANDBUTTON_CLOSE));