1 #include "dialog_multiplayer_profile.qh"
3 #include "playermodel.qh"
4 #include "statslist.qh"
5 #include "languagelist.qh"
6 #include "textlabel.qh"
7 #include "commandbutton.qh"
9 #include "colorpicker.qh"
11 #include "colorbutton.qh"
12 #include "checkbox.qh"
13 #include "radiobutton.qh"
15 entity makeXonoticProfileTab()
18 me = NEW(XonoticProfileTab);
19 me.configureDialog(me);
22 void XonoticProfileTab_draw(entity me)
24 if(cvar_string("_cl_name") == "Player")
25 me.playerNameLabel.alpha = ((mod(time * 2, 2) < 1) ? 1 : 0);
27 me.playerNameLabel.alpha = me.playerNameLabelAlpha;
28 SUPER(XonoticProfileTab).draw(me);
30 void XonoticProfileTab_fill(entity me)
32 entity e, pms, label, box;
34 entity profileApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0',
37 "playermodel $_cl_playermodel;"
38 "playerskin $_cl_playerskin;"
39 "sendcvar cl_allow_uidtracking;"
40 "sendcvar cl_allow_uid2name;"
41 , COMMANDBUTTON_APPLY);
42 profileApplyButton.disableOnClick = true;
47 me.gotoRC(me, 0.5, 0);
48 me.TD(me, 1, 3, me.playerNameLabel = makeXonoticHeaderLabel(_("Name")));
50 me.gotoRC(me, 1.5, 0);
51 me.TD(me, 1, 3, label = makeXonoticTextLabel(0.5, string_null));
53 label.allowColors = 1;
56 label.fontSize = SKINFONTSIZE_TITLE;
58 me.gotoRC(me, 2.5, 0);
59 me.TD(me, 1, 3.0, box = makeXonoticInputBox_T(1, "_cl_name",
60 _("Name under which you will appear in the game")));
61 box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
62 box.maxLength = -127; // negative means encoded length in bytes
63 box.saveImmediately = 0; // Sorry, can't do this, it spams "name" commands.
64 box.enableClearButton = 0;
65 box.applyButton = profileApplyButton;
66 label.textEntity = box;
68 me.TD(me, 5, 1, e = makeXonoticColorpicker(box));
69 me.TD(me, 5, 2, e = makeXonoticCharmap(box));
74 //me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP RIGHT
75 //me.gotoRC(me, 9, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM RIGHT
76 me.gotoRC(me, 9, 0); me.setFirstColumn(me, me.currentColumn); // BOTTOM LEFT
77 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Model")));
80 //me.TDempty(me, 0); // MODEL LEFT, COLOR RIGHT
81 me.TDempty(me, 1); // MODEL RIGHT, COLOR LEFT
82 pms = makeXonoticPlayerModelSelector();
83 me.TD(me, 1, 0.3, e = makeXonoticButton("<<", '0 0 0'));
84 e.onClick = PlayerModelSelector_Prev_Click;
85 e.onClickEntity = pms;
86 e.applyButton = profileApplyButton;
87 me.TD(me, 11.5, 1.4, pms);
88 me.TD(me, 1, 0.3, e = makeXonoticButton(">>", '0 0 0'));
89 e.onClick = PlayerModelSelector_Next_Click;
90 e.onClickEntity = pms;
91 e.applyButton = profileApplyButton;
93 //me.setFirstColumn(me, me.currentColumn + 2); // MODEL LEFT, COLOR RIGHT
94 me.gotoRC(me, me.currentRow, 0); me.setFirstColumn(me, me.currentColumn); // MODEL RIGHT, COLOR LEFT
96 me.TD(me, 1, 1, e = makeXonoticHeaderLabel(_("Glowing color")));
97 for(i = 0; i < 15; ++i)
101 me.TDNoMargin(me, 1, 0.2, e = makeXonoticColorButton(1, 0, i), '0 1 0');
102 e.applyButton = profileApplyButton;
106 me.TD(me, 1, 1, e = makeXonoticHeaderLabel(_("Detail color")));
107 for(i = 0; i < 15; ++i)
111 me.TDNoMargin(me, 1, 0.2, e = makeXonoticColorButton(2, 1, i), '0 1 0');
112 e.applyButton = profileApplyButton;
115 // ====================
116 // STATISTICS SECTION
117 // ====================
118 me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP RIGHT
119 //me.gotoRC(me, 9, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM RIGHT
120 //me.gotoRC(me, 9, 0); me.setFirstColumn(me, me.currentColumn); // BOTTOM LEFT
121 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Statistics")));
124 me.TDempty(me, 0.25);
125 me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uidtracking", _("Allow player statistics to track your client")));
126 e.applyButton = profileApplyButton;
128 me.TDempty(me, 0.25);
129 me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uid2name", _("Allow player statistics to use your nickname")));
130 e.applyButton = profileApplyButton;
131 setDependent(e, "cl_allow_uidtracking", 1, 1);
132 me.gotoRC(me, 4, 3.1); // TOP RIGHT
133 //me.gotoRC(me, 12.5, 3.1); // BOTTOM RIGHT
134 //me.gotoRC(me, 12.5, 0); // BOTTOM LEFT
135 me.TDempty(me, 0.25);
136 me.TD(me, 9, 2.5, statslist = makeXonoticStatsList());
137 //setDependent(statslist, "cl_allow_uidtracking", 1, 1);
142 me.gotoRC(me, 16, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS
143 //me.gotoRC(me, 13.5, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS
144 //me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP SECTION, TOP POS
145 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Country")));
149 me.TD(me, 4.5, 2, e = makeXonoticLanguageList()); // todo: cl_country: create proper country list
155 me.gotoRC(me, 13.5, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS
156 //me.gotoRC(me, 19.5, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, BOTTOM POS
157 //me.gotoRC(me, 6.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP SECTION, BOTTOM POS
159 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gender:")));
160 me.TD(me, 1, 2, e = makeXonoticTextSlider("_cl_gender"));
161 e.addValue(e, _("Undisclosed"), "0");
162 e.addValue(e, _("Female"), "1");
163 e.addValue(e, _("Male"), "2");
164 e.configureXonoticTextSliderValues(e);
166 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Gender")));
168 #define GENDERWIDTH_OFFSET 0.25
169 #define GENDERWIDTH_LENGTH 2.5
170 #define GENDERWIDTH_ITEM (GENDERWIDTH_LENGTH / 3)
171 me.TDempty(me, GENDERWIDTH_OFFSET);
172 me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "_cl_gender", "2", _("Female")));
173 me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "_cl_gender", "1", _("Male")));
174 me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "_cl_gender", "0", _("Undisclosed")));
177 me.gotoRC(me, me.rows - 1, 0);
178 me.TD(me, 1, me.columns, profileApplyButton);