MCPcopy Create free account
hub / github.com/ZDoom/Raze / PerformBind

Method PerformBind

source/common/console/c_bind.cpp:370–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368//=============================================================================
369
370void FKeyBindings::PerformBind(FCommandLine &argv, const char *msg)
371{
372 int i;
373
374 if (argv.argc() > 1)
375 {
376 i = GetKeyFromName (argv[1]);
377 if (!i)
378 {
379 Printf ("Unknown key \"%s\"\n", argv[1]);
380 return;
381 }
382 if (argv.argc() == 2)
383 {
384 Printf ("\"%s\" = \"%s\"\n", argv[1], Binds[i].GetChars());
385 }
386 else
387 {
388 Binds[i] = argv[2];
389 }
390 }
391 else
392 {
393 Printf ("%s:\n", msg);
394
395 for (i = 0; i < NUM_KEYS; i++)
396 {
397 if (!Binds[i].IsEmpty())
398 Printf ("%s \"%s\"\n", KeyName (i), Binds[i].GetChars());
399 }
400 }
401}
402
403
404//=============================================================================

Callers 1

CCMDFunction · 0.80

Calls 6

GetKeyFromNameFunction · 0.85
PrintfFunction · 0.85
KeyNameFunction · 0.85
argcMethod · 0.80
GetCharsMethod · 0.45
IsEmptyMethod · 0.45

Tested by

no test coverage detected