| 417 | //============================================================================= |
| 418 | |
| 419 | void 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 | // |
no test coverage detected