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);
46 me.setFirstColumn(me, me.currentColumn);
47 me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Panel background defaults:")));
49 me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Background:")));
50 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg"));
51 e.addValue(e, _("Disable"), "0");
52 e.addValue(e, "border_default", "border_default"); // this is a file name!
53 e.configureXonoticTextSliderValues(e);
56 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Color:")));
57 me.TD(me, 2, 2.6, e = makeXonoticColorpickerString("hud_panel_bg_color", "hud_panel_bg_color"));
61 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Border size:")));
62 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_border"));
63 e.addValue(e, _("Disable"), "0");
64 for (i = 1; i <= 10; ++i) {
65 e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
67 e.configureXonoticTextSliderValues(e);
70 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
71 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_alpha"));
72 for (i = 1; i <= 10; ++i) {
73 e.addValue(e, strzone(ftos_decimals(i / 10, 1)), strzone(ftos(i / 10)));
75 e.configureXonoticTextSliderValues(e);
78 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Team color:")));
79 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_color_team"));
80 e.addValue(e, _("Disable"), "0");
81 for (i = 1; i <= 10; ++i) {
82 e.addValue(e, strzone(ftos_decimals(i / 10, 1)), strzone(ftos(i / 10)));
84 e.configureXonoticTextSliderValues(e);
87 me.TD(me, 1, 3.6, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", _("Test team color in configure mode")));
90 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Padding:")));
91 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_padding"));
92 for (i = 0; i <= 10; ++i) {
93 e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
95 e.configureXonoticTextSliderValues(e);
98 me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("HUD Dock:")));
99 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_dock"));
100 e.addValue(e, ZCTX(_("DOCK^Disabled")), "0");
101 e.addValue(e, ZCTX(_("DOCK^Small")), "dock_small");
102 e.addValue(e, ZCTX(_("DOCK^Medium")), "dock_medium");
103 e.addValue(e, ZCTX(_("DOCK^Large")), "dock_large");
104 e.configureXonoticTextSliderValues(e);
107 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Color:")));
108 me.TD(me, 2, 2.6, e = makeXonoticColorpickerString("hud_dock_color", "hud_dock_color"));
112 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
113 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_dock_alpha"));
114 for (i = 1; i <= 10; ++i) {
115 e.addValue(e, strzone(ftos_decimals(i / 10, 1)), strzone(ftos(i / 10)));
117 e.configureXonoticTextSliderValues(e);
120 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Team color:")));
121 me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_dock_color_team"));
122 e.addValue(e, _("Disable"), "0");
123 for (i = 1; i <= 10; ++i) {
124 e.addValue(e, strzone(ftos_decimals(i / 10, 1)), strzone(ftos(i / 10)));
126 e.configureXonoticTextSliderValues(e);
128 me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Grid settings:")));
131 me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_configure_grid", _("Snap panels to grid")));
134 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Grid size:")));
135 setDependent(e, "hud_configure_grid", 1, 1);
136 me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, _("X:")));
137 setDependent(e, "hud_configure_grid", 1, 1);
138 me.TD(me, 1, 1.1, e = makeXonoticTextSlider("hud_configure_grid_xsize"));
139 for (i = 1; i <= 14; ++i) {
140 e.addValue(e, strzone(sprintf("%.1f%%", i / 2)), strzone(ftos(i / 200)));
142 e.configureXonoticTextSliderValues(e);
143 setDependent(e, "hud_configure_grid", 1, 1);
144 me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, _("Y:")));
145 setDependent(e, "hud_configure_grid", 1, 1);
146 me.TD(me, 1, 1.1, e = makeXonoticTextSlider("hud_configure_grid_ysize"));
147 for (i = 1; i <= 14; ++i) {
148 e.addValue(e, strzone(sprintf("%.1f%%", i / 2)), strzone(ftos(i / 200)));
150 e.configureXonoticTextSliderValues(e);
151 setDependent(e, "hud_configure_grid", 1, 1);
153 me.gotoRC(me, me.rows - 1, 0);
154 me.TD(me, 1, me.columns, e = makeXonoticCommandButton(_("Exit setup"), '0 0 0', "_hud_configure 0", 1));