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 language_selector_click(entity me, entity btn)
32 localcmd("\nmenu_cmd languageselect\n");
34 void XonoticProfileTab_fill(entity me)
36 entity e, pms, label, box;
38 entity profileApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0',
41 "playermodel $_cl_playermodel;"
42 "playerskin $_cl_playerskin;"
43 , COMMANDBUTTON_APPLY);
44 profileApplyButton.disableOnClick = true;
49 me.gotoRC(me, 0.5, 0);
50 me.TD(me, 1, 3, me.playerNameLabel = makeXonoticHeaderLabel(_("Name")));
52 me.gotoRC(me, 1.5, 0);
53 me.TD(me, 1, 3, label = makeXonoticTextLabel(0.5, string_null));
55 label.allowColors = 1;
58 label.fontSize = SKINFONTSIZE_TITLE;
60 me.gotoRC(me, 2.5, 0);
61 me.TD(me, 1, 3.0, box = makeXonoticInputBox_T(1, "_cl_name",
62 _("Name under which you will appear in the game")));
63 box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
64 box.maxLength = -127; // negative means encoded length in bytes
65 box.saveImmediately = 0; // Sorry, can't do this, it spams "name" commands.
66 box.enableClearButton = 0;
67 box.applyButton = profileApplyButton;
68 label.textEntity = box;
70 me.TD(me, 5, 1, e = makeXonoticColorpicker(box));
71 me.TD(me, 5, 2, e = makeXonoticCharmap(box));
76 //me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP RIGHT
77 //me.gotoRC(me, 9, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM RIGHT
78 me.gotoRC(me, 9, 0); me.setFirstColumn(me, me.currentColumn); // BOTTOM LEFT
79 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Model")));
82 //me.TDempty(me, 0); // MODEL LEFT, COLOR RIGHT
83 me.TDempty(me, 1); // MODEL RIGHT, COLOR LEFT
84 pms = makeXonoticPlayerModelSelector();
85 me.TD(me, 1, 0.3, e = makeXonoticButton("<<", '0 0 0'));
86 e.onClick = PlayerModelSelector_Prev_Click;
87 e.onClickEntity = pms;
88 e.applyButton = profileApplyButton;
89 me.TD(me, 11.5, 1.4, pms);
90 me.TD(me, 1, 0.3, e = makeXonoticButton(">>", '0 0 0'));
91 e.onClick = PlayerModelSelector_Next_Click;
92 e.onClickEntity = pms;
93 e.applyButton = profileApplyButton;
95 //me.setFirstColumn(me, me.currentColumn + 2); // MODEL LEFT, COLOR RIGHT
96 me.gotoRC(me, me.currentRow, 0); me.setFirstColumn(me, me.currentColumn); // MODEL RIGHT, COLOR LEFT
98 me.TD(me, 1, 1, e = makeXonoticHeaderLabel(_("Glowing color")));
99 for(i = 0; i < 15; ++i)
103 me.TDNoMargin(me, 1, 0.2, e = makeXonoticColorButton(1, 0, i), '0 1 0');
104 e.applyButton = profileApplyButton;
108 me.TD(me, 1, 1, e = makeXonoticHeaderLabel(_("Detail color")));
109 for(i = 0; i < 15; ++i)
113 me.TDNoMargin(me, 1, 0.2, e = makeXonoticColorButton(2, 1, i), '0 1 0');
114 e.applyButton = profileApplyButton;
117 // ====================
118 // STATISTICS SECTION
119 // ====================
120 me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP RIGHT
121 //me.gotoRC(me, 9, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM RIGHT
122 //me.gotoRC(me, 9, 0); me.setFirstColumn(me, me.currentColumn); // BOTTOM LEFT
123 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Statistics")));
126 me.TDempty(me, 0.25);
127 me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uidtracking", _("Allow player statistics to track your client")));
130 me.TDempty(me, 0.25);
131 me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uid2name", _("Allow player statistics to use your nickname")));
133 setDependent(e, "cl_allow_uidtracking", 1, 1);
134 me.gotoRC(me, 4, 3.1); // TOP RIGHT
135 //me.gotoRC(me, 12.5, 3.1); // BOTTOM RIGHT
136 //me.gotoRC(me, 12.5, 0); // BOTTOM LEFT
137 me.TDempty(me, 0.25);
138 me.TD(me, 9, 2.5, statslist = makeXonoticStatsList());
139 //setDependent(statslist, "cl_allow_uidtracking", 1, 1);
144 me.gotoRC(me, 16, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS
145 //me.gotoRC(me, 13.5, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS
146 //me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP SECTION, TOP POS
147 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Country")));
150 me.TDempty(me, 0.75);
151 me.TD(me, 1, 1.5, e = makeXonoticButton(_("Select language..."), '0 0 0'));
152 e.onClick = language_selector_click;
153 e.onClickEntity = me;
156 me.TD(me, 4.5, 2, e = makeXonoticLanguageList()); // todo: cl_country: create proper country list
163 me.gotoRC(me, 13.5, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS
164 //me.gotoRC(me, 19.5, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, BOTTOM POS
165 //me.gotoRC(me, 6.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP SECTION, BOTTOM POS
167 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gender:")));
168 me.TD(me, 1, 2, e = makeXonoticTextSlider("_cl_gender"));
169 e.addValue(e, _("Undisclosed"), "0");
170 e.addValue(e, _("Female"), "1");
171 e.addValue(e, _("Male"), "2");
172 e.configureXonoticTextSliderValues(e);
174 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Gender")));
176 #define GENDERWIDTH_OFFSET 0.25
177 #define GENDERWIDTH_LENGTH 2.5
178 #define GENDERWIDTH_ITEM (GENDERWIDTH_LENGTH / 3)
179 me.TDempty(me, GENDERWIDTH_OFFSET);
180 me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "_cl_gender", "2", _("Female")));
181 me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "_cl_gender", "1", _("Male")));
182 me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "_cl_gender", "0", _("Undisclosed")));
185 me.gotoRC(me, me.rows - 1, 0);
186 me.TD(me, 1, me.columns, profileApplyButton);