Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
dialog_multiplayer_profile.qc File Reference
#include "dialog_multiplayer_profile.qh"
#include "playermodel.qh"
#include "statslist.qh"
#include "languagelist.qh"
#include "textlabel.qh"
#include "commandbutton.qh"
#include "inputbox.qh"
#include "colorpicker.qh"
#include "charmap.qh"
#include "colorbutton.qh"
#include "checkbox.qh"
#include "radiobutton.qh"
Include dependency graph for dialog_multiplayer_profile.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void language_selector_click (entity me, entity btn)
entity makeXonoticProfileTab ()
void XonoticProfileTab_draw (entity me)
void XonoticProfileTab_fill (entity me)

Function Documentation

◆ language_selector_click()

void language_selector_click ( entity me,
entity btn )

Definition at line 29 of file dialog_multiplayer_profile.qc.

30{
31 localcmd("\nmenu_cmd languageselect\n");
32}
void localcmd(string command,...)

References entity(), and localcmd().

Referenced by XonoticProfileTab_fill().

◆ makeXonoticProfileTab()

entity makeXonoticProfileTab ( )

Definition at line 15 of file dialog_multiplayer_profile.qc.

16{
18 me.configureDialog(me);
19 return me;
20}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define NEW(cname,...)
Definition oo.qh:117

References entity(), and NEW.

Referenced by XonoticMultiplayerDialog_fill().

◆ XonoticProfileTab_draw()

void XonoticProfileTab_draw ( entity me)

Definition at line 21 of file dialog_multiplayer_profile.qc.

22{
23 if(cvar_string("_cl_name") == "Player")
24 me.playerNameLabel.alpha = ((mod(time * 2, 2) < 1) ? 1 : 0);
25 else
26 me.playerNameLabel.alpha = me.playerNameLabelAlpha;
27 SUPER(XonoticProfileTab).draw(me);
28}
float time
float mod(float val, float m)
const string cvar_string(string name)
#define SUPER(cname)
Definition oo.qh:231

References cvar_string(), entity(), mod(), SUPER, and time.

◆ XonoticProfileTab_fill()

void XonoticProfileTab_fill ( entity me)

Definition at line 33 of file dialog_multiplayer_profile.qc.

34{
35 entity e, pms, label, box;
36 float i;
37 entity profileApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0',
38 "color -1 -1; " // apply colors contained in _cl_color
39 "name \"$_cl_name\"; "
40 "playermodel $_cl_playermodel; "
41 "playerskin $_cl_playerskin"
43 profileApplyButton.disableOnClick = true;
44
45 // ==============
46 // NAME SECTION
47 // ==============
48 me.gotoRC(me, 0.5, 0);
49 me.TD(me, 1, 3, me.playerNameLabel = makeXonoticHeaderLabel(_("Name")));
50
51 me.gotoRC(me, 1.5, 0);
52 me.TD(me, 1, 3, label = makeXonoticTextLabel(0.5, string_null));
53 label.allowCut = true;
54 label.allowColors = true;
55 label.alpha = 1;
56 label.isBold = true;
57 label.fontSize = SKINFONTSIZE_TITLE;
58
59 me.gotoRC(me, 2.5, 0);
60 me.TD(me, 1, 3.0, box = makeXonoticInputBox_T(1, "_cl_name",
61 _("Name under which you will appear in the game")));
62 box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
63 box.maxLength = -127; // negative means encoded length in bytes
64 box.saveImmediately = false; // Sorry, can't do this, it spams "name" commands.
65 box.enableClearButton = false;
66 box.applyButton = profileApplyButton;
67 label.textEntity = box;
68 me.TR(me);
69 me.TD(me, 5, 1, e = makeXonoticColorpicker(box));
70 me.TD(me, 5, 2, e = makeXonoticCharmap(box));
71
72 // ===============
73 // MODEL SECTION
74 // ===============
75 //me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP RIGHT
76 //me.gotoRC(me, 9, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM RIGHT
77 me.gotoRC(me, 9, 0); me.setFirstColumn(me, me.currentColumn); // BOTTOM LEFT
78 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Model")));
79
80 me.TR(me);
81 //me.TDempty(me, 0); // MODEL LEFT, COLOR RIGHT
82 me.TDempty(me, 1); // MODEL RIGHT, COLOR LEFT
84 me.TD(me, 1, 0.3, e = makeXonoticButton("<<", '0 0 0'));
86 e.onClickEntity = pms;
87 e.applyButton = profileApplyButton;
88 me.TD(me, 11.5, 1.4, pms);
89 me.TD(me, 1, 0.3, e = makeXonoticButton(">>", '0 0 0'));
91 e.onClickEntity = pms;
92 e.applyButton = profileApplyButton;
93
94 //me.setFirstColumn(me, me.currentColumn + 2); // MODEL LEFT, COLOR RIGHT
95 me.gotoRC(me, me.currentRow, 0); me.setFirstColumn(me, me.currentColumn); // MODEL RIGHT, COLOR LEFT
96 me.TR(me);
97 me.TD(me, 1, 1, e = makeXonoticHeaderLabel(_("Glowing color")));
98 for(i = 0; i < 15; ++i)
99 {
100 if(mod(i, 5) == 0)
101 me.TR(me);
102 me.TDNoMargin(me, 1, 0.2, e = makeXonoticColorButton(1, 0, i), '0 1 0');
103 e.applyButton = profileApplyButton;
104 }
105 me.TR(me);
106 me.TR(me);
107 me.TD(me, 1, 1, e = makeXonoticHeaderLabel(_("Detail color")));
108 for(i = 0; i < 15; ++i)
109 {
110 if(mod(i, 5) == 0)
111 me.TR(me);
112 me.TDNoMargin(me, 1, 0.2, e = makeXonoticColorButton(2, 1, i), '0 1 0');
113 e.applyButton = profileApplyButton;
114 }
115
116 // ====================
117 // STATISTICS SECTION
118 // ====================
119 me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP RIGHT
120 //me.gotoRC(me, 9, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM RIGHT
121 //me.gotoRC(me, 9, 0); me.setFirstColumn(me, me.currentColumn); // BOTTOM LEFT
122 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Statistics")));
123
124 me.TR(me);
125 me.TDempty(me, 0.25);
126 me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uidtracking", _("Allow player statistics to track your client")));
127 e.sendCvars = true;
128 me.TR(me);
129 me.TDempty(me, 0.25);
130 me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uid2name", _("Allow player statistics to use your nickname")));
131 e.sendCvars = true;
132 setDependent(e, "cl_allow_uidtracking", 1, 1);
133 me.TR(me);
134 me.TDempty(me, 0.25);
135 me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uidranking", _("Allow player statistics to rank you in leaderboards")));
136 e.sendCvars = true;
137 setDependent(e, "cl_allow_uidtracking", 1, 1);
138 me.gotoRC(me, 4.5, 3.1); // TOP RIGHT
139 //me.gotoRC(me, 12.5, 3.1); // BOTTOM RIGHT
140 //me.gotoRC(me, 12.5, 0); // BOTTOM LEFT
141 me.TDempty(me, 0.25);
142 me.TD(me, 9, 2.5, statslist = makeXonoticStatsList());
143 //setDependent(statslist, "cl_allow_uidtracking", 1, 1);
144
145 // =================
146 // COUNTRY SECTION
147 // =================
148 me.gotoRC(me, 16, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS
149 //me.gotoRC(me, 13.5, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS
150 //me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP SECTION, TOP POS
151 //me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Country")));
152
153 me.TR(me);
154 me.TDempty(me, 0.75);
155 me.TD(me, 1, 1.5, e = makeXonoticButton(_("Select language..."), '0 0 0'));
156 e.onClick = language_selector_click;
157 e.onClickEntity = me;
158 /*
159 me.TDempty(me, 0.5);
160 me.TD(me, 4.5, 2, e = makeXonoticLanguageList()); // todo: cl_country: create proper country list
161 */
162
163 me.gotoRC(me, me.rows - 1, 0);
164 me.TD(me, 1, me.columns, profileApplyButton);
165}
entity makeXonoticCharmap(entity controlledInputBox)
Definition charmap.qc:32
entity makeXonoticColorButton(float theGroup, float theColor, float theValue)
Definition colorbutton.qc:3
entity makeXonoticColorpicker(entity theTextbox)
Definition colorpicker.qc:5
entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, int theFlags)
#define COMMANDBUTTON_APPLY
void language_selector_click(entity me, entity btn)
entity makeXonoticButton(string theText, vector theColor)
Definition button.qc:9
void setDependent(entity e, string theCvarName, float theCvarMin, float theCvarMax)
Definition util.qc:180
string string_null
Definition nil.qh:9
entity makeXonoticPlayerModelSelector()
Definition playermodel.qc:3
void PlayerModelSelector_Next_Click(entity btn, entity me)
void PlayerModelSelector_Prev_Click(entity btn, entity me)
entity makeXonoticStatsList()
Definition statslist.qc:4
entity statslist
Definition statslist.qh:23
entity makeXonoticTextLabel(float theAlign, string theText)
Definition textlabel.qc:3
entity makeXonoticHeaderLabel(string theText)
Definition textlabel.qc:9
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition checkbox.qc:28
entity makeXonoticInputBox_T(bool doEditColorCodes, string theCvar, string theTooltip)
Definition inputbox.qc:3

References COMMANDBUTTON_APPLY, entity(), language_selector_click(), makeXonoticButton(), makeXonoticCharmap(), makeXonoticCheckBox(), makeXonoticColorButton(), makeXonoticColorpicker(), makeXonoticCommandButton(), makeXonoticHeaderLabel(), makeXonoticInputBox_T(), makeXonoticPlayerModelSelector(), makeXonoticStatsList(), makeXonoticTextLabel(), mod(), PlayerModelSelector_Next_Click(), PlayerModelSelector_Prev_Click(), setDependent(), statslist, and string_null.