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 not(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 me.TD(me, 1, 2, e = makeXonoticSlider(0.005, 0.1, 0.005, "hud_damage_factor"));
49 setDependent(e, "hud_damage", 0.001, 100);
52 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Fade rate:")));
53 me.TD(me, 1, 2, e = makeXonoticSlider(0.25, 1, 0.05, "hud_damage_fade_rate"));
54 setDependent(e, "hud_damage", 0.001, 100);
58 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_hidewaypoints", _("Waypoints")));
61 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Scale:")));
62 me.TD(me, 1, 2, e = makeXonoticSlider(0.5, 1.5, 0.05, "g_waypointsprite_scale"));
63 setDependent(e, "cl_hidewaypoints", 0, 0);
66 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Alpha:")));
67 me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.05, "g_waypointsprite_alpha"));
68 setDependent(e, "cl_hidewaypoints", 0, 0);
71 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Edge offset:")));
72 me.TD(me, 1, 2, e = makeXonoticSlider(0, 0.3, 0.01, "g_waypointsprite_edgeoffset_bottom"));
73 makeMulti(e, "g_waypointsprite_edgeoffset_top");
74 makeMulti(e, "g_waypointsprite_edgeoffset_left");
75 makeMulti(e, "g_waypointsprite_edgeoffset_right");
76 setDependent(e, "cl_hidewaypoints", 0, 0);
80 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_shownames", _("Show names above players")));
83 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(25, 0, "hud_shownames_crosshairdistance", _("Only when near crosshair")));
86 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "hud_shownames_status", _("Display health and armor")));
90 me.TD(me, 1, 2, e = makeXonoticButton(_("Enter HUD editor"), '0 0 0'));
91 e.onClick = HUDSetup_Check_Gamestatus;
93 // TODO: show hud config name with text here
95 me.gotoRC(me, me.rows - 1, 0);
96 me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
97 e.onClick = Dialog_Close;