1 #ifndef DIALOG_MULTIPLAYER_PROFILE_H
2 #define DIALOG_MULTIPLAYER_PROFILE_H
4 CLASS(XonoticProfileTab, XonoticTab)
5 METHOD(XonoticProfileTab, fill, void(entity));
6 METHOD(XonoticProfileTab, draw, void(entity));
7 ATTRIB(XonoticProfileTab, intendedWidth, float, 0.9)
8 ATTRIB(XonoticProfileTab, rows, float, 23)
9 ATTRIB(XonoticProfileTab, columns, float, 6.1) // added extra .2 for center space
10 ATTRIB(XonoticProfileTab, playerNameLabel, entity, NULL)
11 ATTRIB(XonoticProfileTab, playerNameLabelAlpha, float, SKINALPHA_HEADER)
12 ENDCLASS(XonoticProfileTab)
13 entity makeXonoticProfileTab();
17 entity makeXonoticProfileTab()
20 me = NEW(XonoticProfileTab);
21 me.configureDialog(me);
24 void XonoticProfileTab_draw(entity me)
26 if(cvar_string("_cl_name") == "Player")
27 me.playerNameLabel.alpha = ((mod(time * 2, 2) < 1) ? 1 : 0);
29 me.playerNameLabel.alpha = me.playerNameLabelAlpha;
30 SUPER(XonoticProfileTab).draw(me);
32 void XonoticProfileTab_fill(entity me)
34 entity e, pms, label, box;
40 me.gotoRC(me, 0.5, 0);
41 me.TD(me, 1, 3, me.playerNameLabel = makeXonoticHeaderLabel(_("Name")));
43 me.gotoRC(me, 1.5, 0);
44 me.TD(me, 1, 3, label = makeXonoticTextLabel(0.5, string_null));
46 label.allowColors = 1;
49 label.fontSize = SKINFONTSIZE_TITLE;
51 me.gotoRC(me, 2.5, 0);
52 me.TD(me, 1, 3.0, box = makeXonoticInputBox_T(1, "_cl_name",
53 _("Name under which you will appear in the game")));
54 box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
55 box.maxLength = -127; // negative means encoded length in bytes
56 box.saveImmediately = 0; // Sorry, can't do this, it spams "name" commands.
57 box.enableClearButton = 0;
58 label.textEntity = box;
60 me.TD(me, 5, 1, e = makeXonoticColorpicker(box));
61 me.TD(me, 5, 2, e = makeXonoticCharmap(box));
66 //me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP RIGHT
67 //me.gotoRC(me, 9, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM RIGHT
68 me.gotoRC(me, 9, 0); me.setFirstColumn(me, me.currentColumn); // BOTTOM LEFT
69 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Model")));
72 //me.TDempty(me, 0); // MODEL LEFT, COLOR RIGHT
73 me.TDempty(me, 1); // MODEL RIGHT, COLOR LEFT
74 pms = makeXonoticPlayerModelSelector();
75 me.TD(me, 1, 0.3, e = makeXonoticButton("<<", '0 0 0'));
76 e.onClick = PlayerModelSelector_Prev_Click;
77 e.onClickEntity = pms;
78 me.TD(me, 11.5, 1.4, pms);
79 me.TD(me, 1, 0.3, e = makeXonoticButton(">>", '0 0 0'));
80 e.onClick = PlayerModelSelector_Next_Click;
81 e.onClickEntity = pms;
83 //me.setFirstColumn(me, me.currentColumn + 2); // MODEL LEFT, COLOR RIGHT
84 me.gotoRC(me, me.currentRow, 0); me.setFirstColumn(me, me.currentColumn); // MODEL RIGHT, COLOR LEFT
86 me.TD(me, 1, 1, e = makeXonoticHeaderLabel(_("Glowing color")));
87 for(i = 0; i < 15; ++i)
91 me.TDNoMargin(me, 1, 0.2, e = makeXonoticColorButton(1, 0, i), '0 1 0');
95 me.TD(me, 1, 1, e = makeXonoticHeaderLabel(_("Detail color")));
96 for(i = 0; i < 15; ++i)
100 me.TDNoMargin(me, 1, 0.2, e = makeXonoticColorButton(2, 1, i), '0 1 0');
103 // ====================
104 // STATISTICS SECTION
105 // ====================
106 me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP RIGHT
107 //me.gotoRC(me, 9, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM RIGHT
108 //me.gotoRC(me, 9, 0); me.setFirstColumn(me, me.currentColumn); // BOTTOM LEFT
109 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Statistics")));
112 me.TDempty(me, 0.25);
113 me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uidtracking", _("Allow player statistics to track your client")));
115 me.TDempty(me, 0.25);
116 me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uid2name", _("Allow player statistics to use your nickname")));
117 setDependent(e, "cl_allow_uidtracking", 1, 1);
118 me.gotoRC(me, 4, 3.1); // TOP RIGHT
119 //me.gotoRC(me, 12.5, 3.1); // BOTTOM RIGHT
120 //me.gotoRC(me, 12.5, 0); // BOTTOM LEFT
121 me.TDempty(me, 0.25);
122 me.TD(me, 9, 2.5, statslist = makeXonoticStatsList());
123 //setDependent(statslist, "cl_allow_uidtracking", 1, 1);
128 me.gotoRC(me, 16, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS
129 //me.gotoRC(me, 13.5, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS
130 //me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP SECTION, TOP POS
131 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Country")));
135 me.TD(me, 4.5, 2, e = makeXonoticLanguageList()); // todo: cl_country: create proper country list
141 me.gotoRC(me, 13.5, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS
142 //me.gotoRC(me, 19.5, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, BOTTOM POS
143 //me.gotoRC(me, 6.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP SECTION, BOTTOM POS
145 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gender:")));
146 me.TD(me, 1, 2, e = makeXonoticTextSlider("_cl_gender"));
147 e.addValue(e, _("Undisclosed"), "0");
148 e.addValue(e, _("Female"), "1");
149 e.addValue(e, _("Male"), "2");
150 e.configureXonoticTextSliderValues(e);
152 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Gender")));
154 #define GENDERWIDTH_OFFSET 0.25
155 #define GENDERWIDTH_LENGTH 2.5
156 #define GENDERWIDTH_ITEM (GENDERWIDTH_LENGTH / 3)
157 me.TDempty(me, GENDERWIDTH_OFFSET);
158 me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "_cl_gender", "2", _("Female")));
159 me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "_cl_gender", "1", _("Male")));
160 me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "_cl_gender", "0", _("Undisclosed")));
163 me.gotoRC(me, me.rows - 1, 0);
164 me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "color -1 -1;name \"$_cl_name\";sendcvar cl_weaponpriority;sendcvar cl_autoswitch;sendcvar cl_forceplayermodels;sendcvar cl_forceplayermodelsfromxonotic;playermodel $_cl_playermodel;playerskin $_cl_playerskin", COMMANDBUTTON_APPLY));