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

Method ArchiveBindings

source/common/console/c_bind.cpp:419–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417//=============================================================================
418
419void FKeyBindings::ArchiveBindings(FConfigFile *f, const char *matchcmd)
420{
421 int i;
422
423 for (i = 0; i < NUM_KEYS; i++)
424 {
425 if (Binds[i].IsEmpty())
426 {
427 if (matchcmd == nullptr)
428 {
429 f->ClearKey(ConfigKeyName(i));
430 }
431 }
432 else if (matchcmd == nullptr || Binds[i].CompareNoCase(matchcmd) == 0)
433 {
434 if (Binds[i][0] == '\1')
435 {
436 Binds[i] = "";
437 continue;
438 }
439 f->SetValueForKey(ConfigKeyName(i), Binds[i].GetChars());
440 if (matchcmd != nullptr)
441 { // If saving a specific command, set a marker so that
442 // it does not get saved in the general binding list.
443 Binds[i] = "\1";
444 }
445 }
446 }
447}
448
449//=============================================================================
450//

Callers 1

ArchiveGameDataMethod · 0.80

Calls 6

ConfigKeyNameFunction · 0.85
ClearKeyMethod · 0.80
CompareNoCaseMethod · 0.80
IsEmptyMethod · 0.45
SetValueForKeyMethod · 0.45
GetCharsMethod · 0.45

Tested by

no test coverage detected