2 CLASS(XonoticHUDDialog) EXTENDS(XonoticDialog)
3 METHOD(XonoticHUDDialog, toString, string(entity))
4 METHOD(XonoticHUDDialog, fill, void(entity))
5 METHOD(XonoticHUDDialog, showNotify, void(entity))
6 ATTRIB(XonoticHUDDialog, title, string, _("HUD settings"))
7 ATTRIB(XonoticHUDDialog, color, vector, SKINCOLOR_DIALOG_HUD)
8 ATTRIB(XonoticHUDDialog, intendedWidth, float, 0.5)
9 ATTRIB(XonoticHUDDialog, rows, float, 18)
10 ATTRIB(XonoticHUDDialog, columns, float, 3)
11 ENDCLASS(XonoticHUDDialog)
12 void HUDSetup_Start(entity me, entity btn);
16 void HUDSetup_Check_Gamestatus(entity me, entity btn)
18 if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))) // we're not in a match, ask the player if they want to start one anyway
20 DialogOpenButton_Click(me, main.hudconfirmDialog);
22 else // already in a match, lets just cut to the point and open up the hud editor directly
24 HUDSetup_Start(me, btn);
27 void XonoticHUDDialog_showNotify(entity me)
31 string XonoticHUDDialog_toString(entity me)
33 return "hi"; // TODO: show hud config name with text here
35 void XonoticHUDDialog_fill(entity me)
40 me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Damage:")));
43 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Overlay:")));
44 me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_damage"));
47 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Factor:")));
48 setDependent(e, "hud_damage", 0.001, 100);
49 me.TD(me, 1, 2, e = makeXonoticSlider(0.025, 0.1, 0.025, "hud_damage_factor"));
50 setDependent(e, "hud_damage", 0.001, 100);
53 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Fade rate:")));
54 setDependent(e, "hud_damage", 0.001, 100);
55 me.TD(me, 1, 2, e = makeXonoticSlider(0.25, 1, 0.05, "hud_damage_fade_rate"));
56 setDependent(e, "hud_damage", 0.001, 100);
60 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_hidewaypoints", _("Waypoints")));
63 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Scale:")));
64 setDependent(e, "cl_hidewaypoints", 0, 0);
65 me.TD(me, 1, 2, e = makeXonoticSlider(0.5, 1.5, 0.05, "g_waypointsprite_scale"));
66 setDependent(e, "cl_hidewaypoints", 0, 0);
69 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Alpha:")));
70 setDependent(e, "cl_hidewaypoints", 0, 0);
71 me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.05, "g_waypointsprite_alpha"));
72 setDependent(e, "cl_hidewaypoints", 0, 0);
75 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Edge offset:")));
76 setDependent(e, "cl_hidewaypoints", 0, 0);
77 me.TD(me, 1, 2, e = makeXonoticSlider(0, 0.3, 0.01, "g_waypointsprite_edgeoffset_bottom"));
78 makeMulti(e, "g_waypointsprite_edgeoffset_top g_waypointsprite_edgeoffset_left g_waypointsprite_edgeoffset_right");
79 setDependent(e, "cl_hidewaypoints", 0, 0);
83 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_shownames", _("Show names above players")));
86 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(25, 0, "hud_shownames_crosshairdistance", _("Only when near crosshair")));
89 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "hud_shownames_status", _("Display health and armor")));
93 me.TD(me, 1, 2, e = makeXonoticButton(_("Enter HUD editor"), '0 0 0'));
94 e.onClick = HUDSetup_Check_Gamestatus;
96 // TODO: show hud config name with text here
98 me.gotoRC(me, me.rows - 1, 0);
99 me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
100 e.onClick = Dialog_Close;
101 e.onClickEntity = me;