]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hud.c
Merge branch 'master' into cbrutail/translation-hu_0.6
[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                 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);
51         me.TR(me);
52                 me.TDempty(me, 0.2);
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);
57         me.TR(me);
58         
59         me.TR(me);
60                 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_hidewaypoints", _("Waypoints")));
61         me.TR(me);
62                 me.TDempty(me, 0.2);
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);
67         me.TR(me);
68                 me.TDempty(me, 0.2);
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);
73         me.TR(me);
74                 me.TDempty(me, 0.2);
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);
80         me.TR(me);
81         
82         me.TR(me);
83                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_shownames", _("Show names above players")));
84         me.TR(me);
85                 me.TDempty(me, 0.2);
86                 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(25, 0, "hud_shownames_crosshairdistance", _("Only when near crosshair")));
87         me.TR(me);
88                 me.TDempty(me, 0.2);
89                 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "hud_shownames_status", _("Display health and armor")));
90         me.TR(me);
91         me.TR(me);
92                 me.TDempty(me, 0.5);
93                 me.TD(me, 1, 2, e = makeXonoticButton(_("Enter HUD editor"), '0 0 0'));
94                         e.onClick = HUDSetup_Check_Gamestatus;
95                         e.onClickEntity = me;
96                 // TODO: show hud config name with text here 
97                 
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;
102 }
103 #endif