| 429 | } |
| 430 | |
| 431 | void InputManager::writeConfig() |
| 432 | { |
| 433 | if(!mJoysticks) |
| 434 | { |
| 435 | LOG(LogError) << "ERROR - cannot write config without being initialized!"; |
| 436 | return; |
| 437 | } |
| 438 | |
| 439 | std::string path = getConfigPath(); |
| 440 | |
| 441 | pugi::xml_document doc; |
| 442 | |
| 443 | pugi::xml_node root = doc.append_child("inputList"); |
| 444 | |
| 445 | mKeyboardInputConfig->writeToXML(root); |
| 446 | for(int i = 0; i < mNumJoysticks; i++) |
| 447 | { |
| 448 | mInputConfigs[i]->writeToXML(root); |
| 449 | } |
| 450 | |
| 451 | doc.save_file(path.c_str()); |
| 452 | } |
| 453 | |
| 454 | std::string InputManager::getConfigPath() |
| 455 | { |
no test coverage detected