]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hud.c
Merge remote branch 'origin/master' into samual/menu_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_multiplayer_playersetup_hud.c
1 #ifdef INTERFACE
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);
13 #endif
14
15 #ifdef IMPLEMENTATION
16 void HUDSetup_Check_Gamestatus(entity me, entity btn)
17 {
18         if not(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)) // we're not in a match, ask the player if they want to start one anyway
19         {
20                 DialogOpenButton_Click(me, main.hudconfirmDialog);
21         }
22         else // already in a match, lets just cut to the point and open up the hud editor directly
23         {
24                 HUDSetup_Start(me, btn);
25         }
26 }
27 void XonoticHUDDialog_showNotify(entity me)
28 {
29         loadAllCvars(me);
30 }
31 string XonoticHUDDialog_toString(entity me)
32 {
33         return "hi"; // TODO: show hud config name with text here 
34 }
35 void XonoticHUDDialog_fill(entity me)
36 {
37         entity e;
38         
39         me.TR(me);
40                 me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Damage:")));
41         me.TR(me);
42                 me.TDempty(me, 0.2);
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"));
45         me.TR(me);
46                 me.TDempty(me, 0.2);
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);
50         me.TR(me);
51                 me.TDempty(me, 0.2);
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);
55         me.TR(me);
56         
57         me.TR(me);
58                 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_hidewaypoints", _("Waypoints")));
59         me.TR(me);
60                 me.TDempty(me, 0.2);
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);
64         me.TR(me);
65                 me.TDempty(me, 0.2);
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);
69         me.TR(me);
70                 me.TDempty(me, 0.2);
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);
77         me.TR(me);
78         
79         me.TR(me);
80                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_shownames", _("Show names above players")));
81         me.TR(me);
82                 me.TDempty(me, 0.2);
83                 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(25, 0, "hud_shownames_crosshairdistance", _("Only when near crosshair")));
84         me.TR(me);
85                 me.TDempty(me, 0.2);
86                 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "hud_shownames_status", _("Display health and armor")));
87         me.TR(me);
88         me.TR(me);
89                 me.TDempty(me, 0.5);
90                 me.TD(me, 1, 2, e = makeXonoticButton(_("Enter HUD editor"), '0 0 0'));
91                         e.onClick = HUDSetup_Check_Gamestatus;
92                         e.onClickEntity = me;
93                 // TODO: show hud config name with text here 
94                 
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;
98                         e.onClickEntity = me;
99 }
100 #endif