Xonotic
dialog_multiplayer_profile.qc
Go to the documentation of this file.
2 
3 #include "playermodel.qh"
4 #include "statslist.qh"
5 #include "languagelist.qh"
6 #include "textlabel.qh"
7 #include "commandbutton.qh"
8 #include "inputbox.qh"
9 #include "colorpicker.qh"
10 #include "charmap.qh"
11 #include "colorbutton.qh"
12 #include "checkbox.qh"
13 #include "radiobutton.qh"
14 
16 {
17  entity me;
18  me = NEW(XonoticProfileTab);
19  me.configureDialog(me);
20  return me;
21 }
23 {
24  if(cvar_string("_cl_name") == "Player")
25  me.playerNameLabel.alpha = ((mod(time * 2, 2) < 1) ? 1 : 0);
26  else
27  me.playerNameLabel.alpha = me.playerNameLabelAlpha;
28  SUPER(XonoticProfileTab).draw(me);
29 }
31 {
32  localcmd("\nmenu_cmd languageselect\n");
33 }
35 {
36  entity e, pms, label, box;
37  float i;
38  entity profileApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0',
39  "color -1 -1;" // apply colors contained in _cl_color
40  "name \"$_cl_name\";"
41  "playermodel $_cl_playermodel;"
42  "playerskin $_cl_playerskin;"
44  profileApplyButton.disableOnClick = true;
45 
46  // ==============
47  // NAME SECTION
48  // ==============
49  me.gotoRC(me, 0.5, 0);
50  me.TD(me, 1, 3, me.playerNameLabel = makeXonoticHeaderLabel(_("Name")));
51 
52  me.gotoRC(me, 1.5, 0);
53  me.TD(me, 1, 3, label = makeXonoticTextLabel(0.5, string_null));
54  label.allowCut = 1;
55  label.allowColors = 1;
56  label.alpha = 1;
57  label.isBold = true;
58  label.fontSize = SKINFONTSIZE_TITLE;
59 
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;
69  me.TR(me);
70  me.TD(me, 5, 1, e = makeXonoticColorpicker(box));
71  me.TD(me, 5, 2, e = makeXonoticCharmap(box));
72 
73  // ===============
74  // MODEL SECTION
75  // ===============
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")));
80 
81  me.TR(me);
82  //me.TDempty(me, 0); // MODEL LEFT, COLOR RIGHT
83  me.TDempty(me, 1); // MODEL RIGHT, COLOR LEFT
85  me.TD(me, 1, 0.3, e = makeXonoticButton("<<", '0 0 0'));
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'));
92  e.onClickEntity = pms;
93  e.applyButton = profileApplyButton;
94 
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
97  me.TR(me);
98  me.TD(me, 1, 1, e = makeXonoticHeaderLabel(_("Glowing color")));
99  for(i = 0; i < 15; ++i)
100  {
101  if(mod(i, 5) == 0)
102  me.TR(me);
103  me.TDNoMargin(me, 1, 0.2, e = makeXonoticColorButton(1, 0, i), '0 1 0');
104  e.applyButton = profileApplyButton;
105  }
106  me.TR(me);
107  me.TR(me);
108  me.TD(me, 1, 1, e = makeXonoticHeaderLabel(_("Detail color")));
109  for(i = 0; i < 15; ++i)
110  {
111  if(mod(i, 5) == 0)
112  me.TR(me);
113  me.TDNoMargin(me, 1, 0.2, e = makeXonoticColorButton(2, 1, i), '0 1 0');
114  e.applyButton = profileApplyButton;
115  }
116 
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")));
124 
125  me.TR(me);
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")));
128  e.sendCvars = true;
129  me.TR(me);
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")));
132  e.sendCvars = true;
133  setDependent(e, "cl_allow_uidtracking", 1, 1);
134  me.TR(me);
135  me.TDempty(me, 0.25);
136  me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uidranking", _("Allow player statistics to rank you in leaderboards")));
137  e.sendCvars = true;
138  setDependent(e, "cl_allow_uidtracking", 1, 1);
139  me.gotoRC(me, 4.5, 3.1); // TOP RIGHT
140  //me.gotoRC(me, 12.5, 3.1); // BOTTOM RIGHT
141  //me.gotoRC(me, 12.5, 0); // BOTTOM LEFT
142  me.TDempty(me, 0.25);
143  me.TD(me, 9, 2.5, statslist = makeXonoticStatsList());
144  //setDependent(statslist, "cl_allow_uidtracking", 1, 1);
145 
146  // =================
147  // COUNTRY SECTION
148  // =================
149  me.gotoRC(me, 16, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS
150  //me.gotoRC(me, 13.5, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS
151  //me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP SECTION, TOP POS
152  //me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Country")));
153 
154  me.TR(me);
155  me.TDempty(me, 0.75);
156  me.TD(me, 1, 1.5, e = makeXonoticButton(_("Select language..."), '0 0 0'));
157  e.onClick = language_selector_click;
158  e.onClickEntity = me;
159  /*
160  me.TDempty(me, 0.5);
161  me.TD(me, 4.5, 2, e = makeXonoticLanguageList()); // todo: cl_country: create proper country list
162  */
163 
164  me.gotoRC(me, me.rows - 1, 0);
165  me.TD(me, 1, me.columns, profileApplyButton);
166 }
entity makeXonoticProfileTab()
string string_null
Definition: nil.qh:9
#define NEW(cname,...)
Definition: oo.qh:105
entity makeXonoticHeaderLabel(string theText)
Definition: textlabel.qc:10
entity() spawn
entity makeXonoticTextLabel(float theAlign, string theText)
Definition: textlabel.qc:3
entity statslist
Definition: statslist.qh:23
void PlayerModelSelector_Next_Click(entity btn, entity me)
Definition: playermodel.qc:131
void language_selector_click(entity me, entity btn)
#define SUPER(cname)
Definition: oo.qh:219
entity makeXonoticCharmap(entity controlledInputBox)
Definition: charmap.qc:32
void PlayerModelSelector_Prev_Click(entity btn, entity me)
Definition: playermodel.qc:139
entity makeXonoticStatsList()
Definition: statslist.qc:4
entity makeXonoticPlayerModelSelector()
Definition: playermodel.qc:3
void XonoticProfileTab_draw(entity me)
entity makeXonoticColorButton(float theGroup, float theColor, float theValue)
Definition: colorbutton.qc:3
entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, int theFlags)
entity makeXonoticColorpicker(entity theTextbox)
Definition: colorpicker.qc:5
void XonoticProfileTab_fill(entity me)
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition: checkbox.qc:28
#define COMMANDBUTTON_APPLY
float time
Definition: csprogsdefs.qc:16
entity makeXonoticInputBox_T(float doEditColorCodes, string theCvar, string theTooltip)
Definition: inputbox.qc:3