Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
cl_cmd.qc File Reference
Include dependency graph for cl_cmd.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CONSOLE_COMMAND(name, execution)
#define CONSOLE_COMMAND(name, execution)
#define CONSOLE_COMMAND(name, execution)
#define CONSOLE_COMMAND(name, execution)
#define CONSOLE_COMMANDS_MOVEMENT()
#define CONSOLE_COMMANDS_NORMAL()

Functions

 CLIENT_COMMAND (blurtest, "Feature for testing blur postprocessing")
 CLIENT_COMMAND (boxparticles, "Spawn particles manually")
 CLIENT_COMMAND (create_scrshot_ent, "Create an entity at this location for automatic screenshots")
 CLIENT_COMMAND (debugmodel, "Spawn a debug model manually")
 CLIENT_COMMAND (handlevote, "System to handle selecting a vote or option")
 CLIENT_COMMAND (hud, "Commands regarding/controlling the HUD system")
 CLIENT_COMMAND (localprint, "Create your own centerprint sent to yourself")
 CLIENT_COMMAND (mv_download, "Retrieve mapshot picture from the server")
 CLIENT_COMMAND (print_cptimes, "Print the stored checkpoint times for current or last run")
 CLIENT_COMMAND (sendcvar, "Send a cvar to the server (like cl_weaponpriority)")
void ConsoleCommand_macro_init ()
bool ConsoleCommand_macro_movement (string s, int argc)
bool ConsoleCommand_macro_normal (string s, int argc)
bool CSQC_ConsoleCommand (string command)
void DrawDebugModel (entity this)
void GameCommand (string command)
void LocalCommand_blurtest (int request)
void LocalCommand_boxparticles (int request, int argc)
void LocalCommand_create_scrshot_ent (int request)
void LocalCommand_debugmodel (int request, int argc)
void LocalCommand_handlevote (int request, int argc)
void LocalCommand_hud (int request, int argc)
void LocalCommand_localprint (int request, int argc)
bool LocalCommand_macro_command (int argc, string command)
void LocalCommand_macro_help ()
bool LocalCommand_macro_usage (int argc)
void LocalCommand_macro_write_aliases (int fh)
void LocalCommand_mv_download (int request, int argc)
void LocalCommand_print_cptimes (int request)
void LocalCommand_sendcvar (int request, int argc)

Macro Definition Documentation

◆ CONSOLE_COMMAND [1/4]

#define CONSOLE_COMMAND ( name,
execution )
Value:
{ registercommand(name); }
string name
Definition menu.qh:30

◆ CONSOLE_COMMAND [2/4]

#define CONSOLE_COMMAND ( name,
execution )
Value:
registercommand(name);

◆ CONSOLE_COMMAND [3/4]

#define CONSOLE_COMMAND ( name,
execution )
Value:
{ if (name == s) { { execution } return true; } }

◆ CONSOLE_COMMAND [4/4]

#define CONSOLE_COMMAND ( name,
execution )
Value:
{ if (name == s) { { execution } return true; } }

◆ CONSOLE_COMMANDS_MOVEMENT

#define CONSOLE_COMMANDS_MOVEMENT ( )
Value:
CONSOLE_COMMAND("+forward", { ++camera_direction.x; }) \
CONSOLE_COMMAND("-forward", { --camera_direction.x; }) \
CONSOLE_COMMAND("+back", { --camera_direction.x; }) \
CONSOLE_COMMAND("-back", { ++camera_direction.x; }) \
CONSOLE_COMMAND("+moveup", { ++camera_direction.z; }) \
CONSOLE_COMMAND("-moveup", { --camera_direction.z; }) \
CONSOLE_COMMAND("+movedown", { --camera_direction.z; }) \
CONSOLE_COMMAND("-movedown", { ++camera_direction.z; }) \
CONSOLE_COMMAND("+moveright", { --camera_direction.y; }) \
CONSOLE_COMMAND("-moveright", { ++camera_direction.y; }) \
CONSOLE_COMMAND("+moveleft", { ++camera_direction.y; }) \
CONSOLE_COMMAND("-moveleft", { --camera_direction.y; }) \
CONSOLE_COMMAND("+roll_right", { ++camera_roll; }) \
CONSOLE_COMMAND("-roll_right", { --camera_roll; }) \
CONSOLE_COMMAND("+roll_left", { --camera_roll; }) \
CONSOLE_COMMAND("-roll_left", { ++camera_roll; }) \
/* nothing */
#define CONSOLE_COMMAND(name, execution)
vector camera_direction
Definition main.qh:156
float camera_roll
Definition main.qh:155

Definition at line 586 of file cl_cmd.qc.

586#define CONSOLE_COMMANDS_MOVEMENT() \
587 CONSOLE_COMMAND("+forward", { ++camera_direction.x; }) \
588 CONSOLE_COMMAND("-forward", { --camera_direction.x; }) \
589 CONSOLE_COMMAND("+back", { --camera_direction.x; }) \
590 CONSOLE_COMMAND("-back", { ++camera_direction.x; }) \
591 CONSOLE_COMMAND("+moveup", { ++camera_direction.z; }) \
592 CONSOLE_COMMAND("-moveup", { --camera_direction.z; }) \
593 CONSOLE_COMMAND("+movedown", { --camera_direction.z; }) \
594 CONSOLE_COMMAND("-movedown", { ++camera_direction.z; }) \
595 CONSOLE_COMMAND("+moveright", { --camera_direction.y; }) \
596 CONSOLE_COMMAND("-moveright", { ++camera_direction.y; }) \
597 CONSOLE_COMMAND("+moveleft", { ++camera_direction.y; }) \
598 CONSOLE_COMMAND("-moveleft", { --camera_direction.y; }) \
599 CONSOLE_COMMAND("+roll_right", { ++camera_roll; }) \
600 CONSOLE_COMMAND("-roll_right", { --camera_roll; }) \
601 CONSOLE_COMMAND("+roll_left", { --camera_roll; }) \
602 CONSOLE_COMMAND("-roll_left", { ++camera_roll; }) \
603 /* nothing */

Referenced by ConsoleCommand_macro_init(), and ConsoleCommand_macro_movement().

◆ CONSOLE_COMMANDS_NORMAL

#define CONSOLE_COMMANDS_NORMAL ( )
Value:
CONSOLE_COMMAND("+showaccuracy", { }) \
CONSOLE_COMMAND("-showaccuracy", { }) \
/* nothing */

Definition at line 581 of file cl_cmd.qc.

581#define CONSOLE_COMMANDS_NORMAL() \
582 CONSOLE_COMMAND("+showaccuracy", { }) \
583 CONSOLE_COMMAND("-showaccuracy", { }) \
584 /* nothing */

Referenced by ConsoleCommand_macro_init(), and ConsoleCommand_macro_normal().

Function Documentation

◆ CLIENT_COMMAND() [1/10]

CLIENT_COMMAND ( blurtest ,
"Feature for testing blur postprocessing"  )

Definition at line 483 of file cl_cmd.qc.

483{ LocalCommand_blurtest(request); }
void LocalCommand_blurtest(int request)
Definition cl_cmd.qc:40

References LocalCommand_blurtest().

◆ CLIENT_COMMAND() [2/10]

CLIENT_COMMAND ( boxparticles ,
"Spawn particles manually"  )

Definition at line 484 of file cl_cmd.qc.

484{ LocalCommand_boxparticles(request, arguments); }
void LocalCommand_boxparticles(int request, int argc)
Definition cl_cmd.qc:76

References LocalCommand_boxparticles().

◆ CLIENT_COMMAND() [3/10]

CLIENT_COMMAND ( create_scrshot_ent ,
"Create an entity at this location for automatic screenshots"  )

Definition at line 485 of file cl_cmd.qc.

void LocalCommand_create_scrshot_ent(int request)
Definition cl_cmd.qc:130

References LocalCommand_create_scrshot_ent().

◆ CLIENT_COMMAND() [4/10]

CLIENT_COMMAND ( debugmodel ,
"Spawn a debug model manually"  )

Definition at line 486 of file cl_cmd.qc.

486{ LocalCommand_debugmodel(request, arguments); }
void LocalCommand_debugmodel(int request, int argc)
Definition cl_cmd.qc:170

References LocalCommand_debugmodel().

◆ CLIENT_COMMAND() [5/10]

CLIENT_COMMAND ( handlevote ,
"System to handle selecting a vote or option"  )

Definition at line 487 of file cl_cmd.qc.

487{ LocalCommand_handlevote(request, arguments); }
void LocalCommand_handlevote(int request, int argc)
Definition cl_cmd.qc:203

References LocalCommand_handlevote().

◆ CLIENT_COMMAND() [6/10]

CLIENT_COMMAND ( hud ,
"Commands regarding/controlling the HUD system"  )

Definition at line 488 of file cl_cmd.qc.

488{ LocalCommand_hud(request, arguments); }
void LocalCommand_hud(int request, int argc)
Definition cl_cmd.qc:251

References hud, and LocalCommand_hud().

◆ CLIENT_COMMAND() [7/10]

CLIENT_COMMAND ( localprint ,
"Create your own centerprint sent to yourself"  )

Definition at line 489 of file cl_cmd.qc.

489{ LocalCommand_localprint(request, arguments); }
void LocalCommand_localprint(int request, int argc)
Definition cl_cmd.qc:345

References LocalCommand_localprint().

◆ CLIENT_COMMAND() [8/10]

CLIENT_COMMAND ( mv_download ,
"Retrieve mapshot picture from the server"  )

Definition at line 490 of file cl_cmd.qc.

490{ LocalCommand_mv_download(request, arguments); }
void LocalCommand_mv_download(int request, int argc)
Definition cl_cmd.qc:370

References LocalCommand_mv_download().

◆ CLIENT_COMMAND() [9/10]

CLIENT_COMMAND ( print_cptimes ,
"Print the stored checkpoint times for current or last run"  )

Definition at line 491 of file cl_cmd.qc.

491{ LocalCommand_print_cptimes(request); }
void LocalCommand_print_cptimes(int request)
Definition cl_cmd.qc:430

References LocalCommand_print_cptimes().

◆ CLIENT_COMMAND() [10/10]

CLIENT_COMMAND ( sendcvar ,
"Send a cvar to the server (like cl_weaponpriority)"  )

Definition at line 492 of file cl_cmd.qc.

492{ LocalCommand_sendcvar(request, arguments); }
void LocalCommand_sendcvar(int request, int argc)
Definition cl_cmd.qc:395

References LocalCommand_sendcvar().

◆ ConsoleCommand_macro_init()

void ConsoleCommand_macro_init ( )

Definition at line 605 of file cl_cmd.qc.

606{
607 // first init normal commands
608 #define CONSOLE_COMMAND(name, execution) \
609 { registercommand(name); }
610
612 #undef CONSOLE_COMMAND
613
614 // then init movement commands
615 #ifndef CAMERATEST
616 if (isdemo())
617 {
618 #endif
619 #define CONSOLE_COMMAND(name, execution) \
620 registercommand(name);
621
623 #undef CONSOLE_COMMAND
624 #ifndef CAMERATEST
625}
626 #endif
627}
#define CONSOLE_COMMANDS_NORMAL()
Definition cl_cmd.qc:581
#define CONSOLE_COMMANDS_MOVEMENT()
Definition cl_cmd.qc:586
float isdemo()

References CONSOLE_COMMANDS_MOVEMENT, CONSOLE_COMMANDS_NORMAL, and isdemo().

Referenced by CSQC_Init().

◆ ConsoleCommand_macro_movement()

bool ConsoleCommand_macro_movement ( string s,
int argc )

Definition at line 640 of file cl_cmd.qc.

641{
642 if (camera_active)
643 {
644 #define CONSOLE_COMMAND(name, execution) \
645 { if (name == s) { { execution } return true; } }
646
648 #undef CONSOLE_COMMAND
649 }
650
651 return false;
652}
float camera_active
Definition main.qh:153

References camera_active, and CONSOLE_COMMANDS_MOVEMENT.

Referenced by CSQC_ConsoleCommand().

◆ ConsoleCommand_macro_normal()

bool ConsoleCommand_macro_normal ( string s,
int argc )

Definition at line 629 of file cl_cmd.qc.

630{
631 #define CONSOLE_COMMAND(name, execution) \
632 { if (name == s) { { execution } return true; } }
633
635 #undef CONSOLE_COMMAND
636
637 return false;
638}

References CONSOLE_COMMANDS_NORMAL.

Referenced by CSQC_ConsoleCommand().

◆ CSQC_ConsoleCommand()

bool CSQC_ConsoleCommand ( string command)

Definition at line 660 of file cl_cmd.qc.

661{
662 int argc = tokenize_console(command);
663 string s = strtolower(argv(0));
664 // Return value should be true if CSQC handled the command, otherwise return false to have the engine handle it.
665 return ConsoleCommand_macro_normal(s, argc)
667 ;
668}
bool ConsoleCommand_macro_normal(string s, int argc)
Definition cl_cmd.qc:629
bool ConsoleCommand_macro_movement(string s, int argc)
Definition cl_cmd.qc:640
string strtolower(string s)
#define tokenize_console
string argv(float n)

References argv(), ConsoleCommand_macro_movement(), ConsoleCommand_macro_normal(), strtolower(), and tokenize_console.

◆ DrawDebugModel()

void DrawDebugModel ( entity this)

Definition at line 21 of file cl_cmd.qc.

22{
23 if (time - floor(time) > 0.5)
24 {
25 PolyDrawModel(this);
26 this.drawmask = 0;
27 }
28 else
29 {
30 this.renderflags = 0;
31 this.drawmask = MASK_NORMAL;
32 }
33}
void PolyDrawModel(entity e)
Definition draw.qc:182
float renderflags
Definition main.qh:111
float drawmask
const float MASK_NORMAL
float time
float floor(float f)

References drawmask, entity(), floor(), MASK_NORMAL, PolyDrawModel(), renderflags, and time.

Referenced by LocalCommand_debugmodel().

◆ GameCommand()

void GameCommand ( string command)

Definition at line 530 of file cl_cmd.qc.

531{
532 int argc = tokenize_console(command);
533
534 // Guide for working with argc arguments by example:
535 // argc: 1 - 2 - 3 - 4
536 // argv: 0 - 1 - 2 - 3
537 // cmd vote - master - login - password
538 string s = strtolower(argv(0));
539 if (s == "help")
540 {
541 if (argc == 1)
542 {
543 LOG_HELP("Client console commands:");
545
546 LOG_HELP("\nGeneric commands shared by all programs:");
548
549 LOG_HELP("\nUsage:^3 cl_cmd <command>^7, where possible commands are listed above.");
550 LOG_HELP("For help about a specific command, type cl_cmd help <command>");
551
552 return;
553 }
554 else if (GenericCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it
555 {
556 return;
557 }
558 else if (LocalCommand_macro_usage(argc)) // now try for normal commands too
559 {
560 return;
561 }
562 }
563 // continue as usual and scan for normal commands
564 if (GenericCommand(command) // handled by common/command/generic.qc
565 || LocalCommand_macro_command(argc, command) // handled by one of the above LocalCommand_* functions
566 || MUTATOR_CALLHOOK(CSQC_ConsoleCommand, s, argc, command) // handled by a mutator
567 ) return;
568
569 // nothing above caught the command, must be invalid
570 LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.");
571}
#define MUTATOR_CALLHOOK(id,...)
Definition base.qh:143
bool LocalCommand_macro_usage(int argc)
Definition cl_cmd.qc:509
bool LocalCommand_macro_command(int argc, string command)
Definition cl_cmd.qc:499
void LocalCommand_macro_help()
Definition cl_cmd.qc:494
float GenericCommand_macro_usage(int argc)
Definition generic.qc:582
void GenericCommand_macro_help()
Definition generic.qc:567
float GenericCommand(string command)
Definition generic.qc:603
#define CSQC_ConsoleCommand
Definition _all.inc:309
#define LOG_HELP(...)
Definition log.qh:85
#define LOG_INFO(...)
Definition log.qh:65
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))

References argv(), CSQC_ConsoleCommand, GenericCommand(), GenericCommand_macro_help(), GenericCommand_macro_usage(), LocalCommand_macro_command(), LocalCommand_macro_help(), LocalCommand_macro_usage(), LOG_HELP, LOG_INFO, MUTATOR_CALLHOOK, strcat(), strtolower(), and tokenize_console.

◆ LocalCommand_blurtest()

void LocalCommand_blurtest ( int request)

Definition at line 40 of file cl_cmd.qc.

41{
42 TC(int, request);
43 // Simple command to work with postprocessing temporarily... possibly completely pointless, the glsl shader is used for a real feature now...
44 // Anyway, to enable it, just compile the client with -DBLURTEST and then you can use the command.
45
46 #ifdef BLURTEST
47 switch (request)
48 {
50 {
51 blurtest_time0 = time;
52 blurtest_time1 = time + stof(argv(1));
53 blurtest_radius = stof(argv(2));
54 blurtest_power = stof(argv(3));
55 LOG_INFO("Enabled blurtest");
56 return;
57 }
58
59 default:
61 {
62 LOG_HELP("Usage:^3 cl_cmd blurtest");
63 LOG_HELP(" No arguments required.");
64 return;
65 }
66 }
67 #else
68 if (request)
69 {
70 LOG_INFO("Blurtest is not enabled on this client.");
71 return;
72 }
73 #endif
74}
const int CMD_REQUEST_COMMAND
Definition command.qh:3
const int CMD_REQUEST_USAGE
Definition command.qh:4
#define TC(T, sym)
Definition _all.inc:82
float stof(string val,...)

References argv(), CMD_REQUEST_COMMAND, CMD_REQUEST_USAGE, LOG_HELP, LOG_INFO, stof(), TC, and time.

Referenced by CLIENT_COMMAND().

◆ LocalCommand_boxparticles()

void LocalCommand_boxparticles ( int request,
int argc )

Definition at line 76 of file cl_cmd.qc.

77{
78 TC(int, request); TC(int, argc);
79 switch (request)
80 {
82 {
83 if (argc == 9)
84 {
85 int effect = _particleeffectnum(argv(1));
86 if (effect >= 0)
87 {
88 int index = stoi(argv(2));
89 entity own;
90 if (index <= 0)
91 own = entitybyindex(-index);
92 else
93 own = findfloat(NULL, entnum, index);
94 vector org_from = stov(argv(3));
95 vector org_to = stov(argv(4));
96 vector dir_from = stov(argv(5));
97 vector dir_to = stov(argv(6));
98 int countmultiplier = stoi(argv(7));
99 int flags = stoi(argv(8));
100 boxparticles(effect, own, org_from, org_to, dir_from, dir_to, countmultiplier, flags);
101 return;
102 }
103 }
104 }
105
106 default:
107 LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
109 {
110 LOG_HELP(
111 "Usage:^3 cl_cmd boxparticles <effectname> <owner> <org_from> <org_to> <dir_from> <dir_to> <countmultiplier> <flags>\n"
112 " <effectname> is the name of a particle effect in effectinfo.txt\n"
113 " <owner> is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n"
114 " <org_from> is the starting origin of the box\n"
115 " <org_to> is the ending origin of the box\n"
116 " <dir_from> is the minimum velocity\n"
117 " <dir_to> is the maximum velocity\n"
118 " <countmultiplier> defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n"
119 " <flags> can contain:\n"
120 " 1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n"
121 " 2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n"
122 " 4 to respect globals particles_fade (set right before via prvm_globalset client)\n"
123 " 128 to draw a trail, not a box"
124 );
125 return;
126 }
127 }
128}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float flags
float entnum
#define stoi(s)
Definition int.qh:4
#define LOG_INFOF(...)
Definition log.qh:66
vector stov(string s)
entity findfloat(entity start,.float field, float match)
#define NULL
Definition post.qh:14
vector
Definition self.qh:92

References argv(), CMD_REQUEST_COMMAND, CMD_REQUEST_USAGE, entity(), entnum, findfloat(), flags, LOG_HELP, LOG_INFOF, NULL, stoi, stov(), TC, and vector.

Referenced by CLIENT_COMMAND().

◆ LocalCommand_create_scrshot_ent()

void LocalCommand_create_scrshot_ent ( int request)

Definition at line 130 of file cl_cmd.qc.

131{
132 TC(int, request);
133 switch (request)
134 {
136 {
137 string path = ((argv(1) == "") ? "" : strcat(argv(1), "/"));
138 string filename = strcat(path, MapInfo_Map_bspname, "_scrshot_ent.txt");
139 int fh = fopen(filename, FILE_APPEND);
140
141 if (fh >= 0)
142 {
143 fputs(fh, "{\n");
144 fputs(fh, strcat("\"classname\" \"info_autoscreenshot\"\n"));
145 fputs(fh, strcat("\"origin\" \"", strcat(ftos(view_origin.x), " ", ftos(view_origin.y), " ", ftos(view_origin.z)), "\"\n"));
146 fputs(fh, strcat("\"angles\" \"", strcat(ftos(view_angles.x), " ", ftos(view_angles.y), " ", ftos(view_angles.z)), "\"\n"));
147 fputs(fh, "}\n");
148
149 LOG_INFO("Completed screenshot entity dump in ^2data/data/", path, MapInfo_Map_bspname, "_scrshot_ent.txt^7.");
150
151 fclose(fh);
152 }
153 else
154 {
155 LOG_INFO("^1Error: ^7Could not dump to file!");
156 }
157 return;
158 }
159
160 default:
162 {
163 LOG_HELP("Usage:^3 cl_cmd create_scrshot_ent [<path>]");
164 LOG_HELP(" Where <path> can be the subdirectory of data/data in which the file is saved.");
165 return;
166 }
167 }
168}
vector view_origin
Definition main.qh:109
vector view_angles
const float FILE_APPEND
string MapInfo_Map_bspname
Definition mapinfo.qh:6
void fclose(float fhandle)
void fputs(float fhandle, string s)
float fopen(string filename, float mode)
string ftos(float f)

References argv(), CMD_REQUEST_COMMAND, CMD_REQUEST_USAGE, fclose(), FILE_APPEND, fopen(), fputs(), ftos(), LOG_HELP, LOG_INFO, MapInfo_Map_bspname, strcat(), TC, view_angles, and view_origin.

Referenced by CLIENT_COMMAND().

◆ LocalCommand_debugmodel()

void LocalCommand_debugmodel ( int request,
int argc )

Definition at line 170 of file cl_cmd.qc.

171{
172 TC(int, request); TC(int, argc);
173 switch (request)
174 {
176 {
177 string modelname = argv(1);
178
179 if (modelname != "")
180 {
181 entity debugmodel_entity = new(debugmodel);
182 precache_model(modelname);
183 _setmodel(debugmodel_entity, modelname);
184 setorigin(debugmodel_entity, view_origin);
185 debugmodel_entity.angles = view_angles;
186 debugmodel_entity.draw = DrawDebugModel;
187 IL_PUSH(g_drawables, debugmodel_entity);
188 return;
189 }
190 // fall through
191 }
192
193 default:
195 {
196 LOG_HELP("Usage:^3 cl_cmd debugmodel <model>");
197 LOG_HELP(" Where <model> is a string of the model name to use for the debug model.");
198 return;
199 }
200 }
201}
void DrawDebugModel(entity this)
Definition cl_cmd.qc:21
IntrusiveList g_drawables
Definition main.qh:91
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.

References argv(), CMD_REQUEST_COMMAND, CMD_REQUEST_USAGE, DrawDebugModel(), entity(), g_drawables, IL_PUSH(), LOG_HELP, TC, view_angles, and view_origin.

Referenced by CLIENT_COMMAND().

◆ LocalCommand_handlevote()

void LocalCommand_handlevote ( int request,
int argc )

Definition at line 203 of file cl_cmd.qc.

204{
205 TC(int, request); TC(int, argc);
206 switch (request)
207 {
209 {
210 int vote_selection;
211 string vote_string;
212
213 if (InterpretBoolean(argv(1)))
214 {
215 vote_selection = 2;
216 vote_string = "yes";
217 }
218 else
219 {
220 vote_selection = 1;
221 vote_string = "no";
222 }
223
224 if (vote_selection)
225 {
226 if (uid2name_dialog) // handled by "uid2name" option
227 {
228 vote_active = 0;
229 vote_prev = 0;
230 vote_change = -9999;
231 localcmd(strcat("setreport cl_allow_uid2name ", ftos(vote_selection - 1), "\n"));
232 uid2name_dialog = 0;
233 }
234 else { localcmd(strcat("cmd vote ", vote_string, "\n")); }
235
236 return;
237 }
238 }
239
240 default:
241 LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
243 {
244 LOG_HELP("Usage:^3 cl_cmd handlevote <vote>");
245 LOG_HELP(" Where <vote> is the selection for either the current poll or uid2name.");
246 return;
247 }
248 }
249}
ERASEABLE float InterpretBoolean(string input)
Definition bool.qh:13
float uid2name_dialog
Definition vote.qh:10
int vote_active
Definition hud.qh:98
float vote_change
Definition hud.qh:101
int vote_prev
Definition hud.qh:99
void localcmd(string command,...)
int vote_selection
Definition vote.qh:53

References argv(), CMD_REQUEST_COMMAND, CMD_REQUEST_USAGE, ftos(), InterpretBoolean(), localcmd(), LOG_HELP, LOG_INFOF, strcat(), TC, uid2name_dialog, vote_active, vote_change, vote_prev, and vote_selection.

Referenced by CLIENT_COMMAND().

◆ LocalCommand_hud()

void LocalCommand_hud ( int request,
int argc )

Definition at line 251 of file cl_cmd.qc.

252{
253 TC(int, request); TC(int, argc);
254 switch (request)
255 {
257 {
258 if(MUTATOR_CALLHOOK(HUD_Command, argc))
259 return;
260
261 switch (argv(1))
262 {
263 case "configure":
264 {
265 cvar_set("_hud_configure", ftos(!autocvar__hud_configure));
266 return;
267 }
268
269 case "quickmenu":
270 {
271 if (argv(2) == "help")
272 {
273 LOG_HELP(" quickmenu [[default | file | \"\"] <submenu> <filename>]");
274 LOG_HELP("Called without options (or with \"\") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.");
275 LOG_HELP("A submenu name can be given to open the quickmenu directly in a submenu; it requires to specify 'default', 'file' or '\"\"' option.");
276 LOG_HELP("A file name can also be given to open a different quickmenu");
277 return;
278 }
279 string file = ((argv(4) == "") ? autocvar_hud_panel_quickmenu_file : argv(4));
280 if (QuickMenu_IsOpened())
282 else
283 QuickMenu_Open(argv(2), argv(3), file); // mode, submenu
284 return;
285 }
286
287 case "save":
288 {
289 if (argv(2))
290 {
292 return;
293 }
294 else
295 {
296 break; // go to usage, we're missing the paramater needed here.
297 }
298 }
299
300 case "scoreboard_columns_set":
301 {
303 return;
304 }
305
306 case "scoreboard_columns_help":
307 {
309 return;
310 }
311
312 case "radar":
313 {
314 if (argv(2))
316 else
318 return;
319 }
320
321 case "clickradar":
322 {
323 if(!isdemo())
325 return;
326 }
327 }
328 }
329
330 default:
331 LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
333 {
334 LOG_HELP("Usage:^3 cl_cmd hud <action> [<configname> | <radartoggle> | <layout>]");
335 LOG_HELP(" Where <action> is the command to complete,");
336 LOG_HELP(" <configname> is the name to save to for 'save' action,");
337 LOG_HELP(" <radartoggle> is to maximize/minimize radar for 'radar' action,");
338 LOG_HELP(" and <layout> is how to organize the scoreboard columns for 'scoreboard_columns_set' action.");
339 LOG_HELP(" Full list of commands here: configure, quickmenu, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.");
340 return;
341 }
342 }
343}
void Cmd_Scoreboard_Help()
void Cmd_Scoreboard_SetFields(int argc)
bool hud_panel_radar_mouse
Definition hud.qh:71
bool hud_panel_radar_maximized
Definition hud.qh:70
bool QuickMenu_IsOpened()
Definition quickmenu.qc:291
void HUD_Panel_ExportCfg(string cfgname)
Definition hud_config.qc:10
bool autocvar__hud_configure
Definition hud_config.qh:3
void cvar_set(string name, string value)
bool QuickMenu_Open(string mode, string submenu, string file)
Definition quickmenu.qc:107
void QuickMenu_Close()
Definition quickmenu.qc:263
string autocvar_hud_panel_quickmenu_file
Definition quickmenu.qh:7
void HUD_Radar_Show_Maximized(bool doshow, bool clickable)
Definition radar.qc:31

References argv(), autocvar__hud_configure, autocvar_hud_panel_quickmenu_file, CMD_REQUEST_COMMAND, CMD_REQUEST_USAGE, Cmd_Scoreboard_Help(), Cmd_Scoreboard_SetFields(), cvar_set(), ftos(), HUD_Panel_ExportCfg(), hud_panel_radar_maximized, hud_panel_radar_mouse, HUD_Radar_Show_Maximized(), InterpretBoolean(), isdemo(), LOG_HELP, LOG_INFOF, MUTATOR_CALLHOOK, QuickMenu_Close(), QuickMenu_IsOpened(), QuickMenu_Open(), and TC.

Referenced by CLIENT_COMMAND().

◆ LocalCommand_localprint()

void LocalCommand_localprint ( int request,
int argc )

Definition at line 345 of file cl_cmd.qc.

346{
347 TC(int, request); TC(int, argc);
348 switch (request)
349 {
351 {
352 if (argv(1))
353 {
355 return;
356 }
357 }
358
359 default:
360 LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
362 {
363 LOG_HELP("Usage:^3 cl_cmd localprint \"<message>\"");
364 LOG_HELP(" <message> is the centerprint message to send to yourself.");
365 return;
366 }
367 }
368}
void centerprint_AddStandard(string strMessage)

References argv(), centerprint_AddStandard(), CMD_REQUEST_COMMAND, CMD_REQUEST_USAGE, LOG_HELP, LOG_INFOF, and TC.

Referenced by CLIENT_COMMAND().

◆ LocalCommand_macro_command()

bool LocalCommand_macro_command ( int argc,
string command )

Definition at line 499 of file cl_cmd.qc.

500{
501 string c = strtolower(argv(0));
502 FOREACH(CLIENT_COMMANDS, it.m_name == c, {
503 it.m_invokecmd(it, CMD_REQUEST_COMMAND, NULL, argc, command);
504 return true;
505 });
506 return false;
507}
#define FOREACH(list, cond, body)
Definition iter.qh:19

References argv(), FOREACH, and strtolower().

Referenced by GameCommand().

◆ LocalCommand_macro_help()

void LocalCommand_macro_help ( )

Definition at line 494 of file cl_cmd.qc.

495{
496 FOREACH(CLIENT_COMMANDS, true, LOG_HELPF(" ^2%s^7: %s", it.m_name, it.m_description));
497}
#define LOG_HELPF(...)
Definition log.qh:86

References FOREACH, and LOG_HELPF.

Referenced by GameCommand().

◆ LocalCommand_macro_usage()

bool LocalCommand_macro_usage ( int argc)

Definition at line 509 of file cl_cmd.qc.

510{
511 string c = strtolower(argv(1));
512 FOREACH(CLIENT_COMMANDS, it.m_name == c, {
513 it.m_invokecmd(it, CMD_REQUEST_USAGE, NULL, argc, "");
514 return true;
515 });
516 return false;
517}

References argv(), FOREACH, and strtolower().

Referenced by GameCommand().

◆ LocalCommand_macro_write_aliases()

void LocalCommand_macro_write_aliases ( int fh)

Definition at line 519 of file cl_cmd.qc.

520{
521 FOREACH(CLIENT_COMMANDS, true, CMD_Write_Alias("qc_cmd_cl", it.m_name, it.m_description));
522}
#define CMD_Write_Alias(execute, command, description)
Definition generic.qh:34

References CMD_Write_Alias, and FOREACH.

Referenced by GENERIC_COMMAND().

◆ LocalCommand_mv_download()

void LocalCommand_mv_download ( int request,
int argc )

Definition at line 370 of file cl_cmd.qc.

371{
372 TC(int, request); TC(int, argc);
373 switch (request)
374 {
376 {
377 if (argv(1))
378 {
380 return;
381 }
382 }
383
384 default:
385 LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
387 {
388 LOG_HELP("Usage:^3 cl_cmd mv_download <mapid>");
389 LOG_HELP(" Where <mapid> is the id number of the map to request an image of on the map vote selection menu.");
390 return;
391 }
392 }
393}
void Cmd_MapVote_MapDownload(int argc)
Definition mapvoting.qc:645

References argv(), Cmd_MapVote_MapDownload(), CMD_REQUEST_COMMAND, CMD_REQUEST_USAGE, LOG_HELP, LOG_INFOF, and TC.

Referenced by CLIENT_COMMAND().

◆ LocalCommand_print_cptimes()

void LocalCommand_print_cptimes ( int request)

Definition at line 430 of file cl_cmd.qc.

431{
432 switch(request)
433 {
435 {
436 LOG_HELP(_("Checkpoint times:"));
437 for (int i = 0; i <= 255; ++i)
438 {
441 }
442 return;
443 }
444 default:
446 {
447 LOG_HELP("Usage:^3 cl_cmd print_cptimes");
448 LOG_HELP(" No arguments required, will show current or last run checkpoint times.");
449 return;
450 }
451 }
452}
string race_checkpoint_splits[256]
Definition racetimer.qh:14

References CMD_REQUEST_COMMAND, CMD_REQUEST_USAGE, LOG_HELP, and race_checkpoint_splits.

Referenced by CLIENT_COMMAND().

◆ LocalCommand_sendcvar()

void LocalCommand_sendcvar ( int request,
int argc )

Definition at line 395 of file cl_cmd.qc.

396{
397 TC(int, request); TC(int, argc);
398 switch (request)
399 {
401 {
402 if (argv(1))
403 {
404 // W_FixWeaponOrder will trash argv, so save what we need.
405 string thiscvar = string_null; strcpy(thiscvar, argv(1));
406 string s = cvar_string(thiscvar);
407
408 if (thiscvar == "cl_weaponpriority")
410 else if (substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18)
412
413 localcmd("cmd sentcvar ", thiscvar, " \"", s, "\"\n");
414 strfree(thiscvar);
415 return;
416 }
417 }
418
419 default:
420 LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
422 {
423 LOG_HELP("Usage:^3 cl_cmd sendcvar <cvar>");
424 LOG_HELP(" Where <cvar> is the cvar to send to the server.");
425 return;
426 }
427 }
428}
#define strlen
string substring(string s, float start, float length)
const string cvar_string(string name)
string string_null
Definition nil.qh:9
#define strfree(this)
Definition string.qh:59
#define strcpy(this, s)
Definition string.qh:52
string W_NumberWeaponOrder(string order)
Definition all.qc:120
string W_FixWeaponOrder(string order, float complete)
Definition all.qc:95

References argv(), CMD_REQUEST_COMMAND, CMD_REQUEST_USAGE, cvar_string(), localcmd(), LOG_HELP, LOG_INFOF, strcpy, strfree, string_null, strlen, substring(), TC, W_FixWeaponOrder(), and W_NumberWeaponOrder().

Referenced by CLIENT_COMMAND().