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 30 of file dialog_multiplayer_profile.qc.

31{
32 localcmd("\nmenu_cmd languageselect\n");
33}
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{
17 entity me;
19 me.configureDialog(me);
20 return me;
21}
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 22 of file dialog_multiplayer_profile.qc.

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}
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 34 of file dialog_multiplayer_profile.qc.

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 = true;
55 label.allowColors = true;
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 = false; // Sorry, can't do this, it spams "name" commands.
66 box.enableClearButton = false;
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 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:10
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:10
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.